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 A4ED6A04B6; Thu, 17 Sep 2020 07:11:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 82DC71D50B; Thu, 17 Sep 2020 07:11:06 +0200 (CEST) Received: from tc-sys-mailedm04.tc.baidu.com (mx55.baidu.com [61.135.168.55]) by dpdk.org (Postfix) with ESMTP id CEB241D505 for ; Thu, 17 Sep 2020 07:11:04 +0200 (CEST) Received: from localhost (cp01-cos-dev01.cp01.baidu.com [10.92.119.46]) by tc-sys-mailedm04.tc.baidu.com (Postfix) with ESMTP id 9F2B7236C047 for ; Thu, 17 Sep 2020 13:10:59 +0800 (CST) From: Li RongQing To: dev@dpdk.org Date: Thu, 17 Sep 2020 13:11:01 +0800 Message-Id: <1600319462-2053-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Subject: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") Cc: stable@dpdk.org Signed-off-by: Li RongQing --- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } rcvd = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx); -- 2.16.2