aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmritha Nambiar <amritha.nambiar@intel.com>2016-03-09 18:32:16 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-04 20:44:56 -0400
commit4ae7834221679bff2d7f75ba80a20673cecb38ad (patch)
tree1e092a0f8de947c4799ec3339aeb51a79eb39b48
parentdbd15b8f9cc3f0f8d665d048a31c0f4b5c9150a5 (diff)
ixgbe: Extend cls_u32 offload to support UDP headers
Added support to match on UDP fields in the transport layer. Extended core logic to support multiple headers. Verified with the following filters : handle 1: u32 divisor 1 u32 ht 800: order 1 link 1: \ offset at 0 mask 0f00 shift 6 plus 0 eat match ip protocol 6 ff u32 ht 1: order 2 \ match tcp src 1024 ffff match tcp dst 23 ffff action drop handle 2: u32 divisor 1 u32 ht 800: order 3 link 2: \ offset at 0 mask 0f00 shift 6 plus 0 eat match ip protocol 17 ff u32 ht 2: order 4 \ match udp src 1025 ffff match udp dst 24 ffff action drop Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Acked-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c19
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_model.h8
2 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 77c1c85a957c..359869cf5b09 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8257,19 +8257,20 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
8257 return -EINVAL; 8257 return -EINVAL;
8258 8258
8259 for (i = 0; nexthdr[i].jump; i++) { 8259 for (i = 0; nexthdr[i].jump; i++) {
8260 if (nexthdr->o != cls->knode.sel->offoff || 8260 if (nexthdr[i].o != cls->knode.sel->offoff ||
8261 nexthdr->s != cls->knode.sel->offshift || 8261 nexthdr[i].s != cls->knode.sel->offshift ||
8262 nexthdr->m != cls->knode.sel->offmask || 8262 nexthdr[i].m != cls->knode.sel->offmask ||
8263 /* do not support multiple key jumps its just mad */ 8263 /* do not support multiple key jumps its just mad */
8264 cls->knode.sel->nkeys > 1) 8264 cls->knode.sel->nkeys > 1)
8265 return -EINVAL; 8265 return -EINVAL;
8266 8266
8267 if (nexthdr->off != cls->knode.sel->keys[0].off || 8267 if (nexthdr[i].off == cls->knode.sel->keys[0].off &&
8268 nexthdr->val != cls->knode.sel->keys[0].val || 8268 nexthdr[i].val == cls->knode.sel->keys[0].val &&
8269 nexthdr->mask != cls->knode.sel->keys[0].mask) 8269 nexthdr[i].mask == cls->knode.sel->keys[0].mask) {
8270 return -EINVAL; 8270 adapter->jump_tables[link_uhtid] =
8271 8271 nexthdr[i].jump;
8272 adapter->jump_tables[link_uhtid] = nexthdr->jump; 8272 break;
8273 }
8273 } 8274 }
8274 return 0; 8275 return 0;
8275 } 8276 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h
index 74c53ad9d268..60adde55a8c3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h
@@ -82,6 +82,12 @@ static struct ixgbe_mat_field ixgbe_tcp_fields[] = {
82 { .val = NULL } /* terminal node */ 82 { .val = NULL } /* terminal node */
83}; 83};
84 84
85static struct ixgbe_mat_field ixgbe_udp_fields[] = {
86 {.off = 0, .val = ixgbe_mat_prgm_ports,
87 .type = IXGBE_ATR_FLOW_TYPE_UDPV4},
88 { .val = NULL } /* terminal node */
89};
90
85struct ixgbe_nexthdr { 91struct ixgbe_nexthdr {
86 /* offset, shift, and mask of position to next header */ 92 /* offset, shift, and mask of position to next header */
87 unsigned int o; 93 unsigned int o;
@@ -98,6 +104,8 @@ struct ixgbe_nexthdr {
98static struct ixgbe_nexthdr ixgbe_ipv4_jumps[] = { 104static struct ixgbe_nexthdr ixgbe_ipv4_jumps[] = {
99 { .o = 0, .s = 6, .m = 0xf, 105 { .o = 0, .s = 6, .m = 0xf,
100 .off = 8, .val = 0x600, .mask = 0xff00, .jump = ixgbe_tcp_fields}, 106 .off = 8, .val = 0x600, .mask = 0xff00, .jump = ixgbe_tcp_fields},
107 { .o = 0, .s = 6, .m = 0xf,
108 .off = 8, .val = 0x1100, .mask = 0xff00, .jump = ixgbe_udp_fields},
101 { .jump = NULL } /* terminal node */ 109 { .jump = NULL } /* terminal node */
102}; 110};
103#endif /* _IXGBE_MODEL_H_ */ 111#endif /* _IXGBE_MODEL_H_ */