Skip to content

Commit 584fb76

Browse files
brettcreeleydavem330
authored andcommitted
ionic: Prevent filter add/del err msgs when the device is not available
Currently when a request for add/deleting a filter is made when ionic_heartbeat_check() returns failure the driver will be overly verbose about failures, especially when these are usually temporary fails and the request will be retried later. An example of this is a filter add when the FW is in the middle of resetting: IONIC_CMD_RX_FILTER_ADD (31) failed: IONIC_RC_ERROR (-6) rx_filter add failed: ADDR 01:80:c2:00:00:0e Fix this by checking for -ENXIO and other error values on filter request fails before printing the error message. Add similar checking to the delete filter code. Fixes: f91958c ("ionic: tame the filter no space message") Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f16f5be commit 584fb76

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,24 @@ static int ionic_lif_filter_add(struct ionic_lif *lif,
376376

377377
spin_unlock_bh(&lif->rx_filters.lock);
378378

379-
if (err == -ENOSPC) {
380-
if (le16_to_cpu(ctx.cmd.rx_filter_add.match) == IONIC_RX_FILTER_MATCH_VLAN)
381-
lif->max_vlans = lif->nvlans;
379+
/* store the max_vlans limit that we found */
380+
if (err == -ENOSPC &&
381+
le16_to_cpu(ctx.cmd.rx_filter_add.match) == IONIC_RX_FILTER_MATCH_VLAN)
382+
lif->max_vlans = lif->nvlans;
383+
384+
/* Prevent unnecessary error messages on recoverable
385+
* errors as the filter will get retried on the next
386+
* sync attempt.
387+
*/
388+
switch (err) {
389+
case -ENOSPC:
390+
case -ENXIO:
391+
case -ETIMEDOUT:
392+
case -EAGAIN:
393+
case -EBUSY:
382394
return 0;
395+
default:
396+
break;
383397
}
384398

385399
ionic_adminq_netdev_err_print(lif, ctx.cmd.cmd.opcode,
@@ -494,9 +508,22 @@ static int ionic_lif_filter_del(struct ionic_lif *lif,
494508
spin_unlock_bh(&lif->rx_filters.lock);
495509

496510
if (state != IONIC_FILTER_STATE_NEW) {
497-
err = ionic_adminq_post_wait(lif, &ctx);
498-
if (err && err != -EEXIST)
511+
err = ionic_adminq_post_wait_nomsg(lif, &ctx);
512+
513+
switch (err) {
514+
/* ignore these errors */
515+
case -EEXIST:
516+
case -ENXIO:
517+
case -ETIMEDOUT:
518+
case -EAGAIN:
519+
case -EBUSY:
520+
case 0:
521+
break;
522+
default:
523+
ionic_adminq_netdev_err_print(lif, ctx.cmd.cmd.opcode,
524+
ctx.comp.comp.status, err);
499525
return err;
526+
}
500527
}
501528

502529
return 0;

0 commit comments

Comments
 (0)