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 AC66B454E9 for ; Tue, 25 Jun 2024 02:00:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A37CD4026F; Tue, 25 Jun 2024 02:00:13 +0200 (CEST) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mails.dpdk.org (Postfix) with ESMTP id AB80641141 for ; Tue, 25 Jun 2024 02:00:11 +0200 (CEST) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-424a3411edeso37435e9.0 for ; Mon, 24 Jun 2024 17:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273611; x=1719878411; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v+S4ZQN+S8Kg7+BC99jGy1OOXPpTgKCbBLgl3Cqsrdc=; b=CuvSzFdZlrB/gfWAzWJgrcCjFPFRpA9h+XMz9uQDG0if7YtuRku76Qjv1VK8DCsepv 0RlUoV/Ftc2YIAhb6QchF1UV9uY/9j6JPcpOW0sPDAZyTD3+LmoMegl/fgP8xJYxcEMw VXeyG4Mo177/Y6elO/x7+DRx6Dnaco7W6ITYzBp7PNm8fvwth0EPZUMirvoFf2nahR0U dBEpOIVCcV2EDVVEYHXyZrTrZltF0WeCoEwgQJTZI08KMA4/FCNKqCd4yRJSko/rm2IL YPhwQISmfZ57VPlit/oUb2HiZ4vQxN04gxPMdcGIprX33wQkhfx1VWThRroV+kxtT+C5 msxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273611; x=1719878411; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v+S4ZQN+S8Kg7+BC99jGy1OOXPpTgKCbBLgl3Cqsrdc=; b=PR2BU1ES7P2VqwFtCg9Gp27lgoK7PBECPaEOUBeiTvNrV5axBqef3Dqilr2LC7BurV fUlcWQQFQrjDwUmcqMeDh7EewTUn1VxmPeeN/7PYuNl4Q+5kPsyDBxqWAPS6SUh6M2SM U2l/0QF8wTWWHG//IJh+PDBPt3EbUF2cmIHYcChY6p+6T9RETVX0KtSK+U4DvvdkV4SA x+tYmUylKc6qQ/r/EoclVxcQBCuh4CQiaDTd8+OKD2gMgA+nZifdoT7/GUQ7FZ98C8PJ UTGl+bTB331ZNO66LFHGBY1AwpOw4P3MQToa6fj9zQVpVQEWO3/tutSx/XUq/tsTTc5G mbQg== X-Forwarded-Encrypted: i=1; AJvYcCWLHIiNaPUZi5JP4jlhHUHqmSR+eaMXZkpJ+4SuLWjdNrDJNAHZiuoTH6HPY8ZxPKTFBPopgKfP62cJqYxDZhI= X-Gm-Message-State: AOJu0Yx/O0XTxc56OtJiUBttPEVi/6jIBF/6uFKXjULcOCaVbcTevDOF 4BsgEITn3iz5tYNsquTzW5DQx3eIVREktjRnolJ8Qs3DTqxnuQz9fS0+YQ== X-Google-Smtp-Source: AGHT+IHTMpW/RITDHSObRUzCflr7Ox3WxG2aQBD6GVdgeuGeKbFcaj3W7tmX6O3XcBSIK7QaHbqE5A== X-Received: by 2002:a5d:6dac:0:b0:35f:283e:dae2 with SMTP id ffacd0b85a97d-366e95d93a7mr4607711f8f.48.1719273611328; Mon, 24 Jun 2024 17:00:11 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366f624cdacsm3436945f8f.70.2024.06.24.17.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:00:10 -0700 (PDT) From: luca.boccassi@gmail.com To: Ciara Loftus Cc: Stephen Hemminger , dpdk stable Subject: patch 'net/af_xdp: count mbuf allocation failures' has been queued to stable release 22.11.6 Date: Tue, 25 Jun 2024 00:58:04 +0100 Message-Id: <20240624235907.885628-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com> References: <20240624235907.885628-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/13ac24282065220a4c3dbed9cc961a6a9b728421 Thanks. Luca Boccassi --- >From 13ac24282065220a4c3dbed9cc961a6a9b728421 Mon Sep 17 00:00:00 2001 From: Ciara Loftus Date: Tue, 14 May 2024 08:41:53 +0000 Subject: [PATCH] net/af_xdp: count mbuf allocation failures [ upstream commit f294405ab98594aa41269507dde95cc89bb20a61 ] Failures to allocate mbufs in the receive path were not being accounted for in the ethdev statistics. Fix this. Bugzilla ID: 1429 Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") Reported-by: Stephen Hemminger Signed-off-by: Ciara Loftus Acked-by: Stephen Hemminger --- drivers/net/af_xdp/rte_eth_af_xdp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index b28418234d..544ce40693 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -290,6 +290,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) unsigned long rx_bytes = 0; int i; struct rte_mbuf *fq_bufs[ETH_AF_XDP_RX_BATCH_SIZE]; + struct rte_eth_dev *dev = &rte_eth_devices[rxq->port]; nb_pkts = xsk_ring_cons__peek(rx, nb_pkts, &idx_rx); @@ -317,6 +318,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) * xsk_ring_cons__peek */ rx->cached_cons -= nb_pkts; + dev->data->rx_mbuf_alloc_failed += nb_pkts; + return 0; } @@ -368,6 +371,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) int i; uint32_t free_thresh = fq->size >> 1; struct rte_mbuf *mbufs[ETH_AF_XDP_RX_BATCH_SIZE]; + struct rte_eth_dev *dev = &rte_eth_devices[rxq->port]; if (xsk_prod_nb_free(fq, free_thresh) >= free_thresh) (void)reserve_fill_queue(umem, nb_pkts, NULL, fq); @@ -386,6 +390,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) * xsk_ring_cons__peek */ rx->cached_cons -= nb_pkts; + dev->data->rx_mbuf_alloc_failed += nb_pkts; return 0; } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-06-25 00:22:14.676720415 +0100 +++ 0018-net-af_xdp-count-mbuf-allocation-failures.patch 2024-06-25 00:22:13.101183937 +0100 @@ -1 +1 @@ -From f294405ab98594aa41269507dde95cc89bb20a61 Mon Sep 17 00:00:00 2001 +From 13ac24282065220a4c3dbed9cc961a6a9b728421 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f294405ab98594aa41269507dde95cc89bb20a61 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 0997543ee5..0db761a204 100644 +index b28418234d..544ce40693 100644 @@ -24 +25 @@ -@@ -320,6 +320,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -290,6 +290,7 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) @@ -32 +33 @@ -@@ -347,6 +348,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -317,6 +318,8 @@ af_xdp_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) @@ -41 +42 @@ -@@ -398,6 +401,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -368,6 +371,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) @@ -49 +50 @@ -@@ -416,6 +420,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -386,6 +390,7 @@ af_xdp_rx_cp(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)