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 3269843CE7 for ; Mon, 18 Mar 2024 16:39:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C948402B8; Mon, 18 Mar 2024 16:39:51 +0100 (CET) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id A6A2F40289 for ; Mon, 18 Mar 2024 16:39:48 +0100 (CET) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3417a3151c5so432014f8f.1 for ; Mon, 18 Mar 2024 08:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710776388; x=1711381188; 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=08yZSv7iv1LmjvR8xnV26pWXZ4tM8zI5u9iogXnmlHo=; b=JSFm+ndAn3+m+beDHlEEe1080R2TS4Q3hWtVAeZzpl7vuuL+rJIORAip6lE9AD4mp+ HH9RZdLUcC/yY3rYmhv9Xt4HZT+HlKYtQjrkZw601GiC9HViqu5wpZ66uJArau6ACoff trbBEFs6YQZgRl4lPYJRSQOWOXFshtphaUgp+5cIrqG2BOFYy7I0blBONPs3grv1yizV kqx6W8hfHp8pFBhJXK6UR+RBZCty5nGTAJRx55V8hkqMDaSgUaQcCPOH947G9USKEyYN Lj4jIoMr4gl0xBKKvFgYC8gTyOaLTZeZCrlt1kS8tjWorowuLP0dOPGRKmKRzOwF195T DQYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710776388; x=1711381188; 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=08yZSv7iv1LmjvR8xnV26pWXZ4tM8zI5u9iogXnmlHo=; b=V048MpzuIcgh0Ehbcsfg+g6x9mfLFeT9FNsjLDrK0OJROcjEweOpOTM5Gv51ssYltO pyCmyAsRfrGqDplNb9ZsPcO9tHvbk2u3+7g8T32FH4/7NiuSQxEPMTLd6YXqTvAf98WC t9BUD8L/Y5JYab9M1rkJf2y+XzKFTU0nYSHSFPO1jhpxJKsVTQ2JwZCM0bTIcvKU3iRZ hvK45jVkKeFLfvIuuECmamDNu5/5Fv5RVX9BdtOEyXLD7FEyVe3K+hSvohCbdYPDaBvj tKtKVGn8qBIlkxQP0B3iCb825WkBGqsqTnp3o348uoq6x4CTnfSfvcZ/vGR9uG1+MIqB 6GXQ== X-Forwarded-Encrypted: i=1; AJvYcCUgZqDke4XasZcgjww+brwodKgFWEhR7Un5pSsk+DLt8r8UdWg6PWT53ZqnvManPHzyJc2KKkMZTs5LGadzMwg= X-Gm-Message-State: AOJu0YzQvlntNDcqxZVGsSOkyc8nVZVJVBe8sehlNGZB3dsRlf+T37JW yFV5kdVQAXF+Xsw6noHqNUbuDcVWDBHMtSUutCn0PDCQojWGjWxI X-Google-Smtp-Source: AGHT+IEdVEcYSoyt54gr96LotiXwAA036DoI/Ki0XBmWQEIqfrl4yp/MD61sS9i76F+ARwkWc5Jv1w== X-Received: by 2002:adf:cf08:0:b0:33e:7f67:5dd8 with SMTP id o8-20020adfcf08000000b0033e7f675dd8mr8957573wrj.54.1710776388294; Mon, 18 Mar 2024 08:39:48 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id l21-20020a056000023500b0033ec312cd8asm10122816wrz.33.2024.03.18.08.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:39:47 -0700 (PDT) From: luca.boccassi@gmail.com To: Shai Brandes Cc: Amit Bernstein , dpdk stable Subject: patch 'net/ena: fix fast mbuf free' has been queued to stable release 22.11.5 Date: Mon, 18 Mar 2024 15:38:57 +0000 Message-Id: <20240318153919.3407921-7-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240318153919.3407921-1-luca.boccassi@gmail.com> References: <20240314000957.2810803-61-luca.boccassi@gmail.com> <20240318153919.3407921-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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/20/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/fd262a1e35203a71035baa9374a3fe05362bbedc Thanks. Luca Boccassi --- >From fd262a1e35203a71035baa9374a3fe05362bbedc Mon Sep 17 00:00:00 2001 From: Shai Brandes Date: Tue, 12 Mar 2024 20:06:50 +0200 Subject: [PATCH] net/ena: fix fast mbuf free [ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ] In case the application enables fast mbuf release optimization, the driver releases 256 TX mbufs in bulk upon reaching the TX free threshold. The existing implementation utilizes rte_mempool_put_bulk for bulk freeing TXs, which exclusively supports direct mbufs. In case the application transmits indirect bufs, the driver must also decrement the mbuf reference count and unlink the mbuf segment. For such case, the driver should employ rte_pktmbuf_free_bulk. Fixes: c339f53823f3 ("net/ena: support fast mbuf free") Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/ena_ethdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 7345e480f8..2c4e3505d0 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -3030,8 +3030,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, m_next = mbuf->next; mbufs_to_clean[mbuf_cnt++] = mbuf; if (mbuf_cnt == buf_size) { - rte_mempool_put_bulk(mbufs_to_clean[0]->pool, (void **)mbufs_to_clean, - (unsigned int)mbuf_cnt); + rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt); mbuf_cnt = 0; } mbuf = m_next; @@ -3100,8 +3099,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt) } if (mbuf_cnt != 0) - rte_mempool_put_bulk(mbufs_to_clean[0]->pool, - (void **)mbufs_to_clean, mbuf_cnt); + rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt); /* Notify completion handler that full cleanup was performed */ if (free_pkt_cnt == 0 || total_tx_pkts < cleanup_budget) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-18 12:58:39.558767567 +0000 +++ 0007-net-ena-fix-fast-mbuf-free.patch 2024-03-18 12:58:39.103344447 +0000 @@ -1 +1 @@ -From 89b081e154c5f81295014fd8b5b32193dd01b9cb Mon Sep 17 00:00:00 2001 +From fd262a1e35203a71035baa9374a3fe05362bbedc Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 3157237c0d..537ee9f8c3 100644 +index 7345e480f8..2c4e3505d0 100644 @@ -28 +29 @@ -@@ -3122,8 +3122,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, +@@ -3030,8 +3030,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, @@ -38 +39 @@ -@@ -3191,8 +3190,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt) +@@ -3100,8 +3099,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)