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 43306A0545 for ; Wed, 25 May 2022 03:11:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BBE4400D6; Wed, 25 May 2022 03:11:30 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 17BDE400D6; Wed, 25 May 2022 03:11:28 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L7Cgt1khgzDqQj; Wed, 25 May 2022 09:11:22 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 25 May 2022 09:11:25 +0800 Subject: Re: [PATCH] net/bonding: fix mbuf fast free usage To: Ferruh Yigit CC: , Chas Williams , Neil Horman , , Thomas Monjalon , David Marchand References: <20220521070814.35704-1-humin29@huawei.com> <3581c8fc-0623-7c61-4c67-8b9ba40343f5@amd.com> From: "Min Hu (Connor)" Message-ID: Date: Wed, 25 May 2022 09:11:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <3581c8fc-0623-7c61-4c67-8b9ba40343f5@amd.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 Thanks Ferruh, v2 has been sent. 在 2022/5/24 21:43, Ferruh Yigit 写道: > On 5/21/2022 8:08 AM, Min Hu (Connor) wrote: >> [CAUTION: External Email] >> >> Usage of 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload has two >> constraints: per-queue all mbufs comes from the same mempool and >> has refcnt = 1. >> >> Bonding mode Broadcast, Tx mbuf has more than one refcnt. >> Bonding mode 8023AD, It contains two mempools separately for LACP >> packets and other packets. In Tx or Rx, Fast mbuf free will operate >> mbuf from different mempool. >> >> This patch will prevent 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload >> when in bonding mode Broadcast and mode 8023AD. >> > > Hi Connor, > > Please find a few syntax comment below, rest lgtm. > >> Fixes: 78aecefed955 ("bond: move param parsing in configure step") >> Cc: stable@dpdk.org >> >> Signed-off-by: Min Hu (Connor) >> --- >>   drivers/net/bonding/rte_eth_bond_pmd.c | 10 ++++++++++ >>   1 file changed, 10 insertions(+) >> >> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c >> b/drivers/net/bonding/rte_eth_bond_pmd.c >> index c929b55768..5ca90c7590 100644 >> --- a/drivers/net/bonding/rte_eth_bond_pmd.c >> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c >> @@ -3563,6 +3563,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) >>          const char *name = dev->device->name; >>          struct bond_dev_private *internals = dev->data->dev_private; >>          struct rte_kvargs *kvlist = internals->kvlist; >> +       uint64_t offloads; >>          int arg_count; >>          uint16_t port_id = dev - rte_eth_devices; >>          uint8_t agg_mode; >> @@ -3613,6 +3614,15 @@ bond_ethdev_configure(struct rte_eth_dev *dev) >>                  } >>          } >> >> +       offloads = dev->data->dev_conf.txmode.offloads; >> +       if ((offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) && >> +               (internals->mode == BONDING_MODE_8023AD || >> +               internals->mode == BONDING_MODE_BROADCAST)) { > > Can you indent above two lines one more tab, to differentiate them from > content of the if block. > >> +               RTE_BOND_LOG(WARNING, "BOND MODE Broadcast & 8023AD >> don't support MBUF_FAST_FREE offload, force disable it."); > > - Why "BOND MODE" is uppercase, if there is no special reason for it, I > suggest using lower case. > > - Can you break the message to next line, this enables shorter line > without breaking the message: > RTE_BOND_LOG(WARNING, >     "BOND MODE Broadcast & 8023AD don't support .... > >> +               offloads &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; >> +               dev->data->dev_conf.txmode.offloads = offloads; >> +       } >> + >>          /* set the max_rx_pktlen */ >>          internals->max_rx_pktlen = internals->candidate_max_rx_pktlen; >> >> -- >> 2.33.0 >> > > .