From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id CC55A5F39 for ; Mon, 2 Apr 2018 08:17:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2018 23:17:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,394,1517904000"; d="scan'208";a="30307133" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by orsmga008.jf.intel.com with ESMTP; 01 Apr 2018 23:17:30 -0700 Received: from pgsmsx101.gar.corp.intel.com ([169.254.1.195]) by KMSMSX156.gar.corp.intel.com ([169.254.1.97]) with mapi id 14.03.0319.002; Mon, 2 Apr 2018 14:17:29 +0800 From: "Zhao1, Wei" To: Chas Williams <3chas3@gmail.com>, "dev@dpdk.org" CC: "Lu, Wenzhuo" , Chas Williams Thread-Topic: [dpdk-dev] [PATCH] net/e1000: add mac_addr_set set to em Thread-Index: AQHTqRo7dvRjlTB4gUiWFCDG8K81z6PtQGgQ Date: Mon, 2 Apr 2018 06:17:28 +0000 Message-ID: References: <20180219003955.18775-1-3chas3@gmail.com> In-Reply-To: <20180219003955.18775-1-3chas3@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/e1000: add mac_addr_set set to em 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: Mon, 02 Apr 2018 06:17:33 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams > Sent: Monday, February 19, 2018 8:40 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Chas Williams > Subject: [dpdk-dev] [PATCH] net/e1000: add mac_addr_set set to em >=20 > From: Chas Williams >=20 > Based on the equivalent code in the igb driver. >=20 > Signed-off-by: Chas Williams > --- > drivers/net/e1000/em_ethdev.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/drivers/net/e1000/em_ethdev.c > b/drivers/net/e1000/em_ethdev.c index 242375f..5bb9cc9 100644 > --- a/drivers/net/e1000/em_ethdev.c > +++ b/drivers/net/e1000/em_ethdev.c > @@ -94,6 +94,8 @@ static int em_get_rx_buffer_size(struct e1000_hw *hw); > static int eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr > *mac_addr, > uint32_t index, uint32_t pool); > static void eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index); > +static void eth_em_default_mac_addr_set(struct rte_eth_dev *dev, > + struct ether_addr *addr); >=20 > static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, > struct ether_addr *mc_addr_set, > @@ -190,6 +192,7 @@ static const struct eth_dev_ops eth_em_ops =3D { > .dev_led_off =3D eth_em_led_off, > .flow_ctrl_get =3D eth_em_flow_ctrl_get, > .flow_ctrl_set =3D eth_em_flow_ctrl_set, > + .mac_addr_set =3D eth_em_default_mac_addr_set, > .mac_addr_add =3D eth_em_rar_set, > .mac_addr_remove =3D eth_em_rar_clear, > .set_mc_addr_list =3D eth_em_set_mc_addr_list, > @@ -1809,6 +1812,15 @@ eth_em_rar_clear(struct rte_eth_dev *dev, > uint32_t index) > e1000_rar_set(hw, addr, index); > } >=20 > +static void > +eth_em_default_mac_addr_set(struct rte_eth_dev *dev, > + struct ether_addr *addr) > +{ > + eth_em_rar_clear(dev, 0); > + > + eth_em_rar_set(dev, (void *)addr, 0, 0); } > + > static int > eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > -- > 2.9.5 I think this patch is need by em to enable the feature of configuration fo= r=20 default Receive Address Register, if DPDK user use rte function of rte_eth_dev_default_mac_addr_set(), it can do this config work like other = NIC. Acked-by: Wei Zhao