Netdev List
 help / color / mirror / Atom feed
* [PATCH 1/7] neigh: Create mechanism for generic neigh private areas.
@ 2011-12-01  3:41 David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-12-01  3:41 UTC (permalink / raw)
  To: netdev


The implementation private sits right after the primary_key memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/net/neighbour.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 7ae5acf..87c0e5c 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -179,6 +179,13 @@ struct neigh_table {
 	struct pneigh_entry	**phash_buckets;
 };
 
+#define NEIGH_PRIV_ALIGN	sizeof(long long)
+
+static inline void *neighbour_priv(const struct neighbour *n)
+{
+	return (char *)n + ALIGN(sizeof(*n) + n->tbl->key_len, NEIGH_PRIV_ALIGN);
+}
+
 /* flags for neigh_update() */
 #define NEIGH_UPDATE_F_OVERRIDE			0x00000001
 #define NEIGH_UPDATE_F_WEAK_OVERRIDE		0x00000002
-- 
1.7.6.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH 1/7] neigh: Create mechanism for generic neigh private areas.
@ 2011-07-25 10:01 David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-07-25 10:01 UTC (permalink / raw)
  To: roland-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA


The implementation private sits right after the primary_key memory.

Signed-off-by: David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
---
 include/net/neighbour.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4ba8521..8ff9143 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -178,6 +178,13 @@ struct neigh_table {
 	struct pneigh_entry	**phash_buckets;
 };
 
+#define NEIGH_PRIV_ALIGN	sizeof(long long)
+
+static inline void *neighbour_priv(const struct neighbour *n)
+{
+	return (char *)n + ALIGN(sizeof(*n) + n->tbl->key_len, NEIGH_PRIV_ALIGN);
+}
+
 /* flags for neigh_update() */
 #define NEIGH_UPDATE_F_OVERRIDE			0x00000001
 #define NEIGH_UPDATE_F_WEAK_OVERRIDE		0x00000002
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-01  3:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01  3:41 [PATCH 1/7] neigh: Create mechanism for generic neigh private areas David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-07-25 10:01 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox