From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 1/3] ethdev: fix adding invalid MAC addr Date: Fri, 05 May 2017 16:07:58 +0200 Message-ID: <2884082.25luyXgJup@xps> References: <1493729065-17090-1-git-send-email-wei.dai@intel.com> <1493944802-52943-2-git-send-email-wei.dai@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Dai, Wei" To: "Yang, Qiming" Return-path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 221AF3B5 for ; Fri, 5 May 2017 16:08:00 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 05/05/2017 03:46, Yang, Qiming: > Hi, Dai wei > > > static void > > diff --git a/drivers/net/e1000/igb_ethdev.c > > b/drivers/net/e1000/igb_ethdev.c index b6b81cb..e8c6282 100644 > > --- a/drivers/net/e1000/igb_ethdev.c > > +++ b/drivers/net/e1000/igb_ethdev.c > > @@ -171,9 +171,9 @@ static int eth_igb_led_off(struct rte_eth_dev *dev); > > > > static void igb_intr_disable(struct e1000_hw *hw); static int > > igb_get_rx_buffer_size(struct e1000_hw *hw); > > -static void > > eth_igb_rar_set(struct rte_eth_dev *dev, > > - struct ether_addr *mac_addr, > > - uint32_t index, uint32_t pool); > > +static int eth_igb_rar_set(struct rte_eth_dev *dev, > > + struct ether_addr *mac_addr, > > + uint32_t index, uint32_t pool); > > static void eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index); > > static void eth_igb_default_mac_addr_set(struct rte_eth_dev *dev, > > struct ether_addr *addr); > > @@ -3079,7 +3079,7 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, > > struct rte_eth_fc_conf *fc_conf) } > > > > #define E1000_RAH_POOLSEL_SHIFT (18) > > -static void > > +static int > > eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, > > uint32_t index, __rte_unused uint32_t pool) { @@ -3090,6 > > +3090,7 @@ eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr > > *mac_addr, > > rah = E1000_READ_REG(hw, E1000_RAH(index)); > > rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + pool)); > > E1000_WRITE_REG(hw, E1000_RAH(index), rah); > > + return 0; > > } > What's the meaning to add a return here? Return 0 can't represent adding an invalid or valid address, it's meaningless. Because drivers/net/e1000/igb_ethdev.c: .mac_addr_add = eth_igb_rar_set, and .mac_addr_add is changed to return an error code.