From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3AAF5A0513; Wed, 15 Jan 2020 16:54:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A12861C1C5; Wed, 15 Jan 2020 16:53:57 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 1B1481C0D4 for ; Wed, 15 Jan 2020 16:53:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 07:53:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,323,1574150400"; d="scan'208";a="254009700" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by fmsmga001.fm.intel.com with ESMTP; 15 Jan 2020 07:53:51 -0800 From: Bernard Iremonger To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com, declan.doherty@intel.com Cc: konstantin.ananyev@intel.com, stephen1.byrne@intel.com, helin.zhang@intel.com, Bernard Iremonger Date: Wed, 15 Jan 2020 15:53:35 +0000 Message-Id: <1579103627-31985-2-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1579010128-15794-2-git-send-email-bernard.iremonger@intel.com> References: <1579010128-15794-2-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v6 01/13] app/testpmd: parse flow command line for ESP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" add ITEM_ESP add ITEM_ESP_SPI Signed-off-by: Bernard Iremonger Acked-by: Ori Kam --- app/test-pmd/cmdline_flow.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 99dade7..9c6edb8 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -213,6 +213,8 @@ enum index { ITEM_TAG, ITEM_TAG_DATA, ITEM_TAG_INDEX, + ITEM_ESP, + ITEM_ESP_SPI, /* Validate/create actions. */ ACTIONS, @@ -746,6 +748,7 @@ static const enum index next_item[] = { ITEM_PPPOE_PROTO_ID, ITEM_HIGIG2, ITEM_TAG, + ITEM_ESP, END_SET, ZERO, }; @@ -1017,6 +1020,12 @@ static const enum index item_higig2[] = { ZERO, }; +static const enum index item_esp[] = { + ITEM_ESP_SPI, + ITEM_NEXT, + ZERO, +}; + static const enum index next_set_raw[] = { SET_RAW_INDEX, ITEM_ETH, @@ -2593,6 +2602,20 @@ static const struct token token_list[] = { NEXT_ENTRY(ITEM_PARAM_IS)), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)), }, + [ITEM_ESP] = { + .name = "esp", + .help = "match ESP header", + .priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)), + .next = NEXT(item_esp), + .call = parse_vc, + }, + [ITEM_ESP_SPI] = { + .name = "spi", + .help = "security policy index", + .next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp, + hdr.spi)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", @@ -6230,14 +6253,15 @@ flow_item_default_mask(const struct rte_flow_item *item) case RTE_FLOW_ITEM_TYPE_GTP: mask = &rte_flow_item_gtp_mask; break; - case RTE_FLOW_ITEM_TYPE_ESP: - mask = &rte_flow_item_esp_mask; - break; case RTE_FLOW_ITEM_TYPE_GTP_PSC: mask = &rte_flow_item_gtp_psc_mask; break; case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID: mask = &rte_flow_item_pppoe_proto_id_mask; + break; + case RTE_FLOW_ITEM_TYPE_ESP: + mask = &rte_flow_item_esp_mask; + break; default: break; } @@ -6327,6 +6351,10 @@ cmd_set_raw_parsed(const struct buffer *in) case RTE_FLOW_ITEM_TYPE_GENEVE: size = sizeof(struct rte_flow_item_geneve); break; + case RTE_FLOW_ITEM_TYPE_ESP: + size = sizeof(struct rte_flow_item_esp); + proto = 0x32; + break; default: printf("Error - Not supported item\n"); *total_size = 0; -- 2.7.4