Enabled RSS enables RSS hash computation and provision in pseudo header.
It still makes sense for applications even if only one Rx queue is used.
Fixes:
4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
Fixes:
088e17210a7a ("net/sfc: query RSS key and hash types config")
Fixes:
82faef507608 ("net/sfc: set RSS key and hash types config")
Fixes:
af0d9317970c ("net/sfc: query RSS redirection table")
Fixes:
32bcfb0a50b1 ("net/sfc: update RSS redirection table")
Fixes:
f5258439ee5d ("net/sfc: avoid failure on port start if Rx mode is rejected")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
{
struct sfc_adapter *sa = dev->data->dev_private;
{
struct sfc_adapter *sa = dev->data->dev_private;
- if ((sa->rss_channels == 1) ||
- (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE))
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)
+ if (sa->rss_channels == 0)
+ return -EINVAL;
+
unsigned int efx_hash_types;
int rc = 0;
unsigned int efx_hash_types;
int rc = 0;
- if ((sa->rss_channels == 1) ||
- (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)) {
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
sfc_err(sa, "RSS is not available");
return -ENOTSUP;
}
sfc_err(sa, "RSS is not available");
return -ENOTSUP;
}
+ if (sa->rss_channels == 0) {
+ sfc_err(sa, "RSS is not configured");
+ return -EINVAL;
+ }
+
if ((rss_conf->rss_key != NULL) &&
(rss_conf->rss_key_len != sizeof(sa->rss_key))) {
sfc_err(sa, "RSS key size is wrong (should be %lu)",
if ((rss_conf->rss_key != NULL) &&
(rss_conf->rss_key_len != sizeof(sa->rss_key))) {
sfc_err(sa, "RSS key size is wrong (should be %lu)",
struct sfc_adapter *sa = dev->data->dev_private;
int entry;
struct sfc_adapter *sa = dev->data->dev_private;
int entry;
- if ((sa->rss_channels == 1) ||
- (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE))
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)
+ if (sa->rss_channels == 0)
+ return -EINVAL;
+
if (reta_size != EFX_RSS_TBL_SIZE)
return -EINVAL;
if (reta_size != EFX_RSS_TBL_SIZE)
return -EINVAL;
- if ((sa->rss_channels == 1) ||
- (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)) {
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
sfc_err(sa, "RSS is not available");
return -ENOTSUP;
}
sfc_err(sa, "RSS is not available");
return -ENOTSUP;
}
+ if (sa->rss_channels == 0) {
+ sfc_err(sa, "RSS is not configured");
+ return -EINVAL;
+ }
+
if (reta_size != EFX_RSS_TBL_SIZE) {
sfc_err(sa, "RETA size is wrong (should be %u)",
EFX_RSS_TBL_SIZE);
if (reta_size != EFX_RSS_TBL_SIZE) {
sfc_err(sa, "RETA size is wrong (should be %u)",
EFX_RSS_TBL_SIZE);
static int
sfc_rx_default_rxq_set_filter(struct sfc_adapter *sa, struct sfc_rxq *rxq)
{
static int
sfc_rx_default_rxq_set_filter(struct sfc_adapter *sa, struct sfc_rxq *rxq)
{
- boolean_t rss = (sa->rss_channels > 1) ? B_TRUE : B_FALSE;
+ boolean_t rss = (sa->rss_channels > 0) ? B_TRUE : B_FALSE;
struct sfc_port *port = &sa->port;
int rc;
struct sfc_port *port = &sa->port;
int rc;
int rc = 0;
#if EFSYS_OPT_RX_SCALE
int rc = 0;
#if EFSYS_OPT_RX_SCALE
- if (sa->rss_channels > 1) {
+ if (sa->rss_channels > 0) {
rc = efx_rx_scale_mode_set(sa->nic, EFX_RX_HASHALG_TOEPLITZ,
sa->rss_hash_types, B_TRUE);
if (rc != 0)
rc = efx_rx_scale_mode_set(sa->nic, EFX_RX_HASHALG_TOEPLITZ,
sa->rss_hash_types, B_TRUE);
if (rc != 0)
#if EFSYS_OPT_RX_SCALE
sa->rss_channels = (dev_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) ?
#if EFSYS_OPT_RX_SCALE
sa->rss_channels = (dev_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) ?
- MIN(sa->rxq_count, EFX_MAXRSS) : 1;
+ MIN(sa->rxq_count, EFX_MAXRSS) : 0;
- if (sa->rss_channels > 1) {
+ if (sa->rss_channels > 0) {
for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index)
sa->rss_tbl[sw_index] = sw_index % sa->rss_channels;
}
for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index)
sa->rss_tbl[sw_index] = sw_index % sa->rss_channels;
}