net: ixgbe: Match on multiple headers for cls_u32 offloads
Subsystems (2)
PATCH 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
--- drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 215 +++++++++++++++++------- drivers/net/ethernet/intel/ixgbe/ixgbe_model.h | 6 + 3 files changed, 155 insertions(+), 68 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe.h +1 -1
@@ -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 +148 -67
306 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_model.h +6 -0
@@ -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)
kbuild test robot
build botreproduce:
Hi Amritha,
[auto build test ERROR on jkirsher-next-queue/dev-queue]
[cannot apply to v4.6-rc3 next-20160413]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Amritha-Nambiar/net-ixgbe-Match-on-multiple-headers-for-cls_u32-offloads/20160414-073100 base: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue config: i386-randconfig-x003-201615 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c: In function 'ixgbe_sw_init':
>> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:5617:7: error: 'j' undeclared (first use in this function)
for (j = 1; j < IXGBE_MAX_LINK_HANDLE; j++)
^ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:5617:7: note: each undeclared identifier is reported only once for each function it appears in
vim +/j +5617 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
5611 adapter->jump_tables[0] = kzalloc(sizeof(*adapter->jump_tables[0]),
5612 GFP_KERNEL);
5613 if (!adapter->jump_tables[0])
5614 return -ENOMEM;
5615 adapter->jump_tables[0]->mat = ixgbe_ipv4_fields;
5616
> 5617 for (j = 1; j < IXGBE_MAX_LINK_HANDLE; j++)
5618 adapter->jump_tables[j] = NULL;
5619
5620 adapter->mac_table = kzalloc(sizeof(struct ixgbe_mac_addr) *
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 30233 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160414/0ba3ce88/attachment-0001.obj>