Skip to content

Commit c271536

Browse files
committed
Revert "bnxt_en: Support QOS and TPID settings for the SRIOV VLAN"
This reverts commit e76d44f. We no longer accept drivers extending their use of the legacy SR-IOV configuration APIs. Users should move to bridge offload. Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ca6f5c2 commit c271536

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7750,8 +7750,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
77507750
bp->fw_cap |= BNXT_FW_CAP_HOT_RESET_IF;
77517751
if (BNXT_PF(bp) && (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED))
77527752
bp->fw_cap |= BNXT_FW_CAP_LIVEPATCH;
7753-
if (BNXT_PF(bp) && (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED))
7754-
bp->fw_cap |= BNXT_FW_CAP_DFLT_VLAN_TPID_PCP;
77557753

77567754
flags_ext2 = le32_to_cpu(resp->flags_ext2);
77577755
if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ struct bnxt_vf_info {
11351135
u16 vlan;
11361136
u16 func_qcfg_flags;
11371137
u32 flags;
1138+
#define BNXT_VF_QOS 0x1
11381139
#define BNXT_VF_SPOOFCHK 0x2
11391140
#define BNXT_VF_LINK_FORCED 0x4
11401141
#define BNXT_VF_LINK_UP 0x8

drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/if_vlan.h>
1616
#include <linux/interrupt.h>
1717
#include <linux/etherdevice.h>
18-
#include <net/dcbnl.h>
1918
#include "bnxt_hsi.h"
2019
#include "bnxt.h"
2120
#include "bnxt_hwrm.h"
@@ -197,8 +196,11 @@ int bnxt_get_vf_config(struct net_device *dev, int vf_id,
197196
memcpy(&ivi->mac, vf->vf_mac_addr, ETH_ALEN);
198197
ivi->max_tx_rate = vf->max_tx_rate;
199198
ivi->min_tx_rate = vf->min_tx_rate;
200-
ivi->vlan = vf->vlan & VLAN_VID_MASK;
201-
ivi->qos = vf->vlan >> VLAN_PRIO_SHIFT;
199+
ivi->vlan = vf->vlan;
200+
if (vf->flags & BNXT_VF_QOS)
201+
ivi->qos = vf->vlan >> VLAN_PRIO_SHIFT;
202+
else
203+
ivi->qos = 0;
202204
ivi->spoofchk = !!(vf->flags & BNXT_VF_SPOOFCHK);
203205
ivi->trusted = bnxt_is_trusted_vf(bp, vf);
204206
if (!(vf->flags & BNXT_VF_LINK_FORCED))
@@ -254,21 +256,21 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
254256
if (bp->hwrm_spec_code < 0x10201)
255257
return -ENOTSUPP;
256258

257-
if (vlan_proto != htons(ETH_P_8021Q) &&
258-
(vlan_proto != htons(ETH_P_8021AD) ||
259-
!(bp->fw_cap & BNXT_FW_CAP_DFLT_VLAN_TPID_PCP)))
259+
if (vlan_proto != htons(ETH_P_8021Q))
260260
return -EPROTONOSUPPORT;
261261

262262
rc = bnxt_vf_ndo_prep(bp, vf_id);
263263
if (rc)
264264
return rc;
265265

266-
if (vlan_id >= VLAN_N_VID || qos >= IEEE_8021Q_MAX_PRIORITIES ||
267-
(!vlan_id && qos))
266+
/* TODO: needed to implement proper handling of user priority,
267+
* currently fail the command if there is valid priority
268+
*/
269+
if (vlan_id > 4095 || qos)
268270
return -EINVAL;
269271

270272
vf = &bp->pf.vf[vf_id];
271-
vlan_tag = vlan_id | (u16)qos << VLAN_PRIO_SHIFT;
273+
vlan_tag = vlan_id;
272274
if (vlan_tag == vf->vlan)
273275
return 0;
274276

@@ -277,10 +279,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
277279
req->fid = cpu_to_le16(vf->fw_fid);
278280
req->dflt_vlan = cpu_to_le16(vlan_tag);
279281
req->enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN);
280-
if (bp->fw_cap & BNXT_FW_CAP_DFLT_VLAN_TPID_PCP) {
281-
req->enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_TPID);
282-
req->tpid = vlan_proto;
283-
}
284282
rc = hwrm_req_send(bp, req);
285283
if (!rc)
286284
vf->vlan = vlan_tag;

0 commit comments

Comments
 (0)