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 58C471B4B5 for ; Thu, 13 Dec 2018 10:00:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2018 01:00:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,348,1539673200"; d="scan'208";a="98416335" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga007.jf.intel.com with ESMTP; 13 Dec 2018 01:00:22 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Dec 2018 01:00:21 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Dec 2018 01:00:21 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.59]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.201]) with mapi id 14.03.0415.000; Thu, 13 Dec 2018 17:00:18 +0800 From: "Zhang, Qi Z" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Li, Xiaoyun" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v3 22/34] net/ice: support MAC ops Thread-Index: AQHUkeiMH6j0NZq1UUSuwjw3D3mpZ6V8YAMw Date: Thu, 13 Dec 2018 09:00:17 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532FE4FB@SHSMSX103.ccr.corp.intel.com> References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1544598004-27099-1-git-send-email-wenzhuo.lu@intel.com> <1544598004-27099-23-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1544598004-27099-23-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTJmODE3NzAtYjQ1NC00NzU4LTlhNWEtYTdkZjlkMDMyMWU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVm5FTUI5Y29pNlpZSnpBbG9DN0FJZ09XbkRqanRQM2NXYThiMExOWXFtQlhVWHhZR1lpV09LWXVteHFXNWhiTyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 22/34] net/ice: support MAC ops 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: Thu, 13 Dec 2018 09:00:24 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Wednesday, December 12, 2018 3:00 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Li, Xiaoyun ; Wu, Jingjing > > Subject: [dpdk-dev] [PATCH v3 22/34] net/ice: support MAC ops >=20 > Add below ops, > mac_addr_set > mac_addr_add > mac_addr_remove >=20 > Signed-off-by: Wenzhuo Lu > Signed-off-by: Qiming Yang > Signed-off-by: Xiaoyun Li > Signed-off-by: Jingjing Wu ..... > --- > drivers/net/ice/ice_ethdev.c | 233 > +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 233 insertions(+) > > +static int ice_macaddr_set(struct rte_eth_dev *dev, > + struct ether_addr *mac_addr) > +{ > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct ice_vsi *vsi =3D pf->main_vsi; > + struct ice_mac_filter *f; > + uint8_t flags =3D 0; > + int ret; > + > + if (!is_valid_assigned_ether_addr(mac_addr)) { > + PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); > + return -EINVAL; > + } > + > + TAILQ_FOREACH(f, &vsi->mac_list, next) { > + if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr)) > + break; > + } > + > + if (!f) { > + PMD_DRV_LOG(ERR, "Failed to find filter for default mac"); > + return -EIO; > + } > + > + ret =3D ice_remove_mac_filter(vsi, &f->mac_info.mac_addr); > + if (ret !=3D ICE_SUCCESS) { > + PMD_DRV_LOG(ERR, "Failed to delete mac filter"); > + return -EIO; > + } > + ret =3D ice_add_mac_filter(vsi, mac_addr); > + if (ret !=3D ICE_SUCCESS) { > + PMD_DRV_LOG(ERR, "Failed to add mac filter"); > + return -EIO; > + } > + memcpy(&pf->dev_addr, mac_addr, ETH_ADDR_LEN); > + > + flags =3D ICE_AQC_MAN_MAC_UPDATE_LAA_WOL; > + ice_aq_manage_mac_write(hw, mac_addr->addr_bytes, flags, NULL); Should check return value of the AQ command in case some error happen? > + > + return 0; > +} > +