From 706887a33d5135589c14c05bf9746b645d4b1901 Mon Sep 17 00:00:00 2001 From: yuzhitao Date: Tue, 23 Apr 2019 17:17:43 +0800 Subject: [PATCH] net: hns: fix GE receive performance in particular scene. driver inclusion category: bugfix bugzilla: NA CVE: NA When we run 10 threads as iperf client in arm GE port and run one thread in other side which using i350 on X86, in this situation, the X86 iperf data is only about 100M. Reviewed-by: Weiwei Deng Signed-off-by: yuzhitao Reviewed-by: liuyonglong Reviewed-by: lipeng Reviewed-by: Hanjun Guo Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 11 +++++++++++ drivers/net/ethernet/hisilicon/hns/hns_enet.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 3734cfb75596..242a4efb97e2 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 26e9afcbdd50..1b786bc9f82a 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]) -- GitLab