From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 6E7EDF94 for ; Thu, 31 Aug 2017 17:53:37 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 31 Aug 2017 08:53:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,453,1498546800"; d="scan'208";a="144149631" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga005.jf.intel.com with ESMTP; 31 Aug 2017 08:53:34 -0700 To: David Harton , jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org References: <20170822222146.36912-1-dharton@cisco.com> From: Ferruh Yigit Message-ID: Date: Thu, 31 Aug 2017 16:53:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170822222146.36912-1-dharton@cisco.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] i40e: fix i40e_validate_mac_addr to permit multicast addresses X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 15:53:37 -0000 On 8/22/2017 11:21 PM, David Harton wrote: > The i40e maintains a single MAC filter table for both > unicast and multicast addresses. The i40e_validate_mac_addr > function was preventing multicast addresses from being added > to the table via i40evf_add_mac_addr. Fixed the issue by > removing the multicast address check in i40e_validate_mac_addr. > > Signed-off-by: David Harton > --- > drivers/net/i40e/base/i40e_common.c | 12 +++++------- > drivers/net/i40e/i40e_ethdev.c | 3 ++- > 2 files changed, 7 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c > index 900d379..9779854 100644 > --- a/drivers/net/i40e/base/i40e_common.c > +++ b/drivers/net/i40e/base/i40e_common.c > @@ -969,10 +969,10 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[] = { > > > /** > - * i40e_validate_mac_addr - Validate unicast MAC address > + * i40e_validate_mac_addr - Validate MAC address > * @mac_addr: pointer to MAC address > * > - * Tests a MAC address to ensure it is a valid Individual Address > + * Tests a MAC address to ensure it is a valid Address > **/ > enum i40e_status_code i40e_validate_mac_addr(u8 *mac_addr) > { > @@ -980,13 +980,11 @@ enum i40e_status_code i40e_validate_mac_addr(u8 *mac_addr) > > DEBUGFUNC("i40e_validate_mac_addr"); > > - /* Broadcast addresses ARE multicast addresses > - * Make sure it is not a multicast address > + /* > * Reject the zero address > */ > - if (I40E_IS_MULTICAST(mac_addr) || > - (mac_addr[0] == 0 && mac_addr[1] == 0 && mac_addr[2] == 0 && > - mac_addr[3] == 0 && mac_addr[4] == 0 && mac_addr[5] == 0)) > + if (mac_addr[0] == 0 && mac_addr[1] == 0 && mac_addr[2] == 0 && > + mac_addr[3] == 0 && mac_addr[4] == 0 && mac_addr[5] == 0) > status = I40E_ERR_INVALID_MAC_ADDR; > > return status; > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index 5f26e24..00b6082 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1199,7 +1199,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) > > /* Get and check the mac address */ > i40e_get_mac_addr(hw, hw->mac.addr); > - if (i40e_validate_mac_addr(hw->mac.addr) != I40E_SUCCESS) { > + if (i40e_validate_mac_addr(hw->mac.addr) != I40E_SUCCESS || > + I40E_IS_MULTICAST(hw->mac.addr)) { As far as I can see this is to set PF permanent mac address during init(), i40e_macaddr_add() can be used to set multicast address filters. Why do you want to set multicast address as mac permanent address? Any chance that you want to update i40evf_add_mac_addr() to let multicast addresses? > PMD_INIT_LOG(ERR, "mac address is not valid"); > ret = -EIO; > goto err_get_mac_addr; >