Skip to content

Commit dcb4123

Browse files
jco-xilinxdavem330
authored andcommitted
sfc: disable RSS when unsupported
When certain firmware variants are selected (via the sfboot utility) the SFC7000 and SFC8000 series NICs don't support RSS. The driver still tries (and fails) to insert filters with the RSS flag, and the NIC fails to pass traffic. When the firmware reports RSS_LIMITED suppress allocating a default RSS context. The absence of an RSS context is picked up in filter insertion and RSS flags are discarded. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4be2b49 commit dcb4123

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • drivers/net/ethernet/sfc

‎drivers/net/ethernet/sfc/ef10.c‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,10 @@ static int efx_ef10_alloc_rss_context(struct efx_nic *efx, u32 *context,
19201920
return 0;
19211921
}
19221922

1923+
if (nic_data->datapath_caps &
1924+
1 << MC_CMD_GET_CAPABILITIES_OUT_RX_RSS_LIMITED_LBN)
1925+
return -EOPNOTSUPP;
1926+
19231927
MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID,
19241928
nic_data->vport_id);
19251929
MCDI_SET_DWORD(inbuf, RSS_CONTEXT_ALLOC_IN_TYPE, alloc_type);
@@ -2923,9 +2927,16 @@ static void efx_ef10_filter_push_prep(struct efx_nic *efx,
29232927
bool replacing)
29242928
{
29252929
struct efx_ef10_nic_data *nic_data = efx->nic_data;
2930+
u32 flags = spec->flags;
29262931

29272932
memset(inbuf, 0, MC_CMD_FILTER_OP_IN_LEN);
29282933

2934+
/* Remove RSS flag if we don't have an RSS context. */
2935+
if (flags & EFX_FILTER_FLAG_RX_RSS &&
2936+
spec->rss_context == EFX_FILTER_RSS_CONTEXT_DEFAULT &&
2937+
nic_data->rx_rss_context == EFX_EF10_RSS_CONTEXT_INVALID)
2938+
flags &= ~EFX_FILTER_FLAG_RX_RSS;
2939+
29292940
if (replacing) {
29302941
MCDI_SET_DWORD(inbuf, FILTER_OP_IN_OP,
29312942
MC_CMD_FILTER_OP_IN_OP_REPLACE);
@@ -2985,10 +2996,10 @@ static void efx_ef10_filter_push_prep(struct efx_nic *efx,
29852996
spec->dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP ?
29862997
0 : spec->dmaq_id);
29872998
MCDI_SET_DWORD(inbuf, FILTER_OP_IN_RX_MODE,
2988-
(spec->flags & EFX_FILTER_FLAG_RX_RSS) ?
2999+
(flags & EFX_FILTER_FLAG_RX_RSS) ?
29893000
MC_CMD_FILTER_OP_IN_RX_MODE_RSS :
29903001
MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE);
2991-
if (spec->flags & EFX_FILTER_FLAG_RX_RSS)
3002+
if (flags & EFX_FILTER_FLAG_RX_RSS)
29923003
MCDI_SET_DWORD(inbuf, FILTER_OP_IN_RX_CONTEXT,
29933004
spec->rss_context !=
29943005
EFX_FILTER_RSS_CONTEXT_DEFAULT ?

0 commit comments

Comments
 (0)