15
15
#include <linux/if_vlan.h>
16
16
#include <linux/interrupt.h>
17
17
#include <linux/etherdevice.h>
18
- #include <net/dcbnl.h>
19
18
#include "bnxt_hsi.h"
20
19
#include "bnxt.h"
21
20
#include "bnxt_hwrm.h"
@@ -197,8 +196,11 @@ int bnxt_get_vf_config(struct net_device *dev, int vf_id,
197
196
memcpy (& ivi -> mac , vf -> vf_mac_addr , ETH_ALEN );
198
197
ivi -> max_tx_rate = vf -> max_tx_rate ;
199
198
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 ;
202
204
ivi -> spoofchk = !!(vf -> flags & BNXT_VF_SPOOFCHK );
203
205
ivi -> trusted = bnxt_is_trusted_vf (bp , vf );
204
206
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,
254
256
if (bp -> hwrm_spec_code < 0x10201 )
255
257
return - ENOTSUPP ;
256
258
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 ))
260
260
return - EPROTONOSUPPORT ;
261
261
262
262
rc = bnxt_vf_ndo_prep (bp , vf_id );
263
263
if (rc )
264
264
return rc ;
265
265
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 )
268
270
return - EINVAL ;
269
271
270
272
vf = & bp -> pf .vf [vf_id ];
271
- vlan_tag = vlan_id | ( u16 ) qos << VLAN_PRIO_SHIFT ;
273
+ vlan_tag = vlan_id ;
272
274
if (vlan_tag == vf -> vlan )
273
275
return 0 ;
274
276
@@ -277,10 +279,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
277
279
req -> fid = cpu_to_le16 (vf -> fw_fid );
278
280
req -> dflt_vlan = cpu_to_le16 (vlan_tag );
279
281
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
- }
284
282
rc = hwrm_req_send (bp , req );
285
283
if (!rc )
286
284
vf -> vlan = vlan_tag ;
0 commit comments