X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_mbx.c;h=b03a3d6a174e3fc9b599655929514635a5036e91;hb=40486d38496241711955fc752ff4a6db4c89da7f;hp=0d03f50644152082703c4508eb86577639826766;hpb=c05e0c5b74277e6e72a3b4ad8ae62bce0f03ce80;p=dpdk.git diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c index 0d03f50644..b03a3d6a17 100644 --- a/drivers/net/hns3/hns3_mbx.c +++ b/drivers/net/hns3/hns3_mbx.c @@ -324,6 +324,21 @@ hns3_handle_link_change_event(struct hns3_hw *hw, hns3_update_link_status(hw); } +static void +hns3_handle_promisc_info(struct hns3_hw *hw, uint16_t promisc_en) +{ + if (!promisc_en) { + /* + * When promisc/allmulti mode is closed by the hns3 PF kernel + * ethdev driver for untrusted, modify VF's related status. + */ + hns3_warn(hw, "Promisc mode will be closed by host for being " + "untrusted."); + hw->data->promiscuous = 0; + hw->data->all_multicast = 0; + } +} + void hns3_dev_handle_mbx_msg(struct hns3_hw *hw) { @@ -380,6 +395,14 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw) case HNS3_MBX_PUSH_LINK_STATUS: hns3_handle_link_change_event(hw, req); break; + case HNS3_MBX_PUSH_PROMISC_INFO: + /* + * When the trust status of VF device changed by the + * hns3 PF kernel driver, VF driver will receive this + * mailbox message from PF driver. + */ + hns3_handle_promisc_info(hw, req->msg[1]); + break; default: hns3_err(hw, "VF received unsupported(%d) mbx msg from PF",