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 422B9A00E6 for ; Fri, 12 Jul 2019 17:09:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 954FC1BDE1; Fri, 12 Jul 2019 17:09:25 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id BF4F51B9FA for ; Fri, 12 Jul 2019 17:09:23 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id ay6so4911606plb.9 for ; Fri, 12 Jul 2019 08:09:23 -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=qwgXgy0N5+SRt9uGlxG6ba8yOWjcxUnXQEdB2UF3syY=; b=alYLXOCDz/7hxFg3PPBa85MCVair1k+zDQiD0yt0fh46hKaCjkINpDW/uwmeHHX7mS vXPMLaLNZ+qd01NEL0RdDEWHeYavm+wj6qhrQw6IpLRzvs5zMg0a9ILoLw4rA+unnKC2 Lo6Or/OrfeTcOPtI0Cgju8wdBs9PYyI1IL/OL8UtBL+59LY828Ne1Vwu/hYeFOIg+JLm 3+RqwH37gUc2PVbOs65zHz06RnV2sabpHKZOWboKbmHQI9XRrqBjJ3ZQ0Ok87SAZB4ku yBPmF1VnKNsNCMdO9GDrnmAG3ej/iPh05roRHe+6kfK3X6fGK8GjszZ1yW6XbTlUS14m DRmQ== 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=qwgXgy0N5+SRt9uGlxG6ba8yOWjcxUnXQEdB2UF3syY=; b=IMtVrWOA5SidHY32VlZhwM5AHoJ09XfTxbNdyszCkg9Ke1ZaN6iG8cvf/zYGOsKNu7 Gy2EdEwAlfLfHdtqAfXVBw9q9hQE+eVgHOfW5xwrxfny/1x/uJL8l1hhNLCvdYz7+QKQ sg8W1207Zk1vnH/VNhozlG2t6VcmN6m0k216/EchhytBf1bP95l6S7PL24wvhXKJysm7 Du3AnirVdCoMrH/EBWmCu5j+zLW0k9zD8yb3fpEOtCUJ63X3uKuPIwxOcwsScGVHSSh1 UPIsPwaCm7Kh54lTNqdFS9h1k4HpuukAAed4ulkrQstvIQwyFoTf9pDiX5mC1WOeqXe/ Pegg== X-Gm-Message-State: APjAAAUmwkCVBmPgnHCprGFhP6q0eeKlIhLaOgMfCjFBL6ovbjZFBZzZ Qg+NGBRBkUw0vtdPRU+GbEw= X-Google-Smtp-Source: APXvYqwQpHxm7dzdn8N9Mih7hejHEae+MhS2UeyNH7rNcKSI7wgM3i1lffl7/+wwjPZjU/m7oI9Rkg== X-Received: by 2002:a17:902:bc83:: with SMTP id bb3mr12342785plb.56.1562944163040; Fri, 12 Jul 2019 08:09:23 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q69sm15939522pjb.0.2019.07.12.08.09.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 08:09:22 -0700 (PDT) Date: Fri, 12 Jul 2019 08:09:16 -0700 From: Stephen Hemminger To: =?UTF-8?B?SsO6bGl1cw==?= Milan Cc: dev@dpdk.org, xiaolong.ye@intel.com, qi.z.zhang@intel.com, david.marchand@redhat.com Message-ID: <20190712080916.23f835f4@hermes.lan> In-Reply-To: References: 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 09:40:37 +0200 J=C3=BAlius Milan wrote: > 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 *max_= 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; > + } > } Why not do close first and avoid the goto? With your code, max_queues and combined_queues would never get set. ret =3D ioctl(fd, SIOCETHTOOL, &ifr); close(fd); if (ret < 0 && errno !=3D EOPNOTSUPP) return -errno; if (errno =3D=3D EOPNOTSUPP || channels.max_combined =3D=3D 0) { ...