lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 Mar 2012 16:24:04 -0700
From:	Ben Greear <greearb@...delatech.com>
To:	Jiri Pirko <jpirko@...hat.com>
CC:	e1000-devel list <e1000-devel@...ts.sourceforge.net>,
	netdev <netdev@...r.kernel.org>
Subject: Re: VLAN regression caused by: e1000: do vlan cleanup (799d531).

On 03/19/2012 06:08 AM, Jiri Pirko wrote:
> Tue, Mar 13, 2012 at 07:44:18PM CET, greearb@...delatech.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@...delatech.com>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists