All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v2] i40e: Fix add tc filter for IPv6
@ 2021-02-23 13:58 Mateusz Palczewski
  2021-02-23 14:00 ` Palczewski, Mateusz
  0 siblings, 1 reply; 2+ messages in thread
From: Mateusz Palczewski @ 2021-02-23 13:58 UTC (permalink / raw)
  To: intel-wired-lan

Fix insufficient distinction between IPv4 and IPv6 addresses
when creating a filter.
IPv4 and IPv6 are kept in the same memory area. If IPv6 is added,
then it's caught by IPv4 check, which leads to err -95.

Change-Id: I92412cb419d29bb6ce4decbc7c1cd73df9b4db5d
Title: i40e: Fix add tc filter for IPv6
Change-type: DefectResolution
HSDES-Number: 1806493117
HSDES-Tenant: server_platf_lan.bug
Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: nosbuild <nosbuild@intel.com>
Reviewed-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
---
v2: Added space after Fixes tag hash
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 630258e..bb87164 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8115,7 +8115,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
 		return -EOPNOTSUPP;
 
 	/* adding filter using src_port/src_ip is not supported at this stage */
-	if (filter->src_port || filter->src_ipv4 ||
+	if (filter->src_port ||
+	    (filter->src_ipv4 && filter->n_proto != ETH_P_IPV6) ||
 	    !ipv6_addr_any(&filter->ip.v6.src_ip6))
 		return -EOPNOTSUPP;
 
@@ -8144,7 +8145,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
 			cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT);
 		}
 
-	} else if (filter->dst_ipv4 ||
+	} else if ((filter->dst_ipv4 && filter->n_proto != ETH_P_IPV6) ||
 		   !ipv6_addr_any(&filter->ip.v6.dst_ip6)) {
 		cld_filter.element.flags =
 				cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_IP_PORT);
-- 
2.17.1


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

* [Intel-wired-lan] [PATCH net v2] i40e: Fix add tc filter for IPv6
  2021-02-23 13:58 [Intel-wired-lan] [PATCH net v2] i40e: Fix add tc filter for IPv6 Mateusz Palczewski
@ 2021-02-23 14:00 ` Palczewski, Mateusz
  0 siblings, 0 replies; 2+ messages in thread
From: Palczewski, Mateusz @ 2021-02-23 14:00 UTC (permalink / raw)
  To: intel-wired-lan

Sent the wrong version of the patch, will resent the v3 version. 

-----Original Message-----
From: Palczewski, Mateusz <mateusz.palczewski@intel.com> 
Sent: wtorek, 23 lutego 2021 14:58
To: intel-wired-lan@lists.osuosl.org
Cc: Palczewski, Mateusz <mateusz.palczewski@intel.com>; Szczurek, GrzegorzX <grzegorzx.szczurek@intel.com>
Subject: [PATCH net v2] i40e: Fix add tc filter for IPv6

Fix insufficient distinction between IPv4 and IPv6 addresses when creating a filter.
IPv4 and IPv6 are kept in the same memory area. If IPv6 is added, then it's caught by IPv4 check, which leads to err -95.

Change-Id: I92412cb419d29bb6ce4decbc7c1cd73df9b4db5d
Title: i40e: Fix add tc filter for IPv6
Change-type: DefectResolution
HSDES-Number: 1806493117
HSDES-Tenant: server_platf_lan.bug
Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: nosbuild <nosbuild@intel.com>
Reviewed-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
---
v2: Added space after Fixes tag hash
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 630258e..bb87164 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8115,7 +8115,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
 		return -EOPNOTSUPP;
 
 	/* adding filter using src_port/src_ip is not supported at this stage */
-	if (filter->src_port || filter->src_ipv4 ||
+	if (filter->src_port ||
+	    (filter->src_ipv4 && filter->n_proto != ETH_P_IPV6) ||
 	    !ipv6_addr_any(&filter->ip.v6.src_ip6))
 		return -EOPNOTSUPP;
 
@@ -8144,7 +8145,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
 			cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT);
 		}
 
-	} else if (filter->dst_ipv4 ||
+	} else if ((filter->dst_ipv4 && filter->n_proto != ETH_P_IPV6) ||
 		   !ipv6_addr_any(&filter->ip.v6.dst_ip6)) {
 		cld_filter.element.flags =
 				cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_IP_PORT);
--
2.17.1


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

end of thread, other threads:[~2021-02-23 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 13:58 [Intel-wired-lan] [PATCH net v2] i40e: Fix add tc filter for IPv6 Mateusz Palczewski
2021-02-23 14:00 ` Palczewski, Mateusz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.