]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.20/qed-fix-lacp-pdu-drops-for-vfs.patch
Linux 4.14.106
[thirdparty/kernel/stable-queue.git] / queue-4.20 / qed-fix-lacp-pdu-drops-for-vfs.patch
1 From fdcb03cbaecd25dac6af62d445ad337a174ff7ce Mon Sep 17 00:00:00 2001
2 From: Manish Chopra <manishc@marvell.com>
3 Date: Mon, 28 Jan 2019 10:05:05 -0800
4 Subject: qed: Fix LACP pdu drops for VFs
5
6 [ Upstream commit ff9296966e5e00b0d0d00477b2365a178f0f06a3 ]
7
8 VF is always configured to drop control frames
9 (with reserved mac addresses) but to work LACP
10 on the VFs, it would require LACP control frames
11 to be forwarded or transmitted successfully.
12
13 This patch fixes this in such a way that trusted VFs
14 (marked through ndo_set_vf_trust) would be allowed to
15 pass the control frames such as LACP pdus.
16
17 Signed-off-by: Manish Chopra <manishc@marvell.com>
18 Signed-off-by: Ariel Elior <aelior@marvell.com>
19 Signed-off-by: David S. Miller <davem@davemloft.net>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 drivers/net/ethernet/qlogic/qed/qed_l2.c | 5 +++++
23 drivers/net/ethernet/qlogic/qed/qed_l2.h | 3 +++
24 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 10 ++++++++--
25 3 files changed, 16 insertions(+), 2 deletions(-)
26
27 diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
28 index b8baa6fcef8e..e68ca83ae915 100644
29 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
30 +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
31 @@ -748,6 +748,11 @@ int qed_sp_vport_update(struct qed_hwfn *p_hwfn,
32 return rc;
33 }
34
35 + if (p_params->update_ctl_frame_check) {
36 + p_cmn->ctl_frame_mac_check_en = p_params->mac_chk_en;
37 + p_cmn->ctl_frame_ethtype_check_en = p_params->ethtype_chk_en;
38 + }
39 +
40 /* Update mcast bins for VFs, PF doesn't use this functionality */
41 qed_sp_update_mcast_bin(p_hwfn, p_ramrod, p_params);
42
43 diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.h b/drivers/net/ethernet/qlogic/qed/qed_l2.h
44 index 8d80f1095d17..7127d5aaac42 100644
45 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.h
46 +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.h
47 @@ -219,6 +219,9 @@ struct qed_sp_vport_update_params {
48 struct qed_rss_params *rss_params;
49 struct qed_filter_accept_flags accept_flags;
50 struct qed_sge_tpa_params *sge_tpa_params;
51 + u8 update_ctl_frame_check;
52 + u8 mac_chk_en;
53 + u8 ethtype_chk_en;
54 };
55
56 int qed_sp_vport_update(struct qed_hwfn *p_hwfn,
57 diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
58 index ca6290fa0f30..71a7af134dd8 100644
59 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
60 +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
61 @@ -1969,7 +1969,9 @@ static void qed_iov_vf_mbx_start_vport(struct qed_hwfn *p_hwfn,
62 params.vport_id = vf->vport_id;
63 params.max_buffers_per_cqe = start->max_buffers_per_cqe;
64 params.mtu = vf->mtu;
65 - params.check_mac = true;
66 +
67 + /* Non trusted VFs should enable control frame filtering */
68 + params.check_mac = !vf->p_vf_info.is_trusted_configured;
69
70 rc = qed_sp_eth_vport_start(p_hwfn, &params);
71 if (rc) {
72 @@ -5130,6 +5132,9 @@ static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn)
73 params.opaque_fid = vf->opaque_fid;
74 params.vport_id = vf->vport_id;
75
76 + params.update_ctl_frame_check = 1;
77 + params.mac_chk_en = !vf_info->is_trusted_configured;
78 +
79 if (vf_info->rx_accept_mode & mask) {
80 flags->update_rx_mode_config = 1;
81 flags->rx_accept_filter = vf_info->rx_accept_mode;
82 @@ -5147,7 +5152,8 @@ static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn)
83 }
84
85 if (flags->update_rx_mode_config ||
86 - flags->update_tx_mode_config)
87 + flags->update_tx_mode_config ||
88 + params.update_ctl_frame_check)
89 qed_sp_vport_update(hwfn, &params,
90 QED_SPQ_MODE_EBLOCK, NULL);
91 }
92 --
93 2.19.1
94