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 97E41A0C45; Wed, 22 Sep 2021 09:10:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D94A4119F; Wed, 22 Sep 2021 09:10:49 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id B7CB94003F for ; Wed, 22 Sep 2021 09:10:45 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HDq8m380bzbmgR; Wed, 22 Sep 2021 15:06:32 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Wed, 22 Sep 2021 15:10:43 +0800 From: "Min Hu (Connor)" To: CC: , Date: Wed, 22 Sep 2021 15:09:12 +0800 Message-ID: <20210922070913.59515-2-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210922070913.59515-1-humin29@huawei.com> References: <20210922070913.59515-1-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 1/2] net/bonding: fix dedicated queue mode in vector burst 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" From: Chengchang Tang If the vector burst mode is selected, the dedicated queue mode will not take effect on some PMDs because these PMDs may have some limitaions in vector burst mode. For example, the limit on burst size. Currently, both hns3 and intel I40E require four alignments when receiving packets in vector mode. As a result, they cannt accept packets if burst size below four. However, in dedicated queue mode, the burst size of periodic packets processing is one. This patch fixes the above problem by modifying the burst size to 32. This approach also makes the packet processing of the dedicated queue mode more reasonable. Currently, if multiple lacp protocol packets are received in the hardware queue in a cycle, only one lacp packet will be processed in this cycle, and the left packets will be processed in the following cycle. After the modification, all the lacp packets will be processed at one time, which seems more reasonable and closer to the behavior of the bonding driver when the dedicated queue is not turned on. Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control") Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Min Hu(Connor) --- drivers/net/bonding/rte_eth_bond_8023ad.c | 32 ++++++++++++++++------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 8b5b32fcaf..fc8ebd6320 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -838,6 +838,27 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, rx_machine(internals, slave_id, NULL); } +static void +bond_mode_8023ad_dedicated_rxq_process(struct bond_dev_private *internals, + uint16_t slave_id) +{ +#define DEDICATED_QUEUE_BURST_SIZE 32 + struct rte_mbuf *lacp_pkt[DEDICATED_QUEUE_BURST_SIZE]; + uint16_t rx_count = rte_eth_rx_burst(slave_id, + internals->mode4.dedicated_queues.rx_qid, + lacp_pkt, DEDICATED_QUEUE_BURST_SIZE); + + if (rx_count) { + uint16_t i; + + for (i = 0; i < rx_count; i++) + bond_mode_8023ad_handle_slow_pkt(internals, slave_id, + lacp_pkt[i]); + } else { + rx_machine_update(internals, slave_id, NULL); + } +} + static void bond_mode_8023ad_periodic_cb(void *arg) { @@ -926,15 +947,8 @@ bond_mode_8023ad_periodic_cb(void *arg) rx_machine_update(internals, slave_id, lacp_pkt); } else { - uint16_t rx_count = rte_eth_rx_burst(slave_id, - internals->mode4.dedicated_queues.rx_qid, - &lacp_pkt, 1); - - if (rx_count == 1) - bond_mode_8023ad_handle_slow_pkt(internals, - slave_id, lacp_pkt); - else - rx_machine_update(internals, slave_id, NULL); + bond_mode_8023ad_dedicated_rxq_process(internals, + slave_id); } periodic_machine(internals, slave_id); -- 2.33.0