Skip to content

Commit 66064db

Browse files
Suresh Reddydavem330
Suresh Reddy
authored andcommitted
be2net: fix qnq mode detection on VFs
The driver (on PF or VF) needs to detect if the function is in qnq mode for a HW hack in be_rx_compl_get() to work. The driver queries this information using the GET_PROFILE_CONFIG cmd (since the commit below can caused this regression.) But this cmd is not available on VFs and so the VFs fail to detect qnq mode. This causes vlan traffic to not work. The fix is to use the the adapter->function_mode value queried via QUERY_FIRMWARE_CONFIG cmd on both PFs and VFs to detect the qnq mode. Also QNQ_MODE was incorrectly named FLEX10_MODE; correcting that too as the fix reads much better with the name change. Fixes: f93f160 ("refactor multi-channel config code for Skyhawk-R chip") Signed-off-by: Suresh Reddy <[email protected]> Signed-off-by: Sathya Perla <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a72e154 commit 66064db

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

drivers/net/ethernet/emulex/benet/be.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,7 @@ static inline u16 be_max_qs(struct be_adapter *adapter)
557557
#define be_pvid_tagging_enabled(adapter) (adapter->pvid)
558558

559559
/* Is BE in QNQ multi-channel mode */
560-
#define be_is_qnq_mode(adapter) (adapter->mc_type == FLEX10 || \
561-
adapter->mc_type == vNIC1 || \
562-
adapter->mc_type == UFP)
560+
#define be_is_qnq_mode(adapter) (adapter->function_mode & QNQ_MODE)
563561

564562
#define lancer_chip(adapter) (adapter->pdev->device == OC_DEVICE_ID3 || \
565563
adapter->pdev->device == OC_DEVICE_ID4)

drivers/net/ethernet/emulex/benet/be_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ struct be_cmd_resp_modify_eq_delay {
10911091
* based on the skew/IPL.
10921092
*/
10931093
#define RDMA_ENABLED 0x4
1094-
#define FLEX10_MODE 0x400
1094+
#define QNQ_MODE 0x400
10951095
#define VNIC_MODE 0x20000
10961096
#define UMC_ENABLED 0x1000000
10971097
struct be_cmd_req_query_fw_cfg {

drivers/net/ethernet/emulex/benet/be_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,9 +3254,9 @@ static int be_vf_setup(struct be_adapter *adapter)
32543254

32553255
static u8 be_convert_mc_type(u32 function_mode)
32563256
{
3257-
if (function_mode & VNIC_MODE && function_mode & FLEX10_MODE)
3257+
if (function_mode & VNIC_MODE && function_mode & QNQ_MODE)
32583258
return vNIC1;
3259-
else if (function_mode & FLEX10_MODE)
3259+
else if (function_mode & QNQ_MODE)
32603260
return FLEX10;
32613261
else if (function_mode & VNIC_MODE)
32623262
return vNIC2;

0 commit comments

Comments
 (0)