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 CDB60A0579; Thu, 8 Apr 2021 10:40:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A62F40698; Thu, 8 Apr 2021 10:40:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 4BB4840138 for ; Thu, 8 Apr 2021 10:40:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617871201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7Da7ZEu2OI1TzautSyzN1L4CEXtDD9LSuJ3kE8/ehqk=; b=UCwQ0MFf2qIHQRzzUXDpAUOuiVlo+prPKK8Lt1sNlrcylIrfA9xoeehol4HVsLbEFtAnWa q8IbQVbZSWhgLrJjYEE+AoW7oSzYo5cwwh6YTiYbuQrsam8H8BIZxODYBsbfjuHwNGn/NO 1wLEy9D+ZkbNd8lvGL519cb5gyp24Q0= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-ReB-Yq5WNISLPAIi3Lln7w-1; Thu, 08 Apr 2021 04:39:59 -0400 X-MC-Unique: ReB-Yq5WNISLPAIi3Lln7w-1 Received: by mail-vk1-f197.google.com with SMTP id l2so92519vkl.5 for ; Thu, 08 Apr 2021 01:39:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7Da7ZEu2OI1TzautSyzN1L4CEXtDD9LSuJ3kE8/ehqk=; b=AC7pjr1SiTuDbkFGfdQnC3PmuUieaZ4SVCloqYxl/ilg4Ft2jMJAE7ivjKet53or1+ 9MDtaZI84EJKS4PZc9Eq+D8WkMlhMCnq+O/KKkhnHfNPPVG7OjEYJAhnSYTWyT3NCUjJ /jqrTGiMgiB1zJ/rS+Ngi/Q8i2f2v6f4RfMXQWnHPkL5RrPKDQhDm5YwnDHZHpavgUtv cunvDJQXgYdi/3gM9VcBBhAoiHTWN9Nk8+GTH3AwaSBdVkphPpmhNqcXfEjlL70i+7g0 WyQx2BULBlh/Z6B5jYE4i2qXAW+Q7rVk8JXyInCe2DfMs2eZcXy6HiRdZuOz248HL4bT EC9Q== X-Gm-Message-State: AOAM532PHo/na0vKj6hR/SNkMlNkC7cUG31PEmjpblST+hYp5XXfP84l 1hOCO+L/L9c14f8873vIFnBtCtRC2ZkiBLXu+6ctUc3ea7xR2maiXT1bDIJWDc2dLgs27VzYr0H JgxkDSNwCK95nPnQA5kA= X-Received: by 2002:a05:6102:a84:: with SMTP id n4mr4914937vsg.18.1617871199312; Thu, 08 Apr 2021 01:39:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkP8GvPgB3fl3WUgaIrv02f+xxW8Sm5dewi/OWBXIvfBFxyMrBdYPXHzknr7w+qmxqD25E2QDUj51cg6BPYJw= X-Received: by 2002:a05:6102:a84:: with SMTP id n4mr4914926vsg.18.1617871199035; Thu, 08 Apr 2021 01:39:59 -0700 (PDT) MIME-Version: 1.0 References: <20210331085345.6290-1-leyi.rong@intel.com> <10399e65-e2c4-fe91-b548-f7bfd55ffc51@intel.com> In-Reply-To: <10399e65-e2c4-fe91-b548-f7bfd55ffc51@intel.com> From: David Marchand Date: Thu, 8 Apr 2021 10:39:47 +0200 Message-ID: To: Ferruh Yigit Cc: Leyi Rong , Qi Zhang , Beilei Xing , dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Wed, Apr 7, 2021 at 6:40 PM Ferruh Yigit wrote: > > 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. As I said earlier, what is the point of setting it in ethdev.c too? It would be more consistent to have this in a single location. drivers/net/i40e/i40e_ethdev.c: dev->tx_pkt_burst = i40e_xmit_pkts; drivers/net/i40e/i40e_ethdev.c: dev->tx_pkt_prepare = i40e_prep_pkts; drivers/net/i40e/i40e_ethdev_vf.c: eth_dev->tx_pkt_burst = &i40e_xmit_pkts; drivers/net/i40e/i40e_rxtx.c: if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx512) { drivers/net/i40e/i40e_rxtx.c: if (dev->tx_pkt_burst == i40e_xmit_pkts_vec_avx2 || drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_burst == i40e_xmit_pkts_vec) { drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_burst = i40e_xmit_pkts_vec_avx512; drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_burst = use_avx2 ? drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_burst = i40e_xmit_pkts_simple; drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_prepare = NULL; drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_burst = i40e_xmit_pkts; drivers/net/i40e/i40e_rxtx.c: dev->tx_pkt_prepare = i40e_prep_pkts; drivers/net/i40e/i40e_rxtx.c: eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; drivers/net/i40e/i40e_vf_representor.c: ethdev->tx_pkt_burst = i40e_vf_representor_tx_burst; -- David Marchand