提交 706887a3 编写于 作者: Y yuzhitao 提交者: Xie XiuQi

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: NWeiwei Deng <dengweiwei@huawei.com>
Signed-off-by: Nyuzhitao <yuzhitao@huawei.com>
Reviewed-by: Nliuyonglong <liuyonglong@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7bfd843b
...@@ -1488,6 +1488,13 @@ static int hns_nic_net_open(struct net_device *ndev) ...@@ -1488,6 +1488,13 @@ static int hns_nic_net_open(struct net_device *ndev)
return ret; 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); ret = hns_nic_net_up(ndev);
if (ret) { if (ret) {
netdev_err(ndev, netdev_err(ndev,
...@@ -2029,6 +2036,10 @@ hns_nic_select_queue(struct net_device *ndev, struct sk_buff *skb, ...@@ -2029,6 +2036,10 @@ hns_nic_select_queue(struct net_device *ndev, struct sk_buff *skb,
is_multicast_ether_addr(eth_hdr->h_dest)) is_multicast_ether_addr(eth_hdr->h_dest))
return 0; 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); ring = hns_calc_tx_ring_idx(priv, skb);
if (ring != INVALID_TX_RING) if (ring != INVALID_TX_RING)
return ring; return ring;
......
...@@ -82,6 +82,8 @@ struct hns_nic_priv { ...@@ -82,6 +82,8 @@ struct hns_nic_priv {
struct work_struct service_task; struct work_struct service_task;
struct notifier_block notifier_block; struct notifier_block notifier_block;
u16 tx_queue;
}; };
#define tx_ring_data(priv, idx) ((priv)->ring_data[idx]) #define tx_ring_data(priv, idx) ((priv)->ring_data[idx])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册