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 359C57D56 for ; Fri, 5 May 2017 03:46:09 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 04 May 2017 18:46:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,290,1491289200"; d="scan'208";a="97878064" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 04 May 2017 18:46:08 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 4 May 2017 18:46:08 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Fri, 5 May 2017 09:46:06 +0800 From: "Yang, Qiming" To: "Dai, Wei" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 1/3] ethdev: fix adding invalid MAC addr Thread-Index: AQHSxTlU+p3XJ+puBUyiADK50Gvve6Hk9zmg Date: Fri, 5 May 2017 01:46:05 +0000 Message-ID: References: <1493729065-17090-1-git-send-email-wei.dai@intel.com> <1493944802-52943-1-git-send-email-wei.dai@intel.com> <1493944802-52943-2-git-send-email-wei.dai@intel.com> In-Reply-To: <1493944802-52943-2-git-send-email-wei.dai@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTUwODg3MTUtNzczZi00Yjc4LThmNTEtODVjMGFjYzJkODY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlA1SjFXZHZxcFVGU01oNGRMckFGRzVWa1lFczBPZDFGcWNxQmZGNGlON2M9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 01:46:10 -0000 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); >=20 > 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) } >=20 > #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 =3D E1000_READ_REG(hw, E1000_RAH(index)); > rah |=3D (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.