All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
Cc: Jesse Gross <jesse@nicira.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"Duyck, Alexander H" <alexander.h.duyck@intel.com>
Subject: RE: [PATCH] ixgb: Convert to new vlan model.
Date: Tue, 14 Dec 2010 19:15:21 +0000	[thread overview]
Message-ID: <1292354121.20458.11.camel@bwh-desktop> (raw)
In-Reply-To: <EA929A9653AAE14F841771FB1DE5A136602D6751C1@rrsmsx501.amr.corp.intel.com>

On Tue, 2010-12-14 at 12:08 -0700, Tantilov, Emil S wrote:
> Ben Hutchings wrote:
> > On Tue, 2010-12-14 at 11:09 -0700, Tantilov, Emil S wrote:
> >> Ben Hutchings wrote:
> >>> On Mon, 2010-12-13 at 19:42 -0800, Jesse Gross wrote:
> >>>> This switches the ixgb driver to use the new vlan interfaces.
> >>>> In doing this, it completes the work begun in
> >>>> ae54496f9e8d40c89e5668205c181dccfa9ecda1 allowing the use of
> >>>> hardware vlan insertion without having a vlan group configured.
> >>>> [...] diff --git a/drivers/net/ixgb/ixgb_ethtool.c
> >>>> b/drivers/net/ixgb/ixgb_ethtool.c
> >>>> index 43994c1..0e4c527 100644
> >>>> --- a/drivers/net/ixgb/ixgb_ethtool.c
> >>>> +++ b/drivers/net/ixgb/ixgb_ethtool.c
> >>>> @@ -706,6 +706,45 @@ ixgb_get_strings(struct net_device *netdev,
> >>>> u32  stringset, u8 *data)  	} } 
> >>>> 
> >>>> +static int ixgb_set_flags(struct net_device *netdev, u32 data) +{
> >>>> +	struct ixgb_adapter *adapter = netdev_priv(netdev); +	bool
> >>>> need_reset; +	int rc; +
> >>>> +	/* The hardware requires that RX vlan stripping and TX vlan
> >>>> insertion +	 * be configured together.  Therefore, if one setting
> >>>> changes adjust the +	 * other one to match. +	 */
> >>>> +	if (!!(data & ETH_FLAG_RXVLAN) != !!(data & ETH_FLAG_TXVLAN)) {
> >>>> +		if ((data & ETH_FLAG_RXVLAN) !=
> >>>> +		    (netdev->features & NETIF_F_HW_VLAN_RX))
> >>>> +			data ^= ETH_FLAG_TXVLAN;
> >>>> +		else if ((data & ETH_FLAG_TXVLAN) !=
> >>>> +		    (netdev->features & NETIF_F_HW_VLAN_TX))
> >>>> +			data ^= ETH_FLAG_RXVLAN;
> >>>> +	}
> >>> [...]
> >>> 
> >>> I think this should reject attempts to change just one flag with
> >>> -EINVAL, rather than quietly 'fixing' the setting.
> >>> 
> >>> Ben.
> >> 
> >> I'm not sure this is a good idea. At least not without some sort of
> >> explanation. Since there is no way for the user to know that he needs
> >> to disable both.
> > 
> > Document the limitation in Documentation/networking/ixgb.txt.  You
> > could also send a patch for the ethtool manual page stating that this
> > restriction might exist.
> > 
> > Ben.
> 
> Just to make sure it's clear - there is no hard requirement for both 
> settings to be set at the same time. So setting:
> ethtool -K eth0 rxvlan off
> 
> Is a valid setting and will disable stripping on Rx, but because of 
> the design, stripping on Tx will also be disabled.

Then it's *not* a valid setting for your hardware/driver.

[...]
> Either way we should update the docs as it is not intuitive.

Yes.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2010-12-14 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  3:42 [PATCH] ixgb: Convert to new vlan model Jesse Gross
2010-12-14 16:31 ` Ben Hutchings
2010-12-14 18:09   ` Tantilov, Emil S
2010-12-14 18:12     ` Ben Hutchings
2010-12-14 19:08       ` Tantilov, Emil S
2010-12-14 19:15         ` Ben Hutchings [this message]
2010-12-14 21:29           ` Jesse Gross
2010-12-14 21:47             ` Ben Hutchings
2010-12-14 21:53               ` Jesse Gross
2010-12-15 18:09             ` Tantilov, Emil S
2010-12-16  4:29               ` Jesse Gross
2010-12-15 22:49 ` 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=1292354121.20458.11.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=emil.s.tantilov@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --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 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.