From patchwork Mon Jul 25 10:01:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 1004092 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6PA4EG4031054 for ; Mon, 25 Jul 2011 10:04:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751554Ab1GYKEG (ORCPT ); Mon, 25 Jul 2011 06:04:06 -0400 Received: from shards.monkeyblade.net ([198.137.202.13]:45766 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871Ab1GYKDU (ORCPT ); Mon, 25 Jul 2011 06:03:20 -0400 Received: from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net [74.93.104.98]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id p6PA1H5F011179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 25 Jul 2011 03:01:18 -0700 Date: Mon, 25 Jul 2011 03:01:17 -0700 (PDT) Message-Id: <20110725.030117.316830174679013084.davem@davemloft.net> To: roland@kernel.org CC: linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/7] neigh: Create mechanism for generic neigh private areas. From: David Miller X-Mailer: Mew version 6.3 on Emacs 23.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 25 Jul 2011 10:04:14 +0000 (UTC) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (shards.monkeyblade.net [198.137.202.13]); Mon, 25 Jul 2011 03:01:18 -0700 (PDT) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The implementation private sits right after the primary_key memory. Signed-off-by: David S. Miller --- 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