netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: e1000-devel list <e1000-devel@lists.sourceforge.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: VLAN regression caused by: e1000: do vlan cleanup (799d531).
Date: Mon, 19 Mar 2012 16:24:04 -0700	[thread overview]
Message-ID: <4F67C014.1090500@candelatech.com> (raw)
In-Reply-To: <20120319130836.GD2192@minipsycho.brq.redhat.com>

On 03/19/2012 06:08 AM, Jiri Pirko wrote:
> Tue, Mar 13, 2012 at 07:44:18PM CET, greearb@candelatech.com wrote:

>>> I have suspition that vlan filter must be on/offed along with vlan
>>> accel.
>>
>> Ok, if I disable rx-vlan-hw-parse on both NICs, traffic starts working.
>>
>> And, if I re-enable rx-vlan-hw-parse on both NICs, it continues to work.
>>
>> Maybe the initialization logic needs some fixing?
>
> Could you please try following patch?

That patches fixes the problem for me.  Only lightly tested
at this point, but I have verified VLAN traffic works as desired.

Thanks,
Ben

>
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 6419a88..b06c31c 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -164,6 +164,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
>   static bool e1000_vlan_used(struct e1000_adapter *adapter);
>   static void e1000_vlan_mode(struct net_device *netdev,
>   			    netdev_features_t features);
> +static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
> +				     bool filter_on);
>   static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
>   static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
>   static void e1000_restore_vlan(struct e1000_adapter *adapter);
> @@ -1214,7 +1216,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
>   	if (err)
>   		goto err_register;
>
> -	e1000_vlan_mode(netdev, netdev->features);
> +	e1000_vlan_filter_on_off(adapter, false);
>
>   	/* print bus type/speed/width info */
>   	e_info(probe, "(PCI%s:%dMHz:%d-bit) %pM\n",
> @@ -4772,6 +4774,22 @@ static bool e1000_vlan_used(struct e1000_adapter *adapter)
>   	return false;
>   }
>
> +static void __e1000_vlan_mode(struct e1000_adapter *adapter,
> +			      netdev_features_t features)
> +{
> +	struct e1000_hw *hw =&adapter->hw;
> +	u32 ctrl;
> +
> +	ctrl = er32(CTRL);
> +	if (features&  NETIF_F_HW_VLAN_RX) {
> +		/* enable VLAN tag insert/strip */
> +		ctrl |= E1000_CTRL_VME;
> +	} else {
> +		/* disable VLAN tag insert/strip */
> +		ctrl&= ~E1000_CTRL_VME;
> +	}
> +	ew32(CTRL, ctrl);
> +}
>   static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
>   				     bool filter_on)
>   {
> @@ -4781,6 +4799,7 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
>   	if (!test_bit(__E1000_DOWN,&adapter->flags))
>   		e1000_irq_disable(adapter);
>
> +	__e1000_vlan_mode(adapter, adapter->netdev->features);
>   	if (filter_on) {
>   		/* enable VLAN receive filtering */
>   		rctl = er32(RCTL);
> @@ -4801,24 +4820,14 @@ static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
>   }
>
>   static void e1000_vlan_mode(struct net_device *netdev,
> -	netdev_features_t features)
> +			    netdev_features_t features)
>   {
>   	struct e1000_adapter *adapter = netdev_priv(netdev);
> -	struct e1000_hw *hw =&adapter->hw;
> -	u32 ctrl;
>
>   	if (!test_bit(__E1000_DOWN,&adapter->flags))
>   		e1000_irq_disable(adapter);
>
> -	ctrl = er32(CTRL);
> -	if (features&  NETIF_F_HW_VLAN_RX) {
> -		/* enable VLAN tag insert/strip */
> -		ctrl |= E1000_CTRL_VME;
> -	} else {
> -		/* disable VLAN tag insert/strip */
> -		ctrl&= ~E1000_CTRL_VME;
> -	}
> -	ew32(CTRL, ctrl);
> +	__e1000_vlan_mode(adapter, features);
>
>   	if (!test_bit(__E1000_DOWN,&adapter->flags))
>   		e1000_irq_enable(adapter);


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2012-03-19 23:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 18:17 VLAN regression caused by: e1000: do vlan cleanup (799d531) Ben Greear
2012-03-13  9:59 ` Jiri Pirko
2012-03-13 16:18   ` Ben Greear
2012-03-13 18:44   ` Ben Greear
2012-03-19 13:08     ` Jiri Pirko
2012-03-19 23:24       ` Ben Greear [this message]
2012-03-20  6:26         ` Jiri Pirko

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=4F67C014.1090500@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jpirko@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).