All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shannon Nelson <snelson@pensando.io>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next 5/8] ionic: support ethtool rxhash disable
Date: Wed, 4 Mar 2020 17:32:27 -0800	[thread overview]
Message-ID: <20200304173227.6e95d1a4@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <39446ac7-9ce1-1c81-427b-a9821145fd1d@pensando.io>

On Wed, 4 Mar 2020 16:24:01 -0800 Shannon Nelson wrote:
> On 3/4/20 11:59 AM, Jakub Kicinski wrote:
> > On Tue,  3 Mar 2020 20:20:10 -0800 Shannon Nelson wrote:  
> >> We can disable rxhashing by setting rss_types to 0.  The user
> >> can toggle this with "ethtool -K <ethX> rxhash off|on",
> >> which calls into the .ndo_set_features callback with the
> >> NETIF_F_RXHASH feature bit set or cleared.  This patch adds
> >> a check for that bit and updates the FW if necessary.
> >>
> >> Signed-off-by: Shannon Nelson <snelson@pensando.io>
> >> ---
> >>   drivers/net/ethernet/pensando/ionic/ionic_lif.c | 11 +++++++++--
> >>   1 file changed, 9 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> >> index d1567e477b1f..4b953f9e9084 100644
> >> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> >> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> >> @@ -1094,6 +1094,7 @@ static int ionic_set_nic_features(struct ionic_lif *lif,
> >>   	u64 vlan_flags = IONIC_ETH_HW_VLAN_TX_TAG |
> >>   			 IONIC_ETH_HW_VLAN_RX_STRIP |
> >>   			 IONIC_ETH_HW_VLAN_RX_FILTER;
> >> +	u64 old_hw_features;
> >>   	int err;
> >>   
> >>   	ctx.cmd.lif_setattr.features = ionic_netdev_features_to_nic(features);
> >> @@ -1101,9 +1102,13 @@ static int ionic_set_nic_features(struct ionic_lif *lif,
> >>   	if (err)
> >>   		return err;
> >>   
> >> +	old_hw_features = lif->hw_features;
> >>   	lif->hw_features = le64_to_cpu(ctx.cmd.lif_setattr.features &
> >>   				       ctx.comp.lif_setattr.features);
> >>   
> >> +	if ((old_hw_features ^ lif->hw_features) & IONIC_ETH_HW_RX_HASH)
> >> +		ionic_lif_rss_config(lif, lif->rss_types, NULL, NULL);  
> >
> > Is this change coming from the HW or from ethtool? AFAIK hw_features
> > are what's supported, features is what's enabled..  
> 
> This is looking at the feature bits coming in from ndo_set_features - if 
> the RX_HASH bit has been turned off in the incoming features bitmask, 
> then I need to disable the hw hashing.
> 
> I believe the confusion is between lif->hw_features, describing what is 
> currently enabled in the hw, versus the netdev->hw_features, that is 
> what we've told the the stack we have available.

Ah, you're very right. So the problem is that the current handling only
sends the general IONIC_LIF_ATTR_FEATURES request, but the device also
needs an extra IONIC_LIF_ATTR_RSS to disable RSS? Got it.

  reply	other threads:[~2020-03-05  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  4:20 [PATCH v2 net-next 0/8] ionic updates Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 1/8] ionic: keep ionic dev on lif init fail Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 2/8] ionic: remove pragma packed Shannon Nelson
2020-03-04 19:54   ` Jakub Kicinski
2020-03-05  0:05     ` Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 3/8] ionic: improve irq numa locality Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 4/8] ionic: clean up bitflag usage Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 5/8] ionic: support ethtool rxhash disable Shannon Nelson
2020-03-04 19:59   ` Jakub Kicinski
2020-03-05  0:24     ` Shannon Nelson
2020-03-05  1:32       ` Jakub Kicinski [this message]
2020-03-04  4:20 ` [PATCH v2 net-next 6/8] ionic: print pci bus lane info Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 7/8] ionic: add support for device id 0x1004 Shannon Nelson
2020-03-04  4:20 ` [PATCH v2 net-next 8/8] ionic: drop ethtool driver version Shannon Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200304173227.6e95d1a4@kicinski-fedora-PC1C0HJN \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=snelson@pensando.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.