summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hns_enet.c
diff options
context:
space:
mode:
authorSheng Li <lisheng011@huawei.com>2016-03-22 08:06:23 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-03-22 19:45:57 (GMT)
commitf8a1a636c2a940d37dba9153bcfe687a802745fb (patch)
tree3accd53d992e8623ba6fcc15f83eac57a920eaaa /drivers/net/ethernet/hisilicon/hns/hns_enet.c
parent0d6b425a3773c3445b0f51b2f333821beaacb619 (diff)
downloadlinux-f8a1a636c2a940d37dba9153bcfe687a802745fb.tar.xz
net: hns: fixed portid bug in sending manage pkt
In chip V2, the default value of port id in tx BD is Zero. If it is not configurated to the other value, all management packets will be sent out from port0. So port_id in the tx BD needs to be updated when sending a management packet. In V2 chip, when sending mamagement packets, the driver should config the port id to BD descs. Signed-off-by: Sheng Li <lisheng011@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_enet.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index ef84bd7..ef517af 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -66,10 +66,14 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
desc->addr = cpu_to_le64(dma);
desc->tx.send_size = cpu_to_le16((u16)size);
- /*config bd buffer end */
+ /* config bd buffer end */
hnae_set_bit(rrcfv, HNSV2_TXD_VLD_B, 1);
hnae_set_field(bn_pid, HNSV2_TXD_BUFNUM_M, 0, buf_num - 1);
+ /* fill port_id in the tx bd for sending management pkts */
+ hnae_set_field(bn_pid, HNSV2_TXD_PORTID_M,
+ HNSV2_TXD_PORTID_S, ring->q->handle->dport_id);
+
if (type == DESC_TYPE_SKB) {
skb = (struct sk_buff *)priv;