DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner ethernet type on E-Switch
@ 2018-11-21 17:44 Viacheslav Ovsiienko
  2018-11-22 11:42 ` Shahaf Shuler
  0 siblings, 1 reply; 2+ messages in thread
From: Viacheslav Ovsiienko @ 2018-11-21 17:44 UTC (permalink / raw)
  To: shahafs; +Cc: dev

The TCA_FLOWER_KEY_VLAN_ETH_TYPE should be specified for the E-Switch
Flows with VLAN and L3 pattern items in the Netlink messages. The patch
adds missing flower key to the messages. This patch partially reverts to
the code smashed by http://patches.dpdk.org/patch/47781

Fixes: 251e8d02cf37 ("net/mlx5: add VXLAN to flow translate routine")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_tcf.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c
index 22a866d..fb284c3 100644
--- a/drivers/net/mlx5/mlx5_flow_tcf.c
+++ b/drivers/net/mlx5/mlx5_flow_tcf.c
@@ -3260,7 +3260,8 @@ struct pedit_parser {
 			assert(mask.ipv4);
 			spec.ipv4 = items->spec;
 			if (!decap.vxlan) {
-				if (!eth_type_set && !vlan_eth_type_set)
+				if (!eth_type_set ||
+				    (!vlan_eth_type_set && vlan_present))
 					mnl_attr_put_u16
 						(nlh,
 						 vlan_present ?
@@ -3317,14 +3318,14 @@ struct pedit_parser {
 			assert(mask.ipv6);
 			spec.ipv6 = items->spec;
 			if (!decap.vxlan) {
-				if (!eth_type_set || !vlan_eth_type_set) {
+				if (!eth_type_set ||
+				    (!vlan_eth_type_set && vlan_present))
 					mnl_attr_put_u16
 						(nlh,
 						 vlan_present ?
 						 TCA_FLOWER_KEY_VLAN_ETH_TYPE :
 						 TCA_FLOWER_KEY_ETH_TYPE,
 						 RTE_BE16(ETH_P_IPV6));
-				}
 				eth_type_set = 1;
 				vlan_eth_type_set = 1;
 				if (mask.ipv6 == &flow_tcf_mask_empty.ipv6)
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner ethernet type on E-Switch
  2018-11-21 17:44 [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner ethernet type on E-Switch Viacheslav Ovsiienko
@ 2018-11-22 11:42 ` Shahaf Shuler
  0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-11-22 11:42 UTC (permalink / raw)
  To: Slava Ovsiienko; +Cc: dev

Wednesday, November 21, 2018 7:45 PM, Viacheslav Ovsiienko:
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner ethernet type on E-
> Switch
> 
> The TCA_FLOWER_KEY_VLAN_ETH_TYPE should be specified for the E-Switch
> Flows with VLAN and L3 pattern items in the Netlink messages. The patch
> adds missing flower key to the messages. This patch partially reverts to the
> code smashed by
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatc
> hes.dpdk.org%2Fpatch%2F47781&amp;data=02%7C01%7Cshahafs%40mellan
> ox.com%7C6cdd88ebb5494ed2809908d64fd90b8f%7Ca652971c7d2e4d9ba6a4
> d149256f461b%7C0%7C0%7C636784190968004901&amp;sdata=y%2BjABP0X3
> Z%2FQ70nemjj%2FzBaFkJ8ndpK%2BO1VmIH5BGPE%3D&amp;reserved=0
> 
> Fixes: 251e8d02cf37 ("net/mlx5: add VXLAN to flow translate routine")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

Applied to next-net-mlx, thanks.

Ferruh, please let me know if you think it can be added to 18.11, it is relatively small, local, yet important fix. 

> ---
>  drivers/net/mlx5/mlx5_flow_tcf.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c
> b/drivers/net/mlx5/mlx5_flow_tcf.c
> index 22a866d..fb284c3 100644
> --- a/drivers/net/mlx5/mlx5_flow_tcf.c
> +++ b/drivers/net/mlx5/mlx5_flow_tcf.c
> @@ -3260,7 +3260,8 @@ struct pedit_parser {
>  			assert(mask.ipv4);
>  			spec.ipv4 = items->spec;
>  			if (!decap.vxlan) {
> -				if (!eth_type_set && !vlan_eth_type_set)
> +				if (!eth_type_set ||
> +				    (!vlan_eth_type_set && vlan_present))
>  					mnl_attr_put_u16
>  						(nlh,
>  						 vlan_present ?
> @@ -3317,14 +3318,14 @@ struct pedit_parser {
>  			assert(mask.ipv6);
>  			spec.ipv6 = items->spec;
>  			if (!decap.vxlan) {
> -				if (!eth_type_set || !vlan_eth_type_set) {
> +				if (!eth_type_set ||
> +				    (!vlan_eth_type_set && vlan_present))
>  					mnl_attr_put_u16
>  						(nlh,
>  						 vlan_present ?
> 
> TCA_FLOWER_KEY_VLAN_ETH_TYPE :
> 
> TCA_FLOWER_KEY_ETH_TYPE,
>  						 RTE_BE16(ETH_P_IPV6));
> -				}
>  				eth_type_set = 1;
>  				vlan_eth_type_set = 1;
>  				if (mask.ipv6 ==
> &flow_tcf_mask_empty.ipv6)
> --
> 1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-22 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 17:44 [dpdk-dev] [PATCH] net/mlx5: fix VLAN inner ethernet type on E-Switch Viacheslav Ovsiienko
2018-11-22 11:42 ` Shahaf Shuler

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).