Commit 96c0e861 authored by Peng Li's avatar Peng Li Committed by David S. Miller

net: hns3: Add support to enable TX/RX promisc mode for H/W rev(0x21)

HCLGE_PROMISC_TX_EN_B and HCLGE_PROMISC_RX_EN_B are not supported
on pdev revision(0x20), new revision(0x21) supports them.
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b5455a9
...@@ -484,6 +484,8 @@ struct hclge_promisc_param { ...@@ -484,6 +484,8 @@ struct hclge_promisc_param {
u8 enable; u8 enable;
}; };
#define HCLGE_PROMISC_TX_EN_B BIT(4)
#define HCLGE_PROMISC_RX_EN_B BIT(5)
#define HCLGE_PROMISC_EN_B 1 #define HCLGE_PROMISC_EN_B 1
#define HCLGE_PROMISC_EN_ALL 0x7 #define HCLGE_PROMISC_EN_ALL 0x7
#define HCLGE_PROMISC_EN_UC 0x1 #define HCLGE_PROMISC_EN_UC 0x1
......
...@@ -3586,7 +3586,14 @@ int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, ...@@ -3586,7 +3586,14 @@ int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev,
req = (struct hclge_promisc_cfg_cmd *)desc.data; req = (struct hclge_promisc_cfg_cmd *)desc.data;
req->vf_id = param->vf_id; req->vf_id = param->vf_id;
req->flag = (param->enable << HCLGE_PROMISC_EN_B);
/* HCLGE_PROMISC_TX_EN_B and HCLGE_PROMISC_RX_EN_B are not supported on
* pdev revision(0x20), new revision support them. The
* value of this two fields will not return error when driver
* send command to fireware in revision(0x20).
*/
req->flag = (param->enable << HCLGE_PROMISC_EN_B) |
HCLGE_PROMISC_TX_EN_B | HCLGE_PROMISC_RX_EN_B;
ret = hclge_cmd_send(&hdev->hw, &desc, 1); ret = hclge_cmd_send(&hdev->hw, &desc, 1);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment