Skip to content

Commit

Permalink
net/hns3: remove redundant mailbox response
Browse files Browse the repository at this point in the history
[ upstream commit 17ff952 ]

Some mbx messages do not need to reply with data. In this case,
it is no need to set the response data address and the response
length.

This patch removes these redundant codes from mbx messages that do
not need be replied.

Fixes: a5475d6 ("net/hns3: support VF")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and steevenlee committed May 8, 2021
1 parent 5c61f0e commit 2782c99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/hns3/hns3_ethdev_vf.c
Expand Up @@ -1455,13 +1455,12 @@ hns3vf_set_tc_queue_mapping(struct hns3_adapter *hns, uint16_t nb_rx_q,
static void
hns3vf_request_link_info(struct hns3_hw *hw)
{
uint8_t resp_msg;
int ret;

if (rte_atomic16_read(&hw->reset.resetting))
return;
ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_LINK_STATUS, 0, NULL, 0, false,
&resp_msg, sizeof(resp_msg));
NULL, 0);
if (ret)
hns3_err(hw, "Failed to fetch link status from PF: %d", ret);
}
Expand Down Expand Up @@ -1657,11 +1656,10 @@ hns3vf_keep_alive_handler(void *param)
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
struct hns3_adapter *hns = eth_dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
uint8_t respmsg;
int ret;

ret = hns3_send_mbx_msg(hw, HNS3_MBX_KEEP_ALIVE, 0, NULL, 0,
false, &respmsg, sizeof(uint8_t));
false, NULL, 0);
if (ret)
hns3_err(hw, "VF sends keeping alive cmd failed(=%d)",
ret);
Expand Down

0 comments on commit 2782c99

Please sign in to comment.