Commit 44af79f9 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier

IPoIB: clarify to_ipoib_neigh()

Cosmetic change: make alignment explicit in to_ipoib_neigh.
Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 4d9781c5
...@@ -217,10 +217,16 @@ struct ipoib_neigh { ...@@ -217,10 +217,16 @@ struct ipoib_neigh {
struct list_head list; struct list_head list;
}; };
/*
* We stash a pointer to our private neighbour information after our
* hardware address in neigh->ha. The ALIGN() expression here makes
* sure that this pointer is stored aligned so that an unaligned
* load is not needed to dereference it.
*/
static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh)
{ {
return (struct ipoib_neigh **) (neigh->ha + 24 - return (void*) neigh + ALIGN(offsetof(struct neighbour, ha) +
(offsetof(struct neighbour, ha) & 4)); INFINIBAND_ALEN, sizeof(void *));
} }
extern struct workqueue_struct *ipoib_workqueue; extern struct workqueue_struct *ipoib_workqueue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment