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 2DB3B437A1; Wed, 27 Dec 2023 05:34:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D78424029C; Wed, 27 Dec 2023 05:34:06 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 3504A4027A for ; Wed, 27 Dec 2023 05:34:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703651645; x=1735187645; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kcHPD+IIs5lbBBiO6oxiSo7Lh7potA3lgOy4mTiZhew=; b=OGzlqvd8ipFMB+1W0UQZylQGMmSYKCDCJbt843kLrh2ShDcdM68S8ahw du8gzjrptBDbUrcQZH6n1dGIffpzU+QsOxDkiBf0N852RoRteEV9syvyo boN+yZiZIMrVv9r2OBMW+dbE9Y++zaS/HxlJQRBf5EzJEuK6LIECmEA2W 1wTh1+Z4+JGP4CLA9eURzEvIYQZU9yUZ8taJ1PJQe2fdLCAd4gVdHvFTu 86/C1tqIGe2FpA/E/SpVw+v0WS3DVJsI16UC1/hgfiabAAV0PRZywkJPB OjL/oPtnfonKoAn88U5LILOiGiHJioyDu61g4/5yu2Ghub0PMubBCi/Xc w==; X-IronPort-AV: E=McAfee;i="6600,9927,10935"; a="482588372" X-IronPort-AV: E=Sophos;i="6.04,308,1695711600"; d="scan'208";a="482588372" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2023 20:34:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10935"; a="844046632" X-IronPort-AV: E=Sophos;i="6.04,308,1695711600"; d="scan'208";a="844046632" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Dec 2023 20:34:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 26 Dec 2023 20:34:03 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 26 Dec 2023 20:34:03 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 26 Dec 2023 20:34:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UrUMVysnLHCisHpVsb6eg5XPQtzLmLjZ4KOMIHfYpSVxQTsPPWKQItuS9u1awvaPpNua7/Ws280zeq5zAMVNXZ1u8scVWYsmxCWvX8rKjlHidY4oETNxubChv1EVUuZAtqeouk2L+BVXHUr2u1qFPtz5H51ZHFsAiuRsTjd43fpTtf0iYQ9OVSyWIDN1yuY/M3tOqwbzppemqHLjMAtTuyKDSq7pMgy3H22aLF/oKHqgk0zT3sX/gL+1KIHut1PrNGf+//X7BEvAKUJBpYQ8BlN6KS2xvB/wf0JzaPwNEzXfzZnfeBvQCxsWyJrSxPTJfxMrqwYv6w8BcYgz9ZyLeQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dvRmihkBTsburbMVLkAX97/SNf3VHKD1eKM09en/e7Q=; b=AEu2tztzenPNppNyfLTwjRpcyTV64Fs1uhpDdJWX1a7chsj2+OJimBlhxIW1wndFBI6CZuSCbUpLggmABfRhUHUgBYoUS6JCu5hrSGZQaouaZCUPKXe0LTRDzNAZOeo00+gv/Q9fz0PHbB01f6JBeXM5PEeGEoUhyQkmBLTi+gFOhaM1L6WxGaajXN9752cVHbNO7uWDVQwfevcnTSCU4ww5PaCdlCvqIddnVtBXp0h5HISvFxpfMW8rwHRLvKei+5KjOljJgKfsAvPePuD7Bwg6crqaXjQ1ygNtFMO7L+1BORE7u9Rq8FB0xDaas4ANeVwCIwWEBYP+0ZKD196KdA== 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 Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by DS7PR11MB6293.namprd11.prod.outlook.com (2603:10b6:8:97::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 04:34:01 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73%4]) with mapi id 15.20.7113.026; Wed, 27 Dec 2023 04:34:00 +0000 From: "Zhang, Qi Z" To: "Zeng, ZhichaoX" , "dev@dpdk.org" CC: "Wu, Jingjing" , "Xing, Beilei" Subject: RE: [PATCH v4 1/3] net/iavf: support Tx LLDP on scalar Thread-Topic: [PATCH v4 1/3] net/iavf: support Tx LLDP on scalar Thread-Index: AQHaM94Yfqr6eUASq0arF5/68QQyo7C8kpEw Date: Wed, 27 Dec 2023 04:34:00 +0000 Message-ID: References: <20231220093239.1148174-2-zhichaox.zeng@intel.com> <20231221072827.1808983-1-zhichaox.zeng@intel.com> <20231221072827.1808983-2-zhichaox.zeng@intel.com> In-Reply-To: <20231221072827.1808983-2-zhichaox.zeng@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|DS7PR11MB6293:EE_ x-ms-office365-filtering-correlation-id: 733a5587-342b-4e82-4646-08dc06950c74 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5RDQkhZxwVAbQ2NXVaYO0MXLFeB6wVaHFxTXJNfP3PMpY0u2Bp8iUFEsA2UnVoV/A4+uOziP/nig1S+OWfGW/hy1r3EOuTafQlTuO0tPQkvlukLqW9zb6ryF1m1mEufpeCet66otPVGePL31fNnoui8De3NrEt4f3SjRf/bakOSWy8GmIB0OBBdeRmurGFFv4TIG3HzYXWsS1ejQuptRJD8OUEc9mCZm1+RhrkiJy1SqFD9WJGFm6o9VDo8rZugx3OeszZyHaG+FJeEFZuQB3ThyVsvI1/V4ezVuLrwjOJ6Y+lGK+jMq2IbIogjZ5KAfmjS8PE679P/TO37kd39Gl81qpqrfQ2PN2VScBvHThY1r84bk54YOKe/19MijvJHyVijMibLxcHodLW/zQGTBRWDNDdOXos+xOZUpEp2BcB5W+15EtuKYY9UFj9tRR9oHeIbC/njdEWV6fv23/IvvqmYzzjh3YNAQH5OQpX+KbXd4ayfXXn1vVjftuu2r6mX9hi8IaSyzxbkWPxLRl0ht1dJZUJ2CZaeEe9xw1PoqHso4EXlB1ykhKNm3qajpyXHqHWIdnWebteNml44iBZA2iMqpgiw2fS6z2c1NwuH14M3pnuWcCPoNQjbOvnNtA6Rx x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(346002)(136003)(39860400002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(55016003)(6506007)(107886003)(7696005)(26005)(86362001)(38070700009)(33656002)(38100700002)(122000001)(82960400001)(83380400001)(52536014)(4326008)(8676002)(5660300002)(9686003)(53546011)(71200400001)(478600001)(110136005)(54906003)(76116006)(316002)(66946007)(66556008)(66476007)(66446008)(64756008)(41300700001)(2906002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?T1kENqKgZcN0Iq7xlMu+HfWQwzImH9jniVSoT1lIB7N6kTBVZvkaCfu/RzSx?= =?us-ascii?Q?AtFxJtmXcoi2hjxF+HcvhVKqqg5rMKsxsC2A6Wka33GUe3Ax+hebGabL6jlq?= =?us-ascii?Q?1XMzHlCrVt1nGHYm/cDzhIn8byVrw3SbbTGfciDR+FXV5oGVISy3WsB91zLr?= =?us-ascii?Q?RyxosQzJeeIC/UrFY/BRB4zmClRKYC3qy/fK0PQ/GsYjt10QOChAMHzyLBTp?= =?us-ascii?Q?MIUZSmSUjhvVHAccFZShoo5rlGwqIhdd9MasGYkPgOfPXuU1hU1l06QXw8i1?= =?us-ascii?Q?CJVclK2sDBKYsPJUEBHr7pYjbRuvOGzzsbzUPy3nKFJ4331PxetytVCBr8As?= =?us-ascii?Q?ACc55kVpvFBZvW2D06ig1HyD4czwSoia0miJaxBog3A4aPfclMORfaH4878d?= =?us-ascii?Q?JbHwxJudSsBBvvJBswAAvtZY7hBW/KkYpRHkVPCL11g3eXpfIC4OzoPyCE4F?= =?us-ascii?Q?wX58uYG4oBw83bN4Zlyq+kyMNjXlVvWv6sHcZccU7uC3S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TVHIelW9AHjOkVZjtJOeXn/Rvu+rCz?= =?us-ascii?Q?YCuuekJ2zCEHihjALWZmEgCRmBxT/rNzTKnfPi+Q5JLeqGDEsGhn658F7OFk?= =?us-ascii?Q?a6tSjrl8plJVEXmjW2dapM3jqdBKqCdh0f5KmspO25oNwANV10cKcIZhRiYW?= =?us-ascii?Q?pysVxdQNM4W82EGX3aqnRgckTlemEezKLMKwGbGt?= 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: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 733a5587-342b-4e82-4646-08dc06950c74 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2023 04:34:00.8544 (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: JH9J9h/QS94rQ90vuphVYFrxxvUAVSb/npId49yANzfcJ3TaHqz4QgQVBsqXIsy4XgNAHHw5kitSx0sMVclD8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB6293 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Zeng, ZhichaoX > Sent: Thursday, December 21, 2023 3:28 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Zeng, ZhichaoX > ; Wu, Jingjing ; Xing, Be= ilei > > Subject: [PATCH v4 1/3] net/iavf: support Tx LLDP on scalar >=20 > This patch adds an mbuf dynfield IAVF_TX_LLDP_DYNFIELD to determine > whether or not to fill the SWTCH_UPLINK bit in the Tx context descriptor = to > send LLDP packet. >=20 > Signed-off-by: Zhichao Zeng > --- > drivers/net/iavf/iavf_ethdev.c | 1 + > drivers/net/iavf/iavf_rxtx.c | 16 ++++++++++++++-- > drivers/net/iavf/iavf_rxtx.h | 3 +++ > 3 files changed, 18 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > d1edb0dd5c..1be248926c 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -41,6 +41,7 @@ > #define IAVF_NO_POLL_ON_LINK_DOWN_ARG "no-poll-on-link-down" > uint64_t iavf_timestamp_dynflag; > int iavf_timestamp_dynfield_offset =3D -1; > +int iavf_tx_lldp_dynfield_offset =3D -1; >=20 > static const char * const iavf_valid_args[] =3D { > IAVF_PROTO_XTR_ARG, > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c = index > f19aa14646..3107102911 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -2418,8 +2418,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq) >=20 > /* Check if the context descriptor is needed for TX offloading */ stati= c inline > uint16_t -iavf_calc_context_desc(uint64_t flags, uint8_t vlan_flag) > +iavf_calc_context_desc(struct rte_mbuf *mb, uint8_t vlan_flag) > { > + uint64_t flags =3D mb->ol_flags; > if (flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG | > RTE_MBUF_F_TX_TUNNEL_MASK | > RTE_MBUF_F_TX_OUTER_IP_CKSUM | > RTE_MBUF_F_TX_OUTER_UDP_CKSUM)) > @@ -2427,6 +2428,12 @@ iavf_calc_context_desc(uint64_t flags, uint8_t > vlan_flag) > if (flags & RTE_MBUF_F_TX_VLAN && > vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) > return 1; > + > + if (iavf_tx_lldp_dynfield_offset =3D=3D > + rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL)) > + if (*RTE_MBUF_DYNFIELD(mb, Its not necessary to lookup the dynamic field at data path which consume co= nsiderable CPU cycles that impact the performance. the dynamic field offset can be decided during dev_start. > + iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) > + return 1; > return 0; > } >=20 > @@ -2446,6 +2453,11 @@ iavf_fill_ctx_desc_cmd_field(volatile uint64_t > *field, struct rte_mbuf *m, > << IAVF_TXD_CTX_QW1_CMD_SHIFT; > } >=20 > + if (*RTE_MBUF_DYNFIELD(m, > + iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) > + cmd |=3D IAVF_TX_CTX_DESC_SWTCH_UPLINK > + << IAVF_TXD_CTX_QW1_CMD_SHIFT; > + > *field |=3D cmd; > } >=20 > @@ -2826,7 +2838,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, uint16_t nb_pkts) >=20 > nb_desc_data =3D mb->nb_segs; > nb_desc_ctx =3D > - iavf_calc_context_desc(mb->ol_flags, txq->vlan_flag); > + iavf_calc_context_desc(mb, txq->vlan_flag); > nb_desc_ipsec =3D !!(mb->ol_flags & > RTE_MBUF_F_TX_SEC_OFFLOAD); >=20 > /** > diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h = index > f432f9d956..f6954a83c2 100644 > --- a/drivers/net/iavf/iavf_rxtx.h > +++ b/drivers/net/iavf/iavf_rxtx.h > @@ -107,8 +107,11 @@ > #define IAVF_MAX_DATA_PER_TXD \ > (IAVF_TXD_QW1_TX_BUF_SZ_MASK >> > IAVF_TXD_QW1_TX_BUF_SZ_SHIFT) >=20 > +#define IAVF_TX_LLDP_DYNFIELD "intel_pmd_dynfield_tx_lldp" > + > extern uint64_t iavf_timestamp_dynflag; extern int > iavf_timestamp_dynfield_offset; > +extern int iavf_tx_lldp_dynfield_offset; It may not necessary to expose the offset value, as IAVF_TX_LLDP_DYNFIELD i= s the contract between application and PMD already.