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 23465A0352; Tue, 25 Jan 2022 13:42:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D54FD4294D; Tue, 25 Jan 2022 13:42:54 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 68093426E4 for ; Tue, 25 Jan 2022 13:42:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643114573; x=1674650573; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=E/AvX5HGtFneoNInyE1NOdNbClyWf5cYJ/SKt3G8Jms=; b=GfU0yMLtPYI18qVUCvddopnjFmWTmeVrxhXdgZILX+RTo4Fcye/u0naC WLoEaB8iVd0AREp9bbJlqm1562d9j4vXuUHvt/4HoiMB6axhcGDuKiPds QA8J0PxihysCUKPmeDfx/WvJunE5LqdcniKyqCOdyfBkgHwf0MTo4aYFT Gz5gLmFQnyuCtdhIpMQMdUiFIvOYF4YtI6Q6gEmD/y4hs/pALD84RLxur 0nhnHCw1yQJXU6oeEL6IQ7rt2g8nnD3S1ol2Y8kQ/8Db5uFn3P+sfz41w NFZ1LJJTL+qibVFmeBrL1rLsRKb3AkfFvsPSJHh7ISTYwIiUB6o8HVe67 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="270735825" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="270735825" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 04:42:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="617598103" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jan 2022 04:42:52 -0800 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.2308.20; Tue, 25 Jan 2022 04:42:52 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2308.20 via Frontend Transport; Tue, 25 Jan 2022 04:42:52 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.46) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 25 Jan 2022 04:42:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h3x/I6IkiWdaOTJGj0KY77mRY979quIgrJeIlZ5wuot+V/60WExl5mMLiRg29RqJLoUZV5S24Oqc7M++kjd4VC528MpOPd1wT7a22+GW1of31cWgtcBdEtGFqsJowuBoxjlcdFzvXj9nPLpwHPtJhMrUtzIqBWkBYNkjwe4u2ZWLfqeu4pp0cqc1Qw2XN6SfqQPhEAOqu7u+gWpPGn5ukLl6iUMTN9YTPiQockuH5xSHJDyJ63yooBE3HPFdPFAtAmvbCQHTf34+6zCXzqfZkpPyL9IQBumNm6rMxp90xx77bApTvloOO9LIRLnrM9/LcX1+X9kp3M6rmyIJZZiZFw== 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=U27fy8CvTZz+jqUj5wzWDxIHtX2TtIMWyEUSiu0Q5co=; b=k3viqQtY28QRRPaKG2JIjJ0HOuKU2j1pRgEobmUrr2MnJJdeY1VjL+obpmvvzP4SPMZP/9RfoA+LukC0KrXog7tMQPsaj+UtqLpqMpZq62Lv8Z+Codroxt3Qo5kzzJWBXbDJxxP7AnzBnmBwWCyAh7yWAt6EPNOrPdx6310mpNMP8alEVL3kKNXVWpjB4FoWl4wH4A0k6WpoCKDHzxyX8ia61TzpNKxeICszzS09LWwRkEBior36u0DymJ9BFehQvHF1y2LEc1QA4CFe2Rq3ddEWqKbiiuejQ7obH9IPJYpW5cYqkruvGnepA+W3YFsC8h57m0G6qLvWJhGQtMBH1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by BN6PR11MB3954.namprd11.prod.outlook.com (2603:10b6:405:79::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Tue, 25 Jan 2022 12:42:50 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4909.017; Tue, 25 Jan 2022 12:42:50 +0000 Message-ID: <371cfb8b-b650-5a4d-fa45-ff99bcb7e5d8@intel.com> Date: Tue, 25 Jan 2022 12:42:44 +0000 Subject: Re: [PATCH] app/testpmd: update raw flow to take hex input Content-Language: en-US To: , CC: , , , References: <20220111050538.12957-1-nipun.gupta@nxp.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20220111050538.12957-1-nipun.gupta@nxp.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0351.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::27) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3b279d0-00d7-4220-da65-08d9e0003269 X-MS-TrafficTypeDiagnostic: BN6PR11MB3954:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JBb7KGdbyxJWFVL2tpx5EdC4WNIWEpfWnLAEq/+vUUZT35ojPj3T6PVx0Hhz/78lE0KczfmhXpm48Mhm6BIUoQSVvQx/PmLx+em5tlvSRCRvJUpuGa9W8LOzemtPLRCQEDIS81LvfR4P5x6rrEjqsBmZCFwMaJU8dIy0HRYkehF1cPmgbdPYZal9ul6gUM3PNj+0I+ro990y1OvUkolLkyagPwdkmvP4VDQ40ZXW3w7/hkRrj7cOOYOXRr7Zh6rKl5eHK6C0AxEMWLnDLAoddxtKG2Iw0AkPF1nrDzcPbNsi9XbTrRLPxsxXXi4g1x1RJbGkKioSPEZvMn6qQzkauIz0n/TxjxABmIbWcLdxFl8lLsXE5yvqcjkRGadBrnJnIoNLk80PS+thl/zirF0GccJ6v5BbORwlzVGBjS89bkMO6F170QPyMjBZQYaZ7i0XAmHXqr4ttSfSEDy2DP5FgTZVxruyBU7qsAJrBibhL7NTxIRkVcrL/QS/s6zmWy6VuX2vl/wDKbLAhKakzql954vf3x590Gi1K0XqmW5zR2JO0XBIgpchn6bWomqjH+XGLyasmmiRyZjsAQ0p3KwY/rooCMZUR1xf7SikTW6DPISFzSOQw2N/YILuAnxRPUxL/VrPXfF6bY89hDs5jwoo9yTKpodsykZG0YRWvRC70yq3mmbRIcPi4ESCmJkGU3Yjx8vJRPbBDbUEeaiCZ8z/dw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6512007)(86362001)(36756003)(4326008)(508600001)(2616005)(53546011)(186003)(6666004)(44832011)(31696002)(26005)(82960400001)(6486002)(66476007)(2906002)(83380400001)(5660300002)(316002)(8936002)(31686004)(38100700002)(6506007)(66946007)(66556008)(8676002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dm9GV25oMTcrU1pnZ09CMEw1bFJTSEVHNFVNdVY2dWxkdDJhMlJVWXl2VHk3?= =?utf-8?B?cExMUGFaYTN5OEI3aVNDelZsQmkvb1JDMy9ld0RpVEFEakNERGZFSGpVZktX?= =?utf-8?B?ZUtGYnVndFBRM3A5NEhrOUEzOHkzVXkzSE5BNmVwQkN3UUNQZGpQaGhVc3NC?= =?utf-8?B?VlFpK2FQN0lZenZEMXY1OEtSTXR6UnpOQUZrUlpRa1BudER5Y0pROUplelZP?= =?utf-8?B?SmNTU2Qvc0xCUGdoaW16K1NwV0FHeTA2clJ6UVNSeGJoOWxuU0dLdGV5cmJi?= =?utf-8?B?Z0ZVZHR0aURHRkdCajQyTDFuQVB4dXZrYUVQbjlER0NwaVFENGVzdCtRL1RC?= =?utf-8?B?bFk5MExQRzFZYitSTmtYY3lIaFMwYTNjMDZFdUVYQWxySXhEQVdmMXhIYzRD?= =?utf-8?B?WVc0VUVvMzYrNFJqK3JEaHVzMnZFYmxwOGxjdjZxL1JsOTlYSGN5MlFnR1Fa?= =?utf-8?B?cXdic005V3dkVE00cFNLbzFvTHhlQ005RlJ6aEdIMlozOTBpVmVHTTBuN0Ez?= =?utf-8?B?ZFg1STMrdks1M04reHVUWW9Wc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1QmVSZ2pRUlM2aTRnYUE4VEpGYnVjUGFuejZTckhtOXJx?= =?utf-8?B?emNhSmlQSjlsRi9OcXhXd3hiZnA4ZkVpcHVtajMrbkdMTHk5UmdkSGZ1UFRk?= =?utf-8?B?cHkvdG1sZE9PSzFMSVY3K3c3R1pwVW5PYkJxTzZqZzFRd0JUblpLM1RNbWw1?= =?utf-8?B?amFFYmllc3pHVkhNcDFuNm0xT2c1ajNNY3RvZWY3Z3JIdlZoeWdGQytidUpt?= =?utf-8?B?czlSV2czMWZiRUlwSUxMa3RkcTdKR0dwT2ZwbjhEUTd3VllOQ2FGbHl2U09j?= =?utf-8?B?UHZSVnIyZkZpcE93YU12TFB3U1ExZnQ5RTR6Qm01TjFpUjZqOWRsdVlwVEkw?= =?utf-8?B?Rm0vMlk5UXh3bElhRmRxeVEySStMNHpSMW5nQ2ZCTGZTbVFTVmRoekZFeFYx?= =?utf-8?B?RXZGQzREanlYaS8xSGh6bHd4S1Zxc1JVc1dJSU5ZTGNEcnpUaFdWbkNPMDV2?= =?utf-8?B?N3dyNFBHNnFWUVhtajdPelY1TERYbi9GR0NVeWE1OU9QOG5YYUlqVkw1U2Z3?= =?utf-8?B?RFdIOFpTaVFyZlVrMmxEemdVblZCOWx6V1VWQ3I1UXNtamYvdkdFVjlkRHVn?= =?utf-8?B?Rkp3NmRLZmlwekp0R3lNQkZCZVQwa3F5THFFaXpINXFjNmkwcmlGbmY3RmNX?= =?utf-8?B?NnB2KzZ4WmNVRVlPQU5XeFFXOWx0NVFNKzJWTEcyVmMrVVl3b2NEaE93QitC?= =?utf-8?Q?8l1Rh3JIE66n0eJC8Xc3ahE=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b3b279d0-00d7-4220-da65-08d9e0003269 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2022 12:42:50.2711 (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: Ed1Ssh5IKdozbG2AGU8kYZgbuDjz9KMcUcWE+JhL6UdoYvcyu8TF/bu8/iyde+mFTSOCpTtbPIpHemt7Vsx2vQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3954 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 On 1/11/2022 5:05 AM, nipun.gupta@nxp.com wrote: > From: Nipun Gupta > > This patch enables method to provide key and mask for raw rules > to be provided as hexadecimal values. There is new parameter > pattern_mask added to support this. > > Signed-off-by: Nipun Gupta Looks good to me. Ori, any objection/comment? > --- > app/test-pmd/cmdline_flow.c | 15 +++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 +++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index bbe3dc0115..cfa68abc40 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -166,6 +166,7 @@ enum index { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_ETH, > ITEM_ETH_DST, > ITEM_ETH_SRC, > @@ -1107,6 +1108,7 @@ static const enum index item_raw[] = { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_NEXT, > ZERO, > }; > @@ -2664,6 +2666,19 @@ static const struct token token_list[] = { > ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > ITEM_RAW_PATTERN_SIZE)), > }, > + [ITEM_RAW_PATTERN_HEX] = { > + .name = "pattern_hex", > + .help = "hex string to look for", > + .next = NEXT(item_raw, > + NEXT_ENTRY(COMMON_HEX), > + NEXT_ENTRY(ITEM_PARAM_IS, > + ITEM_PARAM_SPEC, > + ITEM_PARAM_MASK)), > + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern), > + ARGS_ENTRY(struct rte_flow_item_raw, length), > + ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > + ITEM_RAW_PATTERN_SIZE)), > + }, > [ITEM_ETH] = { > .name = "eth", > .help = "match Ethernet header", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 44228cd7d2..68c216c805 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3634,6 +3634,7 @@ This section lists supported pattern items and their attributes, if any. > - ``offset {integer}``: absolute or relative offset for pattern. > - ``limit {unsigned}``: search area limit for start of pattern. > - ``pattern {string}``: byte string to look for. > + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for. > > - ``eth``: match Ethernet header. > > @@ -5080,6 +5081,18 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands:: > testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6 > / end actions rss types ipv6 end queues end / end > > +Sample RAW rule > +~~~~~~~~~~~~~~~ > + > +A RAW rule can be creted as following using ``pattern_hex`` key and mask. > + s/creted/created/ > +:: > + > + testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset > + is 0 limit is 0 pattern_hex spec 00000000000000000000000000000000000000000000000000000a0a0a0a > + pattern_hex mask 0000000000000000000000000000000000000000000000000000ffffffff / end actions > + queue index 4 / end > + > BPF Functions > -------------- >