From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7CD5AA04B6;
	Thu, 17 Sep 2020 09:33:18 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 457871D53C;
	Thu, 17 Sep 2020 09:33:18 +0200 (CEST)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id E9A801D538
 for <dev@dpdk.org>; Thu, 17 Sep 2020 09:33:16 +0200 (CEST)
IronPort-SDR: /VJJSWB7dLVmlux5bY3btM2+KvZx4lMxtAUaO6jaXHyRZOVlusEhWEkafk6YHlKQwSsFQ76QNY
 HQl/LswGS2Hw==
X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="139647189"
X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="139647189"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 17 Sep 2020 00:33:16 -0700
IronPort-SDR: qrmUYGkYy+/cX9A3lc3YYSG3yoyvpDNWea0y8c7jvK32zyyHOpvvn1V00pMu6DkILZyachBD1Y
 h5Uh5giACdkA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="452193781"
Received: from irsmsx604.ger.corp.intel.com ([163.33.146.137])
 by orsmga004.jf.intel.com with ESMTP; 17 Sep 2020 00:33:15 -0700
Received: from irsmsx604.ger.corp.intel.com (163.33.146.137) by
 IRSMSX604.ger.corp.intel.com (163.33.146.137) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.1713.5; Thu, 17 Sep 2020 08:33:14 +0100
Received: from irsmsx604.ger.corp.intel.com ([163.33.146.137]) by
 IRSMSX604.ger.corp.intel.com ([163.33.146.137]) with mapi id 15.01.1713.004;
 Thu, 17 Sep 2020 08:33:14 +0100
From: "Loftus, Ciara" <ciara.loftus@intel.com>
To: Li RongQing <lirongqing@baidu.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH 1/2] af_xdp: not return a negative value in
 af_xdp_rx_zc
Thread-Index: AQHWjLDPzjL2VXvukkW2iQDXsdp3X6lsbviw
Date: Thu, 17 Sep 2020 07:33:14 +0000
Message-ID: <8f957ea1b71346419be4f2a36bf9cbad@intel.com>
References: <1600319386-24559-1-git-send-email-lirongqing@baidu.com>
In-Reply-To: <1600319386-24559-1-git-send-email-lirongqing@baidu.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-reaction: no-action
dlp-version: 11.5.1.3
x-originating-ip: [163.33.253.164]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH 1/2] af_xdp: not return a negative value
	in	af_xdp_rx_zc
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

>=20
> af_xdp_rx_zc should always return the number of received packets,
> and negative value will be as number of received packets, and
> confuse the caller
>=20
> Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
> Cc: stable@dpdk.org
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Hi,

Thank you for the patch. The same fix was submitted and accepted into the n=
ext-net tree a few weeks ago:
http://git.dpdk.org/next/dpdk-next-net/commit/?id=3De85f60b4e282695ca0e457d=
c1ad21479b4bd7479
It should hopefully hit the main tree soon.

Ciara

>=20
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c
> b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 936d4a7d5..7ce4ad04a 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -236,7 +236,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs,
> uint16_t nb_pkts)
>  	if (rte_pktmbuf_alloc_bulk(umem->mb_pool, fq_bufs, nb_pkts)) {
>  		AF_XDP_LOG(DEBUG,
>  			"Failed to get enough buffers for fq.\n");
> -		return -1;
> +		return 0;
>  	}
>=20
>  	rcvd =3D xsk_ring_cons__peek(rx, nb_pkts, &idx_rx);
> --
> 2.16.2