diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2014-09-11 14:11:17 +0300 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-09-22 09:46:53 -0700 |
commit | 3e0629cb6c0518423c9e2671bbe8ec15dde5dcaf (patch) | |
tree | bed642a5d9178ccebddf180ca2d5cdd8a7c31092 /drivers/hid/hid-ezkey.c | |
parent | f4fd40b26bd597e203639281859a758402550d62 (diff) |
IB/mlx4: Avoid accessing netdevice when building RoCE qp1 header
The source MAC is needed in RoCE when building the QP1 header.
Currently, this is obtained from the source net device. However, the net
device may not yet exist, or can be destroyed in parallel to this QP1 send
operation (e.g through the VPI port change flow) so accessing it may cause
a kernel crash.
To fix this, we maintain a source MAC cache per port for the net device in
struct mlx4_ib_roce. This cached MAC is initialized to be the default MAC
address obtained during HCA initialization via QUERY_PORT. This cached MAC
is updated via the netdev event notifier handler.
Since the cached MAC is held in an atomic64 object, we do not need locking
when accessing it.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/hid/hid-ezkey.c')
0 files changed, 0 insertions, 0 deletions