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 08E7A43E20; Sun, 7 Apr 2024 10:32:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B6B1402BF; Sun, 7 Apr 2024 10:32:28 +0200 (CEST) Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by mails.dpdk.org (Postfix) with ESMTP id 054774029A for ; Sun, 7 Apr 2024 10:32:25 +0200 (CEST) X-QQ-mid: Yeas8t1712478735t720t43945 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [183.128.132.155]) X-QQ-SSF: 00400000000000F0FUF000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 5350940419559053280 To: , References: <20240201030019.21336-1-jiawenwu@trustnetic.com> <20240201030019.21336-2-jiawenwu@trustnetic.com> <4a0e5000-3ae3-4894-a23d-715801f3c3b7@amd.com> <07f901da6ed4$a3914660$eab3d320$@trustnetic.com> In-Reply-To: Subject: RE: [PATCH 1/2] net/txgbe: add vectorized functions for Rx/Tx Date: Sun, 7 Apr 2024 16:32:14 +0800 Message-ID: <06ff01da88c6$17ec8690$47c593b0$@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQH22iClLZIszsqol4Pnvg9eSGq00wJBYoQQAnLpCT4B394XQAKkVMwpsNoLCNA= X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 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 > >>> @@ -2198,8 +2220,15 @@ txgbe_set_tx_function(struct rte_eth_dev *dev, struct txgbe_tx_queue *txq) > >>> #endif > >>> txq->tx_free_thresh >= RTE_PMD_TXGBE_TX_MAX_BURST) { > >>> PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > >>> - dev->tx_pkt_burst = txgbe_xmit_pkts_simple; > >>> dev->tx_pkt_prepare = NULL; > >>> + if (txq->tx_free_thresh <= RTE_TXGBE_TX_MAX_FREE_BUF_SZ && > >>> + (rte_eal_process_type() != RTE_PROC_PRIMARY || > >>> > >> > >> Why vector Tx enable only for secondary process? > > > > It is not only for secondary process. The constraint is > > > > (rte_eal_process_type() != RTE_PROC_PRIMARY || txgbe_txq_vec_setup(txq) == 0) > > > > This code references ixgbe, which explains: > > "When using multiple processes, the TX function used in all processes > > should be the same, otherwise the secondary processes cannot transmit > > more than tx-ring-size - 1 packets. > > To achieve this, we extract out the code to select the ixgbe TX function > > to be used into a separate function inside the ixgbe driver, and call > > that from a secondary process when it is attaching to an > > already-configured NIC." > > > > Got it, > > 1- Is txgbe has the constraint that same Tx function should be used > separate queues? > Tx functions is all in SW, right? HW interface is same, so HW doesn't > know or care vector Tx or simple Tx is used. > As primary and secondary processes manage different queues, I don't know > why this constraint exists. In theory, the same Tx function needs to be used for different queues. Because some hardware configurations are not per-queue, like MTU. > 2. I see above logic prevents secondary to call 'txgbe_txq_vec_setup()' > again. Perhaps unlikely but technically, if 'txgbe_txq_vec_setup()' > fails for primary 'txgbe_xmit_pkts_simple' is set and for secondary > 'txgbe_xmit_pkts_vec' is set, causing both primary and secondary have > different Tx functions, can you please check if this option is valid. I wonder when 'txgbe_txq_vec_setup()' will fail. It should be when there is a memory allocation error. Then the application will fail to initialize? > There are other comments not addressed, I assume they are accepted and > there will be a new version, but I want to highlight in case they are > missed. Yes, other issues will be fixed in the next version. I am sorry that I have been busy with other work these months. I will send the next version in these two days.