DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ori Kam <orika@nvidia.com>
To: "Zhang, Yuying" <yuying.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"aman.deep.singh@intel.com" <aman.deep.singh@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v1] app/testpmd: refine encap content
Date: Wed, 11 Oct 2023 09:30:11 +0000	[thread overview]
Message-ID: <MW2PR12MB46668C8014AB5AC0221873E2D6CCA@MW2PR12MB4666.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230822011306.19616-1-yuying.zhang@intel.com>

Hi Zhang,

> -----Original Message-----
> From: Zhang, Yuying <yuying.zhang@intel.com>
> Sent: Tuesday, August 22, 2023 4:13 AM
> 
> From: Yuying Zhang <yuying.zhang@intel.com>
> 
> Refine vxlan encap content of all protocol headers.
> 
> Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> ---
>  app/test-pmd/cmdline_flow.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 95c0a19beb..a488864e2b 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -8523,7 +8523,7 @@ parse_setup_vxlan_encap_data(struct
> action_vxlan_encap_data *action_vxlan_encap_
>  				.type = RTE_FLOW_ITEM_TYPE_END,
>  			},
>  		},
> -		.item_eth.hdr.ether_type = 0,
> +		.item_eth.hdr.ether_type =
> rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4),
>  		.item_vlan = {
>  			.hdr.vlan_tci = vxlan_encap_conf.vlan_tci,
>  			.hdr.eth_proto = 0,
> @@ -8531,24 +8531,32 @@ parse_setup_vxlan_encap_data(struct
> action_vxlan_encap_data *action_vxlan_encap_
>  		.item_ipv4.hdr = {
>  			.src_addr = vxlan_encap_conf.ipv4_src,
>  			.dst_addr = vxlan_encap_conf.ipv4_dst,
> +			.version_ihl = RTE_IPV4_VHL_DEF,
> +			.next_proto_id = IPPROTO_UDP,
> +			.time_to_live = IPDEFTTL,

You can use the following command, right?
set vxlan-tos-ttl ip-version ipv4|ipv6 vni <vni> udp-src <udp-src> udp-dst <udp-dst> ip-tos <ip-tos> ip-ttl <ip-ttl> ip-src <ip-src> ip-dst <ip-dst> eth-src <eth-src> eth-dst <eth-dst>

> +			.hdr_checksum = rte_cpu_to_be_16(1),

This checksum should be calculated by HW so why set it?

>  		},
>  		.item_udp.hdr = {
>  			.src_port = vxlan_encap_conf.udp_src,
>  			.dst_port = vxlan_encap_conf.udp_dst,
> +			.dgram_cksum = RTE_BE16(0x01),

This should be calculated by HW or set to 0

>  		},
> -		.item_vxlan.hdr.flags = 0,
> +		.item_vxlan.hdr.flags = 0x08,
>  	};
>  	memcpy(action_vxlan_encap_data-
> >item_eth.hdr.dst_addr.addr_bytes,
>  	       vxlan_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
>  	memcpy(action_vxlan_encap_data->item_eth.hdr.src_addr.addr_bytes,
>  	       vxlan_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
>  	if (!vxlan_encap_conf.select_ipv4) {
> +		action_vxlan_encap_data->item_eth.type =
> RTE_BE16(RTE_ETHER_TYPE_IPV6);
>  		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.src_addr,
>  		       &vxlan_encap_conf.ipv6_src,
>  		       sizeof(vxlan_encap_conf.ipv6_src));
>  		memcpy(&action_vxlan_encap_data->item_ipv6.hdr.dst_addr,
>  		       &vxlan_encap_conf.ipv6_dst,
>  		       sizeof(vxlan_encap_conf.ipv6_dst));
> +		action_vxlan_encap_data->item_ipv6.hdr.proto =
> IPPROTO_UDP;
> +		action_vxlan_encap_data->item_ipv6.hdr.hop_limits =
> IPDEFTTL;
>  		action_vxlan_encap_data->items[2] = (struct rte_flow_item){
>  			.type = RTE_FLOW_ITEM_TYPE_IPV6,
>  			.spec = &action_vxlan_encap_data->item_ipv6,
> --
> 2.25.1


Best,
Ori


      parent reply	other threads:[~2023-10-11  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  1:13 Zhang, Yuying
2023-10-10 10:52 ` Ferruh Yigit
2023-10-11  9:30 ` Ori Kam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW2PR12MB46668C8014AB5AC0221873E2D6CCA@MW2PR12MB4666.namprd12.prod.outlook.com \
    --to=orika@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).