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 4485EA054F; Mon, 1 Mar 2021 12:04:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C319922A257; Mon, 1 Mar 2021 12:04:41 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1525322A23C; Mon, 1 Mar 2021 12:04:39 +0100 (CET) IronPort-SDR: iUC3tpr8HYhBfP0FqGOMW7YV1gNSIFLEH6bCjsxw4UqtZvQoaU+vpce3NrZ13brL/DC1ETYVLO 1ziv9xmkM/2g== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="186481938" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="186481938" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 03:04:38 -0800 IronPort-SDR: nZMnt12buhtAc3CGSy7d9VU4SdXHrXj7zJpnNbIqaq+fi7dWTEAjx3hG0AiPWFuH9VHHC5Wq1z 4AVXr0JmNj/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="517385519" Received: from silpixa00399839.ir.intel.com (HELO localhost.localdomain) ([10.237.222.142]) by orsmga004.jf.intel.com with ESMTP; 01 Mar 2021 03:04:37 -0800 From: Ciara Loftus To: dev@dpdk.org Cc: huangying-c@360.cn, Ciara Loftus , stable@dpdk.org Date: Mon, 1 Mar 2021 10:34:13 +0000 Message-Id: <20210301103413.31183-1-ciara.loftus@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/af_xdp: fix error handling during Rx queue setup 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 Sender: "dev" Prior to this commit, if rte_pktmbuf_alloc_bullk failed during rx queue setup the error was not returned to the user and they may incorrectly assume that the rx queue had been successfully set up. This commit ensures that the error is returned to the user. Bugzilla ID: 643 Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") Cc: stable@dpdk.org Signed-off-by: Ciara Loftus --- drivers/net/af_xdp/rte_eth_af_xdp.c | 3 ++- 1 file changed, 2 insertions(+), 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 b8d5ad0d91..3957227bf0 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -1145,7 +1145,8 @@ xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq, } #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) - if (rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size)) { + ret = rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size); + if (ret) { AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n"); goto err; } -- 2.17.1