Skip to contentSkip to conversation

cxgb4: fix issues in rule processing for tc-flower offload

PATCH In review Rahul Lakkireddy 2 participants 4 messages Jan 17, 2018 – Jan 22, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover cxgb4: fix issues in rule processing for tc-flower offload

Patch 1 sets filter type to indicate IPv6 when processing flow match parameters.

Patch 2 fixes endianness issue when processing vlan flow match parameters.

Kumar Sanghvi (2):
cxgb4: set filter type to 1 for ETH_P_IPV6
cxgb4: fix endianness for vlan value in cxgb4_tc_flower

 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/2 cxgb4: set filter type to 1 for ETH_P_IPV6

From: Kumar Sanghvi <[email protected]>

For ethtype_key = ETH_P_IPV6, set filter type as 1 in cxgb4_tc_flower code when processing flow match parameters.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +3 -0
index d4a548a6a55c..276edcbb3259 100644
@@ -111,6 +111,9 @@ static void cxgb4_process_flow_match(struct net_device *dev,
 			ethtype_mask = 0;
 		}
 
+		if (ethtype_key == ETH_P_IPV6)
+			fs->type = 1;
+
 		fs->val.ethtype = ethtype_key;
 		fs->mask.ethtype = ethtype_mask;
 		fs->val.proto = key->ip_proto;
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/2 cxgb4: fix endianness for vlan value in cxgb4_tc_flower

In reply to Rahul Lakkireddy

From: Kumar Sanghvi <[email protected]>

Don't change endianness when assigning vlan value in cxgb4_tc_flower code when processing flow match parameters. The value gets converted to network order as part of filtering code in set_filter_wr.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +2 -2
index 276edcbb3259..a452d5a1b0f3 100644
@@ -208,8 +208,8 @@ static void cxgb4_process_flow_match(struct net_device *dev,
 					   VLAN_PRIO_SHIFT);
 		vlan_tci_mask = mask->vlan_id | (mask->vlan_priority <<
 						 VLAN_PRIO_SHIFT);
-		fs->val.ivlan = cpu_to_be16(vlan_tci);
-		fs->mask.ivlan = cpu_to_be16(vlan_tci_mask);
+		fs->val.ivlan = vlan_tci;
+		fs->mask.ivlan = vlan_tci_mask;
 
 		/* Chelsio adapters use ivlan_vld bit to match vlan packets
 		 * as 802.1Q. Also, when vlan tag is present in packets,
Signature · 1 line
2.14.1
maintainer
#3 lore raw
In reply to Rahul Lakkireddy

From: Rahul Lakkireddy <[email protected]>
Date: Wed, 17 Jan 2018 12:13:32 +0530

Quoted 4 lines

Patch 1 sets filter type to indicate IPv6 when processing flow match parameters.

Patch 2 fixes endianness issue when processing vlan flow match parameters.

Series applied, thank you.