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 5E215A0551; Fri, 26 Aug 2022 04:30:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0161940143; Fri, 26 Aug 2022 04:30:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id BF5A3400D6 for ; Fri, 26 Aug 2022 04:30:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661481029; x=1693017029; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=bb5VozDOPm6lClIocpDO9M5MMigXZ0Z56EiQXILJ1yI=; b=c0o/9K2QsA7+TqV/t4SAFOl6h2a4SnvwV4gfw34KJpSmCAE26CyzTWEH bs7PC2TwzNsA1FgkeVueTbfftZB4HyeusyAe47vPuGAGs61WJa2ebap9q YvHCpU0ucQeCY/hinJxqlndxRCDTNE11TUVjeSnBFwt0NUW9y2vxANkaR 2DWWqL8Psqaxkc7CgGy6TDRlzmLa+LAHZv4W/XSUic5IE8VxZ/Rkd7TUL gr1FofYVOKm0bhXGtvTsiQee0QUlPkKZs+VQsLK5BhXVbBJUYlpIYa2IH ieKqPx/T4tGNavyXTrWFcNrp6c2lWYhANbClBot95p3VB4qfAO4NebddU A==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="277420069" X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="277420069" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 19:30:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="639871356" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 25 Aug 2022 19:30:28 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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.2375.31; Thu, 25 Aug 2022 19:30:28 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 25 Aug 2022 19:30:27 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 25 Aug 2022 19:30:27 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 25 Aug 2022 19:30:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F58NlecKdkLC3guiPHOEfneIL31fa6eQE6Q3uX5UESBE4FyHss1cnm4EzcOhSUjmEPgDYno9YRd+KoVxROq4PI6o8NrBVO2L/kj0BEM3V/Kp9P/Wj2XrrCSPUnndoxRSfcVpP7I1ATcKOmLrAIdNVW0yq30kgYt2RwdqhU+GsgeRjYmMXXoT2t/RywuvsCqyAyzdpuxlpnpK6dS1DMzPyh3ZTL5vBwQvV+NmkenK0GKrb/EQKW99YUAgRv2o3yj1H84vxo4Kh3olQimPl7SE+nk++7xf9dMRjLWYO8okvnILRoQwvjCLedz1uGxa1RTlfvCjxD2YWdSxhBcU0vnREg== 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=YO/RpJaouzIB7oRl7I1X8V6NZ6NK1cFHnhxTgWfuPjc=; b=IYykOsaXuKzGb9V3eCwgj2lxPCeacsxfWPnhuUsBPnZ5SJnolBZ8sC64c00xQCpKgPMG3ikSPpBxKw2NWiuH9/ATw1dBLoKe8YyWhgU07J8LOF5XvoOtv8OAJmc7RJ2kCna5LiXMz5RUsLKV0yB8pNZKWN3OBXVl+AGdVkqW08L+dlcn97Ah/GnVFmyG9wW6jLiAj3v/ZjglER2X5cruFn8RKDtnybUaROYYEJg0CC9iwGv9T/gXEkFBsORKVP4Pm80glVUPMfRTmwrvY06g/c0kwxlKNKew3QiHHjuB0xHCXXrfXnZnMI+ydC1F0l6utE4SixVl22uVISSrebSWsg== 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 DM5PR11MB1674.namprd11.prod.outlook.com (2603:10b6:4:b::8) by PH7PR11MB6353.namprd11.prod.outlook.com (2603:10b6:510:1ff::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Fri, 26 Aug 2022 02:30:25 +0000 Received: from DM5PR11MB1674.namprd11.prod.outlook.com ([fe80::484b:2b33:def6:8f4f]) by DM5PR11MB1674.namprd11.prod.outlook.com ([fe80::484b:2b33:def6:8f4f%11]) with mapi id 15.20.5546.023; Fri, 26 Aug 2022 02:30:24 +0000 From: "Ling, Jin" To: "Liu, KevinX" , "dev@dpdk.org" Subject: RE: [PATCH v4] net/ice: refactor proto_ext to remove global variable Thread-Topic: [PATCH v4] net/ice: refactor proto_ext to remove global variable Thread-Index: AQHYuPHmrTRSI3h2QUWQHAsTiB63tK3AdOXQ Date: Fri, 26 Aug 2022 02:30:24 +0000 Message-ID: References: <20220727165901.457146-1-kevinx.liu@intel.com> <20220826101458.1520919-1-kevinx.liu@intel.com> In-Reply-To: <20220826101458.1520919-1-kevinx.liu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5f9eebf4-ba44-48a4-93fb-08da870aee92 x-ms-traffictypediagnostic: PH7PR11MB6353:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: z9MS0wn+5JBFHLqSwCt5A3PFTPA242e+41jyQJKfJ6nwh0NJ7Yhsc7znu4gJ39p5ZOlDKhQX/ti28vTR3eq3OU/AC2bT2pHGfB5G0BX7Hbcp4Mf6vTSPSSOSTLXzJwW8J+zf3ru4xFdGOmBN5XNs59gb1O5XGjvMHicS5PFZ3v3lXFX+4zJvBQ0tiJ+FFMahJhxovlIsSglH+qrX0C3XLOZuT1vmE7WqqFGj6RipeNKm+jNhCjG17jPskD8GyKR6Eh8voPIEEWgHUGTjaKw6aGQlMViifLPzRNvM4KVYntCm5KT1bIl2IdqrUrxdel4Qe0H11ZevFwhmuJftB+WBPPUd10o0PkJf8tYknzL7CaWGJYu8Hhx+6kpusC7B6XtgE5T21+zPbvqaM0XIzvsBRlnuxdyLUFzoYbakMtKMuv9SIfr8V80O2h29Fd0TfxOYam65K3/WKOj5qihquNQHlOzs4dL5M8U3Hrn1fViVU3DAGIIKd+VwZQXydELITi6kw6AqxUR/fXMY52sil6u/eiJfRa8TqjGoZs7++9OEYOG7JFYOfCtK4vi/Uceo+4hX5hrbpmdUUCQO3h7buePPuxxYTI4LdCprw316WaayyAaPGh748XVwvlC+Na7Khb+vXFBdInNuXt6Uvm7gFdk9MAQJvsNLVIkcllyfiTGeUBDnn1jTDkGjlw9Bc3621+SuXZO11iUvOFRuvB4ZvOcrr4iHku60X+gtFW0Fm45snpQR/lwM28myqIlvdjiDtc1xYTUun49MIW5JUnJVQ05idw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1674.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(136003)(346002)(376002)(39860400002)(86362001)(30864003)(82960400001)(38070700005)(122000001)(38100700002)(316002)(110136005)(52536014)(2906002)(8936002)(5660300002)(8676002)(76116006)(66946007)(66556008)(66476007)(66446008)(64756008)(83380400001)(186003)(478600001)(55016003)(7696005)(71200400001)(53546011)(26005)(9686003)(41300700001)(6506007)(33656002)(579004)(559001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?N013dWg5cHJvYjhLbDBFb29Bd3JsV21SbWxkaVZVd3NwM3JTY2orRk0w?= =?iso-2022-jp?B?NzErMnJuOURVemRPUEh5bCtOaUFyNm8ya2dnL1ppUUtiek5nTmM3Si9t?= =?iso-2022-jp?B?MHJTVHVSeXp0RXBMZ2ViV0M0ZzU2amQxdlIwTGdsT3BqV08veGtQb3No?= =?iso-2022-jp?B?R3VZcDI1Qzd6SFFpQnRWcDFKM2o4VjBQazFtMVlsbWhJNXArVHFvL0Y2?= =?iso-2022-jp?B?KzJtWjREYytqajBYZWZRSWVaRlNBOTRCTllDZkNlMGJWM2IrdUlIckZO?= =?iso-2022-jp?B?ckdveHJGK3F3S1BZbWIyKy9PbytST3J3QS9XRmxTSThhNmd3dVNSY2lG?= =?iso-2022-jp?B?ZU53cXRCUzF1VEdnQ0JtOHNHMHlGMjNxaFBXYm1GTlVvamMzcmU1ek9T?= =?iso-2022-jp?B?UzNzc3Z1SlpyOHFOYjRCWkxGbExnQVdpUjhzNHN6K29DR1FGTlZWb3Y3?= =?iso-2022-jp?B?SFN3T0ZxZklJZWl4RDJKZ2xpMk5xNnRLN3g4YWMyaXBhRnNhMTcxeE15?= =?iso-2022-jp?B?N1FIMDgzb0cvaStZSnhTdDY0L01LZnA1T3F0aVJLSFhKRGh5QXdsNHZh?= =?iso-2022-jp?B?dU00d2E1Uisvc1dadmg5RzhDUi96UlJxR3FFUWtoVlA1N2RmOFM4bFBv?= =?iso-2022-jp?B?K2dBZExIZHRsdVZnM1ltZGx0TS9MRW8rcHhpMTdjYVZvUTd4bXl2TUUy?= =?iso-2022-jp?B?eWs3bDVJaW1ORjgrUWx5dCtWb3ZuNGJQd0FIQWNYeU5yVHEzWURkZ2dm?= =?iso-2022-jp?B?a080UGJSVkRzbUlqUkFzN2dSYlpjRXNxVWdTZGlQSWNCMTlUNFVYbHNm?= =?iso-2022-jp?B?ME9oTVhydnhUZzFIS1NOcVBJcHh1N1diL2VHNjFUVmhybTRyM1B1YnMr?= =?iso-2022-jp?B?ZUlUelhlT0x3cXVBbW9jZnZtSGl0UUlPdHZ5cndBQ29CTjRWVVlTc2Yv?= =?iso-2022-jp?B?Z25KUE1uVHVucGFITEtxWGsrZjdRNlFSNXBBQm42WXBLQVBORTVZN1dR?= =?iso-2022-jp?B?eGdLd0ZwOW9wZEpxSiswKzNjMURWbk9CMFQ4STdIK3hXVm5KeXJDV1JH?= =?iso-2022-jp?B?Ui92by82dVR3SWt1S1UyT1ZETlduVmtDNkxQcXcrcTVqci9Ra20vYk9C?= =?iso-2022-jp?B?NFliVUQ0bFlRZ1Zac3d5clJhbDJ0eU9Jc1E1SEpHNEVMdU1pT1RKQ2Jh?= =?iso-2022-jp?B?ZG5tT1pCZlMrVnY5MU9iNHliOS9lTDB6WjZYUVNJYXNTQTZyTDZTYmxL?= =?iso-2022-jp?B?TFJjb295aWFSeDZ0UDRGZm9wRjhlbUhwam1Hb0gySkpCWVhkMW9wY2FV?= =?iso-2022-jp?B?Mi9BMXFyVzR4amI0ZUpyT0JUV2oyYTVJZmdSRDEzVWh5TkZSOGMxY1kz?= =?iso-2022-jp?B?STdtT0pCWjJmLzV3Nm5rL01oVXZBejQzdFBuQlZJVS84bHppdmZkOVBj?= =?iso-2022-jp?B?bW80ckxnMjJGcG1ZN1dMWWdOUDIwdlBnV2t0elVtcUd0R0dOQ3REM0pz?= =?iso-2022-jp?B?OU9pZzI5OGVLT1lpSzNrVVkrTnNQSWVlc3ZFdDNiT3RhSFZxMEQ4WldE?= =?iso-2022-jp?B?SndOa08rVTJFb0YrUkFDZmltMXdYcU0wSDRlSk1SZ1ZGV3JiaFd0cXdx?= =?iso-2022-jp?B?S0VRMnJORGRldnV2YTNoZVU3UFczL0lRTkxRRFVTTWd4dVBaSW03RDhh?= =?iso-2022-jp?B?VlgvTTBQcEROY09za0FVcHNoSTZpbmhuTDVDcEd5U0tiUm9Cck1pSXlU?= =?iso-2022-jp?B?SEJQQ2tQUFFNa1B2dUpDVkZkTWJCMnlXMWVxNmtrZE5mNnZpdng1QTBM?= =?iso-2022-jp?B?QndKS2JGYzlFU25mZTVQQVdWQ09KMWViSFFRZC9CTnM0MmFTaXBrdG5i?= =?iso-2022-jp?B?a0Nic0pVNWszMk5DZGhMSk8wWVc5Y3g5bVpuY09xS2R4b2lQUHQ0eFFS?= =?iso-2022-jp?B?Mmd5WlRxcHo0RWl0aVNQeExjSTZwb2pnWW1jbGdyUkwyNVV4bUc0bVVM?= =?iso-2022-jp?B?WTVtY1FGZzByZExrck91YnV6b1NKL2I3SXViaGQ4enN6N1NBbm4yYlda?= =?iso-2022-jp?B?OFZpWDZqaUlYbWxWNlBxWWJ1NVNVUXRXUzZ4czk2RFFmKzFtWE9raktm?= =?iso-2022-jp?B?OGNQVGkxbFdjYThLOXZzZnhBUWI2VFRYS3BIVmdTOGwzU1Y2OW5hbFJX?= =?iso-2022-jp?B?MFB1WUl4T1EvUWw3YkNnL0tYa0JqNy9GbXVZUmZhL0M4bXhrbmVWdmtN?= =?iso-2022-jp?B?dThKNnJtZHJ5WWx2NU9laGwwbnd4YUlHNEtERUQvNkh3UVFRSTRHU2Vk?= =?iso-2022-jp?B?VlAxeQ==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1674.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f9eebf4-ba44-48a4-93fb-08da870aee92 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2022 02:30:24.8196 (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: AJLjDaYJRN9GesCtnW9tyHTlO0WPLgX5rBj6wS1w6pRdV/ztzXsPEC4vB6hMC1e6kEYb+lbNAEx3xVVfA9BGWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6353 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 Tested-by: Jin Ling -----Original Message----- From: Kevin Liu =20 Sent: 2022=1B$BG/=1B(B8=1B$B7n=1B(B26=1B$BF|=1B(B 18:15 To: dev@dpdk.org Cc: Yang, Qiming ; Zhang, Qi Z ; Yang, SteveX ; Liu, KevinX Subject: [PATCH v4] net/ice: refactor proto_ext to remove global variable The ice has the feature to extract protocol fields into flex descriptor by = programming per queue. However, the dynamic field for proto_ext are allocat= ed by PMD, it is the responsibility of application to reserved the field, b= efore start DPDK. Application with parse the offset and proto_ext name to PMD with devargs. Remove related private API in 'rte_pmd_ice.h' and 'rte_pmd_ice.h' file. Signed-off-by: Kevin Liu --- v2: Delete doc content related to 'rte_pmd_ice.h'. --- v3: Delete doc content related to 'rte_pmd_ice.h'. --- v4: refine code and change the check mode of dynamic field. --- doc/api/doxy-api-index.md | 1 - doc/api/doxy-api.conf.in | 1 - doc/guides/nics/ice.rst | 33 ++-- drivers/net/ice/ice_ddp_package.c | 1 - drivers/net/ice/ice_ethdev.c | 113 ++++++++++---- drivers/net/ice/ice_ethdev.h | 7 + drivers/net/ice/ice_rxtx.c | 45 ++---- drivers/net/ice/ice_rxtx.h | 1 + drivers/net/ice/ice_testpmd.c | 2 +- drivers/net/ice/meson.build | 2 - drivers/net/ice/rte_pmd_ice.h | 247 ------------------------------ drivers/net/ice/version.map | 7 - 12 files changed, 122 insertions(+), 338 deletions(-) delete mode 100644 = drivers/net/ice/rte_pmd_ice.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 18= 6a258be4..e578800cea 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -44,7 +44,6 @@ The public API headers are grouped by topics: [KNI](@ref rte_kni.h), [ixgbe](@ref rte_pmd_ixgbe.h), [i40e](@ref rte_pmd_i40e.h), - [ice](@ref rte_pmd_ice.h), [iavf](@ref rte_pmd_iavf.h), [ioat](@ref rte_ioat_rawdev.h), [bnxt](@ref rte_pmd_bnxt.h), diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index 6084= 94a7c0..6fab7436d7 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -18,7 +18,6 @@ INPUT =3D @TOPDIR@/doc/api/doxy-api-ind= ex.md \ @TOPDIR@/drivers/net/dpaa2 \ @TOPDIR@/drivers/net/i40e \ @TOPDIR@/drivers/net/iavf \ - @TOPDIR@/drivers/net/ice \ @TOPDIR@/drivers/net/ixgbe \ @TOPDIR@/drivers/net/mlx5 \ @TOPDIR@/drivers/net/softnic \ diff --git a/doc/= guides/nics/ice.rst b/doc/guides/nics/ice.rst index 6b903b9bbc..432c6fd7ed = 100644 --- a/doc/guides/nics/ice.rst +++ b/doc/guides/nics/ice.rst @@ -110,29 +110,43 @@ Runtime Config Options =20 The argument format is:: =20 - -a 18:00.0,proto_xtr=3D[...] - -a 18:00.0,proto_xtr=3D + 18:00.0,proto_xtr=3D[...],field_of= fs=3D, \ + field_name=3D + =20 + 18:00.0,proto_xtr=3D,field_offs=3D,field_name=3D =20 Queues are grouped by ``(`` and ``)`` within the group. The ``-`` charac= ter is used as a range separator and ``,`` is used as a single number separa= tor. The grouping ``()`` can be omitted for single element group. If no queue= s are specified, PMD will use this protocol extraction type for all queues. + ``field_offs`` is the offset of mbuf dynamic field for protocol extracti= on data. + ``field_name`` is the name of mbuf dynamic field for protocol extraction= data. + ``field_offs`` and ``field_name`` will be checked whether it is=20 + valid. If it is invalid the value needs to be reconfigured. =20 Protocol is : ``vlan, ipv4, ipv6, ipv6_flow, tcp, ip_offset``. =20 .. code-block:: console =20 - dpdk-testpmd -a 18:00.0,proto_xtr=3D'[(1,2-3,8-9):tcp,10-13:vlan]' + dpdk-testpmd -c 0xff -- -i + port stop 0 + port detach 0 + port attach=20 + 18:00.0,proto_xtr=3D'[(1,2-3,8-9):tcp,10-13:vlan]',field_offs=3D92,field_= n + ame=3Dpmd_dyn =20 This setting means queues 1, 2-3, 8-9 are TCP extraction, queues 10-13 a= re - VLAN extraction, other queues run with no protocol extraction. + VLAN extraction, other queues run with no protocol extraction. The=20 + offset of mbuf dynamic field is 92 for all queues with protocol extracti= on. =20 .. code-block:: console =20 - dpdk-testpmd -a 18:00.0,proto_xtr=3Dvlan,proto_xtr=3D'[(1,2-3,8-9):tcp= ,10-23:ipv6]' + dpdk-testpmd -c 0xff -- -i + port stop 0 + port detach 0 + port attach 18:00.0,proto_xtr=3Dvlan,proto_xtr=3D'[(1,2-3,8-9):tcp,10-= 23:ipv6]', \ + field_offs=3D92,field_name=3Dpmd_dyn =20 This setting means queues 1, 2-3, 8-9 are TCP extraction, queues 10-23 a= re - IPv6 extraction, other queues use the default VLAN extraction. + IPv6 extraction, other queues use the default VLAN extraction. The=20 + offset of mbuf dynamic field is 92 for all queues with protocol extracti= on. =20 The extraction metadata is copied into the registered dynamic mbuf field= , and the related dynamic mbuf flags is set. @@ -211,13 +225,6 @@ Runtime Config Options =20 IPHDR2 - Outer/Single IPv6 Header offset. =20 - Use ``rte_net_ice_dynf_proto_xtr_metadata_get`` to access the protocol - extraction metadata, and use ``RTE_PKT_RX_DYNF_PROTO_XTR_*`` to get the - metadata type of ``struct rte_mbuf::ol_flags``. - - The ``rte_net_ice_dump_proto_xtr_metadata`` routine shows how to - access the protocol extraction result in ``struct rte_mbuf``. - - ``Hardware debug mask log support`` (default ``0``) =20 User can enable the related hardware debug mask such as ICE_DBG_NVM:: diff --git a/drivers/net/ice/ice_ddp_package.c b/drivers/net/ice/ice_ddp_pa= ckage.c index c7b5dc7ee7..86c0d6d499 100644 --- a/drivers/net/ice/ice_ddp_package.c +++ b/drivers/net/ice/ice_ddp_package.c @@ -7,7 +7,6 @@ #include =20 #include "ice_ethdev.h" -#include "rte_pmd_ice.h" =20 #define ICE_BUFF_SEG_HEADER_FLAG 0x1 #define ICE_PKG_HDR_HEADR_PART1 1 diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c in= dex b2300790ae..ed21f5c569 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -20,7 +20,6 @@ #include "base/ice_common.h" #include "base/ice_ptp_hw.h" =20 -#include "rte_pmd_ice.h" #include "ice_ethdev.h" #include "ice_rxtx.h" #include "ice_generic_flow.h" @@ -29,6 +28,8 @@ #define ICE_SAFE_MODE_SUPPORT_ARG "safe-mode-support" #define ICE_PIPELINE_MODE_SUPPORT_ARG "pipeline-mode-support" #define ICE_PROTO_XTR_ARG "proto_xtr" +#define ICE_FIELD_OFFS_ARG "field_offs" +#define ICE_FIELD_NAME_ARG "field_name" #define ICE_HW_DEBUG_MASK_ARG "hw_debug_mask" #define ICE_ONE_PPS_OUT_ARG "pps_out" #define ICE_RX_LOW_LATENCY_ARG "rx_low_latency" @@ -42,6 +43,8 @@ static const char * const ice_valid_args[] =3D { ICE_SAFE_MODE_SUPPORT_ARG, ICE_PIPELINE_MODE_SUPPORT_ARG, ICE_PROTO_XTR_ARG, + ICE_FIELD_OFFS_ARG, + ICE_FIELD_NAME_ARG, ICE_HW_DEBUG_MASK_ARG, ICE_ONE_PPS_OUT_ARG, ICE_RX_LOW_LATENCY_ARG, @@ -50,16 +53,8 @@ static const char * const ice_valid_args[] =3D { =20 #define PPS_OUT_DELAY_NS 1 =20 -static const struct rte_mbuf_dynfield ice_proto_xtr_metadata_param =3D { - .name =3D "intel_pmd_dynfield_proto_xtr_metadata", - .size =3D sizeof(uint32_t), - .align =3D __alignof__(uint32_t), - .flags =3D 0, -}; - struct proto_xtr_ol_flag { const struct rte_mbuf_dynflag param; - uint64_t *ol_flag; bool required; }; =20 @@ -67,23 +62,17 @@ static bool ice_proto_xtr_hw_support[PROTO_XTR_MAX]; =20 static struct proto_xtr_ol_flag ice_proto_xtr_ol_flag_params[] =3D { [PROTO_XTR_VLAN] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_vlan" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_vlan_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_vlan" }}, [PROTO_XTR_IPV4] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv4" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_ipv4_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv4" }}, [PROTO_XTR_IPV6] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv6" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_ipv6_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv6" }}, [PROTO_XTR_IPV6_FLOW] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv6_flow" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ipv6_flow" }}, [PROTO_XTR_TCP] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_tcp" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_tcp_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_tcp" }}, [PROTO_XTR_IP_OFFSET] =3D { - .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ip_offset" }, - .ol_flag =3D &rte_net_ice_dynflag_proto_xtr_ip_offset_mask }, + .param =3D { .name =3D "intel_pmd_dynflag_proto_xtr_ip_offset" }} }; =20 #define ICE_OS_DEFAULT_PKG_NAME "ICE OS Default Package" @@ -612,6 +601,45 @@ handle_proto_xtr_arg(__rte_unused const char *key, con= st char *value, return 0; } =20 +static int +handle_field_offs_arg(__rte_unused const char *key, const char *value, + void *offs_args) +{ + uint8_t *offset =3D offs_args; + + if (value =3D=3D NULL || offs_args =3D=3D NULL) + return -EINVAL; + + if (!isdigit(*value)) + return -1; + + *offset =3D atoi(value); + + return 0; +} + +static int +handle_field_name_arg(__rte_unused const char *key, const char *value, + void *name_args) +{ + char *name =3D name_args; + int ret; + + if (name =3D=3D NULL || name_args =3D=3D NULL) + return -EINVAL; + if (isdigit(*value)) + return -1; + + ret =3D strlcpy(name, value, RTE_MBUF_DYN_NAMESIZE); + if (ret < 0 || ret >=3D RTE_MBUF_DYN_NAMESIZE) { + PMD_DRV_LOG(ERR, + "The protocol extraction field name too long : '%s'", + name); + return -1; + } + return 0; +} + static void ice_check_proto_xtr_support(struct ice_hw *hw) { @@ -1400,7 +1428,7 @@ ic= e_init_proto_xtr(struct rte_eth_dev *dev) struct ice_hw *hw =3D ICE_PF_TO_HW(pf); const struct proto_xtr_ol_flag *ol_flag; bool proto_xtr_enable =3D false; - int offset; + int offset, field_offs; uint16_t i; =20 pf->proto_xtr =3D rte_zmalloc(NULL, pf->lan_nb_qps, 0); @@ -1422,27 +1450= ,35 @@ ice_init_proto_xtr(struct rte_eth_dev *dev) } } =20 - if (likely(!proto_xtr_enable)) + if (likely(!proto_xtr_enable)) { + ad->devargs.xtr_field_offs =3D -1; return; + } =20 ice_check_proto_xtr_support(hw); =20 - offset =3D rte_mbuf_dynfield_register(&ice_proto_xtr_metadata_param); - if (unlikely(offset =3D=3D -1)) { - PMD_DRV_LOG(ERR, - "Protocol extraction metadata is disabled in mbuf with error %d", - -rte_errno); + /*check mbuf dynfield*/ + field_offs =3D rte_mbuf_dynfield_lookup(ad->devargs.xtr_field_name, NULL)= ; + if (ad->devargs.xtr_field_offs =3D=3D field_offs) { + PMD_DRV_LOG(DEBUG, + "Protocol extraction metadata offset in mbuf is : %d", + ad->devargs.xtr_field_offs); + } else { + PMD_DRV_LOG(ERR, "Invalid field offset or name, no match dynfield, [%d],= [%s]", + ad->devargs.xtr_field_offs, ad->devargs.xtr_field_name); + ad->devargs.xtr_field_offs =3D -1; return; } =20 PMD_DRV_LOG(DEBUG, "Protocol extraction metadata offset in mbuf is : %d", - offset); - rte_net_ice_dynfield_proto_xtr_metadata_offs =3D offset; + ad->devargs.xtr_field_offs); =20 for (i =3D 0; i < RTE_DIM(ice_proto_xtr_ol_flag_params); i++) { ol_flag =3D &ice_proto_xtr_ol_flag_params[i]; =20 + ad->devargs.xtr_flag_offs[i] =3D 0xff; + if (!ol_flag->required) continue; =20 @@ -1450,7 +1486,7 @@ ice_init_proto_xtr(struct rte_eth_dev *dev) PMD_DRV_LOG(ERR, "Protocol extraction type %u is not supported in hardware", i); - rte_net_ice_dynfield_proto_xtr_metadata_offs =3D -1; + ad->devargs.xtr_field_offs =3D -1; break; } =20 @@ -1460,14 +1496,15 @@ ice_init_proto_xtr(struct rte_eth_dev *dev) "Protocol extraction offload '%s' failed to register with error %d= ", ol_flag->param.name, -rte_errno); =20 - rte_net_ice_dynfield_proto_xtr_metadata_offs =3D -1; + ad->devargs.xtr_field_offs =3D -1; break; } =20 PMD_DRV_LOG(DEBUG, "Protocol extraction offload '%s' offset in mbuf is : %d", ol_flag->param.name, offset); - *ol_flag->ol_flag =3D 1ULL << offset; + + ad->devargs.xtr_flag_offs[i] =3D offset; } } =20 @@ -2010,6 +2047,16 @@ static int ice_parse_devargs(struct rte_eth_dev *dev= ) if (ret) goto bail; =20 + ret =3D rte_kvargs_process(kvlist, ICE_FIELD_OFFS_ARG, + &handle_field_offs_arg, &ad->devargs.xtr_field_offs); + if (ret) + goto bail; + + ret =3D rte_kvargs_process(kvlist, ICE_FIELD_NAME_ARG, + &handle_field_name_arg, &ad->devargs.xtr_field_name); + if (ret) + goto bail; + ret =3D rte_kvargs_process(kvlist, ICE_SAFE_MODE_SUPPORT_ARG, &parse_bool, &ad->devargs.safe_mode_support); if (ret) diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h in= dex ec23dae665..62d9654841 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -565,6 +565,10 @@ struct ice_devargs { uint8_t proto_xtr[ICE_MAX_QUEUE_NUM]; uint8_t pin_idx; uint8_t pps_out_ena; + int xtr_field_offs; + uint8_t xtr_flag_offs[PROTO_XTR_MAX]; + /* Name of the field. */ + char xtr_field_name[RTE_MBUF_DYN_NAMESIZE]; }; =20 /** @@ -725,4 +729,7 @@ ice_align_floor(int n) ((phy_type) & ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC) || \ ((phy_type) & ICE_PHY_TYPE_HIGH_100G_AUI2)) =20 +__rte_experimental +int rte_pmd_ice_dump_package(uint16_t port, uint8_t **buff, uint32_t=20 +*size); + #endif /* _ICE_ETHDEV_H_ */ diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index = bfb3a16ae2..5af7c0c8f6 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -6,7 +6,6 @@ #include #include =20 -#include "rte_pmd_ice.h" #include "ice_rxtx.h" #include "ice_rxtx_vec_common.h" =20 @@ -15,16 +14,11 @@ RTE_MBUF_F_TX_TCP_SEG | \ RTE_MBUF_F_TX_OUTER_IP_CKSUM) =20 -/* Offset of mbuf dynamic field for protocol extraction data */ -int rte_n= et_ice_dynfield_proto_xtr_metadata_offs =3D -1; - -/* Mask of mbuf dynamic flags for protocol extraction type */ -uint64_t rt= e_net_ice_dynflag_proto_xtr_vlan_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv4_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask; -uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask; +/** + * The mbuf dynamic field pointer for protocol extraction metadata. + */ +#define ICE_DYNF_PROTO_XTR_METADATA(m, n) \ + RTE_MBUF_DYNFIELD((m), (n), uint32_t *) =20 static int ice_monitor_callback(const uint64_t value, @@ -160,7 +154,7 @@ ice_rxd_to_= pkt_fields_by_comms_aux_v1(struct ice_rx_queue *rxq, if (metadata) { mb->ol_flags |=3D rxq->xtr_ol_flag; =20 - *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) =3D metadata; + *ICE_DYNF_PROTO_XTR_METADATA(mb, rxq->xtr_field_offs) =3D metadata; } } #else @@ -200,7 +194,7 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct ice_rx_que= ue *rxq, if (metadata) { mb->ol_flags |=3D rxq->xtr_ol_flag; =20 - *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb) =3D metadata; + *ICE_DYNF_PROTO_XTR_METADATA(mb, rxq->xtr_field_offs) =3D metadata; } } #else @@ -226,29 +220,12 @@ ice_select_rxd_to_pkt_fields_handler(struct ice_rx_qu= eue *rxq, uint32_t rxdid) =20 switch (rxdid) { case ICE_RXDID_COMMS_AUX_VLAN: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_vlan_mask; - break; - case ICE_RXDID_COMMS_AUX_IPV4: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_ipv4_mask; - break; - case ICE_RXDID_COMMS_AUX_IPV6: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_ipv6_mask; - break; - case ICE_RXDID_COMMS_AUX_IPV6_FLOW: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; - break; - case ICE_RXDID_COMMS_AUX_TCP: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_tcp_mask; - break; - case ICE_RXDID_COMMS_AUX_IP_OFFSET: - rxq->xtr_ol_flag =3D rte_net_ice_dynflag_proto_xtr_ip_offset_mask; break; - case ICE_RXDID_COMMS_GENERIC: /* fallthrough */ case ICE_RXDID_COMMS_OVS: @@ -260,7 +237,7 @@ ice_select_rxd_to_pkt_fields_handler(struct ice_rx_queu= e *rxq, uint32_t rxdid) break; } =20 - if (!rte_net_ice_dynf_proto_xtr_metadata_avail()) + if (rxq->xtr_field_offs =3D=3D -1) rxq->xtr_ol_flag =3D 0; } =20 @@ -346,7 +323,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) return -EINVAL; } =20 - ice_select_rxd_to_pkt_fields_handler(rxq, rxdid); + rxq->rxdid =3D rxdid; =20 /* Enable Flexible Descriptors in the queue context which * allows this driver to select a specific receive descriptor format @@ -= 1121,6 +1098,10 @@ ice_rx_queue_setup(struct rte_eth_dev *dev, rxq->rx_deferred_start =3D rx_conf->rx_deferred_start; rxq->proto_xtr =3D pf->proto_xtr !=3D NULL ? pf->proto_xtr[queue_idx] : PROTO_XTR_NONE; + if (rxq->proto_xtr !=3D PROTO_XTR_NONE && + ad->devargs.xtr_flag_offs[rxq->proto_xtr] !=3D 0xff) + rxq->xtr_ol_flag =3D 1ULL << ad->devargs.xtr_flag_offs[rxq->proto_xtr]; + rxq->xtr_field_offs =3D ad->devargs.xtr_field_offs; =20 /* Allocate the maximum number of RX ring hardware descriptor. */ len =3D ICE_MAX_RING_DESC; diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index = f5337d5284..6c08c175dc 100644 --- a/drivers/net/ice/ice_rxtx.h +++ b/drivers/net/ice/ice_rxtx.h @@ -88,6 +88,7 @@ struct ice_rx_queue { bool q_set; /* indicate if rx queue has been configured */ bool rx_deferred_start; /* don't start this queue in dev start */ uint8_t proto_xtr; /* Protocol extraction from flexible descriptor */ + int xtr_field_offs; /*Protocol extraction matedata offset*/ uint64_t xtr_ol_flag; /* Protocol extraction offload flag */ uint32_t rxdid; /* Receive Flex Descriptor profile ID */ ice_rx_release_mbufs_t rx_rel_mbufs; diff --git a/drivers/net/ice/ice_testpmd.c b/drivers/net/ice/ice_testpmd.c = index 2de9b36503..10ae9d5bdd 100644 --- a/drivers/net/ice/ice_testpmd.c +++ b/drivers/net/ice/ice_testpmd.c @@ -2,12 +2,12 @@ * Copyright(c) 2022 Intel Corporation. */ =20 -#include =20 #include #include =20 #include "testpmd.h" +#include "ice_ethdev.h" =20 /* Fixed size for ICE ddp runtime configure */ #define ICE_BUFF_SIZE 0x000c9000 diff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build inde= x 1045919687..528e77613e 100644 --- a/drivers/net/ice/meson.build +++ b/drivers/net/ice/meson.build @@ -78,5 +78,3 @@ sources +=3D files( 'ice_dcf_parent.c', 'ice_dcf_sched.c', ) - -headers =3D files('rte_pmd_ice.h') diff --git a/drivers/net/ice/rte_pmd_ice.h b/drivers/net/ice/rte_pmd_ice.h = deleted file mode 100644 index 53c81ccf4e..0000000000 --- a/drivers/net/ice/rte_pmd_ice.h +++ /dev/null @@ -1,247 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2019 Intel Corporation - */ - -#ifndef _RTE_PMD_ICE_H_ -#define _RTE_PMD_ICE_H_ - -/** - * @file rte_pmd_ice.h - * - * ice PMD specific functions. - * - * @b EXPERIMENTAL: this API may change, or be removed, without prior noti= ce - * - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The supported network protocol extraction metadata format. - */ -union rte_net_ice_proto_xtr_metadata { - uint32_t metadata; - - struct { - uint16_t data0; - uint16_t data1; - } raw; - - struct { - uint16_t stag_vid:12, - stag_dei:1, - stag_pcp:3; - uint16_t ctag_vid:12, - ctag_dei:1, - ctag_pcp:3; - } vlan; - - struct { - uint16_t protocol:8, - ttl:8; - uint16_t tos:8, - ihl:4, - version:4; - } ipv4; - - struct { - uint16_t hoplimit:8, - nexthdr:8; - uint16_t flowhi4:4, - tc:8, - version:4; - } ipv6; - - struct { - uint16_t flowlo16; - uint16_t flowhi4:4, - tc:8, - version:4; - } ipv6_flow; - - struct { - uint16_t fin:1, - syn:1, - rst:1, - psh:1, - ack:1, - urg:1, - ece:1, - cwr:1, - res1:4, - doff:4; - uint16_t rsvd; - } tcp; - - uint32_t ip_ofs; -}; - -/* Offset of mbuf dynamic field for protocol extraction data */ -extern in= t rte_net_ice_dynfield_proto_xtr_metadata_offs; - -/* Mask of mbuf dynamic flags for protocol extraction type */ -extern uint= 64_t rte_net_ice_dynflag_proto_xtr_vlan_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv4_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_tcp_mask; -extern uint64_t rte_net_ice_dynflag_proto_xtr_ip_offset_mask; - -/** - * The mbuf dynamic field pointer for protocol extraction metadata. - */ -#define RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m) \ - RTE_MBUF_DYNFIELD((m), \ - rte_net_ice_dynfield_proto_xtr_metadata_offs, \ - uint32_t *) - -/** - * The mbuf dynamic flag for VLAN protocol extraction metadata, it is vali= d - * when dev_args 'proto_xtr' has 'vlan' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_VLAN \ - (rte_net_ice_dynflag_proto_xtr_vlan_mask) - -/** - * The mbuf dynamic flag for IPv4 protocol extraction metadata, it is vali= d - * when dev_args 'proto_xtr' has 'ipv4' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV4 \ - (rte_net_ice_dynflag_proto_xtr_ipv4_mask) - -/** - * The mbuf dynamic flag for IPv6 protocol extraction metadata, it is vali= d - * when dev_args 'proto_xtr' has 'ipv6' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV6 \ - (rte_net_ice_dynflag_proto_xtr_ipv6_mask) - -/** - * The mbuf dynamic flag for IPv6 with flow protocol extraction metadata, = it is - * valid when dev_args 'proto_xtr' has 'ipv6_flow' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW \ - (rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask) - -/** - * The mbuf dynamic flag for TCP protocol extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'tcp' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_TCP \ - (rte_net_ice_dynflag_proto_xtr_tcp_mask) - -/** - * The mbuf dynamic flag for IP_OFFSET extraction metadata, it is valid - * when dev_args 'proto_xtr' has 'ip_offset' specified. - */ -#define RTE_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET \ - (rte_net_ice_dynflag_proto_xtr_ip_offset_mask) - -/** - * Check if mbuf dynamic field for protocol extraction metadata is registe= red. - * - * @return - * True if registered, false otherwise. - */ -__rte_experimental -static __rte_always_inline int -rte_net_ice_dynf_proto_xtr_metadata_avail(void) -{ - return rte_net_ice_dynfield_proto_xtr_metadata_offs !=3D -1; -} - -/** - * Get the mbuf dynamic field for protocol extraction metadata. - * - * @param m - * The pointer to the mbuf. - * @return - * The saved protocol extraction metadata. - */ -__rte_experimental -static __rte_always_inline uint32_t -rte_net_ice_dynf_proto_xtr_metadata_get(struct rte_mbuf *m) -{ - return *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(m); -} - -/** - * Dump the mbuf dynamic field for protocol extraction metadata. - * - * @param m - * The pointer to the mbuf. - */ -__rte_experimental -static inline void -rte_net_ice_dump_proto_xtr_metadata(struct rte_mbuf *m) -{ - union rte_net_ice_proto_xtr_metadata data; - - if (!rte_net_ice_dynf_proto_xtr_metadata_avail()) - return; - - data.metadata =3D rte_net_ice_dynf_proto_xtr_metadata_get(m); - - if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_VLAN) - printf(" - Protocol Extraction:[0x%04x:0x%04x],vlan,stag=3D%u:%u:%u,ctag= =3D%u:%u:%u", - data.raw.data0, data.raw.data1, - data.vlan.stag_pcp, - data.vlan.stag_dei, - data.vlan.stag_vid, - data.vlan.ctag_pcp, - data.vlan.ctag_dei, - data.vlan.ctag_vid); - else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_IPV4) - printf(" - Protocol Extraction:[0x%04x:0x%04x],ipv4,ver=3D%u,hdrlen=3D%u= ,tos=3D%u,ttl=3D%u,proto=3D%u", - data.raw.data0, data.raw.data1, - data.ipv4.version, - data.ipv4.ihl, - data.ipv4.tos, - data.ipv4.ttl, - data.ipv4.protocol); - else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_IPV6) - printf(" - Protocol Extraction:[0x%04x:0x%04x],ipv6,ver=3D%u,tc=3D%u,flo= w_hi4=3D0x%x,nexthdr=3D%u,hoplimit=3D%u", - data.raw.data0, data.raw.data1, - data.ipv6.version, - data.ipv6.tc, - data.ipv6.flowhi4, - data.ipv6.nexthdr, - data.ipv6.hoplimit); - else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW) - printf(" - Protocol Extraction:[0x%04x:0x%04x],ipv6_flow,ver=3D%u,tc=3D%= u,flow=3D0x%x%04x", - data.raw.data0, data.raw.data1, - data.ipv6_flow.version, - data.ipv6_flow.tc, - data.ipv6_flow.flowhi4, - data.ipv6_flow.flowlo16); - else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_TCP) - printf(" - Protocol Extraction:[0x%04x:0x%04x],tcp,doff=3D%u,flags=3D%s%= s%s%s%s%s%s%s", - data.raw.data0, data.raw.data1, - data.tcp.doff, - data.tcp.cwr ? "C" : "", - data.tcp.ece ? "E" : "", - data.tcp.urg ? "U" : "", - data.tcp.ack ? "A" : "", - data.tcp.psh ? "P" : "", - data.tcp.rst ? "R" : "", - data.tcp.syn ? "S" : "", - data.tcp.fin ? "F" : ""); - else if (m->ol_flags & RTE_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET) - printf(" - Protocol Offset:ip_offset=3D%u", - data.ip_ofs); -} - -__rte_experimental -int rte_pmd_ice_dump_package(uint16_t port, uint8_t **buff, uint32_t *size= ); - -#ifdef __cplusplus -} -#endif - -#endif /* _RTE_PMD_ICE_H_ */ diff --git a/drivers/net/ice/version.map b/drivers/net/ice/version.map inde= x 60a3f17393..620152e080 100644 --- a/drivers/net/ice/version.map +++ b/drivers/net/ice/version.map @@ -6,12 +6,5 @@ EXPERIMENTAL { global: =20 # added in 19.11 - rte_net_ice_dynfield_proto_xtr_metadata_offs; - rte_net_ice_dynflag_proto_xtr_vlan_mask; - rte_net_ice_dynflag_proto_xtr_ipv4_mask; - rte_net_ice_dynflag_proto_xtr_ipv6_mask; - rte_net_ice_dynflag_proto_xtr_ipv6_flow_mask; - rte_net_ice_dynflag_proto_xtr_tcp_mask; - rte_net_ice_dynflag_proto_xtr_ip_offset_mask; rte_pmd_ice_dump_package; }; -- 2.34.1