Commit 897d7846 authored by Amir Vadai's avatar Amir Vadai Committed by David S. Miller

net/mlx4_en: sk_prio <=> UP for untagged traffic

Since vlan egress map is only good for tagged traffic, need to have other
mapping to be used by untagged traffic.
For that, the driver uses sch_mqprio mapping. This mapping could be set by
using tc tool from iproute2 package.
Mapped UP will be used by the HW for QoS purposes, but won't go out on the
wire.
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 564c274c
...@@ -45,6 +45,14 @@ ...@@ -45,6 +45,14 @@
#include "mlx4_en.h" #include "mlx4_en.h"
#include "en_port.h" #include "en_port.h"
static int mlx4_en_setup_tc(struct net_device *dev, u8 up)
{
if (up != MLX4_EN_NUM_UP)
return -EINVAL;
return 0;
}
static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
{ {
struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_priv *priv = netdev_priv(dev);
...@@ -1038,6 +1046,7 @@ static const struct net_device_ops mlx4_netdev_ops = { ...@@ -1038,6 +1046,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
.ndo_poll_controller = mlx4_en_netpoll, .ndo_poll_controller = mlx4_en_netpoll,
#endif #endif
.ndo_set_features = mlx4_en_set_features, .ndo_set_features = mlx4_en_set_features,
.ndo_setup_tc = mlx4_en_setup_tc,
}; };
int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
...@@ -1119,6 +1128,15 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, ...@@ -1119,6 +1128,15 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
netif_set_real_num_tx_queues(dev, priv->tx_ring_num); netif_set_real_num_tx_queues(dev, priv->tx_ring_num);
netif_set_real_num_rx_queues(dev, priv->rx_ring_num); netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
netdev_set_num_tc(dev, MLX4_EN_NUM_UP);
/* First 9 rings are for UP 0 */
netdev_set_tc_queue(dev, 0, MLX4_EN_NUM_TX_RINGS + 1, 0);
/* Partition Tx queues evenly amongst UP's 1-7 */
for (i = 1; i < MLX4_EN_NUM_UP; i++)
netdev_set_tc_queue(dev, i, 1, MLX4_EN_NUM_TX_RINGS + i);
SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops); SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops);
/* Set defualt MAC */ /* Set defualt MAC */
......
...@@ -577,7 +577,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb) ...@@ -577,7 +577,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb)
return MLX4_EN_NUM_TX_RINGS + (vlan_tag >> 13); return MLX4_EN_NUM_TX_RINGS + (vlan_tag >> 13);
} }
return __skb_tx_hash(dev, skb, MLX4_EN_NUM_TX_RINGS); return skb_tx_hash(dev, skb);
} }
static void mlx4_bf_copy(void __iomem *dst, unsigned long *src, unsigned bytecnt) static void mlx4_bf_copy(void __iomem *dst, unsigned long *src, unsigned bytecnt)
......
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