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 24A51A034F; Fri, 7 May 2021 12:23:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FB4B4013F; Fri, 7 May 2021 12:23:48 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id C099140040 for ; Fri, 7 May 2021 12:23:46 +0200 (CEST) IronPort-SDR: bzHDta+wbKxh44sLCqZCaZVLbiWtcQOYsq7lBKRB7u2WzgReQbl5VV9d5Wc2mOGiQHMpA3I6kp xcCfEgAtX4Pw== X-IronPort-AV: E=McAfee;i="6200,9189,9976"; a="259976801" X-IronPort-AV: E=Sophos;i="5.82,280,1613462400"; d="scan'208";a="259976801" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2021 03:23:45 -0700 IronPort-SDR: S5JS+oSqjHCpU5nGS+AFB5lmdwqi8yeIn15Rsj78e1+zMey2y+Y/X25/du3WfXGAh/mGCPyyqQ RU5N0LJoCEFg== X-IronPort-AV: E=Sophos;i="5.82,280,1613462400"; d="scan'208";a="431239789" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.210.230]) ([10.213.210.230]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2021 03:23:44 -0700 To: David Marchand , "Min Hu (Connor)" Cc: dev References: <1619594455-56787-1-git-send-email-humin29@huawei.com> <1619594455-56787-6-git-send-email-humin29@huawei.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <5c39e9bc-24ae-0c78-6860-cf5cef10ce58@intel.com> Date: Fri, 7 May 2021 11:23:40 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 5/5] net/hns3: select Tx prepare based on Tx offload 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" On 5/7/2021 10:26 AM, David Marchand wrote: > On Wed, Apr 28, 2021 at 9:21 AM Min Hu (Connor) wrote: >> >> From: Chengchang Tang >> >> Tx prepare should be called only when necessary to reduce the impact on >> performance. >> >> For partial TX offload, users need to call rte_eth_tx_prepare() to invoke >> the tx_prepare callback of PMDs. In this callback, the PMDs adjust the >> packet based on the offloading used by the user. (e.g. For some PMDs, >> pseudo-headers need to be calculated when the TX cksum is offloaded.) >> >> However, for the users, they cannot grasp all the hardware and PMDs >> characteristics. As a result, users cannot decide when they need to >> actually call tx_prepare. Therefore, we should assume that the user calls >> rte_eth_tx_prepare() when using any Tx offloading to ensure that related >> functions work properly. Whether packets need to be adjusted should be >> determined by PMDs. They can make judgments in the dev_configure or >> queue_setup phase. When the related function is not used, the pointer of >> tx_prepare should be set to NULL to reduce the performance loss caused by >> invoking rte_eth_tx_repare(). >> >> In this patch, if tx_prepare is not required for the offloading used by >> the users, the tx_prepare pointer will be set to NULL. >> >> Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") >> Cc: stable@dpdk.org >> >> Signed-off-by: Chengchang Tang >> Signed-off-by: Min Hu (Connor) >> --- >> drivers/net/hns3/hns3_rxtx.c | 36 +++++++++++++++++++++++++++++++++--- >> 1 file changed, 33 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c >> index 3881a72..7ac3a48 100644 >> --- a/drivers/net/hns3/hns3_rxtx.c >> +++ b/drivers/net/hns3/hns3_rxtx.c >> @@ -4203,17 +4203,45 @@ hns3_tx_check_simple_support(struct rte_eth_dev *dev) >> return (offloads == (offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE)); >> } >> >> +static bool >> +hns3_get_tx_prep_needed(struct rte_eth_dev *dev) >> +{ >> +#ifdef RTE_LIBRTE_ETHDEV_DEBUG >> + /* always perform tx_prepare when debug */ >> + return true; > > dev is unused in this case. > http://mails.dpdk.org/archives/test-report/2021-May/193391.html > Thanks David, @Connor, can you please send a quick fix for it? 'RTE_SET_USED(dev);' should fix it.