netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: davem@davemloft.net,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com
Subject: Re: [net-next 07/12] ixgbe: add support for modifying UDP RSS flow hash options
Date: Thu, 23 Jun 2011 20:57:51 -0700	[thread overview]
Message-ID: <BANLkTi=-DjyeT7-KMFpuGY=4MGVA-uSXQg@mail.gmail.com> (raw)
In-Reply-To: <1308795900.3093.713.camel@localhost>

On Wed, Jun 22, 2011 at 19:25, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Wed, 2011-06-22 at 18:44 -0700, Jeff Kirsher wrote:
>> From: Alexander Duyck <alexander.h.duyck@intel.com>
>>
>> This patch adds the ability to add or remove the UDP source and destination
>> ports from the flow hash generated for RSS.  Currently the UDP flow hash is
>> always disabled.  By adding support for enabling the UDP flow hash we are
>> now providing the option of generating an RSS hash based on the UDP source
>> and destination port numbers.
> [...]
>> --- a/drivers/net/ixgbe/ixgbe_ethtool.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethtool.c
> [...]
>> @@ -2681,6 +2726,110 @@ static int ixgbe_del_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
>>       return err;
>>  }
>>
>> +#define UDP_RSS_FLAGS (IXGBE_FLAG2_RSS_FIELD_IPV4_UDP | \
>> +                    IXGBE_FLAG2_RSS_FIELD_IPV6_UDP)
>> +static int ixgbe_set_rss_hash_opt(struct ixgbe_adapter *adapter,
>> +                               struct ethtool_rxnfc *nfc)
>> +{
>> +     u32 flags2 = adapter->flags2;
>> +
>> +     /*
>> +      * RSS does not support anything other than hashing
>> +      * to queues on src and dst IPs and ports
>> +      */
>> +     if (nfc->data & ~(RXH_IP_SRC | RXH_IP_DST |
>> +                       RXH_L4_B_0_1 | RXH_L4_B_2_3))
>> +             return -EINVAL;
>> +
>> +     switch (nfc->flow_type) {
>> +     case TCP_V4_FLOW:
>> +     case TCP_V6_FLOW:
>> +             if (!(nfc->data & RXH_IP_SRC) ||
>> +                 !(nfc->data & RXH_IP_DST) ||
>> +                 !(nfc->data & RXH_L4_B_0_1) ||
>> +                 !(nfc->data & RXH_L4_B_2_3))
>> +                     return -EINVAL;
>> +             break;
>
> This can be written as a simple equality test.
>
>> +     case UDP_V4_FLOW:
>> +             if (!(nfc->data & RXH_IP_SRC) ||
>> +                 !(nfc->data & RXH_IP_DST))
>> +                     return -EINVAL;
>> +             switch (nfc->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3)) {
>
> You could just as well include all flags in the switch.
>
> [...]
>> +     case AH_ESP_V4_FLOW:
>> +     case AH_V4_FLOW:
>> +     case ESP_V4_FLOW:
>> +     case SCTP_V4_FLOW:
>> +     case AH_ESP_V6_FLOW:
>> +     case AH_V6_FLOW:
>> +     case ESP_V6_FLOW:
>> +     case SCTP_V6_FLOW:
>> +             if (!(nfc->data & RXH_IP_SRC) ||
>> +                 !(nfc->data & RXH_IP_DST))
>> +                     return -EINVAL;
>> +               break;
> [...]
>
> This should be written as an equality test, otherwise you will ignore a
> request to include port numbers in the hash for these flow classes.
>
> Ben.
>
>

Alex is on vacation currently, so I will just pull this patch for now
to give Alex time to respond when he returns next week.

-- 
Cheers,
Jeff

  reply	other threads:[~2011-06-24  3:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-23  1:44 [net-next 00/12][pull request] Intel Wired LAN Driver Update Jeff Kirsher
2011-06-23  1:44 ` [net-next 01/12] ixgbe: remove ntuple filtering Jeff Kirsher
2011-06-23  1:44 ` [net-next 02/12] ixgbe: fix flags relating to perfect filters to support coexistence Jeff Kirsher
2011-06-23  1:44 ` [net-next 03/12] ixgbe: update perfect filter framework to support retaining filters Jeff Kirsher
2011-06-23  1:44 ` [net-next 04/12] ixgbe: add basic support for setting and getting nfc controls Jeff Kirsher
2011-06-23  1:44 ` [net-next 05/12] ixgbe: add support for displaying ntuple filters via the nfc interface Jeff Kirsher
2011-06-23  1:44 ` [net-next 06/12] ixgbe: add support for nfc addition and removal of filters Jeff Kirsher
2011-06-23  1:44 ` [net-next 07/12] ixgbe: add support for modifying UDP RSS flow hash options Jeff Kirsher
2011-06-23  2:25   ` Ben Hutchings
2011-06-24  3:57     ` Jeff Kirsher [this message]
2011-06-23  1:44 ` [net-next 08/12] ixgbe: move setting RSC into a separate function Jeff Kirsher
2011-06-23  1:44 ` [net-next 09/12] ixgbe: move reset code " Jeff Kirsher
2011-06-23  1:44 ` [net-next 10/12] ixgbe: disable RSC when Rx checksum is off Jeff Kirsher
2011-06-23  1:44 ` [net-next 11/12] ixgbe: fix ring assignment issues for SR-IOV and drop cases Jeff Kirsher
2011-06-23  1:44 ` [net-next 12/12] ixgbe: update driver version string Jeff Kirsher

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='BANLkTi=-DjyeT7-KMFpuGY=4MGVA-uSXQg@mail.gmail.com' \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).