Commit fc53b4a7 authored by Pieter Jansen van Vuuren's avatar Pieter Jansen van Vuuren Committed by David S. Miller

nfp: add IPv6 ttl and tos match offloading support

Previously matching on IPv6 ttl and tos fields were not offloaded. This
patch enables offloading IPv6 ttl and tos as match fields.
Signed-off-by: default avatarPieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a1e9203c
...@@ -194,7 +194,6 @@ nfp_flower_compile_ipv6(struct nfp_flower_ipv6 *frame, ...@@ -194,7 +194,6 @@ nfp_flower_compile_ipv6(struct nfp_flower_ipv6 *frame,
struct flow_dissector_key_ipv6_addrs *addr; struct flow_dissector_key_ipv6_addrs *addr;
struct flow_dissector_key_basic *basic; struct flow_dissector_key_basic *basic;
/* Wildcard LABEL/TOS/TTL for now. */
memset(frame, 0, sizeof(struct nfp_flower_ipv6)); memset(frame, 0, sizeof(struct nfp_flower_ipv6));
if (dissector_uses_key(flow->dissector, if (dissector_uses_key(flow->dissector,
...@@ -212,6 +211,16 @@ nfp_flower_compile_ipv6(struct nfp_flower_ipv6 *frame, ...@@ -212,6 +211,16 @@ nfp_flower_compile_ipv6(struct nfp_flower_ipv6 *frame,
target); target);
frame->proto = basic->ip_proto; frame->proto = basic->ip_proto;
} }
if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_IP)) {
struct flow_dissector_key_ip *flow_ip;
flow_ip = skb_flow_dissector_target(flow->dissector,
FLOW_DISSECTOR_KEY_IP,
target);
frame->tos = flow_ip->tos;
frame->ttl = flow_ip->ttl;
}
} }
static void static void
......
...@@ -135,7 +135,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls, ...@@ -135,7 +135,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls,
{ {
struct flow_dissector_key_basic *mask_basic = NULL; struct flow_dissector_key_basic *mask_basic = NULL;
struct flow_dissector_key_basic *key_basic = NULL; struct flow_dissector_key_basic *key_basic = NULL;
struct flow_dissector_key_ip *mask_ip = NULL;
u32 key_layer_two; u32 key_layer_two;
u8 key_layer; u8 key_layer;
int key_size; int key_size;
...@@ -207,11 +206,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls, ...@@ -207,11 +206,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls,
flow->key); flow->key);
} }
if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_IP))
mask_ip = skb_flow_dissector_target(flow->dissector,
FLOW_DISSECTOR_KEY_IP,
flow->mask);
if (mask_basic && mask_basic->n_proto) { if (mask_basic && mask_basic->n_proto) {
/* Ethernet type is present in the key. */ /* Ethernet type is present in the key. */
switch (key_basic->n_proto) { switch (key_basic->n_proto) {
...@@ -221,10 +215,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls, ...@@ -221,10 +215,6 @@ nfp_flower_calculate_key_layers(struct nfp_fl_key_ls *ret_key_ls,
break; break;
case cpu_to_be16(ETH_P_IPV6): case cpu_to_be16(ETH_P_IPV6):
if (mask_ip && mask_ip->tos)
return -EOPNOTSUPP;
if (mask_ip && mask_ip->ttl)
return -EOPNOTSUPP;
key_layer |= NFP_FLOWER_LAYER_IPV6; key_layer |= NFP_FLOWER_LAYER_IPV6;
key_size += sizeof(struct nfp_flower_ipv6); key_size += sizeof(struct nfp_flower_ipv6);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment