Skip to content

Commit 52eb95e

Browse files
anjalisinghai1Jeff Kirsher
authored andcommitted
i40e/i40evf: Add ATR HW eviction support for X722
X722 supports evicting ATR filters in the HW. With this patch, we enable the feature in the driver and avoid filter deletion by the driver. Signed-off-by: Anjali Singhai Jain <[email protected]> Signed-off-by: Catherine Sullivan <[email protected]> Tested-by: Jim Young <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 0d8e143 commit 52eb95e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,13 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
20402040
/* Due to lack of space, no more new filters can be programmed */
20412041
if (th->syn && (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED))
20422042
return;
2043+
if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) {
2044+
/* HW ATR eviction will take care of removing filters on FIN
2045+
* and RST packets.
2046+
*/
2047+
if (th->fin || th->rst)
2048+
return;
2049+
}
20432050

20442051
tx_ring->atr_count++;
20452052

@@ -2095,6 +2102,9 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
20952102
I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
20962103
I40E_TXD_FLTR_QW1_CNTINDEX_MASK;
20972104

2105+
if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)
2106+
dtype_cmd |= I40E_TXD_FLTR_QW1_ATR_MASK;
2107+
20982108
fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype);
20992109
fdir_desc->rsvd = cpu_to_le32(0);
21002110
fdir_desc->dtype_cmd_cntindex = cpu_to_le32(dtype_cmd);

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,10 @@ enum i40e_filter_program_desc_pcmd {
10491049
#define I40E_TXD_FLTR_QW1_FD_STATUS_MASK (0x3ULL << \
10501050
I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT)
10511051

1052+
#define I40E_TXD_FLTR_QW1_ATR_SHIFT (0xEULL + \
1053+
I40E_TXD_FLTR_QW1_CMD_SHIFT)
1054+
#define I40E_TXD_FLTR_QW1_ATR_MASK BIT_ULL(I40E_TXD_FLTR_QW1_ATR_SHIFT)
1055+
10521056
#define I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT 20
10531057
#define I40E_TXD_FLTR_QW1_CNTINDEX_MASK (0x1FFUL << \
10541058
I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT)

0 commit comments

Comments
 (0)