From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0075.outbound.protection.outlook.com [104.47.0.75]) by dpdk.org (Postfix) with ESMTP id 75FF81B97C for ; Wed, 4 Apr 2018 10:19:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=H+uiA8R8Kd/eoT1X6m+V2/O650tLzjdYVodahDAvbu8=; b=EiKzLnjcRAoadHk6jTBBCvybEeTblKbp/g1iEHq+iUWBx/pMfZRXgvnnzAQ4nEVjpLPeQ9l9WJFHbbhR7TXhdil8SWbCMWcEluV63KnMuCOfF8xLkg1hn5xUa9fU0eltPovdXjzUjW9n5pJYQF3GrlUgW4y6Kp95Wx2LQYDZ2+E= Received: from HE1PR0402MB2780.eurprd04.prod.outlook.com (10.175.29.14) by HE1PR0402MB3546.eurprd04.prod.outlook.com (10.167.126.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Wed, 4 Apr 2018 08:19:52 +0000 Received: from HE1PR0402MB2780.eurprd04.prod.outlook.com ([fe80::cd9:8128:3f1d:710e]) by HE1PR0402MB2780.eurprd04.prod.outlook.com ([fe80::cd9:8128:3f1d:710e%14]) with mapi id 15.20.0631.013; Wed, 4 Apr 2018 08:19:52 +0000 From: Shreyansh Jain To: Olivier Matz , "dev@dpdk.org" CC: Thomas Monjalon , Ferruh Yigit , Adrien Mazarguil , Tomasz Duszynski , Andrew Rybchenko , Ivan Malov , Ivan Malov Thread-Topic: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting MAC address Thread-Index: AQHTy0kWHR+nI7Au9k+SbGLJ6D1JtKPwQolA Date: Wed, 4 Apr 2018 08:19:43 +0000 Deferred-Delivery: Wed, 4 Apr 2018 08:19:00 +0000 Message-ID: References: <20180227151129.30387-1-olivier.matz@6wind.com> <20180403124103.13124-1-olivier.matz@6wind.com> In-Reply-To: <20180403124103.13124-1-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-originating-ip: [92.121.36.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0402MB3546; 7:2n5Wr22W1FJTC1Ahc9SnZhPqXH8HQ8AydEUn+3cVwIDKZZRRpf+SZUn+XTutqlCJ+LUlEkD0/yDveKpvBncBhQIvC5aFPQMjt4z/kxxnEzV+0Qxzx7j+QT48lshuUp1/SQP6c9eDC7xljMAIO1PqClNcjwVEBrgEp7d6wNn/qtTzftP0XO7rwJv2oJa0j7AGszXo/hxaM0P9QsEVGoeDeF/ma7LIHA//h3Z3DIRYUK+NQBe+0uB/ElKq9r2SUl7Q x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 26c1a251-1c82-4116-bf16-08d59a04d77c x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0402MB3546; x-ms-traffictypediagnostic: HE1PR0402MB3546: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(788757137089)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0402MB3546; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0402MB3546; x-forefront-prvs: 0632519F33 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(346002)(39380400002)(366004)(13464003)(199004)(189003)(6436002)(2906002)(5660300001)(74316002)(2900100001)(5250100002)(305945005)(6246003)(25786009)(486006)(3846002)(81156014)(53936002)(8936002)(55016002)(2501003)(81166006)(4326008)(7736002)(6116002)(9686003)(105586002)(54906003)(6506007)(3660700001)(229853002)(14454004)(68736007)(33656002)(478600001)(186003)(11346002)(4477795004)(53546011)(7696005)(66066001)(86362001)(76176011)(26005)(99286004)(316002)(106356001)(476003)(110136005)(102836004)(3280700002)(59450400001)(6666003)(446003)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0402MB3546; H:HE1PR0402MB2780.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: OeRbqkb0iNVBNp8GdjDuW2g77mhLsf72jSHijeNL33oloKRyACp/BXrmyEMhxXfLPR3sChVSNeIfJvhKOo7TCyP3PzSXIAodb6rMD7X4ofB6BAjyhZ7lv1k4cAs6rWWfwT0MCB1PdMBHdkdX1VA2y4YNM5P4jiqY4QH5EXHZvg0w6nwSNx6eekDx9gXme4Vo5f4y5xImK/x4xFNXS2gzrtacKWevgOeHQrSCkdF/dPNstj1iKEFHkFbJ4/2deDzFD3qELVGgljt2Qlk1suzBah22uRTBxOA8BwDMqVapKlIQYKLhKgY7XjzXuI1V8Yv88WkLW6j0KeHSON0nM0JgrW3y9vXsunPnaP6YXX2BYz0epiP2GuL3yD4LBByvu4WcqZ4Qgr+X0nBN9G/Eg0o7B7O03YuU0P0yPdRz2ApZ5to= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26c1a251-1c82-4116-bf16-08d59a04d77c X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2018 08:19:52.7366 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB3546 Subject: Re: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting MAC address 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: Wed, 04 Apr 2018 08:19:54 -0000 Hello Olivier, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz > Sent: Tuesday, April 3, 2018 6:11 PM > To: dev@dpdk.org > Cc: Thomas Monjalon ; Ferruh Yigit > ; Adrien Mazarguil ; > Tomasz Duszynski ; Andrew Rybchenko > ; Ivan Malov ; Ivan > Malov > Subject: [dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting > MAC address >=20 > Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a > return code is added to notify the caller (librte_ether) if an error > occurred in the PMD. >=20 > The new default MAC address is now copied in dev->data->mac_addrs[0] > only if the operation is successful. >=20 > The patch also updates all the PMDs accordingly. >=20 > Signed-off-by: Olivier Matz > Signed-off-by: Ivan Malov > --- >=20 > v2: > * add same change for net/cxgbe > * mrvl was renamed as mvpp2 > * mvpp2: return success if no ppio as suggested by Tomasz > * mlx5: update comment as suggested by Adrien > * sfc: replace by Ivan's patch >=20 > doc/guides/rel_notes/deprecation.rst | 8 -------- > drivers/net/ark/ark_ethdev.c | 9 ++++++--- > drivers/net/avf/avf_ethdev.c | 12 +++++++---- > drivers/net/bnxt/bnxt_ethdev.c | 10 ++++++---- > drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++++-- > drivers/net/cxgbe/cxgbe_ethdev.c | 5 +++-- > drivers/net/cxgbe/cxgbe_pfvf.h | 2 +- > drivers/net/dpaa/dpaa_ethdev.c | 4 +++- > drivers/net/dpaa2/dpaa2_ethdev.c | 6 ++++-- > drivers/net/e1000/igb_ethdev.c | 12 ++++++----- > drivers/net/failsafe/failsafe_ops.c | 17 +++++++++++++--- > drivers/net/i40e/i40e_ethdev.c | 24 +++++++++++++--------- > drivers/net/i40e/i40e_ethdev_vf.c | 12 ++++++----- > drivers/net/ixgbe/ixgbe_ethdev.c | 13 +++++++----- > drivers/net/mlx4/mlx4.h | 2 +- > drivers/net/mlx4/mlx4_ethdev.c | 7 +++++-- > drivers/net/mlx5/mlx5.h | 2 +- > drivers/net/mlx5/mlx5_mac.c | 7 ++++++- > drivers/net/mvpp2/mrvl_ethdev.c | 15 ++++++++++---- > drivers/net/null/rte_eth_null.c | 3 ++- > drivers/net/octeontx/octeontx_ethdev.c | 4 +++- > drivers/net/qede/qede_ethdev.c | 7 +++---- > drivers/net/sfc/sfc_ethdev.c | 35 ++++++++++++++++++++++---- > ------- > drivers/net/szedata2/rte_eth_szedata2.c | 3 ++- > drivers/net/tap/rte_eth_tap.c | 34 +++++++++++++++++++++----- > ------ > drivers/net/virtio/virtio_ethdev.c | 15 +++++++++----- > drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +++-- > lib/librte_ether/rte_ethdev.c | 7 +++++-- > lib/librte_ether/rte_ethdev_core.h | 2 +- > test/test/virtual_pmd.c | 3 ++- > 30 files changed, 188 insertions(+), 105 deletions(-) >=20 [...] > diff --git a/drivers/net/dpaa/dpaa_ethdev.c > b/drivers/net/dpaa/dpaa_ethdev.c > index db493648a..2e4cb8267 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -813,7 +813,7 @@ dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev, > fman_if_clear_mac_addr(dpaa_intf->fif, index); > } >=20 > -static void > +static int > dpaa_dev_set_mac_addr(struct rte_eth_dev *dev, > struct ether_addr *addr) > { > @@ -825,6 +825,8 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev, > ret =3D fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0); > if (ret) > RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d", > ret); > + > + return 0; This should be 'return ret' as just above this line there is an error condi= tion. > } >=20 > static struct eth_dev_ops dpaa_devops =3D { > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c > b/drivers/net/dpaa2/dpaa2_ethdev.c > index 281483dfd..07d45a11e 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -1019,7 +1019,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev, > "error: Removing the MAC ADDR failed: err =3D %d", ret); > } >=20 > -static void > +static int > dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev, > struct ether_addr *addr) > { > @@ -1031,7 +1031,7 @@ dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev, >=20 > if (dpni =3D=3D NULL) { > DPAA2_PMD_ERR("dpni is NULL"); > - return; > + return -EINVAL; > } >=20 > ret =3D dpni_set_primary_mac_addr(dpni, CMD_PRI_LOW, > @@ -1040,6 +1040,8 @@ dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev, > if (ret) > DPAA2_PMD_ERR( > "error: Setting the MAC ADDR failed %d", ret); > + > + return 0; Same is the case here - It should be 'return ret' as there is an error repo= rted just above this line. > } >=20 > static [...] For the v3 with the changes above, for dpaa/dpaa2 and generic part: Acked-by: Shreyansh Jain - Shreyansh