Skip to content

Commit 1d39fd1

Browse files
committed
Merge branch 'sfc-more-ARFS-fixes'
Edward Cree says: ==================== sfc: more ARFS fixes A couple more bits of breakage in my recent ARFS and async filters work. Patch #1 in particular fixes a bug that leads to memory trampling and consequent crashes. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 988bf72 + 987c658 commit 1d39fd1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4784,8 +4784,9 @@ static bool efx_ef10_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id,
47844784
* will set rule->filter_id to EFX_ARFS_FILTER_ID_PENDING, meaning that
47854785
* the rule is not removed by efx_rps_hash_del() below.
47864786
*/
4787-
ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority,
4788-
filter_idx, true) == 0;
4787+
if (ret)
4788+
ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority,
4789+
filter_idx, true) == 0;
47894790
/* While we can't safely dereference rule (we dropped the lock), we can
47904791
* still test it for NULL.
47914792
*/

drivers/net/ethernet/sfc/rx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ static void efx_filter_rfs_work(struct work_struct *data)
839839
int rc;
840840

841841
rc = efx->type->filter_insert(efx, &req->spec, true);
842+
if (rc >= 0)
843+
rc %= efx->type->max_rx_ip_filters;
842844
if (efx->rps_hash_table) {
843845
spin_lock_bh(&efx->rps_hash_lock);
844846
rule = efx_rps_hash_find(efx, &req->spec);

0 commit comments

Comments
 (0)