DPDK patches and discussions
 help / color / mirror / Atom feed
From: Huisong Li <lihuisong@huawei.com>
To: <dev@dpdk.org>, <andrew.rybchenko@oktetlabs.ru>
Cc: <ferruh.yigit@amd.com>, <humin29@huawei.com>, <3chas3@gmail.com>,
	<liudongdong3@huawei.com>, <huangdaode@huawei.com>,
	<lihuisong@huawei.com>
Subject: [PATCH 2/2] app/testpmd: remove fast free offload for bond3 and bond4
Date: Tue, 8 Nov 2022 16:40:38 +0800	[thread overview]
Message-ID: <20221108084038.25136-3-lihuisong@huawei.com> (raw)
In-Reply-To: <20221108084038.25136-1-lihuisong@huawei.com>

The port configurations of bonding device need to be updated when add a
slave device. But mbuf fast free offload can't be used in bonding mode
Broadcast and mode 8023AD. So remove this offload for both mode in case
of failing to initialize bonding device.

Fixes: 76376bd9cd49 ("app/testpmd: update bond port configurations when add slave")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/testpmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7381dfd9e5..4063ffe0f2 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2812,6 +2812,7 @@ update_bonding_port_dev_conf(portid_t bond_pid)
 {
 #ifdef RTE_NET_BOND
 	struct rte_port *port = &ports[bond_pid];
+	uint8_t bonding_mode;
 	uint16_t i;
 	int ret;
 
@@ -2825,6 +2826,13 @@ update_bonding_port_dev_conf(portid_t bond_pid)
 	if (port->dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
 		port->dev_conf.txmode.offloads |=
 				RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+	/* Bond mode broadcast & 8023AD don't support MBUF_FAST_FREE offload */
+	bonding_mode = rte_eth_bond_mode_get(bond_pid);
+	if (bonding_mode == BONDING_MODE_8023AD ||
+	    bonding_mode == BONDING_MODE_BROADCAST)
+		port->dev_conf.txmode.offloads &=
+				~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+
 	/* Apply Tx offloads configuration */
 	for (i = 0; i < port->dev_info.max_tx_queues; i++)
 		port->txq[i].conf.offloads = port->dev_conf.txmode.offloads;
-- 
2.33.0


  parent reply	other threads:[~2022-11-08  8:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  8:40 [PATCH 0/2] net/bonding: fix mbuf fast free " Huisong Li
2022-11-08  8:40 ` [PATCH 1/2] net/bonding: fix bond3 and bond4 process mbuf fast free Huisong Li
2022-11-08  8:40 ` Huisong Li [this message]
2022-11-08 18:01   ` [PATCH 2/2] app/testpmd: remove fast free offload for bond3 and bond4 Stephen Hemminger
2022-11-09  1:11     ` lihuisong (C)
2022-11-09  2:22 ` [PATCH V2] net/bonding: fix bond3 and bond4 process mbuf fast free Huisong Li
2022-11-09  3:24   ` Stephen Hemminger
2022-11-09 10:37     ` Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221108084038.25136-3-lihuisong@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=3chas3@gmail.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=huangdaode@huawei.com \
    --cc=humin29@huawei.com \
    --cc=liudongdong3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).