Skip to content

Commit b8c8bf4

Browse files
Yunsheng Lindavem330
authored andcommitted
net: hns3: Fix for rx_priv_buf_alloc not setting rx shared buffer
rx_priv_buf_alloc is used to tell hardware how much buffer is used for rx direction, right now only the private buffer is assigned. For ae_dev that doesn't support DCB, private rx buffer is assigned to zero, only shared rx buffer is used. So not setting the shared rx buffer cause dropping of packet in SSU. Fixes: 46a3df9 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bb1fe9e commit b8c8bf4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ struct hclge_tx_buff_alloc {
270270

271271
struct hclge_rx_priv_buff {
272272
__le16 buf_num[HCLGE_TC_NUM];
273-
u8 rsv[8];
273+
__le16 shared_buf;
274+
u8 rsv[6];
274275
};
275276

276277
struct hclge_query_version {

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,10 @@ static int hclge_rx_priv_buf_alloc(struct hclge_dev *hdev)
16221622
cpu_to_le16(true << HCLGE_TC0_PRI_BUF_EN_B);
16231623
}
16241624

1625+
req->shared_buf =
1626+
cpu_to_le16((hdev->s_buf.buf_size >> HCLGE_BUF_UNIT_S) |
1627+
(1 << HCLGE_TC0_PRI_BUF_EN_B));
1628+
16251629
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
16261630
if (ret) {
16271631
dev_err(&hdev->pdev->dev,

0 commit comments

Comments
 (0)