diff options
author | Sheng Li <lisheng011@huawei.com> | 2016-03-22 11:06:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-22 22:45:57 +0300 |
commit | f8a1a636c2a940d37dba9153bcfe687a802745fb (patch) | |
tree | 3accd53d992e8623ba6fcc15f83eac57a920eaaa /drivers/net/ethernet/hisilicon/hns/hns_enet.c | |
parent | 0d6b425a3773c3445b0f51b2f333821beaacb619 (diff) | |
download | linux-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.c | 6 |
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 ef84bd72e3ca..ef517af870c5 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; |