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 30B0AA0C48; Tue, 15 Jun 2021 19:16:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7FE44067A; Tue, 15 Jun 2021 19:16:04 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7897640140 for ; Tue, 15 Jun 2021 19:16:02 +0200 (CEST) IronPort-SDR: A6xsxommPRarNBs53QG1l7Q14mnSufsOK7MjE0WY28POREidwey7Zx0cD4VlwAOHU/cwLQ91nK VCKHLnYabJ4g== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="205853235" X-IronPort-AV: E=Sophos;i="5.83,275,1616482800"; d="scan'208,217";a="205853235" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 10:16:01 -0700 IronPort-SDR: yawANqwWchaA6ncmAfTgctmOhwcsRt4oK1l9NiYd6qdwmsQAj1TehTQgr2ZzqMYdIKfanBvJZX MTvuBIcMGxHA== X-IronPort-AV: E=Sophos;i="5.83,275,1616482800"; d="scan'208,217";a="478782004" Received: from amandee1-mobl.gar.corp.intel.com (HELO [10.215.186.141]) ([10.215.186.141]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 10:15:59 -0700 To: dev@dpdk.org References: <20210531101941.60916-1-rongweil@nvidia.com> <20210531101941.60916-3-rongweil@nvidia.com> From: "Singh, Aman Deep" Message-ID: <49682c24-4660-04a8-8ba6-8129fb9cdf18@intel.com> Date: Tue, 15 Jun 2021 22:45:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210531101941.60916-3-rongweil@nvidia.com> Content-Language: en-GB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [RFC 2/2] app/testpmd: support VXLAN last 8-bits field matching 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 Rongwei, As per VxLAN RFC 7348- Reserved fields (24 bits and 8 bits): MUST be set to zero on transmission and ignored on receipt. I hope this criteria will be met for external packets. On 5/31/2021 3:49 PM, rongwei liu wrote: > Add a new testpmd pattern field 'last_rsvd' that supports the > last 8-bits matching of VXLAN header. > > The examples for the "last_rsvd" pattern field are as below: > > 1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ... > > This flow will exactly match the last 8-bits to be 0x80. > > 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80 > vxlan mask 0x80 / end ... Shouldn't this be as below, (or I am mistaken)- 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80 last_rsvd mask 0x80 / end ... > This flow will only match the MSB of the last 8-bits to be 1. > > Signed-off-by: rongwei liu > --- > app/test-pmd/cmdline_flow.c | 9 +++++++++ > app/test-pmd/util.c | 5 +++-- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 1 + > 3 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 1c587bb7b8..6e76a625ca 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -207,6 +207,7 @@ enum index { > ITEM_SCTP_CKSUM, > ITEM_VXLAN, > ITEM_VXLAN_VNI, > + ITEM_VXLAN_LAST_RSVD, > ITEM_E_TAG, > ITEM_E_TAG_GRP_ECID_B, > ITEM_NVGRE, > @@ -1129,6 +1130,7 @@ static const enum index item_sctp[] = { > > static const enum index item_vxlan[] = { > ITEM_VXLAN_VNI, > + ITEM_VXLAN_LAST_RSVD, > ITEM_NEXT, > ZERO, > }; > @@ -2806,6 +2808,13 @@ static const struct token token_list[] = { > .next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param), > .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)), > }, > + [ITEM_VXLAN_LAST_RSVD] = { > + .name = "last_rsvd", > + .help = "VXLAN last reserved bits", > + .next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param), > + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, > + rsvd1)), > + }, > [ITEM_E_TAG] = { > .name = "e_tag", > .help = "match E-Tag header", > diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c > index a9e431a8b2..59626518d5 100644 > --- a/app/test-pmd/util.c > +++ b/app/test-pmd/util.c > @@ -266,8 +266,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], > vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni); > MKDUMPSTR(print_buf, buf_size, cur_len, > " - VXLAN packet: packet type =%d, " > - "Destination UDP port =%d, VNI = %d", > - packet_type, udp_port, vx_vni >> 8); > + "Destination UDP port =%d, VNI = %d, " > + "last_rsvd = %d", packet_type, > + udp_port, vx_vni >> 8, vx_vni & 0xff); > } > } > MKDUMPSTR(print_buf, buf_size, cur_len, > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 33857acf54..4ca3103067 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3694,6 +3694,7 @@ This section lists supported pattern items and their attributes, if any. > - ``vxlan``: match VXLAN header. > > - ``vni {unsigned}``: VXLAN identifier. > + - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits. > > - ``e_tag``: match IEEE 802.1BR E-Tag header. >