Skip to content

Commit 445b49d

Browse files
sreedeviintelanguy11
authored andcommitted
idpf: Fix RSS LUT configuration on down interfaces
RSS LUT provisioning and queries on a down interface currently return silently without effect. Users should be able to configure RSS settings even when the interface is down. Fix by maintaining RSS configuration changes in the driver's soft copy and deferring HW programming until the interface comes up. Fixes: 02cbfba ("idpf: add ethtool callbacks") Signed-off-by: Sreedevi Joshi <sreedevi.joshi@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Reviewed-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 83f38f2 commit 445b49d

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

drivers/net/ethernet/intel/idpf/idpf_ethtool.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,18 +411,24 @@ static u32 idpf_get_rxfh_indir_size(struct net_device *netdev)
411411
* @netdev: network interface device structure
412412
* @rxfh: pointer to param struct (indir, key, hfunc)
413413
*
414-
* Reads the indirection table directly from the hardware. Always returns 0.
414+
* RSS LUT and Key information are read from driver's cached
415+
* copy. When rxhash is off, rss lut will be displayed as zeros.
416+
*
417+
* Return: 0 on success, -errno otherwise.
415418
*/
416419
static int idpf_get_rxfh(struct net_device *netdev,
417420
struct ethtool_rxfh_param *rxfh)
418421
{
419422
struct idpf_netdev_priv *np = netdev_priv(netdev);
420423
struct idpf_rss_data *rss_data;
421424
struct idpf_adapter *adapter;
425+
struct idpf_vport *vport;
426+
bool rxhash_ena;
422427
int err = 0;
423428
u16 i;
424429

425430
idpf_vport_ctrl_lock(netdev);
431+
vport = idpf_netdev_to_vport(netdev);
426432

427433
adapter = np->adapter;
428434

@@ -432,17 +438,16 @@ static int idpf_get_rxfh(struct net_device *netdev,
432438
}
433439

434440
rss_data = &adapter->vport_config[np->vport_idx]->user_config.rss_data;
435-
if (!test_bit(IDPF_VPORT_UP, np->state))
436-
goto unlock_mutex;
437441

442+
rxhash_ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH);
438443
rxfh->hfunc = ETH_RSS_HASH_TOP;
439444

440445
if (rxfh->key)
441446
memcpy(rxfh->key, rss_data->rss_key, rss_data->rss_key_size);
442447

443448
if (rxfh->indir) {
444449
for (i = 0; i < rss_data->rss_lut_size; i++)
445-
rxfh->indir[i] = rss_data->rss_lut[i];
450+
rxfh->indir[i] = rxhash_ena ? rss_data->rss_lut[i] : 0;
446451
}
447452

448453
unlock_mutex:
@@ -482,8 +487,6 @@ static int idpf_set_rxfh(struct net_device *netdev,
482487
}
483488

484489
rss_data = &adapter->vport_config[vport->idx]->user_config.rss_data;
485-
if (!test_bit(IDPF_VPORT_UP, np->state))
486-
goto unlock_mutex;
487490

488491
if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
489492
rxfh->hfunc != ETH_RSS_HASH_TOP) {
@@ -499,7 +502,8 @@ static int idpf_set_rxfh(struct net_device *netdev,
499502
rss_data->rss_lut[lut] = rxfh->indir[lut];
500503
}
501504

502-
err = idpf_config_rss(vport);
505+
if (test_bit(IDPF_VPORT_UP, np->state))
506+
err = idpf_config_rss(vport);
503507

504508
unlock_mutex:
505509
idpf_vport_ctrl_unlock(netdev);

0 commit comments

Comments
 (0)