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 43BBEA00E6 for ; Fri, 12 Jul 2019 17:48:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EBB361BDF1; Fri, 12 Jul 2019 17:48:57 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 209D91BDE3 for ; Fri, 12 Jul 2019 17:48:55 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id f25so4706717pgv.10 for ; Fri, 12 Jul 2019 08:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yfcYO4yOfJlYgIS+OuW75YWbCJQEqDoX6K/8nkmO/TY=; b=imt/rDTXJNEUXj5sBWOF8xgBjUmPfmScRgFE5+c01dc+qCpFzZoFNIueOFJ4zbeKUB LVa+AOgYCngI9rsmMcW+jTcEAILDWGnTm0pUlcdaB9aMYCtNy4+W1ClimilJqfFlOQcv qIJ3O4z/5PoOk9bWH83Z0AsvXdBFC96MLnXnjDX6cr7w5Zp0G13caWz8mNW7SRdDnBbs Yoim0wFuW0OEPVlT83W3+zHWU6OkcuMdrvS1G58MBhLsQ53c0en9UBxiA+cRBc6A+ZMl H78P+01/z5BA+V8Sq5ZKXC01mgeo1OT4k5L8pkBiK1NksKEU12GrsHyZIKwtWXeDFJ0N c2EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yfcYO4yOfJlYgIS+OuW75YWbCJQEqDoX6K/8nkmO/TY=; b=SJBfhX+dVXqUGNcrW/9Tas++dMaPH4ohWXcQxKx70vk35/l+fNnGCSHhhKTkuWOotA 8jaGgs8u3te0OfjbZlfjkyz7HlN7V4OnYb9XpxqeI0t/uYjMwESPaREEwvS7XbW5mKKY 8TPgd3N/w7JHG72bbEIDvohEbtW34BnmTI7uTslSksB5SO69ubYhWAL6XnB/mnf1W0IP YRUkyp1lc0jigdyRsJm1PGogwB2P/YPHeDpwzsLYtaadPCsF4yQLcgqpjsMr0BcNZ0YZ L/6asCY+JB3lDwf8lOFa+s72U4vYbYH4+CS03LHcZBFZW5eP4t6Oc5LyV1qK2LjyqGqf Y0bw== X-Gm-Message-State: APjAAAUNfJM6Z0vEFVMB/Yt4d/2HOHBlOmyr+mcRSzjjV1akV1W5+DEE jBlcT/T/oEj0PdrUzidXDCA= X-Google-Smtp-Source: APXvYqxc88bSlrjPF+gpvolKpE0iG2CqNqU2RdkOWR1FGJ/AzJqKDldv5J+ML3tnk0bhRe3pTPbhBA== X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr12886760pje.115.1562946535142; Fri, 12 Jul 2019 08:48:55 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 65sm9962055pff.148.2019.07.12.08.48.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 08:48:55 -0700 (PDT) Date: Fri, 12 Jul 2019 08:48:48 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: =?UTF-8?B?SsO6bGl1cw==?= Milan , dev@dpdk.org, xiaolong.ye@intel.com, qi.z.zhang@intel.com, david.marchand@redhat.com Message-ID: <20190712084848.2ccaff67@hermes.lan> In-Reply-To: <4a8960b9-eb63-22f1-280f-a9fd3728d029@intel.com> References: <20190712075546.GA20880@localhost.localdomain> <20190712081006.28838e24@hermes.lan> <4a8960b9-eb63-22f1-280f-a9fd3728d029@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix xdp_get_channels_info return value 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" On Fri, 12 Jul 2019 16:35:55 +0100 Ferruh Yigit wrote: > On 7/12/2019 4:10 PM, Stephen Hemminger wrote: > > On Fri, 12 Jul 2019 09:55:46 +0200 > > J=C3=BAlius Milan wrote: > > =20 > >> Procedure xdp_get_channels_info was returning error code -1 in case of > >> ioctl command SIOCETHTOOL was not supported. This patch sets return > >> value back to 0 as it is valid case. > >> > >> Fixes: 339b88c6a9 ("net/af_xdp: support multi-queue") > >> > >> Signed-off-by: J=C3=BAlius Milan > >> --- > >> drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++++++--- > >> 1 file changed, 7 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/= rte_eth_af_xdp.c > >> index ff8e90589..33352e10a 100644 > >> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > >> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > >> @@ -852,9 +852,13 @@ xdp_get_channels_info(const char *if_name, int *m= ax_queues, > >> ifr.ifr_data =3D (void *)&channels; > >> strncpy(ifr.ifr_name, if_name, IFNAMSIZ); > >> ret =3D ioctl(fd, SIOCETHTOOL, &ifr); > >> - if (ret && errno !=3D EOPNOTSUPP) { > >> - ret =3D -errno; > >> - goto out; > >> + if (ret) { > >> + if (errno =3D=3D EOPNOTSUPP) { > >> + ret =3D 0; > >> + } else { > >> + ret =3D -errno; > >> + goto out; > >> + } > >> } > >> =20 > >> if (channels.max_combined =3D=3D 0 || errno =3D=3D EOPNOTSUPP) { =20 > >=20 > > Still wrong, it doesn't set max_queues/combined_queues if errno =3D=3D = EOPNOTSUPP > > =20 >=20 > Looks like code only fixes the return value, which was 'ret' before, now = '0', > the remaining logic should be same. >=20 > as far as I can see, if errno =3D=3D EOPNOTSUPP, it sets > *max_queues =3D 1; > *combined_queues =3D channels.combined_count; OK, it does return correctly, just the hard way to do it. Keep it for now, I will do a cleanup pass over AF_XDP later. Lots of things could be done simpler