diff options
author | Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com> | 2018-09-20 00:59:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-20 02:12:24 -0400 |
commit | 0216da9413afa546627a1b0d319dfd17fef34050 (patch) | |
tree | 5af7a3b09f3a98afdfb3a723c4ce832b342f4b1b | |
parent | 50fdf60181b01b7383b85d4b9acbb842263d96a2 (diff) |
qed: Do not add VLAN 0 tag to untagged frames in multi-function mode.
In certain multi-function switch dependent modes, firmware adds vlan tag 0
to the untagged frames. This leads to double tagging for the traffic
if the dcbx is enabled, which is not the desired behavior. To avoid this,
driver needs to set "dcb_dont_add_vlan0" flag.
Fixes: cac6f691 ("qed: Add support for Unified Fabric Port")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dcbx.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index 6bb76e6d3c14..d53f33c6b1fc 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c | |||
@@ -190,6 +190,7 @@ qed_dcbx_dp_protocol(struct qed_hwfn *p_hwfn, struct qed_dcbx_results *p_data) | |||
190 | 190 | ||
191 | static void | 191 | static void |
192 | qed_dcbx_set_params(struct qed_dcbx_results *p_data, | 192 | qed_dcbx_set_params(struct qed_dcbx_results *p_data, |
193 | struct qed_hwfn *p_hwfn, | ||
193 | struct qed_hw_info *p_info, | 194 | struct qed_hw_info *p_info, |
194 | bool enable, | 195 | bool enable, |
195 | u8 prio, | 196 | u8 prio, |
@@ -206,6 +207,11 @@ qed_dcbx_set_params(struct qed_dcbx_results *p_data, | |||
206 | else | 207 | else |
207 | p_data->arr[type].update = DONT_UPDATE_DCB_DSCP; | 208 | p_data->arr[type].update = DONT_UPDATE_DCB_DSCP; |
208 | 209 | ||
210 | /* Do not add vlan tag 0 when DCB is enabled and port in UFP/OV mode */ | ||
211 | if ((test_bit(QED_MF_8021Q_TAGGING, &p_hwfn->cdev->mf_bits) || | ||
212 | test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits))) | ||
213 | p_data->arr[type].dont_add_vlan0 = true; | ||
214 | |||
209 | /* QM reconf data */ | 215 | /* QM reconf data */ |
210 | if (p_info->personality == personality) | 216 | if (p_info->personality == personality) |
211 | qed_hw_info_set_offload_tc(p_info, tc); | 217 | qed_hw_info_set_offload_tc(p_info, tc); |
@@ -231,7 +237,7 @@ qed_dcbx_update_app_info(struct qed_dcbx_results *p_data, | |||
231 | 237 | ||
232 | personality = qed_dcbx_app_update[i].personality; | 238 | personality = qed_dcbx_app_update[i].personality; |
233 | 239 | ||
234 | qed_dcbx_set_params(p_data, p_info, enable, | 240 | qed_dcbx_set_params(p_data, p_hwfn, p_info, enable, |
235 | prio, tc, type, personality); | 241 | prio, tc, type, personality); |
236 | } | 242 | } |
237 | } | 243 | } |
@@ -954,6 +960,7 @@ static void qed_dcbx_update_protocol_data(struct protocol_dcb_data *p_data, | |||
954 | p_data->dcb_enable_flag = p_src->arr[type].enable; | 960 | p_data->dcb_enable_flag = p_src->arr[type].enable; |
955 | p_data->dcb_priority = p_src->arr[type].priority; | 961 | p_data->dcb_priority = p_src->arr[type].priority; |
956 | p_data->dcb_tc = p_src->arr[type].tc; | 962 | p_data->dcb_tc = p_src->arr[type].tc; |
963 | p_data->dcb_dont_add_vlan0 = p_src->arr[type].dont_add_vlan0; | ||
957 | } | 964 | } |
958 | 965 | ||
959 | /* Set pf update ramrod command params */ | 966 | /* Set pf update ramrod command params */ |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h index a4d688c04e18..01f253ea4b22 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.h +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.h | |||
@@ -55,6 +55,7 @@ struct qed_dcbx_app_data { | |||
55 | u8 update; /* Update indication */ | 55 | u8 update; /* Update indication */ |
56 | u8 priority; /* Priority */ | 56 | u8 priority; /* Priority */ |
57 | u8 tc; /* Traffic Class */ | 57 | u8 tc; /* Traffic Class */ |
58 | bool dont_add_vlan0; /* Do not insert a vlan tag with id 0 */ | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | #define QED_DCBX_VERSION_DISABLED 0 | 61 | #define QED_DCBX_VERSION_DISABLED 0 |