Skip to content

Commit ff5756d

Browse files
committed
Merge branch 'sfc-vf'
Bert Kenward says: ==================== sfc: additional virtual function support​ This introduces the client side of a mechanism to defer authorisation of operations, for example multicast subscription. Although primarily aimed at SRIOV VFs this can also apply to unprivileged PFs. Also handle reboot ordering corner cases better and reduce the level of some logging. v2: remove #ifdef DEBUG around new WARN_ON in mcdi.c. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 2e4c8ba + 09a0420 commit ff5756d

File tree

4 files changed

+288
-47
lines changed

4 files changed

+288
-47
lines changed

drivers/net/ethernet/sfc/ef10.c

Lines changed: 45 additions & 23 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;
@@ -3833,13 +3840,12 @@ static void efx_ef10_filter_table_remove(struct efx_nic *efx)
38333840
MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE);
38343841
MCDI_SET_QWORD(inbuf, FILTER_OP_IN_HANDLE,
38353842
table->entry[filter_idx].handle);
3836-
rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, inbuf, sizeof(inbuf),
3837-
NULL, 0, NULL);
3843+
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FILTER_OP, inbuf,
3844+
sizeof(inbuf), NULL, 0, NULL);
38383845
if (rc)
3839-
netdev_WARN(efx->net_dev,
3840-
"filter_idx=%#x handle=%#llx\n",
3841-
filter_idx,
3842-
table->entry[filter_idx].handle);
3846+
netif_info(efx, drv, efx->net_dev,
3847+
"%s: filter %04x remove failed\n",
3848+
__func__, filter_idx);
38433849
kfree(spec);
38443850
}
38453851

@@ -3848,11 +3854,14 @@ static void efx_ef10_filter_table_remove(struct efx_nic *efx)
38483854
}
38493855

38503856
#define EFX_EF10_FILTER_DO_MARK_OLD(id) \
3851-
if (id != EFX_EF10_FILTER_ID_INVALID) { \
3852-
filter_idx = efx_ef10_filter_get_unsafe_id(efx, id); \
3853-
WARN_ON(!table->entry[filter_idx].spec); \
3854-
table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_AUTO_OLD; \
3855-
}
3857+
if (id != EFX_EF10_FILTER_ID_INVALID) { \
3858+
filter_idx = efx_ef10_filter_get_unsafe_id(efx, id); \
3859+
if (!table->entry[filter_idx].spec) \
3860+
netif_dbg(efx, drv, efx->net_dev, \
3861+
"%s: marked null spec old %04x:%04x\n", \
3862+
__func__, id, filter_idx); \
3863+
table->entry[filter_idx].spec |= EFX_EF10_FILTER_FLAG_AUTO_OLD;\
3864+
}
38563865
static void efx_ef10_filter_mark_old(struct efx_nic *efx)
38573866
{
38583867
struct efx_ef10_filter_table *table = efx->filter_state;
@@ -4026,9 +4035,10 @@ static int efx_ef10_filter_insert_def(struct efx_nic *efx, bool multicast,
40264035

40274036
rc = efx_ef10_filter_insert(efx, &spec, true);
40284037
if (rc < 0) {
4029-
netif_warn(efx, drv, efx->net_dev,
4030-
"%scast mismatch filter insert failed rc=%d\n",
4031-
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);
40324042
} else if (multicast) {
40334043
table->mcdef_id = efx_ef10_filter_get_unsafe_id(efx, rc);
40344044
if (!nic_data->workaround_26807) {
@@ -4070,19 +4080,31 @@ static int efx_ef10_filter_insert_def(struct efx_nic *efx, bool multicast,
40704080
static void efx_ef10_filter_remove_old(struct efx_nic *efx)
40714081
{
40724082
struct efx_ef10_filter_table *table = efx->filter_state;
4073-
bool remove_failed = false;
4083+
int remove_failed = 0;
4084+
int remove_noent = 0;
4085+
int rc;
40744086
int i;
40754087

40764088
for (i = 0; i < HUNT_FILTER_TBL_ROWS; i++) {
40774089
if (ACCESS_ONCE(table->entry[i].spec) &
40784090
EFX_EF10_FILTER_FLAG_AUTO_OLD) {
4079-
if (efx_ef10_filter_remove_internal(
4080-
efx, 1U << EFX_FILTER_PRI_AUTO,
4081-
i, true) < 0)
4082-
remove_failed = true;
4091+
rc = efx_ef10_filter_remove_internal(efx,
4092+
1U << EFX_FILTER_PRI_AUTO, i, true);
4093+
if (rc == -ENOENT)
4094+
remove_noent++;
4095+
else if (rc)
4096+
remove_failed++;
40834097
}
40844098
}
4085-
WARN_ON(remove_failed);
4099+
4100+
if (remove_failed)
4101+
netif_info(efx, drv, efx->net_dev,
4102+
"%s: failed to remove %d filters\n",
4103+
__func__, remove_failed);
4104+
if (remove_noent)
4105+
netif_info(efx, drv, efx->net_dev,
4106+
"%s: failed to remove %d non-existent filters\n",
4107+
__func__, remove_noent);
40864108
}
40874109

40884110
static int efx_ef10_vport_set_mac_address(struct efx_nic *efx)

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)