Skip to content

Commit 9bf4656

Browse files
skotur-brcmdavem330
authored andcommitted
bnxt_en: Fix to include flow direction in L2 key
FW expects the driver to provide unique flow reference handles for Tx or Rx flows. When a Tx flow and an Rx flow end up sharing a reference handle, flow offload does not seem to work. This could happen in the case of 2 flows having their L2 fields wildcarded but in different direction. Fix to incorporate the flow direction as part of the L2 key v2: Move the dir field to the end of the bnxt_tc_l2_key struct to fix the warning reported by kbuild test robot <[email protected]>. There is existing code that initializes the structure using nested initializer and will warn with the new u8 field added to the beginning. The structure also packs nicer when this new u8 is added to the end of the structure [MChan]. Fixes: abd43a1 ("bnxt_en: Support for 64-bit flow handle.") Signed-off-by: Somnath Kotur <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 685ec6a commit 9bf4656

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ static int __bnxt_tc_del_flow(struct bnxt *bp,
12361236
static void bnxt_tc_set_flow_dir(struct bnxt *bp, struct bnxt_tc_flow *flow,
12371237
u16 src_fid)
12381238
{
1239-
flow->dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX;
1239+
flow->l2_key.dir = (bp->pf.fw_fid == src_fid) ? BNXT_DIR_RX : BNXT_DIR_TX;
12401240
}
12411241

12421242
static void bnxt_tc_set_src_fid(struct bnxt *bp, struct bnxt_tc_flow *flow,
@@ -1405,7 +1405,7 @@ static void bnxt_fill_cfa_stats_req(struct bnxt *bp,
14051405
* 2. 15th bit of flow_handle must specify the flow
14061406
* direction (TX/RX).
14071407
*/
1408-
if (flow_node->flow.dir == BNXT_DIR_RX)
1408+
if (flow_node->flow.l2_key.dir == BNXT_DIR_RX)
14091409
handle = CFA_FLOW_INFO_REQ_FLOW_HANDLE_DIR_RX |
14101410
CFA_FLOW_INFO_REQ_FLOW_HANDLE_MAX_MASK;
14111411
else

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ struct bnxt_tc_l2_key {
2323
__be16 inner_vlan_tci;
2424
__be16 ether_type;
2525
u8 num_vlans;
26+
u8 dir;
27+
#define BNXT_DIR_RX 1
28+
#define BNXT_DIR_TX 0
2629
};
2730

2831
struct bnxt_tc_l3_key {
@@ -98,9 +101,6 @@ struct bnxt_tc_flow {
98101

99102
/* flow applicable to pkts ingressing on this fid */
100103
u16 src_fid;
101-
u8 dir;
102-
#define BNXT_DIR_RX 1
103-
#define BNXT_DIR_TX 0
104104
struct bnxt_tc_l2_key l2_key;
105105
struct bnxt_tc_l2_key l2_mask;
106106
struct bnxt_tc_l3_key l3_key;

0 commit comments

Comments
 (0)