From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F10B020B4F; Fri, 5 May 2017 10:07:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 05 May 2017 10:07:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=3fZT0GpI+C6wN7i L4igwYCwx8+CtadUxgVuLO6wUYW8=; b=WSEmSfpaqjnkD7K+Wuts04jiVuLK8LU Bq+DoFUbn80uMdS1AGSmb/9BUZNkBw7CQJcZeBBfGWgSCphQoXgyf12KGzHuZdkh zzRXAFoF/lBQ4oBbR7+gQYQz51gULxQveWHoZ4JzUzjhgB972Dj16Gb+NNPMpDhF R4flKNI0fyJI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=3fZT0GpI+C6wN7iL4igwYCwx8+CtadUxgVuLO6wUYW8=; b=iqzFI/ZW QHl6sqesZOEkUKizIB5NKrGi2i8Clo7xKQLwl0kxNuOrFFtR7BApoinxI8hEfW3+ /TYZNHfaTDWDGX13GCp5qc8/w1Yrw6JpxNt2hfVRKbKDOMVn4kv4Fz/+7ZkLT6ey fj0qI7qbkq8gukazgAzyh8ukYxUjnAcw12+MNi4sxUpITs8PjPADD7trtm2K1cpi g9cbGFP14Wrr6X4BFHX3FI0SF0VUz083bUqanNGlSagDyHZrFk5ij+62D2xGw6Bk gt5Ly7hogOUCNv13CfUMW6Eh6LWjRqPWwe7k6iPBH1gWEtql5ujaLJWjvE5IAYFM YiIrxdWiHaA0bg== X-ME-Sender: X-Sasl-enc: n/IFuTSAmJA7b5tj8VkbbA4wx9Ze5e8ner8tnrJIT7Y7 1493993279 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B4AC17E5C8; Fri, 5 May 2017 10:07:59 -0400 (EDT) From: Thomas Monjalon To: "Yang, Qiming" Cc: dev@dpdk.org, "Dai, Wei" Date: Fri, 05 May 2017 16:07:58 +0200 Message-ID: <2884082.25luyXgJup@xps> In-Reply-To: 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v7 1/3] ethdev: fix adding invalid MAC addr 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: Fri, 05 May 2017 14:08:01 -0000 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.