diff options
4 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c index 9044496803e6..46ba0cf257c6 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/action.c +++ b/drivers/net/ethernet/netronome/nfp/flower/action.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #define NFP_FL_TUNNEL_CSUM cpu_to_be16(0x01) | 52 | #define NFP_FL_TUNNEL_CSUM cpu_to_be16(0x01) |
53 | #define NFP_FL_TUNNEL_KEY cpu_to_be16(0x04) | 53 | #define NFP_FL_TUNNEL_KEY cpu_to_be16(0x04) |
54 | #define NFP_FL_TUNNEL_GENEVE_OPT cpu_to_be16(0x0800) | 54 | #define NFP_FL_TUNNEL_GENEVE_OPT cpu_to_be16(0x0800) |
55 | #define NFP_FL_SUPPORTED_TUNNEL_INFO_FLAGS IP_TUNNEL_INFO_TX | ||
55 | #define NFP_FL_SUPPORTED_IPV4_UDP_TUN_FLAGS (NFP_FL_TUNNEL_CSUM | \ | 56 | #define NFP_FL_SUPPORTED_IPV4_UDP_TUN_FLAGS (NFP_FL_TUNNEL_CSUM | \ |
56 | NFP_FL_TUNNEL_KEY | \ | 57 | NFP_FL_TUNNEL_KEY | \ |
57 | NFP_FL_TUNNEL_GENEVE_OPT) | 58 | NFP_FL_TUNNEL_GENEVE_OPT) |
@@ -741,11 +742,16 @@ nfp_flower_loop_action(struct nfp_app *app, const struct tc_action *a, | |||
741 | nfp_fl_push_vlan(psh_v, a); | 742 | nfp_fl_push_vlan(psh_v, a); |
742 | *a_len += sizeof(struct nfp_fl_push_vlan); | 743 | *a_len += sizeof(struct nfp_fl_push_vlan); |
743 | } else if (is_tcf_tunnel_set(a)) { | 744 | } else if (is_tcf_tunnel_set(a)) { |
745 | struct ip_tunnel_info *ip_tun = tcf_tunnel_info(a); | ||
744 | struct nfp_repr *repr = netdev_priv(netdev); | 746 | struct nfp_repr *repr = netdev_priv(netdev); |
747 | |||
745 | *tun_type = nfp_fl_get_tun_from_act_l4_port(repr->app, a); | 748 | *tun_type = nfp_fl_get_tun_from_act_l4_port(repr->app, a); |
746 | if (*tun_type == NFP_FL_TUNNEL_NONE) | 749 | if (*tun_type == NFP_FL_TUNNEL_NONE) |
747 | return -EOPNOTSUPP; | 750 | return -EOPNOTSUPP; |
748 | 751 | ||
752 | if (ip_tun->mode & ~NFP_FL_SUPPORTED_TUNNEL_INFO_FLAGS) | ||
753 | return -EOPNOTSUPP; | ||
754 | |||
749 | /* Pre-tunnel action is required for tunnel encap. | 755 | /* Pre-tunnel action is required for tunnel encap. |
750 | * This checks for next hop entries on NFP. | 756 | * This checks for next hop entries on NFP. |
751 | * If none, the packet falls back before applying other actions. | 757 | * If none, the packet falls back before applying other actions. |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.h b/drivers/net/ethernet/netronome/nfp/flower/main.h index 85f8209bf007..81d941ab895c 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.h +++ b/drivers/net/ethernet/netronome/nfp/flower/main.h | |||
@@ -70,6 +70,7 @@ struct nfp_app; | |||
70 | #define NFP_FL_FEATS_GENEVE BIT(0) | 70 | #define NFP_FL_FEATS_GENEVE BIT(0) |
71 | #define NFP_FL_NBI_MTU_SETTING BIT(1) | 71 | #define NFP_FL_NBI_MTU_SETTING BIT(1) |
72 | #define NFP_FL_FEATS_GENEVE_OPT BIT(2) | 72 | #define NFP_FL_FEATS_GENEVE_OPT BIT(2) |
73 | #define NFP_FL_FEATS_VLAN_PCP BIT(3) | ||
73 | #define NFP_FL_FEATS_LAG BIT(31) | 74 | #define NFP_FL_FEATS_LAG BIT(31) |
74 | 75 | ||
75 | struct nfp_fl_mask_id { | 76 | struct nfp_fl_mask_id { |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/match.c b/drivers/net/ethernet/netronome/nfp/flower/match.c index a0c72f277faa..17acb8cc6044 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/match.c +++ b/drivers/net/ethernet/netronome/nfp/flower/match.c | |||
@@ -56,7 +56,7 @@ nfp_flower_compile_meta_tci(struct nfp_flower_meta_tci *frame, | |||
56 | FLOW_DISSECTOR_KEY_VLAN, | 56 | FLOW_DISSECTOR_KEY_VLAN, |
57 | target); | 57 | target); |
58 | /* Populate the tci field. */ | 58 | /* Populate the tci field. */ |
59 | if (flow_vlan->vlan_id) { | 59 | if (flow_vlan->vlan_id || flow_vlan->vlan_priority) { |
60 | tmp_tci = FIELD_PREP(NFP_FLOWER_MASK_VLAN_PRIO, | 60 | tmp_tci = FIELD_PREP(NFP_FLOWER_MASK_VLAN_PRIO, |
61 | flow_vlan->vlan_priority) | | 61 | flow_vlan->vlan_priority) | |
62 | FIELD_PREP(NFP_FLOWER_MASK_VLAN_VID, | 62 | FIELD_PREP(NFP_FLOWER_MASK_VLAN_VID, |
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 2edab01c3beb..bd19624f10cf 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c | |||
@@ -192,6 +192,17 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, | |||
192 | key_size += sizeof(struct nfp_flower_mac_mpls); | 192 | key_size += sizeof(struct nfp_flower_mac_mpls); |
193 | } | 193 | } |
194 | 194 | ||
195 | if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_VLAN)) { | ||
196 | struct flow_dissector_key_vlan *flow_vlan; | ||
197 | |||
198 | flow_vlan = skb_flow_dissector_target(flow->dissector, | ||
199 | FLOW_DISSECTOR_KEY_VLAN, | ||
200 | flow->mask); | ||
201 | if (!(priv->flower_ext_feats & NFP_FL_FEATS_VLAN_PCP) && | ||
202 | flow_vlan->vlan_priority) | ||
203 | return -EOPNOTSUPP; | ||
204 | } | ||
205 | |||
195 | if (dissector_uses_key(flow->dissector, | 206 | if (dissector_uses_key(flow->dissector, |
196 | FLOW_DISSECTOR_KEY_ENC_CONTROL)) { | 207 | FLOW_DISSECTOR_KEY_ENC_CONTROL)) { |
197 | struct flow_dissector_key_ipv4_addrs *mask_ipv4 = NULL; | 208 | struct flow_dissector_key_ipv4_addrs *mask_ipv4 = NULL; |