netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jesse Gross <jesse@nicira.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] sky2: convert to new VLAN model
Date: Fri, 7 Jan 2011 09:27:58 -0800	[thread overview]
Message-ID: <20110107092758.7dc1152f@nehalam> (raw)
In-Reply-To: <AANLkTikwGQFByOZGgCCjTJySPa8QYndZ903CFmOkS1Ha@mail.gmail.com>

On Fri, 7 Jan 2011 12:14:51 -0500
Jesse Gross <jesse@nicira.com> wrote:

> On Thu, Jan 6, 2011 at 11:41 PM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
> > +/* Features available on VLAN with transmit tag stripped */
> > +#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO)
> > +
> > +static void sky2_vlan_mode(struct net_device *dev)
> >  {
> > -       if (onoff) {
> > +       struct sky2_port *sky2 = netdev_priv(dev);
> > +       struct sky2_hw *hw = sky2->hw;
> > +       u16 port = sky2->port;
> > +
> > +       if (dev->features & NETIF_F_HW_VLAN_RX)
> >                sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
> >                             RX_VLAN_STRIP_ON);
> > +       else
> > +               sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
> > +                            RX_VLAN_STRIP_OFF);
> > +
> > +       if (dev->features & NETIF_F_HW_VLAN_TX) {
> >                sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
> >                             TX_VLAN_TAG_ON);
> > +               dev->vlan_features = dev->features & VLAN_FEAT;
> >        } else {
> > -               sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
> > -                            RX_VLAN_STRIP_OFF);
> >                sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
> >                             TX_VLAN_TAG_OFF);
> > +               dev->vlan_features = dev->features & NETIF_F_HIGHDMA;
> 
> Hmm, the chip supports SG only when TX vlan is on and HIGHDMA only
> when it is off?  Currently skb_needs_linearize() assumes that when not
> using vlan acceleration, the DMA engine doesn't care about the
> presence of a vlan tag and directly uses dev->features.

The chip supports checksum offload only if TX_VLAN is enabled.
Scatter/gather without checksum offload is not allowed by kernel
because checksum offload is needed for sendfile.

highdma should always be on

> Also, can't we enable NETIF_F_GRO in vlan_features?  It will be set
> initially by register_netdevice() but if we change the flags it gets
> blown away.

I will revise. GRO is independent of all this.


-- 

  reply	other threads:[~2011-01-07 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  4:41 [PATCH 2/2] sky2: convert to new VLAN model Stephen Hemminger
2011-01-07 17:14 ` Jesse Gross
2011-01-07 17:27   ` Stephen Hemminger [this message]
2011-01-09 15:50     ` Jesse Gross
2011-01-08  4:13   ` [PATCH 2/2] sky2: convert to new VLAN model (v0.2) Stephen Hemminger
2011-01-09 16:13     ` Jesse Gross
2011-01-09 23:54       ` David Miller

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=20110107092758.7dc1152f@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=jesse@nicira.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).