Skip to content

Commit 4ae7834

Browse files
anambiarinJeff Kirsher
authored andcommitted
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 <[email protected]> Acked-by: John Fastabend <[email protected]> Acked-by: Sridhar Samudrala <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent dbd15b8 commit 4ae7834

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8257,19 +8257,20 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
82578257
return -EINVAL;
82588258

82598259
for (i = 0; nexthdr[i].jump; i++) {
8260-
if (nexthdr->o != cls->knode.sel->offoff ||
8261-
nexthdr->s != cls->knode.sel->offshift ||
8262-
nexthdr->m != cls->knode.sel->offmask ||
8260+
if (nexthdr[i].o != cls->knode.sel->offoff ||
8261+
nexthdr[i].s != cls->knode.sel->offshift ||
8262+
nexthdr[i].m != cls->knode.sel->offmask ||
82638263
/* do not support multiple key jumps its just mad */
82648264
cls->knode.sel->nkeys > 1)
82658265
return -EINVAL;
82668266

8267-
if (nexthdr->off != cls->knode.sel->keys[0].off ||
8268-
nexthdr->val != cls->knode.sel->keys[0].val ||
8269-
nexthdr->mask != cls->knode.sel->keys[0].mask)
8270-
return -EINVAL;
8271-
8272-
adapter->jump_tables[link_uhtid] = nexthdr->jump;
8267+
if (nexthdr[i].off == cls->knode.sel->keys[0].off &&
8268+
nexthdr[i].val == cls->knode.sel->keys[0].val &&
8269+
nexthdr[i].mask == cls->knode.sel->keys[0].mask) {
8270+
adapter->jump_tables[link_uhtid] =
8271+
nexthdr[i].jump;
8272+
break;
8273+
}
82738274
}
82748275
return 0;
82758276
}

drivers/net/ethernet/intel/ixgbe/ixgbe_model.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ static struct ixgbe_mat_field ixgbe_tcp_fields[] = {
8282
{ .val = NULL } /* terminal node */
8383
};
8484

85+
static 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+
8591
struct ixgbe_nexthdr {
8692
/* offset, shift, and mask of position to next header */
8793
unsigned int o;
@@ -98,6 +104,8 @@ struct ixgbe_nexthdr {
98104
static struct ixgbe_nexthdr ixgbe_ipv4_jumps[] = {
99105
{ .o = 0, .s = 6, .m = 0xf,
100106
.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},
101109
{ .jump = NULL } /* terminal node */
102110
};
103111
#endif /* _IXGBE_MODEL_H_ */

0 commit comments

Comments
 (0)