From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 878E5A00C2; Thu, 3 Feb 2022 12:09:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 152DE4014F; Thu, 3 Feb 2022 12:09:35 +0100 (CET) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id 3980F40143 for ; Thu, 3 Feb 2022 12:09:33 +0100 (CET) Received: by mail-io1-f54.google.com with SMTP id s18so2722691ioa.12 for ; Thu, 03 Feb 2022 03:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mrl7ZhA+HcoMMZQUzib3+A7nM0pLEI7gR4uFLxcFx14=; b=RIrNjT/NTjQc+rGZyOInnlKbnylkvybeF1PH3aImeEaVrlYumVHlAqzMJJZCMue1+r I18ku/vEb69FfYjB6w8mHDDlwLKQ8rv9rawzkOEblvrQ/JD7ZY3pqkKBJ8EBI9NlEuNH r049XE6NXNsyrYWFSQQLudiWV52PymBi1KSLm3D1s365zm6DpRCiJJcYPL0ZPtHR5HDO LBifXQaLrakUQObJHqFmy9Sx5r+8jA5M+JaLMiycL6shLsZfDNsipR8mvNrlelRmoj9n XcKJk8RLQ5nDwO+A47s8ZQzQUTIwE6dmnEeJFJ9RxP0mAyGCLwql+4K/doNYCP9X1Uhm OSJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mrl7ZhA+HcoMMZQUzib3+A7nM0pLEI7gR4uFLxcFx14=; b=ZRwvrjc5EEttXd1klP6/9vBg10kromITCzVS4Qn44MWZCIzUVsFu6dq9vJXZvR+wWv QQihawoZPBKb1NK9WhvXvL//hgncrBO2ybRtnRdW88JQsU+u59prZtvIphXcEvX84DJT Lo651PAQjmXZi1pYa9fjjskoRHkiWOaUNjRgpCayy+pbH3pHMYC+xSptrFDpWIWN7Um4 XfHslboKMJ1BDOvyNnEdhBVD8oJKCPNZGlLZYYUUUrXLHv2a8Rm9zd5PnPKa97qrVUzR 5SMYDkXMGM7xbN/EOMM9MoDAhaO9STCOlNiWHOk4LyTdVpUqvixuzGGCz6kNbfqddMaB p0wg== X-Gm-Message-State: AOAM532dRkLPHF9GUnQbMnJKfYezg4HuPljiENbCWShJhnE5wjRssuZn hYzRgfdNyvtoIc9kOpIbxbC6ibR6dXm3E5teoUEJrAwSdvI= X-Google-Smtp-Source: ABdhPJyw7CxJA9IDVpAw3y+TupkeKf8JF0tgsH8P0tPAdZSgflI63sq8puS+BIxt2A70h8XGQ+dtoEEmHZ5soJpNFYc= X-Received: by 2002:a02:8791:: with SMTP id t17mr11135250jai.118.1643886572029; Thu, 03 Feb 2022 03:09:32 -0800 (PST) MIME-Version: 1.0 References: <20220203082412.79028-1-kumaraparamesh92@gmail.com> In-Reply-To: <20220203082412.79028-1-kumaraparamesh92@gmail.com> From: kumaraparameshwaran rathinavel Date: Thu, 3 Feb 2022 16:39:20 +0530 Message-ID: Subject: Re: [PATCH v1] drivers/net: use internal API to get eth dev from name To: dev@dpdk.org Cc: Ferruh Yigit , Kumara Parameshwaran Content-Type: multipart/alternative; boundary="0000000000002d4b4905d71b2b7e" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --0000000000002d4b4905d71b2b7e Content-Type: text/plain; charset="UTF-8" Ferruh, Since in the older patch we had introduced rte_eth_dev_get_by_name patch and had been merged to dpdk-next-net, the current patch failed for the build when I submitted the patch. Is there a way to enforce it to dpdk-next-net ? On Thu, Feb 3, 2022 at 1:54 PM Kumara Parameshwaran < kumaraparamesh92@gmail.com> wrote: > From: Kumara Parameshwaran > > Make changes in PMDs to use the new function where > rte_eth_dev_get_port_by_name is used to get port_id > to access rte_eth_devices > > Signed-off-by: Kumara Parameshwaran > --- > v1 > * Replace rte_eth_get_get_port_by_name in PMDs with rte_eth_dev_get_by_name > where port_id is used to retrieve rte_eth_dev data structure > > drivers/net/bonding/rte_eth_bond_api.c | 10 +++++----- > drivers/net/ipn3ke/ipn3ke_ethdev.c | 9 +++------ > drivers/net/memif/rte_eth_memif.c | 7 ++----- > drivers/net/softnic/rte_eth_softnic_thread.c | 8 +++----- > drivers/net/tap/rte_eth_tap.c | 7 ++----- > 5 files changed, 15 insertions(+), 26 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_api.c > b/drivers/net/bonding/rte_eth_bond_api.c > index 8840d9e17b..b78867b125 100644 > --- a/drivers/net/bonding/rte_eth_bond_api.c > +++ b/drivers/net/bonding/rte_eth_bond_api.c > @@ -151,8 +151,8 @@ int > rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) > { > struct bond_dev_private *internals; > + struct rte_eth_dev *bond_dev; > char devargs[52]; > - uint16_t port_id; > int ret; > > if (name == NULL) { > @@ -169,8 +169,8 @@ rte_eth_bond_create(const char *name, uint8_t mode, > uint8_t socket_id) > if (ret) > return ret; > > - ret = rte_eth_dev_get_port_by_name(name, &port_id); > - RTE_ASSERT(!ret); > + bond_dev = rte_eth_dev_get_by_name(name); > + RTE_ASSERT(bond_dev); > > /* > * To make bond_ethdev_configure() happy we need to free the > @@ -178,11 +178,11 @@ rte_eth_bond_create(const char *name, uint8_t mode, > uint8_t socket_id) > * > * Also see comment in bond_ethdev_configure(). > */ > - internals = rte_eth_devices[port_id].data->dev_private; > + internals = bond_dev->data->dev_private; > rte_kvargs_free(internals->kvlist); > internals->kvlist = NULL; > > - return port_id; > + return bond_dev->data->port_id; > } > > int > diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c > b/drivers/net/ipn3ke/ipn3ke_ethdev.c > index 014e438dd5..550a8b0466 100644 > --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c > +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c > @@ -469,7 +469,6 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device > *afu_dev) > struct ipn3ke_hw *hw; > struct rte_eth_dev *i40e_eth; > struct ifpga_rawdev *ifpga_dev; > - uint16_t port_id; > int i, j, retval; > char *fvl_bdf; > > @@ -519,14 +518,12 @@ static int ipn3ke_vswitch_probe(struct > rte_afu_device *afu_dev) > > for (; j < 8; j++) { > fvl_bdf = ifpga_dev->fvl_bdf[j]; > - retval = rte_eth_dev_get_port_by_name(fvl_bdf, > - &port_id); > - if (retval) { > + i40e_eth = rte_eth_dev_get_by_name(fvl_bdf); > + if (!i40e_eth) { > continue; > } else { > - i40e_eth = &rte_eth_devices[port_id]; > rpst.i40e_pf_eth = i40e_eth; > - rpst.i40e_pf_eth_port_id = port_id; > + rpst.i40e_pf_eth_port_id = > i40e_eth->data->port_id; > > j++; > break; > diff --git a/drivers/net/memif/rte_eth_memif.c > b/drivers/net/memif/rte_eth_memif.c > index d3459c5007..5700c6a2bf 100644 > --- a/drivers/net/memif/rte_eth_memif.c > +++ b/drivers/net/memif/rte_eth_memif.c > @@ -88,17 +88,14 @@ memif_mp_send_region(const struct rte_mp_msg *msg, > const void *peer) > const struct mp_region_msg *msg_param = (const struct > mp_region_msg *)msg->param; > struct rte_mp_msg reply; > struct mp_region_msg *reply_param = (struct mp_region_msg > *)reply.param; > - uint16_t port_id; > - int ret; > > /* Get requested port */ > - ret = rte_eth_dev_get_port_by_name(msg_param->port_name, &port_id); > - if (ret) { > + dev = rte_eth_dev_get_by_name(msg_param->port_name); > + if (!dev) { > MIF_LOG(ERR, "Failed to get port id for %s", > msg_param->port_name); > return -1; > } > - dev = &rte_eth_devices[port_id]; > proc_private = dev->process_private; > > memset(&reply, 0, sizeof(reply)); > diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c > b/drivers/net/softnic/rte_eth_softnic_thread.c > index a8c26a5b23..4a9f2fa6a4 100644 > --- a/drivers/net/softnic/rte_eth_softnic_thread.c > +++ b/drivers/net/softnic/rte_eth_softnic_thread.c > @@ -129,14 +129,12 @@ thread_sc_service_up(struct pmd_internals *softnic, > uint32_t thread_id) > struct softnic_thread *t = &softnic->thread[thread_id]; > struct rte_eth_dev *dev; > int status; > - uint16_t port_id; > > /* service params */ > - status = rte_eth_dev_get_port_by_name(softnic->params.name, > &port_id); > - if (status) > - return status; > + dev = rte_eth_dev_get_by_name(softnic->params.name); > + if (!dev) > + return -EINVAL; > > - dev = &rte_eth_devices[port_id]; > snprintf(service_params.name, sizeof(service_params.name), > "%s_%u", > softnic->params.name, > thread_id); > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index 111037de65..bc3d56a311 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -2428,19 +2428,16 @@ tap_mp_sync_queues(const struct rte_mp_msg > *request, const void *peer) > (const struct ipc_queues *)request->param; > struct ipc_queues *reply_param = > (struct ipc_queues *)reply.param; > - uint16_t port_id; > int queue; > - int ret; > > /* Get requested port */ > TAP_LOG(DEBUG, "Received IPC request for %s", > request_param->port_name); > - ret = rte_eth_dev_get_port_by_name(request_param->port_name, > &port_id); > - if (ret) { > + dev = rte_eth_dev_get_by_name(request_param->port_name); > + if (!dev) { > TAP_LOG(ERR, "Failed to get port id for %s", > request_param->port_name); > return -1; > } > - dev = &rte_eth_devices[port_id]; > process_private = dev->process_private; > > /* Fill file descriptors for all queues */ > -- > 2.17.1 > > --0000000000002d4b4905d71b2b7e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ferruh,=C2=A0

Since in the older patch = we had introduced rte_eth_dev_get_by_name patch and had been merged to dpdk= -next-net, the current patch failed for the build when I submitted the patc= h. Is there a way to enforce it to dpdk-next-net ?

On Thu, Feb 3,= 2022 at 1:54 PM Kumara Parameshwaran <kumaraparamesh92@gmail.com> wrote:
From: Kumara Param= eshwaran <k= parameshwar@vmware.com>

Make changes in PMDs to use the new function where
rte_eth_dev_get_port_by_name is used to get port_id
to access rte_eth_devices

Signed-off-by: Kumara Parameshwaran <kparameshwar@vmware.com>
---
v1
* Replace rte_eth_get_get_port_by_name in PMDs with rte_eth_dev_get_by_name=
=C2=A0 where port_id is used to retrieve rte_eth_dev data structure

=C2=A0drivers/net/bonding/rte_eth_bond_api.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 10= +++++-----
=C2=A0drivers/net/ipn3ke/ipn3ke_ethdev.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 9 +++------
=C2=A0drivers/net/memif/rte_eth_memif.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 7 ++-----
=C2=A0drivers/net/softnic/rte_eth_softnic_thread.c |=C2=A0 8 +++-----
=C2=A0drivers/net/tap/rte_eth_tap.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 |=C2=A0 7 ++-----
=C2=A05 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/r= te_eth_bond_api.c
index 8840d9e17b..b78867b125 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -151,8 +151,8 @@ int
=C2=A0rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id= )
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct bond_dev_private *internals;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct rte_eth_dev *bond_dev;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 char devargs[52];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t port_id;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int ret;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (name =3D=3D NULL) {
@@ -169,8 +169,8 @@ rte_eth_bond_create(const char *name, uint8_t mode, uin= t8_t socket_id)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ret;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_eth_dev_get_port_by_name(name, &= ;port_id);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_ASSERT(!ret);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0bond_dev =3D rte_eth_dev_get_by_name(name);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_ASSERT(bond_dev);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* To make bond_ethdev_configure() happy w= e need to free the
@@ -178,11 +178,11 @@ rte_eth_bond_create(const char *name, uint8_t mode, u= int8_t socket_id)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Also see comment in bond_ethdev_configu= re().
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
-=C2=A0 =C2=A0 =C2=A0 =C2=A0internals =3D rte_eth_devices[port_id].data->= ;dev_private;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0internals =3D bond_dev->data->dev_private= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 rte_kvargs_free(internals->kvlist);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 internals->kvlist =3D NULL;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0return port_id;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return bond_dev->data->port_id;
=C2=A0}

=C2=A0int
diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke= _ethdev.c
index 014e438dd5..550a8b0466 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -469,7 +469,6 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device *= afu_dev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ipn3ke_hw *hw;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct rte_eth_dev *i40e_eth;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ifpga_rawdev *ifpga_dev;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t port_id;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int i, j, retval;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 char *fvl_bdf;

@@ -519,14 +518,12 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device= *afu_dev)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (; j < 8; j+= +) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 fvl_bdf =3D ifpga_dev->fvl_bdf[j];
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0retval =3D rte_eth_dev_get_port_by_name(fvl_bdf,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&port_id);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (retval) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0i40e_eth =3D rte_eth_dev_get_by_name(fvl_bdf);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (!i40e_eth) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 } else {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0i40e_eth =3D &rte_eth_devices[por= t_id];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rpst.i40e_pf_eth =3D i40e_eth;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rpst.i40e_pf_eth_port_id =3D port_id;=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rpst.i40e_pf_eth_port_id =3D i40e_eth= ->data->port_id;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 j++;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break;
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_= memif.c
index d3459c5007..5700c6a2bf 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -88,17 +88,14 @@ memif_mp_send_region(const struct rte_mp_msg *msg, cons= t void *peer)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 const struct mp_region_msg *msg_param =3D (cons= t struct mp_region_msg *)msg->param;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct rte_mp_msg reply;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct mp_region_msg *reply_param =3D (struct m= p_region_msg *)reply.param;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t port_id;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Get requested port */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_eth_dev_get_port_by_name(msg_param-= >port_name, &port_id);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D rte_eth_dev_get_by_name(msg_param->p= ort_name);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!dev) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MIF_LOG(ERR, "= Failed to get port id for %s",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 msg_param->port_name);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D &rte_eth_devices[port_id];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 proc_private =3D dev->process_private;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 memset(&reply, 0, sizeof(reply));
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/sof= tnic/rte_eth_softnic_thread.c
index a8c26a5b23..4a9f2fa6a4 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -129,14 +129,12 @@ thread_sc_service_up(struct pmd_internals *softnic, u= int32_t thread_id)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct softnic_thread *t =3D &softnic->t= hread[thread_id];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct rte_eth_dev *dev;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int status;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t port_id;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* service params */
-=C2=A0 =C2=A0 =C2=A0 =C2=A0status =3D rte_eth_dev_get_port_by_name(softnic= ->pa= rams.name, &port_id);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (status)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return status;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D rte_eth_dev_get_by_name(softnic->params.nam= e);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!dev)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL;

-=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D &rte_eth_devices[port_id];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 snprintf(service_params.name, sizeof(serv= ice_params.name), "%s_%u",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 softnic->params.name,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 thread_id);
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c<= br> index 111037de65..bc3d56a311 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2428,19 +2428,16 @@ tap_mp_sync_queues(const struct rte_mp_msg *request= , const void *peer)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (const struct ipc_q= ueues *)request->param;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ipc_queues *reply_param =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (struct ipc_queues = *)reply.param;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t port_id;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int queue;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Get requested port */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 TAP_LOG(DEBUG, "Received IPC request for %= s", request_param->port_name);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D rte_eth_dev_get_port_by_name(request_pa= ram->port_name, &port_id);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D rte_eth_dev_get_by_name(request_param-&= gt;port_name);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!dev) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TAP_LOG(ERR, "= Failed to get port id for %s",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 request_param->port_name);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return -1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 =C2=A0 =C2=A0dev =3D &rte_eth_devices[port_id];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 process_private =3D dev->process_private;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Fill file descriptors for all queues */
--
2.17.1

--0000000000002d4b4905d71b2b7e--