提交 11a85d75 编写于 作者: Y Yuval Mintz 提交者: David S. Miller

qed: Prevent VFs from pause flooding

Firmware would silently drop any control frame sent by VF to prevent
a malicious VF from generating pause flood in the network.
Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a044df83
...@@ -101,6 +101,9 @@ int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn, ...@@ -101,6 +101,9 @@ int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn,
p_ramrod->tx_switching_en = p_params->tx_switching; p_ramrod->tx_switching_en = p_params->tx_switching;
p_ramrod->ctl_frame_mac_check_en = !!p_params->check_mac;
p_ramrod->ctl_frame_ethtype_check_en = !!p_params->check_ethtype;
/* Software Function ID in hwfn (PFs are 0 - 15, VFs are 16 - 135) */ /* Software Function ID in hwfn (PFs are 0 - 15, VFs are 16 - 135) */
p_ramrod->sw_fid = qed_concrete_to_sw_fid(p_hwfn->cdev, p_ramrod->sw_fid = qed_concrete_to_sw_fid(p_hwfn->cdev,
p_params->concrete_fid); p_params->concrete_fid);
......
...@@ -102,6 +102,8 @@ struct qed_sp_vport_start_params { ...@@ -102,6 +102,8 @@ struct qed_sp_vport_start_params {
u16 opaque_fid; u16 opaque_fid;
u8 vport_id; u8 vport_id;
u16 mtu; u16 mtu;
bool check_mac;
bool check_ethtype;
}; };
int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn, int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn,
......
...@@ -1680,6 +1680,7 @@ static void qed_iov_vf_mbx_start_vport(struct qed_hwfn *p_hwfn, ...@@ -1680,6 +1680,7 @@ static void qed_iov_vf_mbx_start_vport(struct qed_hwfn *p_hwfn,
params.vport_id = vf->vport_id; params.vport_id = vf->vport_id;
params.max_buffers_per_cqe = start->max_buffers_per_cqe; params.max_buffers_per_cqe = start->max_buffers_per_cqe;
params.mtu = vf->mtu; params.mtu = vf->mtu;
params.check_mac = true;
rc = qed_sp_eth_vport_start(p_hwfn, &params); rc = qed_sp_eth_vport_start(p_hwfn, &params);
if (rc) { if (rc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册