diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 3734cfb7559612bcd043d3686fad2ef4c030e171..242a4efb97e28297b4335254cd32550e7b461223 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -1488,6 +1488,13 @@ static int hns_nic_net_open(struct net_device *ndev) return ret; } + /** + * The MAC is not XGE, we select fixed xmit queue. Mac0 select tx1, + * mac1 select tx2, and so on. + */ + if (!(h->if_support & SUPPORTED_10000baseKR_Full)) + priv->tx_queue = h->eport_id + 1; + ret = hns_nic_net_up(ndev); if (ret) { netdev_err(ndev, @@ -2029,6 +2036,10 @@ hns_nic_select_queue(struct net_device *ndev, struct sk_buff *skb, is_multicast_ether_addr(eth_hdr->h_dest)) return 0; + /* if netdev init select queue, apply it. */ + if (priv->tx_queue) + return priv->tx_queue; + ring = hns_calc_tx_ring_idx(priv, skb); if (ring != INVALID_TX_RING) return ring; diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.h b/drivers/net/ethernet/hisilicon/hns/hns_enet.h index 26e9afcbdd50f77642d6455a6cea20b2ffc8032c..1b786bc9f82ad12730c2452fa543213c29fcb370 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.h +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.h @@ -82,6 +82,8 @@ struct hns_nic_priv { struct work_struct service_task; struct notifier_block notifier_block; + + u16 tx_queue; }; #define tx_ring_data(priv, idx) ((priv)->ring_data[idx])