From: Stephen Hemminger <shemminger@vyatta.com>
To: "Michał Mirosław" <mirqus@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware
Date: Thu, 7 Jul 2011 10:13:22 -0700 [thread overview]
Message-ID: <20110707101322.784409eb@nehalam.ftrdhcpuser.net> (raw)
In-Reply-To: <CAHXqBF+Ha9XaMDB0x1XBD633mj2b6Jxmg9U_JSokrov90gPA-g@mail.gmail.com>
On Thu, 7 Jul 2011 19:04:46 +0200
Michał Mirosław <mirqus@gmail.com> wrote:
> 2011/7/7 Stephen Hemminger <shemminger@vyatta.com>:
> > Found when reviewing the vendor driver. Apparently some chip versions
> > require receive checksumming to be enabled in order for RSS to work.
> > Rather than silently enabling checksumming which is what the vendor
> > driver does, return an error to the user instead.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> >
> > --- a/drivers/net/sky2.c 2011-07-07 08:36:10.748003369 -0700
> > +++ b/drivers/net/sky2.c 2011-07-07 08:36:37.372004595 -0700
> > @@ -2996,7 +2996,8 @@ static int __devinit sky2_init(struct sk
> > hw->flags = SKY2_HW_GIGABIT
> > | SKY2_HW_NEWER_PHY
> > | SKY2_HW_NEW_LE
> > - | SKY2_HW_ADV_POWER_CTL;
> > + | SKY2_HW_ADV_POWER_CTL
> > + | SKY2_HW_RSS_CHKSUM;
> >
> > /* New transmit checksum */
> > if (hw->chip_rev != CHIP_REV_YU_EX_B0)
> > @@ -3024,7 +3025,7 @@ static int __devinit sky2_init(struct sk
> >
> > /* The workaround for status conflicts VLAN tag detection. */
> > if (hw->chip_rev == CHIP_REV_YU_FE2_A0)
> > - hw->flags |= SKY2_HW_VLAN_BROKEN;
> > + hw->flags |= SKY2_HW_VLAN_BROKEN | SKY2_HW_RSS_CHKSUM;
> > break;
> >
> > case CHIP_ID_YUKON_SUPR:
> > @@ -3033,6 +3034,9 @@ static int __devinit sky2_init(struct sk
> > | SKY2_HW_NEW_LE
> > | SKY2_HW_AUTO_TX_SUM
> > | SKY2_HW_ADV_POWER_CTL;
> > +
> > + if (hw->chip_rev == CHIP_REV_YU_SU_A0)
> > + hw->flags |= SKY2_HW_RSS_CHKSUM;
> > break;
> >
> > case CHIP_ID_YUKON_UL_2:
> > @@ -4187,6 +4191,11 @@ static int sky2_set_features(struct net_
> > struct sky2_port *sky2 = netdev_priv(dev);
> > u32 changed = dev->features ^ features;
> >
> > + /* Some hardware requires receive checksum for RSS to work. */
> > + if ( (features & (NETIF_F_RXHASH|NETIF_F_RXCSUM)) == NETIF_F_RXHASH &&
> > + (sky2->hw->flags & SKY2_HW_RSS_CHKSUM))
> > + return -EINVAL;
> > +
> > if (changed & NETIF_F_RXCSUM) {
> > u32 on = features & NETIF_F_RXCSUM;
> > sky2_write32(sky2->hw, Q_ADDR(rxqaddr[sky2->port], Q_CSR),
>
> Nah. This won't work as the error is not passed to user (except via
> dmesg) as there is no way to do it. Failing ndo_set_features() without
> updating dev->features will also prevent other unrelated changes to
> features set.
I think this needs to be fixed in the netdev core then.
There are bound to be hardware types that can support only some combinations
of features. It should be passed back like all other errors.
next prev parent reply other threads:[~2011-07-07 17:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 15:50 [PATCH net-next 0/5] sky2 driver update Stephen Hemminger
2011-07-07 15:50 ` [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware Stephen Hemminger
2011-07-07 17:04 ` Michał Mirosław
2011-07-07 17:13 ` Stephen Hemminger [this message]
2011-07-07 17:40 ` Michał Mirosław
2011-07-07 23:40 ` [PATCH net-next 1/5] sky2: force receive checksum when using RSS on some hardware (v2) Stephen Hemminger
2011-07-08 8:45 ` Michał Mirosław
2011-07-08 15:32 ` Stephen Hemminger
2011-07-08 15:54 ` David Miller
2011-07-07 15:50 ` [PATCH net-next 2/5] sky2: use correct Inter Packet Gap at 10/100mbit Stephen Hemminger
2011-07-07 15:50 ` [PATCH net-next 3/5] sky2: support for new Optima chipsets (EXPERIMENTAL) Stephen Hemminger
2011-07-07 15:51 ` [PATCH net-next 4/5] sky2: version 1.29 Stephen Hemminger
2011-07-07 15:51 ` [PATCH net-next 5/5] skge/sky2: change config references to Marvell Stephen Hemminger
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=20110707101322.784409eb@nehalam.ftrdhcpuser.net \
--to=shemminger@vyatta.com \
--cc=davem@davemloft.net \
--cc=mirqus@gmail.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).