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 DBEA5A0524; Mon, 19 Apr 2021 12:59:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1074841284; Mon, 19 Apr 2021 12:59:22 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id B8F6F40040 for ; Mon, 19 Apr 2021 12:59:19 +0200 (CEST) IronPort-SDR: etqhDAKBEBgFponMGO61ka5YUKRQoeNB7uGp6aNHYBwneC+1H6Nh0GyCTR64hNGMWsbT6fiQYJ z44Z8Ajdgs5g== X-IronPort-AV: E=McAfee;i="6200,9189,9958"; a="194864591" X-IronPort-AV: E=Sophos;i="5.82,233,1613462400"; d="scan'208";a="194864591" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 03:59:18 -0700 IronPort-SDR: anVhYISVi5FPQewavF+AL41+LhqpSuoeaTFU0basQm60gYVuJeveiuCzrhDF34KUpy92ze6mwC gZIHalzuBypg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,233,1613462400"; d="scan'208";a="523394923" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 19 Apr 2021 03:59:18 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 19 Apr 2021 03:59:17 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 19 Apr 2021 03:59:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Mon, 19 Apr 2021 03:59:17 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Mon, 19 Apr 2021 03:59:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyQqIXLPRNRn+R2AonL54ojQHK/NSI9leTGTgMuhFtnpHEzIC0FGUPMXFMpFxBFlp6tnBQsUmujiOZSyAZCJK+exWDeNt8WJ4WxYznlzL2CZn4jlWfaQCldCcHNqTp0DYpTnLyOxj/x4m3gtEbl207CxOEVja1cp5m4/ULcsYR+2/26B8UrySdgkLcQmz5Mv0zb66sSmTjJCxtUOikf6i8pxalXQMucanMts7eZh/PYmAnsTwTwygNcbaBV6csWkhancyQ9ULRdFHGp0wRqviHJDsBInfB68Go6t6F0ucTv4QBKgf3XFK2Gias7/1jMoApQYalRnyv3T5rTrY0GQNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XKhISSOal0OLRWw4/ZkyWKPqYupm6dxHqDYTp3SdINI=; b=IqsXxmp++hqgt/X8r08WxshyHzDNHvdn0PNMJsKF4qEmyDSaGB8hvf4J8qTpqIVNtF3WxbVozwqi9Ijm3I5udRdZ3Za3jnNBsO2i9t3QQWFCt+eIBVVD04A3k7LGBOxyRd+EtRsc/upEldpXX8Wq5zgcoGT732wc7gkdxJAYCpl6rHvp67DqrgLMipTQJLa5zJABqmodahYcx4cH6qJ64uG5tAsuaD643m/LKOVEVl+8XTf25H9kkrfoSccjkVEYI6jmCd9ZQ301BovAe3K1Fp1AiY4eBwj8U1Wqy2amY/jozOmN7R+KUtlI5ZiRR9JV+PRIw3lRqY4HyNiytrJ4CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XKhISSOal0OLRWw4/ZkyWKPqYupm6dxHqDYTp3SdINI=; b=OSBknfdhQDQkbRceUc2T5WLkDWzMnKCMm734cP3SKygXax4+a1/BAUEUAtxerroLPPG8GD3d/ptzXyJzLWkydbdw1MXAXB8qYzVvVbC0gZvfmrMtCUFdVXq3PPYG/FMzvAsZQpa9h4L54rMUodnRIawHZ9bML+YHA9G0z/rEZGI= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3899.namprd11.prod.outlook.com (2603:10b6:5:19c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.24; Mon, 19 Apr 2021 10:59:11 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a%3]) with mapi id 15.20.4042.021; Mon, 19 Apr 2021 10:59:11 +0000 From: "Ananyev, Konstantin" To: "Rong, Leyi" , "Zhang, Qi Z" CC: "dev@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: add Tx preparation for simple Tx data path Thread-Index: AQHXNPq6JyaPFPWBtUirQQl5eteHo6q7qBDg Date: Mon, 19 Apr 2021 10:59:11 +0000 Message-ID: References: <20210331085345.6290-1-leyi.rong@intel.com> <20210419083622.83717-1-leyi.rong@intel.com> In-Reply-To: <20210419083622.83717-1-leyi.rong@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.255.184.192] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6827f381-cbd1-45d8-0abe-08d903222a00 x-ms-traffictypediagnostic: DM6PR11MB3899: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6LlZCXi19wz9f3Uu1QzRvPnvW0bWUiUuIO+6T64He7v2lpuE443+Cj5YJy97avLE2COaE+o/ZKJZ7w9Fz8zxtSeTx1FTqnxwCim81LIOQmi3Opats2UM/dS0RnOZhmCaW6alxt44uo361Zj9qSlmQX/wjJIPldEyKYj4W5N1QlNbQP+k9Xg0sN8kGXkRAuKlJe7bTpLWTHUzj3SNAUl+bSusrviAYZTUEhKdUhU0rZL0a/WYoPkS+6uRpK+WB1N0cIoePsuA+64FTTb9c5oiahDKkCiJCTnlQzxP3L9bjOzzAxWcX3syEIsaILj7LvnBbAz2EwKRWn+eVCC70zXu1bQ7hwReflEFi0PO56vHBVkrSB6i9h+NwZ0c9RDDD11xj1dixUg+3hIRHyz35jzAddNHognTVxFCjA0mXjLGTtZtxMzmOKHbqDihrmq5ETuIcm22XHdKhcF6tVOsF/GbzhBFgwldE6XgRpFLVcLduGlAsM2YZ1nOGKi5ks5KR/8xOa3zp6eczTERpVTbGqrWeKueVio0HYm/1bRznVhhlQ1JCPAnyZrnbG47thiyv/jva7MyvyRfYyGHxX2uZSe6vRT8XapzgA79znZVxLivX6A= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(346002)(396003)(366004)(376002)(136003)(66446008)(6636002)(6506007)(64756008)(8676002)(66476007)(66556008)(4326008)(478600001)(7696005)(66946007)(86362001)(8936002)(55236004)(2906002)(76116006)(9686003)(5660300002)(186003)(122000001)(38100700002)(26005)(52536014)(71200400001)(316002)(55016002)(83380400001)(110136005)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6Ex/yhQ4JDY2dCs8lIJ1OqgN1byGtSSnyby181KyqaIEYg8p7IBsmn/b48At?= =?us-ascii?Q?vBLczm3qxSPsLKEumNXVIhfWM3y/F03kQYBYydsuRG1eiMl8VIFGGJ5NU+jW?= =?us-ascii?Q?GfLueyaCzbl6vbHnUVyOHZiwT+VfBQO8n/fbPT/A9kG72RLBTHyhXt/beEn+?= =?us-ascii?Q?575I+E3JQ6KxbgMUqdgJRaXIZix4Bow2ScQDxrESK37gq5LCVMRU175YkKQ6?= =?us-ascii?Q?8JAB1FLptRMWhy6Uj5AiTRmEA7YtNJ/LOXfweVwuoEsSE9acIRqn/Znt8GYz?= =?us-ascii?Q?MieXhJgofl0p2paOJ0mOl62I4yn+VPd1MFxtXONKKLWVuviHZcmisyw2dpMA?= =?us-ascii?Q?9koqyzF7ko1m5q9g4PG7osy+9Ftr27L3PTNTc6QDF4vkD5O0hYQ0ml80rtS0?= =?us-ascii?Q?XURutZOD7JEtMbOKIthj9dJ8uCnpJwZIZCRTkWcVNmxbW2KsASPwsay524ru?= =?us-ascii?Q?yvSExedltTD5XA2IvNLXAmEeldwqTxta2WWkrgwSQGfCKNQiuqbHRDMnRySl?= =?us-ascii?Q?CeePhCCebndIOirvdcsJoZgaDLRz3NbkVbg9AXNFxXvxkQ4oj9PbhT8abF5U?= =?us-ascii?Q?nKqLnHH4zMEtVNRkaqQ5y7PDoxWP+HbVHmgrgW2nuuAf1m7jsJyQn1JZxp0R?= =?us-ascii?Q?uh7BpclAwHjKDYmdf8Jnou2dZG+TLLNV0SiQUxt13DWbRG4j794F7ARO1NSe?= =?us-ascii?Q?i+S+1dlRT/g85krX+bCXQVkri5AnLBVNgOxxlVvl8pngH8J+se/X1HRv6YeQ?= =?us-ascii?Q?oCPyFSa63Ms7uUqRFfjdo27DMkufQwPVH7T7tJ/zERI5BeTqGjxruFe5YkVB?= =?us-ascii?Q?0k6e8QCDZHep5q4Q+045dDtSYpIoo2ZS/SP2LruEOcgzdbN81hhVBxYvYAce?= =?us-ascii?Q?KBZwTIDaQDD4PMuzNMFZBTiPysLhCJzJ0OKPGRhPi1kl+jna56vnyHW1Ms9S?= =?us-ascii?Q?phfOi8hUVzzrOLkLJX4qt/CM7yqslHpWksQBXakExvPtcNc+l4RKIGbeHEyo?= =?us-ascii?Q?nKZRe8B7KhE2JvvCWyRId7zUNAWW3D9oSgQDZ4z1WWLogabLgQfPMyGNgikU?= =?us-ascii?Q?HHj/wepwgvxFEdmSkTVCAQufnUCUleNSAVLaWbtBraM05I+NhcRTO7kKLSPe?= =?us-ascii?Q?sz7eGOy5T1PetFdqNWTwrlrkSV1k3pptvu3/u1HTQjPPYFFUQMHNz8QQciJ+?= =?us-ascii?Q?FcOA+QOxliyrHpmlSFybj8NtYmlqwAiDi2JytSrliM/hc5KluKa6zc0VX4Dc?= =?us-ascii?Q?urvlZB+OJpGSzNDjPo5F+j6gu9GEMtmrwnidAFZp3xhw7uOiXQgCb14b3jUP?= =?us-ascii?Q?RtWiL4tcW835GknzF3itSe1b?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6827f381-cbd1-45d8-0abe-08d903222a00 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2021 10:59:11.7063 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dvSo/yDXSwzUrPMCesD9I1d3Wp/vGDCEJZfr3bB84F/bHIYCHPLxDdE05G2CfPg+bsS+NnlXALuo9W2DniTjhAYgSlJYDIlonNI+Hv0JRHE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3899 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: add Tx preparation for simple Tx 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" Hi Leyi, > Introduce i40e_simple_prep_pkts() as the preparation function for > simple Tx data path, as it's for sanity check for simple Tx. >=20 > Suggested-by: Konstantin Ananyev > Signed-off-by: Leyi Rong > --- > drivers/net/i40e/i40e_rxtx.c | 42 +++++++++++++++++++++++++++++++++++- > drivers/net/i40e/i40e_rxtx.h | 2 ++ > 2 files changed, 43 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 3c7686c3f4..282eb5924b 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -1479,6 +1479,46 @@ i40e_xmit_pkts_vec(void *tx_queue, struct rte_mbuf= **tx_pkts, > return nb_tx; > } >=20 > +/********************************************************************* > + * > + * TX simple prep functions > + * > + **********************************************************************/ > +uint16_t > +i40e_simple_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_= pkts, > + uint16_t nb_pkts) > +{ > + int i; > + uint64_t ol_flags; > + struct rte_mbuf *m; > + struct i40e_tx_queue *txq =3D (struct i40e_tx_queue *)tx_queue; > + > + for (i =3D 0; i < nb_pkts; i++) { > + m =3D tx_pkts[i]; > + ol_flags =3D m->ol_flags; > + > + if (!(txq->offloads =3D=3D > + (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) && > + m->nb_segs =3D=3D 1)) { I think we don't need to check txq->offloads here, they should be already checked at setup phase. I suppose: if (m->nb_segs !=3D 1) {...} should be enough here.=20 > + rte_errno =3D EINVAL; > + return i; > + } > + > + if (ol_flags & I40E_TX_OFFLOAD_NOTSUP_MASK) { It would return OK for the packet with any supported by any i40e TX offload= (full-featured path). Probably we need here instead: if (ol_flags & PKT_TX_OFFLOAD_MASK) {...} > + rte_errno =3D ENOTSUP; > + return i; > + } > + > + /* check the size of packet */ > + if (m->pkt_len < I40E_TX_MIN_PKT_LEN || > + m->pkt_len > I40E_FRAME_SIZE_MAX) { > + rte_errno =3D EINVAL; > + return i; > + } > + } > + return i; > +} > + > /********************************************************************* > * > * TX prep functions > @@ -3412,7 +3452,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev) > PMD_INIT_LOG(DEBUG, "Simple tx finally be used."); > dev->tx_pkt_burst =3D i40e_xmit_pkts_simple; > } > - dev->tx_pkt_prepare =3D NULL; > + dev->tx_pkt_prepare =3D i40e_simple_prep_pkts; > } else { > PMD_INIT_LOG(DEBUG, "Xmit tx finally be used."); > dev->tx_pkt_burst =3D i40e_xmit_pkts; > diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h > index 3447a58c82..5ccf5773e8 100644 > --- a/drivers/net/i40e/i40e_rxtx.h > +++ b/drivers/net/i40e/i40e_rxtx.h > @@ -208,6 +208,8 @@ uint16_t i40e_recv_scattered_pkts(void *rx_queue, > uint16_t i40e_xmit_pkts(void *tx_queue, > struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > +uint16_t i40e_simple_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts= , > + uint16_t nb_pkts); > uint16_t i40e_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > int i40e_tx_queue_init(struct i40e_tx_queue *txq); > -- > 2.17.1