Skip to content

Commit

Permalink
net: hns3: refactor mailbox response scheme between PF and VF
Browse files Browse the repository at this point in the history
Currently, PF responds to VF depending on what mailbox it is
handling, it is a bit inflexible. The correct way is, PF should
check the mbx_need_resp field to decide whether gives response
to VF.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Huazhong Tan authored and davem330 committed Mar 22, 2020
1 parent d341001 commit bb5790b
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 155 deletions.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ struct hclgevf_mbx_resp_status {
u8 additional_info[HCLGE_MBX_MAX_RESP_DATA_SIZE];
};

struct hclge_respond_to_vf_msg {
int status;
u8 data[HCLGE_MBX_MAX_RESP_DATA_SIZE];
u16 len;
};

struct hclge_vf_to_pf_msg {
u8 code;
union {
Expand Down Expand Up @@ -127,7 +133,7 @@ struct hclge_mbx_vf_to_pf_cmd {
struct hclge_vf_to_pf_msg msg;
};

#define HCLGE_MBX_NEED_RESP_BIT BIT(0)
#define HCLGE_MBX_NEED_RESP_B 0

struct hclge_mbx_pf_to_vf_cmd {
u8 dest_vfid;
Expand Down
Loading

0 comments on commit bb5790b

Please sign in to comment.