Skip to content

Commit 09a0420

Browse files
sf-hgkdavem330
authored andcommitted
sfc: Downgrade or remove some error messages
Depending on configuration the NIC may return errors for unprivileged functions and/or VFs. Where these are expected and handled, reduce the level of any output. Signed-off-by: Bert Kenward <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8c57836 commit 09a0420

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,17 @@ static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n)
486486
BUILD_BUG_ON(MC_CMD_ALLOC_PIOBUF_IN_LEN != 0);
487487

488488
for (i = 0; i < n; i++) {
489-
rc = efx_mcdi_rpc(efx, MC_CMD_ALLOC_PIOBUF, NULL, 0,
490-
outbuf, sizeof(outbuf), &outlen);
491-
if (rc)
489+
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_ALLOC_PIOBUF, NULL, 0,
490+
outbuf, sizeof(outbuf), &outlen);
491+
if (rc) {
492+
/* Don't display the MC error if we didn't have space
493+
* for a VF.
494+
*/
495+
if (!(efx_ef10_is_vf(efx) && rc == -ENOSPC))
496+
efx_mcdi_display_error(efx, MC_CMD_ALLOC_PIOBUF,
497+
0, outbuf, outlen, rc);
492498
break;
499+
}
493500
if (outlen < MC_CMD_ALLOC_PIOBUF_OUT_LEN) {
494501
rc = -EIO;
495502
break;
@@ -4028,9 +4035,10 @@ static int efx_ef10_filter_insert_def(struct efx_nic *efx, bool multicast,
40284035

40294036
rc = efx_ef10_filter_insert(efx, &spec, true);
40304037
if (rc < 0) {
4031-
netif_warn(efx, drv, efx->net_dev,
4032-
"%scast mismatch filter insert failed rc=%d\n",
4033-
multicast ? "Multi" : "Uni", rc);
4038+
netif_printk(efx, drv, rc == -EPERM ? KERN_DEBUG : KERN_WARNING,
4039+
efx->net_dev,
4040+
"%scast mismatch filter insert failed rc=%d\n",
4041+
multicast ? "Multi" : "Uni", rc);
40344042
} else if (multicast) {
40354043
table->mcdef_id = efx_ef10_filter_get_unsafe_id(efx, rc);
40364044
if (!nic_data->workaround_26807) {

drivers/net/ethernet/sfc/efx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,14 +3174,15 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
31743174
rtnl_lock();
31753175
rc = efx_mtd_probe(efx);
31763176
rtnl_unlock();
3177-
if (rc)
3177+
if (rc && rc != -EPERM)
31783178
netif_warn(efx, probe, efx->net_dev,
31793179
"failed to create MTDs (%d)\n", rc);
31803180

31813181
rc = pci_enable_pcie_error_reporting(pci_dev);
31823182
if (rc && rc != -EINVAL)
3183-
netif_warn(efx, probe, efx->net_dev,
3184-
"pci_enable_pcie_error_reporting failed (%d)\n", rc);
3183+
netif_notice(efx, probe, efx->net_dev,
3184+
"PCIE error reporting unavailable (%d).\n",
3185+
rc);
31853186

31863187
return 0;
31873188

0 commit comments

Comments
 (0)