OSDN Git Service

net/mlx5e: Add VLAN ID rewrite fields
authorEli Britstein <elibr@mellanox.com>
Thu, 21 Mar 2019 22:51:40 +0000 (15:51 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 22 Mar 2019 19:09:32 +0000 (12:09 -0700)
Add VLAN ID rewrite fields as a pre-step to support this rewrite.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
include/linux/mlx5/mlx5_ifc.h

index b4967a0..1b44630 100644 (file)
@@ -1827,6 +1827,7 @@ static int parse_cls_flower(struct mlx5e_priv *priv,
 
 struct pedit_headers {
        struct ethhdr  eth;
+       struct vlan_hdr vlan;
        struct iphdr   ip4;
        struct ipv6hdr ip6;
        struct tcphdr  tcp;
@@ -1884,6 +1885,7 @@ static struct mlx5_fields fields[] = {
        OFFLOAD(SMAC_47_16, 4, eth.h_source[0], 0),
        OFFLOAD(SMAC_15_0,  2, eth.h_source[4], 0),
        OFFLOAD(ETHERTYPE,  2, eth.h_proto, 0),
+       OFFLOAD(FIRST_VID,  2, vlan.h_vlan_TCI, 0),
 
        OFFLOAD(IP_TTL, 1, ip4.ttl,   0),
        OFFLOAD(SIPV4,  4, ip4.saddr, 0),
index 3b83288..b0e17c9 100644 (file)
@@ -5110,6 +5110,7 @@ enum {
        MLX5_ACTION_IN_FIELD_OUT_DIPV6_31_0    = 0x14,
        MLX5_ACTION_IN_FIELD_OUT_SIPV4         = 0x15,
        MLX5_ACTION_IN_FIELD_OUT_DIPV4         = 0x16,
+       MLX5_ACTION_IN_FIELD_OUT_FIRST_VID     = 0x17,
        MLX5_ACTION_IN_FIELD_OUT_IPV6_HOPLIMIT = 0x47,
 };