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 B695FA0C40; Wed, 7 Apr 2021 18:40:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50A1E140EA4; Wed, 7 Apr 2021 18:40:07 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id E2463140E95 for ; Wed, 7 Apr 2021 18:40:05 +0200 (CEST) IronPort-SDR: oY7Ueul50cDtcMECg4fto2Mv10QqlWbiFxfozMd/oNV1yrnLVpZbS10+f2q/hzRQSOi4DRtfKZ 5ErJGiMpqqyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9947"; a="173428127" X-IronPort-AV: E=Sophos;i="5.82,203,1613462400"; d="scan'208";a="173428127" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2021 09:40:04 -0700 IronPort-SDR: 34yRevOwYc5phjd/4pDXnGseeWtcWvWIrY0ta2uoqg4fO74pW3b17hx6116qUR0624oDh7Xi8W SW6bO7K8zq2Q== X-IronPort-AV: E=Sophos;i="5.82,203,1613462400"; d="scan'208";a="379886987" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.202.196]) ([10.213.202.196]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2021 09:40:03 -0700 To: Leyi Rong , qi.z.zhang@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org References: <20210331085345.6290-1-leyi.rong@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <10399e65-e2c4-fe91-b548-f7bfd55ffc51@intel.com> Date: Wed, 7 Apr 2021 17:39:59 +0100 MIME-Version: 1.0 In-Reply-To: <20210331085345.6290-1-leyi.rong@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/i40e: add Tx preparation for vector data path 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 3/31/2021 9:53 AM, Leyi Rong wrote: > Fill up dev->tx_pkt_prepare to i40e_pkt_prepare when on vector and simple > data path selection, as the sanity check is needed ideally. > > Signed-off-by: Leyi Rong > --- > drivers/net/i40e/i40e_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 61cb204be2..b3d7765e3b 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -3412,7 +3412,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev) > PMD_INIT_LOG(DEBUG, "Simple tx finally be used."); > dev->tx_pkt_burst = i40e_xmit_pkts_simple; > } > - dev->tx_pkt_prepare = NULL; > + dev->tx_pkt_prepare = i40e_prep_pkts; > } else { > PMD_INIT_LOG(DEBUG, "Xmit tx finally be used."); > dev->tx_pkt_burst = i40e_xmit_pkts; > It seems prepare function is doing some sanity checks before handing packets to the HW. So with this change all Tx paths calls the same Tx prepare function, if so why not set the function pointer outside of the if block, instead of setting it in both legs of the if/else? This clarifies that Tx prepare used always.