From patchwork Wed May 26 09:52:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 102369 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4Q9psBF020097 for ; Wed, 26 May 2010 09:51:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934170Ab0EZJvy (ORCPT ); Wed, 26 May 2010 05:51:54 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:36989 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933961Ab0EZJvy (ORCPT ); Wed, 26 May 2010 05:51:54 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 26 May 2010 12:52:14 +0300 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 May 2010 12:51:46 +0300 Date: Wed, 26 May 2010 12:52:00 +0300 From: Eli Cohen To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rdreier@cisco.com, yevgenyp@mellanox.co.il Subject: [PATCH] net/core: use net_device dev_id to indicate port number Message-ID: <20100526095200.GA7370@mtldesk030.lab.mtl.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 26 May 2010 09:51:46.0802 (UTC) FILETIME=[0E07C520:01CAFCB9] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17406.006 X-TM-AS-Result: No--9.984900-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 26 May 2010 09:51:55 +0000 (UTC) diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 6c2b15b..612df1e 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c @@ -978,6 +978,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, } SET_NETDEV_DEV(dev, &mdev->dev->pdev->dev); + SET_NETDEV_DEV_ID(dev, port - 1); /* * Initialize driver private data diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3857517..8d5f2c7 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1080,6 +1080,11 @@ static inline void *netdev_priv(const struct net_device *dev) */ #define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype)) +/* + * Set the port number of the physical device that this port net device uses + */ +#define SET_NETDEV_DEV_ID(net, devid) ((net)->dev_id = (devid)) + /** * netif_napi_add - initialize a napi context * @dev: network device