Message ID | 1435286246-22170-1-git-send-email-shaopeng.he@intel.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 57971C7A4; Fri, 26 Jun 2015 04:37:38 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 18038C79C for <dev@dpdk.org>; Fri, 26 Jun 2015 04:37:35 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Jun 2015 19:37:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,681,1427785200"; d="scan'208";a="717906337" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 25 Jun 2015 19:37:34 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5Q2bWrw020857; Fri, 26 Jun 2015 10:37:32 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5Q2bTgD022204; Fri, 26 Jun 2015 10:37:31 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5Q2bSwO022200; Fri, 26 Jun 2015 10:37:28 +0800 From: Shaopeng He <shaopeng.he@intel.com> To: dev@dpdk.org Date: Fri, 26 Jun 2015 10:37:26 +0800 Message-Id: <1435286246-22170-1-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 Cc: Shaopeng He <shaopeng.he@intel.com> Subject: [dpdk-dev] [PATCH] fm10k: fix an error message when adding default VLAN X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
He, Shaopeng
June 26, 2015, 2:37 a.m. UTC
The default MAC address is directly copied to Device Ethernet
Link address array in the device initialize phase, which
bypasses fm10k MAC address number check mechanism, and will
cause an error message when adding default VLAN. Fix it by
moving default MAC address registration to device
initialize phase.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
---
drivers/net/fm10k/fm10k_ethdev.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
Comments
2015-06-26 10:37, Shaopeng He: > The default MAC address is directly copied to Device Ethernet > Link address array in the device initialize phase, which Do you mean "device start phase" instead? > bypasses fm10k MAC address number check mechanism, and will > cause an error message when adding default VLAN. Fix it by What is the error message? Is it only an error message or a behaviour error? > moving default MAC address registration to device > initialize phase. Yes it is moved from start to init. > --- a/drivers/net/fm10k/fm10k_ethdev.c > +++ b/drivers/net/fm10k/fm10k_ethdev.c > @@ -791,14 +791,10 @@ fm10k_dev_start(struct rte_eth_dev *dev) > } > } > > - if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) { > - /* Update default vlan */ > + /* Update default vlan */ > + if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) > fm10k_vlan_filter_set(dev, hw->mac.default_vid, true); > > - /* Add default mac/vlan filter to PF/Switch manager */ > - fm10k_MAC_filter_set(dev, hw->mac.addr, true); > - } > - > return 0; > } > > @@ -2144,6 +2140,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) > > fm10k_mbx_unlock(hw); > > + /* Add default mac address */ > + fm10k_MAC_filter_set(dev, hw->mac.addr, true); > > return 0; > } >
Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, July 01, 2015 9:12 PM > To: He, Shaopeng > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] fm10k: fix an error message when adding > default VLAN > > 2015-06-26 10:37, Shaopeng He: > > The default MAC address is directly copied to Device Ethernet Link > > address array in the device initialize phase, which > > Do you mean "device start phase" instead? Thanks for taking time to review this patch. The default MAC address is read from hardware and copied to dev->data->mac_addrs in eth_fm10k_dev_init, but the fm10k_MAC_filter_set previously was called in fm10k_dev_start, which caused this issue. > > > bypasses fm10k MAC address number check mechanism, and will cause an > > error message when adding default VLAN. Fix it by > > What is the error message? > Is it only an error message or a behaviour error? The error message is "MAC address number not match", it is only an error message, because fm10k_dev_start will eventually be called when default_vid was ready, and MAC/VLAN table will be updated correctly. default_vid is necessary for fm10k to function correctly. > > > moving default MAC address registration to device initialize phase. > > Yes it is moved from start to init. fm10k_MAC_filter_set is moved from eth_fm10k_dev_init to eth_fm10k_dev_init, aligned with the place where the default MAC address is actually read and copied. > > > --- a/drivers/net/fm10k/fm10k_ethdev.c > > +++ b/drivers/net/fm10k/fm10k_ethdev.c > > @@ -791,14 +791,10 @@ fm10k_dev_start(struct rte_eth_dev *dev) > > } > > } > > > > - if (hw->mac.default_vid && hw->mac.default_vid <= > ETHER_MAX_VLAN_ID) { > > - /* Update default vlan */ > > + /* Update default vlan */ > > + if (hw->mac.default_vid && hw->mac.default_vid <= > ETHER_MAX_VLAN_ID) > > fm10k_vlan_filter_set(dev, hw->mac.default_vid, true); > > > > - /* Add default mac/vlan filter to PF/Switch manager */ > > - fm10k_MAC_filter_set(dev, hw->mac.addr, true); > > - } > > - > > return 0; > > } > > > > @@ -2144,6 +2140,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) > > > > fm10k_mbx_unlock(hw); > > > > + /* Add default mac address */ > > + fm10k_MAC_filter_set(dev, hw->mac.addr, true); > > > > return 0; > > } > > >
On 6/26/2015 10:37 AM, He, Shaopeng wrote: > The default MAC address is directly copied to Device Ethernet > Link address array in the device initialize phase, which > bypasses fm10k MAC address number check mechanism, and will > cause an error message when adding default VLAN. Fix it by > moving default MAC address registration to device > initialize phase. > > Signed-off-by: Shaopeng He <shaopeng.he@intel.com> > Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-07-02 12:18, Qiu, Michael: > On 6/26/2015 10:37 AM, He, Shaopeng wrote: > > The default MAC address is directly copied to Device Ethernet > > Link address array in the device initialize phase, which > > bypasses fm10k MAC address number check mechanism, and will > > cause an error message when adding default VLAN. Fix it by > > moving default MAC address registration to device > > initialize phase. > > > > Signed-off-by: Shaopeng He <shaopeng.he@intel.com> > > > Acked-by: Michael Qiu <michael.qiu@intel.com> Applied, thanks
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 406c350..df32665 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -791,14 +791,10 @@ fm10k_dev_start(struct rte_eth_dev *dev) } } - if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) { - /* Update default vlan */ + /* Update default vlan */ + if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) fm10k_vlan_filter_set(dev, hw->mac.default_vid, true); - /* Add default mac/vlan filter to PF/Switch manager */ - fm10k_MAC_filter_set(dev, hw->mac.addr, true); - } - return 0; } @@ -2144,6 +2140,8 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) fm10k_mbx_unlock(hw); + /* Add default mac address */ + fm10k_MAC_filter_set(dev, hw->mac.addr, true); return 0; }