Skip to content

Commit 4382c7b

Browse files
Gal PressmanSaeed Mahameed
authored andcommitted
net/mlx5e: Add 802.1ad VLAN insertion support
Report VLAN insertion support for S-tagged packets and add support by choosing the correct VLAN type in the WQE. Signed-off-by: Gal Pressman <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 7d92d58 commit 4382c7b

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4194,6 +4194,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
41944194
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX;
41954195
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
41964196
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
4197+
netdev->hw_features |= NETIF_F_HW_VLAN_STAG_TX;
41974198

41984199
if (mlx5e_vxlan_allowed(mdev) || MLX5_CAP_ETH(mdev, tunnel_stateless_gre)) {
41994200
netdev->hw_features |= NETIF_F_GSO_PARTIAL;

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
369369
ds_cnt += DIV_ROUND_UP(ihs - sizeof(eseg->inline_hdr.start), MLX5_SEND_WQE_DS);
370370
} else if (skb_vlan_tag_present(skb)) {
371371
eseg->insert.type = cpu_to_be16(MLX5_ETH_WQE_INSERT_VLAN);
372+
if (skb->vlan_proto == cpu_to_be16(ETH_P_8021AD))
373+
eseg->insert.type |= cpu_to_be16(MLX5_ETH_WQE_SVLAN);
372374
eseg->insert.vlan_tci = cpu_to_be16(skb_vlan_tag_get(skb));
373375
}
374376

include/linux/mlx5/qp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ enum {
221221
};
222222

223223
enum {
224+
MLX5_ETH_WQE_SVLAN = 1 << 0,
224225
MLX5_ETH_WQE_INSERT_VLAN = 1 << 15,
225226
};
226227

0 commit comments

Comments
 (0)