From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1A26A04F1; Mon, 6 Jan 2020 03:45:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3736F1D428; Mon, 6 Jan 2020 03:45:51 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id E98261D427 for ; Mon, 6 Jan 2020 03:45:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jan 2020 18:45:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,400,1571727600"; d="scan'208";a="222134949" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 05 Jan 2020 18:45:47 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 5 Jan 2020 18:45:47 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 5 Jan 2020 18:45:47 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.132]) with mapi id 14.03.0439.000; Mon, 6 Jan 2020 10:45:44 +0800 From: "Yang, Qiming" To: "Wang, Haiyue" , "dev@dpdk.org" , "stephen@networkplumber.org" , "Zhang, Qi Z" , "Ye, Xiaolong" Thread-Topic: [PATCH v3] net/ice: use the copy API to do MAC assignment Thread-Index: AQHVweKtZVosaFJA5kGNso1jkO+Jmafc8sog Date: Mon, 6 Jan 2020 02:45:43 +0000 Message-ID: References: <20200102071457.106137-1-haiyue.wang@intel.com> <20200103025845.12609-1-haiyue.wang@intel.com> In-Reply-To: <20200103025845.12609-1-haiyue.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2ViYzRlMjgtODI1OC00YTNmLTgxZjktM2U1OGY0OGViNWM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQnBtRU5SZldKZVwvVVJ6dDJDenVcL2c5WVpPaFY2T1JOZ05SSmt1V0gxamllcVwvWnA0SCtsS3VWS0VudnFpZHdUWiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 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 v3] net/ice: use the copy API to do MAC assignment 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Wang, Haiyue > Sent: Friday, January 3, 2020 10:59 AM > To: dev@dpdk.org; stephen@networkplumber.org; Zhang, Qi Z > ; Yang, Qiming ; Ye, > Xiaolong > Cc: Wang, Haiyue > Subject: [PATCH v3] net/ice: use the copy API to do MAC assignment >=20 > Use the API rte_ether_addr_copy to do MAC assignment, instead of calling > rte_memcpy function directly. >=20 > Signed-off-by: Haiyue Wang > --- > v3: Update the commit message >=20 > v2: Update the commit title and message, use the rte_ether_addr_copy API > instead of just changing the length definition to make code style cle= an. >=20 > drivers/net/ice/ice_ethdev.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > 2cbd82c94..d104df26f 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -873,7 +873,7 @@ ice_add_mac_filter(struct ice_vsi *vsi, struct > rte_ether_addr *mac_addr) > ret =3D -ENOMEM; > goto DONE; > } > - rte_memcpy(&f->mac_info.mac_addr, mac_addr, ETH_ADDR_LEN); > + rte_ether_addr_copy(mac_addr, &f->mac_info.mac_addr); > TAILQ_INSERT_TAIL(&vsi->mac_list, f, next); > vsi->mac_num++; >=20 > @@ -1660,16 +1660,16 @@ ice_setup_vsi(struct ice_pf *pf, enum > ice_vsi_type type) >=20 > if (type =3D=3D ICE_VSI_PF) { > /* MAC configuration */ > - rte_memcpy(pf->dev_addr.addr_bytes, > - hw->port_info->mac.perm_addr, > - ETH_ADDR_LEN); > + rte_ether_addr_copy((struct rte_ether_addr *) > + hw->port_info->mac.perm_addr, > + &pf->dev_addr); >=20 > - rte_memcpy(&mac_addr, &pf->dev_addr, > RTE_ETHER_ADDR_LEN); > + rte_ether_addr_copy(&pf->dev_addr, &mac_addr); > ret =3D ice_add_mac_filter(vsi, &mac_addr); > if (ret !=3D ICE_SUCCESS) > PMD_INIT_LOG(ERR, "Failed to add dflt MAC filter"); >=20 > - rte_memcpy(&mac_addr, &broadcast, > RTE_ETHER_ADDR_LEN); > + rte_ether_addr_copy(&broadcast, &mac_addr); > ret =3D ice_add_mac_filter(vsi, &mac_addr); > if (ret !=3D ICE_SUCCESS) > PMD_INIT_LOG(ERR, "Failed to add MAC filter"); @@ > -3267,7 +3267,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, > PMD_DRV_LOG(ERR, "Failed to add mac filter"); > return -EIO; > } > - memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN); > + rte_ether_addr_copy(mac_addr, &pf->dev_addr); >=20 > flags =3D ICE_AQC_MAN_MAC_UPDATE_LAA_WOL; > ret =3D ice_aq_manage_mac_write(hw, mac_addr->addr_bytes, flags, > NULL); > -- > 2.17.1 Acked-by: Qiming Yang