Skip to contentSkip to conversation

net: ixgbe: Match on multiple headers for cls_u32 offloads

PATCH Superseded Amritha Nambiar 2 participants 2 messages Apr 14, 2016

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ixgbe: Match on multiple headers for cls_u32 offloads

Adds support to set filters with multiple header fields (L3,L4)to match on. This is achieved in the following order:
1. Create a leaf hash table for the next header.
2. Create a link to the leaf hash table from the base hash table with matches on next header type and current header fields.
3. Add filter in leaf hash table with match on next header fields and action.

Verified with the following filters :

Match TCP and DIP:

# tc qdisc add dev enp9s0f0 ingress
# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \
	handle 1: u32 divisor 1
# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \
	u32 ht 800: order 1 link 1: \
	offset at 0 mask 0f00 shift 6 plus 0 eat \
	match ip protocol 6 ff match ip dst 10.0.0.1/32
# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 1: order 1 \
	match tcp src 28 ffff action drop

Delete the filter:

# tc filter del dev enp9s0f0 parent ffff: prio 99 handle 1:0:1 u32

Match on DIP, SIP, UDP (SPort, DPort):

# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \
	handle 2: u32 divisor 1
# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \
	u32 ht 800: order 2 link 2: \
	offset at 0 mask 0f00 shift 6 plus 0 eat \
	match ip dst 15.0.0.2/32 match ip protocol 17 ff \
	match ip src 15.0.0.1/32
# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 2: order 2 \
	match udp src 30 ffff match udp dst 32 ffff action drop

v2: Rename a loop variable to fix build error

---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h       |    2 
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |  216 +++++++++++++++++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_model.h |    6 +
 3 files changed, 156 insertions(+), 68 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe.h +1 -1
index 94e39c1..e7bbe69 100644
@@ -792,7 +792,7 @@ struct ixgbe_adapter {
 	unsigned long fwd_bitmask; /* Bitmask indicating in use pools */
 
 #define IXGBE_MAX_LINK_HANDLE 10
-	struct ixgbe_mat_field *jump_tables[IXGBE_MAX_LINK_HANDLE];
+	struct ixgbe_jump_table *jump_tables[IXGBE_MAX_LINK_HANDLE];
 	unsigned long tables;
 
 /* maximum number of RETA entries among all devices supported by ixgbe
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +149 -67

313 lines not on this page · raw message

drivers/net/ethernet/intel/ixgbe/ixgbe_model.h +6 -0
index 60adde5..a8bed3d 100644
@@ -38,6 +38,12 @@ struct ixgbe_mat_field {
 	unsigned int type;
 };
 
+struct ixgbe_jump_table {
+	struct ixgbe_mat_field *mat;
+	struct ixgbe_fdir_filter *input;
+	union ixgbe_atr_input *mask;
+};
+
 static inline int ixgbe_mat_prgm_sip(struct ixgbe_fdir_filter *input,
 				     union ixgbe_atr_input *mask,
 				     u32 val, u32 m)
#1 lore raw

PATCH v2 1/1 net: ixgbe: Match on multiple headers for cls_u32 offloads

Quoted 40 lines · Amritha Nambiar

Adds support to set filters with multiple header fields (L3,L4)to match on.
This is achieved in the following order:
1. Create a leaf hash table for the next header.
2. Create a link to the leaf hash table from the base hash table with ?? matches on next header type and current header fields.
3. Add filter in leaf hash table with match on next header fields and ?? action.

Verified with the following filters :

Match TCP and DIP:

# tc qdisc add dev enp9s0f0 ingress
# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \
????????handle 1: u32 divisor 1
# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \
????????u32 ht 800: order 1 link 1: \
????????offset at 0 mask 0f00 shift 6 plus 0 eat \
????????match ip protocol 6 ff match ip dst 10.0.0.1/32
# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 1: order
1 \
????????match tcp src 28 ffff action drop

Delete the filter:

# tc filter del dev enp9s0f0 parent ffff: prio 99 handle 1:0:1 u32

Match on DIP, SIP, UDP (SPort, DPort):

# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \
????????handle 2: u32 divisor 1
# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \
????????u32 ht 800: order 2 link 2: \
????????offset at 0 mask 0f00 shift 6 plus 0 eat \
????????match ip dst 15.0.0.2/32 match ip protocol 17 ff \
????????match ip src 15.0.0.1/32
# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 2: order
2 \
????????match udp src 30 ffff match udp dst 32 ffff action drop
Quoted 7 lines

v2: Rename a loop variable to fix build error
---
?drivers/net/ethernet/intel/ixgbe/ixgbe.h?????? |??? 2? ?drivers/net/ethernet/intel/ixgbe/ixgbe_main.c? |? 216
+++++++++++++++++-------
?drivers/net/ethernet/intel/ixgbe/ixgbe_model.h |??? 6 + ?3 files changed, 156 insertions(+), 68 deletions(-)

Dropping because patch does not apply.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160413/c060ba16/attachment.asc>