Netdev List
 help / color / mirror / Atom feed
* Re: [RFC 46/72] ixp2000: Move the Radisys driver
From: Jeff Kirsher @ 2011-07-09 15:58 UTC (permalink / raw)
  To: Lennert Buytenhek
  Cc: davem@davemloft.net, netdev@vger.kernel.org, Lennert Buytenhek
In-Reply-To: <20110626114721.GA19500@wantstofly.org>

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

On Sun, 2011-06-26 at 04:47 -0700, Lennert Buytenhek wrote:
> On Sat, Jun 25, 2011 at 06:58:57AM -0700, Jeff Kirsher wrote:
> 
> > Move the Radisys driver into drivers/net/ethernet/radisys/ and
> > make the necessary Kconfig and Makefile changes
> > 
> > CC: Lennert Buytenhek <kernel@wantstofly.org>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> >  MAINTAINERS                                        |    2 +-
> >  drivers/net/Kconfig                                |    2 --
> >  drivers/net/Makefile                               |    1 -
> >  drivers/net/ethernet/Kconfig                       |    1 +
> >  drivers/net/ethernet/Makefile                      |    1 +
> >  drivers/net/ethernet/radisys/Kconfig               |   16 ++++++++++++++++
> >  drivers/net/ethernet/radisys/Makefile              |    5 +++++
> >  drivers/net/{ => ethernet/radisys}/ixp2000/Kconfig |    2 +-
> >  .../net/{ => ethernet/radisys}/ixp2000/Makefile    |    0
> 
> The ixp2000 is a series of Intel ARM SoCs, and the ENP2611 is a Radisys
> PCI board based on the ixp2000 series (ixp2400), so it doesn't make
> sense to put everything in the radisys/ directory.

It was suggested earlier that it probably should be in either ixp/ or
radisys/, and someone suggested that ixp/ might be confusing.  If you
would like to keep it under drivers/net/ethernet/ixp2000, I am fine with
that as well.

> 
> If you insist on moving all drivers into vendor directories (I don't
> like that idea at all -- are we going to rename directories and shuffle
> stuff around every time vendor A buys vendor B or takes over one of
> vendor B's products?), at least the core ixp2000 code should be under
> intel/.

It was not my preference to place drivers into vendor specific
directories because of that very reason, as I did the work, it just
tended to work out that way.

The reason (as stated before) that it was not moved into intel/
directory is because the driver was not written (and supported) by
Intel.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [RFC 02/72] 3c*/acenic/typhoon: Move 3Com Ethernet drivers
From: Jeff Kirsher @ 2011-07-09 15:27 UTC (permalink / raw)
  To: Alan Cox
  Cc: davem@davemloft.net, netdev@vger.kernel.org, Philip Blundell,
	Steffen Klassert, David Dillow, Jes Sorensen, Donald Becker,
	Craig Southeren, David Hinds
In-Reply-To: <20110628092212.37708ca7@bob.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]

On Tue, 2011-06-28 at 01:22 -0700, Alan Cox wrote:
> On Sat, 25 Jun 2011 06:58:13 -0700
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> 
> > Moves the 3Com drivers into drivers/net/ethernet/3com/ and the
> > necessary Kconfig and Makefile changes.
> 
> This seems a bizarre way to carve stuff up.
> 
> To start with several of the things you put in 3com are just branded
> items, or are boards using non 3com devices which are currently with
> the other drivers that do so, some even use shared midlayers that you
> move them away from.

When I first started the process of organizing drivers/net/ I thought it
made sense to group the 3Com drivers together, even though one of the
drivers (3c503) used the 8390 common code.  Looking back, it does make
sense to keep the 3c503 driver in drivers/net/ethernet/8390/ along with
the other 8390 drivers.

> 
> You also pull stuff out of pcmcia which makes it harder to scan stuff
> grouped logically.

The logic behind this was to have all the Ethernet drivers in
drivers/net/ethernet/.  Since the drivers in drivers/net/pcmcia/ are not
sharing any special network common code or library, it did not seem to
make sense to me to keep them in drivers/net/pcmcia.  Eventually, there
would not be a drivers/net/pcmcia directory since all the drivers in
that directory would be moved into the appropriate
drivers/net/<technology>/ directory (i.e. ethernet, token-ring,fddi,
wireless, etc).  If there were a number of PCMCIA Ethernet drivers,
which all shared a common library or code, then it would make sense to
place them in drivers/net/ethernet/pcmcia/


> So this all seems a bit daft to me.
> 
> Surely it would make sense to put all the Intel 825xx stuff together,
> all the 8390 stuff together and so on.
> 
> Alan



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [RFC 37/72] fsl_*/gianfar*/ucc_*: Move the Freescale drivers
From: Jeff Kirsher @ 2011-07-09 15:07 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: davem@davemloft.net, netdev@vger.kernel.org, Sandeep Gopalpet,
	Fleming Andy-AFLEMING, Gridish Shlomi-RM96313, Li Yang-R58472,
	Pantelis Antoniou, Vitaly Bordug
In-Reply-To: <BANLkTikrLzkXCjzBBOwHUQZEdnzTSZv9bA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

On Wed, 2011-06-29 at 08:39 -0700, Tabi Timur-B04825 wrote:
> On Sat, Jun 25, 2011 at 8:58 AM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
> > Move the Freescale driver into drivers/net/ethernet/freescale/ and
> > make the necessary Kconfig and Makefile changes.
> 
> I don't have an actual objection to this, but I just don't understand
> why it's necessary.  Is this a new trend for drivers/net, to have all
> drivers grouped by manufacturer?  Or is there something special about
> Freescale?
> 

What we are trying to do is better organize the drivers/net directory
structure.  So I am placing all the Ethernet drivers in
drivers/net/ethernet/ and so on.  Under drivers/net/ethernet/, I have
tried to organize drivers by the most appropriate way to help in
maintaining the drivers, a lot of the time it tended to be by
manufacturer.  It made sense to group all the Freescale drivers into a
common directory so that it would be easier to maintain.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [RFC 43/72] a2065/ariadne: Move the a2065/ariadne drivers
From: Jeff Kirsher @ 2011-07-09 14:30 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <BANLkTin_SRhrd4dnfBH48b1aTikw5-mjtg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2268 bytes --]

On Tue, 2011-06-28 at 13:33 -0700, Geert Uytterhoeven wrote:
> On Sat, Jun 25, 2011 at 15:58, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > --- a/drivers/net/ethernet/Kconfig
> > +++ b/drivers/net/ethernet/Kconfig
> > @@ -12,8 +12,31 @@ menuconfig ETHERNET
> >  if ETHERNET
> >
> >  source "drivers/net/ethernet/3com/Kconfig"
> > +
> > +config A2065
> > +       tristate "A2065 support"
> > +       depends on ZORRO
> > +       select CRC32
> > +       ---help---
> > +         If you have a Commodore A2065 Ethernet adapter, say Y. Otherwise,
> > +         say N.
> > +
> > +         To compile this driver as a module, choose M here: the module
> > +         will be called a2065.
> > +
> >  source "drivers/net/ethernet/amd/Kconfig"
> >  source "drivers/net/ethernet/apple/Kconfig"
> > +
> > +config ARIADNE
> > +       tristate "Ariadne support"
> > +       depends on ZORRO
> > +       ---help---
> > +         If you have a Village Tronic Ariadne Ethernet adapter, say Y.
> > +         Otherwise, say N.
> > +
> > +         To compile this driver as a module, choose M here: the module
> > +         will be called ariadne.
> > +
> >  source "drivers/net/ethernet/arm/Kconfig"
> >  source "drivers/net/ethernet/atheros/Kconfig"
> 
> What's the rationale behind this "restructuring"?

In short to better organize drivers/net/.  There are a large number of
drivers in drivers/net/ so we are trying to organize the directory
structure to make it easier to maintain in the future.

> FWIW, both the A2065 and Ariadne drivers are for AMD LANCE variants
> (that is Am7990 and Am79C960)?

I saw that they were LANCE variants, yet did not use the "common" LANCE
code like the other LANCE drivers.  Based on suggestions from Arnd
Bergmann and Joe Perches, I am moving these into the AMD LANCE driver
directory.

> 
> And (in some other patch) 82596.c is an Intel driver, not a Motorola driver.

82596.c is not an Intel driver, it is an Intel part.  The driver was
written and support by someone other than Intel.  I am looking at how to
better organize the 82596.c, lasi_82596.c, lib82596.c, and sni_82596.c
which all use an Intel Ethernet chip but were written and supported by
someone other than Intel.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [net-next 5/5] ixgbe: convert to ndo_fix_features
From: Michal Miroslaw @ 2011-07-09 12:11 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Don Skidmore, netdev, gospo
In-Reply-To: <1310212240-24623-6-git-send-email-jeffrey.t.kirsher@intel.com>

On Sat, Jul 09, 2011 at 04:50:40AM -0700, Jeff Kirsher wrote:
> From: Don Skidmore <donald.c.skidmore@intel.com>
> 
> Private rx_csum flags are now duplicate of netdev->features &
> NETIF_F_RXCSUM.  We remove those duplicates and now use the net_device_ops
> ndo_set_features.  This was based on the original patch submitted by
> Michal Miroslaw <mirq-linux@rere.qmqm.pl>.  I also removed the special
> case not requiring a reset for X540 hardware.  It is needed just as it is
> in 82599 hardware.
[...]
> --- a/drivers/net/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ixgbe/ixgbe_main.c
> @@ -7188,6 +7188,88 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
[...]
> +static int ixgbe_set_features(struct net_device *netdev, u32 data)
> +{
> +	struct ixgbe_adapter *adapter = netdev_priv(netdev);
> +	bool need_reset = false;
> +
> +#ifdef CONFIG_DCB
> +	if ((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&
> +	    !(data &  NETIF_F_HW_VLAN_RX))
> +		return -EINVAL;
> +#endif
> +	/* return error if RXHASH is being enabled when RSS is not supported */
> +	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED) &&
> +	     (data &  NETIF_F_RXHASH))
> +		return -EINVAL;
> +
> +	/* If Rx checksum is disabled, then RSC/LRO should also be disabled */
> +	if (!(data & NETIF_F_RXCSUM)) {
> +		data &= ~NETIF_F_LRO;
> +		adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED;
> +	} else {
> +		adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED;
> +	}

The checks above should be done in ndo_fix_features callback. The check for
RSS_ENABLED for RXHASH is redundant, as the feature is removed in probe()
in this case (see [MARK] below).

> +
> +	/* if state changes we need to update adapter->flags and reset */
> +	if ((adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) &&
> +	    (!!(data & NETIF_F_LRO) !=
> +	     !!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) {
> +		if ((data &  NETIF_F_LRO) &&
> +		    adapter->rx_itr_setting != 1 &&
> +		    adapter->rx_itr_setting > IXGBE_MAX_RSC_INT_RATE) {
> +			e_info(probe, "rx-usecs set too low, "
> +			       "not enabling RSC\n");
> +		} else {
> +			adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED;
> +			switch (adapter->hw.mac.type) {
> +			case ixgbe_mac_X540:
> +			case ixgbe_mac_82599EB:
> +				need_reset = true;
> +				break;
> +			default:
> +				break;
> +			}
> +		}
> +	}
> +
> +	/*
> +	 * Check if Flow Director n-tuple support was enabled or disabled.  If
> +	 * the state changed, we need to reset.
> +	 */
> +	if (!(adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) {
> +		/* turn off ATR, enable perfect filters and reset */
> +		if (data & NETIF_F_NTUPLE) {
> +			adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
> +			adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
> +			need_reset = true;
> +		}
> +	} else if (!(data & NETIF_F_NTUPLE)) {
> +		/* turn off Flow Director, set ATR and reset */
> +		adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
> +		if ((adapter->flags &  IXGBE_FLAG_RSS_ENABLED) &&
> +		    !(adapter->flags &  IXGBE_FLAG_DCB_ENABLED))
> +			adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
> +		need_reset = true;
> +	}

Part of the checks above should be in ndo_fix_features, too. ndo_set_features
should just enable what it has been passed. What ndo_fix_features callback
returns is further limited by generic checks, and then (if the resulting set
is different than current dev->features) ndo_set_features is called.

> +
> +	if (need_reset)
> +		ixgbe_do_reset(netdev);
> +
> +	return 0;
> +
> +}
> +
>  static const struct net_device_ops ixgbe_netdev_ops = {
>  	.ndo_open		= ixgbe_open,
>  	.ndo_stop		= ixgbe_close,
> @@ -7219,6 +7301,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
>  	.ndo_fcoe_disable = ixgbe_fcoe_disable,
>  	.ndo_fcoe_get_wwn = ixgbe_fcoe_get_wwn,
>  #endif /* IXGBE_FCOE */
> +	.ndo_set_features = ixgbe_set_features,
>  };
>  
>  static void __devinit ixgbe_probe_vf(struct ixgbe_adapter *adapter,
> @@ -7486,20 +7569,24 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
>  
>  	netdev->features = NETIF_F_SG |
>  			   NETIF_F_IP_CSUM |
> +			   NETIF_F_IPV6_CSUM |
>  			   NETIF_F_HW_VLAN_TX |
>  			   NETIF_F_HW_VLAN_RX |
> -			   NETIF_F_HW_VLAN_FILTER;
> +			   NETIF_F_HW_VLAN_FILTER |
> +			   NETIF_F_TSO |
> +			   NETIF_F_TSO6 |
> +			   NETIF_F_GRO |
> +			   NETIF_F_RXHASH |
> +			   NETIF_F_RXCSUM;
>  
> -	netdev->features |= NETIF_F_IPV6_CSUM;
> -	netdev->features |= NETIF_F_TSO;
> -	netdev->features |= NETIF_F_TSO6;
> -	netdev->features |= NETIF_F_GRO;
> -	netdev->features |= NETIF_F_RXHASH;
> +	netdev->hw_features = netdev->features;
>  
>  	switch (adapter->hw.mac.type) {
>  	case ixgbe_mac_82599EB:
>  	case ixgbe_mac_X540:
>  		netdev->features |= NETIF_F_SCTP_CSUM;
> +		netdev->hw_features |= NETIF_F_SCTP_CSUM |
> +				       NETIF_F_NTUPLE;
>  		break;
>  	default:
>  		break;
> @@ -7538,6 +7625,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
>  		netdev->vlan_features |= NETIF_F_HIGHDMA;
>  	}
>  
> +	if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
> +		netdev->hw_features |= NETIF_F_LRO;
>  	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
>  		netdev->features |= NETIF_F_LRO;
>  
> @@ -7574,8 +7663,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
>  	if (err)
>  		goto err_sw_init;
>  
> -	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
> +	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) {
> +		netdev->hw_features &= ~NETIF_F_RXHASH;
>  		netdev->features &= ~NETIF_F_RXHASH;
> +	}
>  

[MARK here]

Best Regards,
Michał Mirosław

^ permalink raw reply

* [net-next 5/5] ixgbe: convert to ndo_fix_features
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Don Skidmore, netdev, gospo, Michal Miroslaw, Jeff Kirsher
In-Reply-To: <1310212240-24623-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Don Skidmore <donald.c.skidmore@intel.com>

Private rx_csum flags are now duplicate of netdev->features &
NETIF_F_RXCSUM.  We remove those duplicates and now use the net_device_ops
ndo_set_features.  This was based on the original patch submitted by
Michal Miroslaw <mirq-linux@rere.qmqm.pl>.  I also removed the special
case not requiring a reset for X540 hardware.  It is needed just as it is
in 82599 hardware.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Cc:  Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Tested-by: Phillip Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbe/ixgbe.h         |    1 +
 drivers/net/ixgbe/ixgbe_ethtool.c |  188 -------------------------------------
 drivers/net/ixgbe/ixgbe_main.c    |  105 +++++++++++++++++++--
 3 files changed, 99 insertions(+), 195 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 744b641..2b96d8d 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -588,6 +588,7 @@ extern void ixgbe_clear_rscctl(struct ixgbe_adapter *adapter,
 extern void ixgbe_set_rx_mode(struct net_device *netdev);
 extern int ixgbe_setup_tc(struct net_device *dev, u8 tc);
 extern void ixgbe_tx_ctxtdesc(struct ixgbe_ring *, u32, u32, u32, u32);
+extern void ixgbe_do_reset(struct net_device *netdev);
 #ifdef IXGBE_FCOE
 extern void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter);
 extern int ixgbe_fso(struct ixgbe_ring *tx_ring, struct sk_buff *skb,
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 074e9ba..06b7f88 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -442,109 +442,6 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
 	return 0;
 }
 
-static void ixgbe_do_reset(struct net_device *netdev)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(netdev);
-
-	if (netif_running(netdev))
-		ixgbe_reinit_locked(adapter);
-	else
-		ixgbe_reset(adapter);
-}
-
-static u32 ixgbe_get_rx_csum(struct net_device *netdev)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(netdev);
-	return adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED;
-}
-
-static void ixgbe_set_rsc(struct ixgbe_adapter *adapter)
-{
-	int i;
-
-	for (i = 0; i < adapter->num_rx_queues; i++) {
-		struct ixgbe_ring *ring = adapter->rx_ring[i];
-		if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
-			set_ring_rsc_enabled(ring);
-			ixgbe_configure_rscctl(adapter, ring);
-		} else {
-			ixgbe_clear_rscctl(adapter, ring);
-		}
-	}
-}
-
-static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(netdev);
-	bool need_reset = false;
-
-	if (data) {
-		adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED;
-	} else {
-		adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED;
-
-		if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) {
-			adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED;
-			netdev->features &= ~NETIF_F_LRO;
-		}
-
-		switch (adapter->hw.mac.type) {
-		case ixgbe_mac_X540:
-			ixgbe_set_rsc(adapter);
-			break;
-		case ixgbe_mac_82599EB:
-			need_reset = true;
-			break;
-		default:
-			break;
-		}
-	}
-
-	if (need_reset)
-		ixgbe_do_reset(netdev);
-
-	return 0;
-}
-
-static u32 ixgbe_get_tx_csum(struct net_device *netdev)
-{
-	return (netdev->features & NETIF_F_IP_CSUM) != 0;
-}
-
-static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(netdev);
-	u32 feature_list;
-
-	feature_list = (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
-	switch (adapter->hw.mac.type) {
-	case ixgbe_mac_82599EB:
-	case ixgbe_mac_X540:
-		feature_list |= NETIF_F_SCTP_CSUM;
-		break;
-	default:
-		break;
-	}
-	if (data)
-		netdev->features |= feature_list;
-	else
-		netdev->features &= ~feature_list;
-
-	return 0;
-}
-
-static int ixgbe_set_tso(struct net_device *netdev, u32 data)
-{
-	if (data) {
-		netdev->features |= NETIF_F_TSO;
-		netdev->features |= NETIF_F_TSO6;
-	} else {
-		netdev->features &= ~NETIF_F_TSO;
-		netdev->features &= ~NETIF_F_TSO6;
-	}
-	return 0;
-}
-
 static u32 ixgbe_get_msglevel(struct net_device *netdev)
 {
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -2287,81 +2184,6 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
-static int ixgbe_set_flags(struct net_device *netdev, u32 data)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(netdev);
-	bool need_reset = false;
-	int rc;
-
-#ifdef CONFIG_IXGBE_DCB
-	if ((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&
-	    !(data & ETH_FLAG_RXVLAN))
-		return -EINVAL;
-#endif
-
-	need_reset = (data & ETH_FLAG_RXVLAN) !=
-		     (netdev->features & NETIF_F_HW_VLAN_RX);
-
-	if ((data & ETH_FLAG_RXHASH) &&
-	    !(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
-		return -EOPNOTSUPP;
-
-	rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE |
-				  ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN |
-				  ETH_FLAG_RXHASH);
-	if (rc)
-		return rc;
-
-	/* if state changes we need to update adapter->flags and reset */
-	if ((adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) &&
-	    (!!(data & ETH_FLAG_LRO) !=
-	     !!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) {
-		if ((data & ETH_FLAG_LRO) &&
-		    (!adapter->rx_itr_setting ||
-		     (adapter->rx_itr_setting > IXGBE_MAX_RSC_INT_RATE))) {
-			e_info(probe, "rx-usecs set too low, "
-				      "not enabling RSC.\n");
-		} else {
-			adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED;
-			switch (adapter->hw.mac.type) {
-			case ixgbe_mac_X540:
-				ixgbe_set_rsc(adapter);
-				break;
-			case ixgbe_mac_82599EB:
-				need_reset = true;
-				break;
-			default:
-				break;
-			}
-		}
-	}
-
-	/*
-	 * Check if Flow Director n-tuple support was enabled or disabled.  If
-	 * the state changed, we need to reset.
-	 */
-	if (!(adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) {
-		/* turn off ATR, enable perfect filters and reset */
-		if (data & ETH_FLAG_NTUPLE) {
-			adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
-			adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
-			need_reset = true;
-		}
-	} else if (!(data & ETH_FLAG_NTUPLE)) {
-		/* turn off Flow Director, set ATR and reset */
-		adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
-		if ((adapter->flags & IXGBE_FLAG_RSS_ENABLED) &&
-		    !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
-			adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
-		need_reset = true;
-	}
-
-	if (need_reset)
-		ixgbe_do_reset(netdev);
-
-	return 0;
-}
-
 static int ixgbe_get_ethtool_fdir_entry(struct ixgbe_adapter *adapter,
 					struct ethtool_rxnfc *cmd)
 {
@@ -2744,16 +2566,8 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
 	.set_ringparam          = ixgbe_set_ringparam,
 	.get_pauseparam         = ixgbe_get_pauseparam,
 	.set_pauseparam         = ixgbe_set_pauseparam,
-	.get_rx_csum            = ixgbe_get_rx_csum,
-	.set_rx_csum            = ixgbe_set_rx_csum,
-	.get_tx_csum            = ixgbe_get_tx_csum,
-	.set_tx_csum            = ixgbe_set_tx_csum,
-	.get_sg                 = ethtool_op_get_sg,
-	.set_sg                 = ethtool_op_set_sg,
 	.get_msglevel           = ixgbe_get_msglevel,
 	.set_msglevel           = ixgbe_set_msglevel,
-	.get_tso                = ethtool_op_get_tso,
-	.set_tso                = ixgbe_set_tso,
 	.self_test              = ixgbe_diag_test,
 	.get_strings            = ixgbe_get_strings,
 	.set_phys_id            = ixgbe_set_phys_id,
@@ -2761,8 +2575,6 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
 	.get_ethtool_stats      = ixgbe_get_ethtool_stats,
 	.get_coalesce           = ixgbe_get_coalesce,
 	.set_coalesce           = ixgbe_set_coalesce,
-	.get_flags              = ethtool_op_get_flags,
-	.set_flags              = ixgbe_set_flags,
 	.get_rxnfc		= ixgbe_get_rxnfc,
 	.set_rxnfc		= ixgbe_set_rxnfc,
 };
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index de30796..206c069 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -7188,6 +7188,88 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
 	return 0;
 }
 
+void ixgbe_do_reset(struct net_device *netdev)
+{
+	struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+	if (netif_running(netdev))
+		ixgbe_reinit_locked(adapter);
+	else
+		ixgbe_reset(adapter);
+}
+
+static int ixgbe_set_features(struct net_device *netdev, u32 data)
+{
+	struct ixgbe_adapter *adapter = netdev_priv(netdev);
+	bool need_reset = false;
+
+#ifdef CONFIG_DCB
+	if ((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&
+	    !(data &  NETIF_F_HW_VLAN_RX))
+		return -EINVAL;
+#endif
+	/* return error if RXHASH is being enabled when RSS is not supported */
+	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED) &&
+	     (data &  NETIF_F_RXHASH))
+		return -EINVAL;
+
+	/* If Rx checksum is disabled, then RSC/LRO should also be disabled */
+	if (!(data & NETIF_F_RXCSUM)) {
+		data &= ~NETIF_F_LRO;
+		adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED;
+	} else {
+		adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED;
+	}
+
+	/* if state changes we need to update adapter->flags and reset */
+	if ((adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) &&
+	    (!!(data & NETIF_F_LRO) !=
+	     !!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) {
+		if ((data &  NETIF_F_LRO) &&
+		    adapter->rx_itr_setting != 1 &&
+		    adapter->rx_itr_setting > IXGBE_MAX_RSC_INT_RATE) {
+			e_info(probe, "rx-usecs set too low, "
+			       "not enabling RSC\n");
+		} else {
+			adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED;
+			switch (adapter->hw.mac.type) {
+			case ixgbe_mac_X540:
+			case ixgbe_mac_82599EB:
+				need_reset = true;
+				break;
+			default:
+				break;
+			}
+		}
+	}
+
+	/*
+	 * Check if Flow Director n-tuple support was enabled or disabled.  If
+	 * the state changed, we need to reset.
+	 */
+	if (!(adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) {
+		/* turn off ATR, enable perfect filters and reset */
+		if (data & NETIF_F_NTUPLE) {
+			adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
+			adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
+			need_reset = true;
+		}
+	} else if (!(data & NETIF_F_NTUPLE)) {
+		/* turn off Flow Director, set ATR and reset */
+		adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
+		if ((adapter->flags &  IXGBE_FLAG_RSS_ENABLED) &&
+		    !(adapter->flags &  IXGBE_FLAG_DCB_ENABLED))
+			adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
+		need_reset = true;
+	}
+
+	if (need_reset)
+		ixgbe_do_reset(netdev);
+
+	return 0;
+
+}
+
 static const struct net_device_ops ixgbe_netdev_ops = {
 	.ndo_open		= ixgbe_open,
 	.ndo_stop		= ixgbe_close,
@@ -7219,6 +7301,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
 	.ndo_fcoe_disable = ixgbe_fcoe_disable,
 	.ndo_fcoe_get_wwn = ixgbe_fcoe_get_wwn,
 #endif /* IXGBE_FCOE */
+	.ndo_set_features = ixgbe_set_features,
 };
 
 static void __devinit ixgbe_probe_vf(struct ixgbe_adapter *adapter,
@@ -7486,20 +7569,24 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 
 	netdev->features = NETIF_F_SG |
 			   NETIF_F_IP_CSUM |
+			   NETIF_F_IPV6_CSUM |
 			   NETIF_F_HW_VLAN_TX |
 			   NETIF_F_HW_VLAN_RX |
-			   NETIF_F_HW_VLAN_FILTER;
+			   NETIF_F_HW_VLAN_FILTER |
+			   NETIF_F_TSO |
+			   NETIF_F_TSO6 |
+			   NETIF_F_GRO |
+			   NETIF_F_RXHASH |
+			   NETIF_F_RXCSUM;
 
-	netdev->features |= NETIF_F_IPV6_CSUM;
-	netdev->features |= NETIF_F_TSO;
-	netdev->features |= NETIF_F_TSO6;
-	netdev->features |= NETIF_F_GRO;
-	netdev->features |= NETIF_F_RXHASH;
+	netdev->hw_features = netdev->features;
 
 	switch (adapter->hw.mac.type) {
 	case ixgbe_mac_82599EB:
 	case ixgbe_mac_X540:
 		netdev->features |= NETIF_F_SCTP_CSUM;
+		netdev->hw_features |= NETIF_F_SCTP_CSUM |
+				       NETIF_F_NTUPLE;
 		break;
 	default:
 		break;
@@ -7538,6 +7625,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 		netdev->vlan_features |= NETIF_F_HIGHDMA;
 	}
 
+	if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
+		netdev->hw_features |= NETIF_F_LRO;
 	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
 		netdev->features |= NETIF_F_LRO;
 
@@ -7574,8 +7663,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 	if (err)
 		goto err_sw_init;
 
-	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
+	if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) {
+		netdev->hw_features &= ~NETIF_F_RXHASH;
 		netdev->features &= ~NETIF_F_RXHASH;
+	}
 
 	switch (pdev->device) {
 	case IXGBE_DEV_ID_82599_SFP:
-- 
1.7.6


^ permalink raw reply related

* [net-next 3/5] igb: Add support of SerDes Forced mode for certain hardware
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, Jeff Kirsher
In-Reply-To: <1310212240-24623-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch changes the serdes link code to support a forced mode for
some hardware, based on bit set in EEPROM.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/e1000_82575.c   |   19 +++++++++++++++++--
 drivers/net/igb/e1000_82575.h   |    2 ++
 drivers/net/igb/e1000_defines.h |    5 +++--
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 7b7e157..c0857bd 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1156,10 +1156,13 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
 {
 	u32 ctrl_ext, ctrl_reg, reg;
 	bool pcs_autoneg;
+	s32 ret_val = E1000_SUCCESS;
+	u16 data;
 
 	if ((hw->phy.media_type != e1000_media_type_internal_serdes) &&
 	    !igb_sgmii_active_82575(hw))
-		return 0;
+		return ret_val;
+
 
 	/*
 	 * On the 82575, SerDes loopback mode persists until it is
@@ -1203,6 +1206,18 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
 		/* disable PCS autoneg and support parallel detect only */
 		pcs_autoneg = false;
 	default:
+		if (hw->mac.type == e1000_82575 ||
+		    hw->mac.type == e1000_82576) {
+			ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data);
+			if (ret_val) {
+				printk(KERN_DEBUG "NVM Read Error\n\n");
+				return ret_val;
+			}
+
+			if (data & E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT)
+				pcs_autoneg = false;
+		}
+
 		/*
 		 * non-SGMII modes only supports a speed of 1000/Full for the
 		 * link so it is best to just force the MAC and let the pcs
@@ -1250,7 +1265,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
 	if (!igb_sgmii_active_82575(hw))
 		igb_force_mac_fc(hw);
 
-	return 0;
+	return ret_val;
 }
 
 /**
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
index fd28d62..786e110 100644
--- a/drivers/net/igb/e1000_82575.h
+++ b/drivers/net/igb/e1000_82575.h
@@ -243,6 +243,8 @@ struct e1000_adv_tx_context_desc {
 #define E1000_DTXCTL_MDP_EN     0x0020
 #define E1000_DTXCTL_SPOOF_INT  0x0040
 
+#define E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT	(1 << 14)
+
 #define ALL_QUEUES   0xFFFF
 
 /* RX packet buffer size defines */
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index 446eb5c..2cd4082 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -437,6 +437,7 @@
 #define E1000_RAH_POOL_1 0x00040000
 
 /* Error Codes */
+#define E1000_SUCCESS      0
 #define E1000_ERR_NVM      1
 #define E1000_ERR_PHY      2
 #define E1000_ERR_CONFIG   3
@@ -587,8 +588,8 @@
 #define E1000_NVM_POLL_READ     0    /* Flag for polling for read complete */
 
 /* NVM Word Offsets */
-#define NVM_ID_LED_SETTINGS        0x0004
-/* For SERDES output amplitude adjustment. */
+#define NVM_COMPAT                 0x0003
+#define NVM_ID_LED_SETTINGS        0x0004 /* SERDES output amplitude */
 #define NVM_INIT_CONTROL2_REG      0x000F
 #define NVM_INIT_CONTROL3_PORT_B   0x0014
 #define NVM_INIT_CONTROL3_PORT_A   0x0024
-- 
1.7.6


^ permalink raw reply related

* [net-next 4/5] ixgbe: Make certain to initialize the fdir_perfect_lock in all cases
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, gospo, Jeff Kirsher
In-Reply-To: <1310212240-24623-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Alexander Duyck <alexander.h.duyck@intel.com>

This fix makes it so that the fdir_perfect_lock is initialized in all
cases.  This is necessary as the fdir_filter_exit routine will always
attempt to take the lock before inspecting the filter table.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbe/ixgbe_main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index fa671ae..de30796 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5155,8 +5155,6 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
 		adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED;
 		if (hw->device_id == IXGBE_DEV_ID_82599_T3_LOM)
 			adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE;
-		/* n-tuple support exists, always init our spinlock */
-		spin_lock_init(&adapter->fdir_perfect_lock);
 		/* Flow Director hash filters enabled */
 		adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
 		adapter->atr_sample_rate = 20;
@@ -5177,6 +5175,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
 		break;
 	}
 
+	/* n-tuple support exists, always init our spinlock */
+	spin_lock_init(&adapter->fdir_perfect_lock);
+
 #ifdef CONFIG_IXGBE_DCB
 	/* Configure DCB traffic classes */
 	for (j = 0; j < MAX_TRAFFIC_CLASS; j++) {
-- 
1.7.6


^ permalink raw reply related

* [net-next 2/5] igb: Update copyright on all igb driver files.
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, Jeff Kirsher
In-Reply-To: <1310212240-24623-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch updates the copyright on the igb driver files to 2011.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown  <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/Makefile        |    2 +-
 drivers/net/igb/e1000_82575.c   |    2 +-
 drivers/net/igb/e1000_82575.h   |    2 +-
 drivers/net/igb/e1000_defines.h |    2 +-
 drivers/net/igb/e1000_hw.h      |    2 +-
 drivers/net/igb/e1000_mac.c     |    2 +-
 drivers/net/igb/e1000_mac.h     |    2 +-
 drivers/net/igb/e1000_mbx.c     |    2 +-
 drivers/net/igb/e1000_mbx.h     |    2 +-
 drivers/net/igb/e1000_nvm.c     |    2 +-
 drivers/net/igb/e1000_nvm.h     |    2 +-
 drivers/net/igb/e1000_phy.c     |    2 +-
 drivers/net/igb/e1000_phy.h     |    2 +-
 drivers/net/igb/e1000_regs.h    |    2 +-
 drivers/net/igb/igb.h           |    2 +-
 drivers/net/igb/igb_ethtool.c   |    2 +-
 drivers/net/igb/igb_main.c      |    2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/igb/Makefile b/drivers/net/igb/Makefile
index 8372cb9..c6e4621 100644
--- a/drivers/net/igb/Makefile
+++ b/drivers/net/igb/Makefile
@@ -1,7 +1,7 @@
 ################################################################################
 #
 # Intel 82575 PCI-Express Ethernet Linux driver
-# Copyright(c) 1999 - 2009 Intel Corporation.
+# Copyright(c) 1999 - 2011 Intel Corporation.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 493e331..7b7e157 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
index dd6df34..fd28d62 100644
--- a/drivers/net/igb/e1000_82575.h
+++ b/drivers/net/igb/e1000_82575.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index 6b80d40..446eb5c 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 27153e8..4519a13 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index c822904..2b5ef76 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_mac.h b/drivers/net/igb/e1000_mac.h
index 601be99..4927f61 100644
--- a/drivers/net/igb/e1000_mac.h
+++ b/drivers/net/igb/e1000_mac.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c
index 78d48c7..74f2f11 100644
--- a/drivers/net/igb/e1000_mbx.c
+++ b/drivers/net/igb/e1000_mbx.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_mbx.h b/drivers/net/igb/e1000_mbx.h
index bb112fb..eddb0f8 100644
--- a/drivers/net/igb/e1000_mbx.h
+++ b/drivers/net/igb/e1000_mbx.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_nvm.c b/drivers/net/igb/e1000_nvm.c
index 75bf36a..7dcd65c 100644
--- a/drivers/net/igb/e1000_nvm.c
+++ b/drivers/net/igb/e1000_nvm.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_nvm.h b/drivers/net/igb/e1000_nvm.h
index 7f43564..a2a7ca9 100644
--- a/drivers/net/igb/e1000_nvm.h
+++ b/drivers/net/igb/e1000_nvm.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007 Intel Corporation.
+  Copyright(c) 2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
index d639706..e662554 100644
--- a/drivers/net/igb/e1000_phy.c
+++ b/drivers/net/igb/e1000_phy.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_phy.h b/drivers/net/igb/e1000_phy.h
index 2cc1177..8510797 100644
--- a/drivers/net/igb/e1000_phy.h
+++ b/drivers/net/igb/e1000_phy.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
index 958ca3b..0990f6d 100644
--- a/drivers/net/igb/e1000_regs.h
+++ b/drivers/net/igb/e1000_regs.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index f4fa4b1..0389ff6 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 1862c97..ed63ff4 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index d6c4bd8..f4d82b2 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel(R) Gigabit Ethernet Linux driver
-  Copyright(c) 2007-2009 Intel Corporation.
+  Copyright(c) 2007-2011 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
-- 
1.7.6


^ permalink raw reply related

* [net-next 1/5] igb: Fix lack of flush after register write and before delay
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, Jeff Kirsher
In-Reply-To: <1310212240-24623-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

Register writes followed by a delay are required to have a flush
before the delay in order to commit the values to the register.  Without
the flush, the code following the delay may not function correctly.

Reported-by: Tong Ho <tong.ho@ericsson.com>
Reported-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by:  Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/e1000_82575.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 0f563c8..493e331 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1735,6 +1735,7 @@ static s32 igb_reset_hw_82580(struct e1000_hw *hw)
 		ctrl |= E1000_CTRL_RST;
 
 	wr32(E1000_CTRL, ctrl);
+	wrfl();
 
 	/* Add delay to insure DEV_RST has time to complete */
 	if (global_device_reset)
-- 
1.7.6


^ permalink raw reply related

* [net-next 0/5][pull request] Intel Wired LAN Driver Update
From: Jeff Kirsher @ 2011-07-09 11:50 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo

The following series contains updates to igb and ixgbe.

igb- a fix of adding a flush after a register write, the addition
    of SerDes forced mode support and a trivial update of copyright
    header.

ixgbe- conversion to ndo_fix_features and a fix to initialize
    fdir_perfect_lock in all cases

The following are changes since commit a05e42c27f80d341a5ec2053b041e24231a002e2:
  Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
and are available in the git repository at:
  master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6 master


Alexander Duyck (1):
  ixgbe: Make certain to initialize the fdir_perfect_lock in all cases

Carolyn Wyborny (3):
  igb: Fix lack of flush after register write and before delay
  igb: Update copyright on all igb driver files.
  igb: Add support of SerDes Forced mode for certain hardware

Don Skidmore (1):
  ixgbe: convert to ndo_fix_features

 drivers/net/igb/Makefile          |    2 +-
 drivers/net/igb/e1000_82575.c     |   22 ++++-
 drivers/net/igb/e1000_82575.h     |    4 +-
 drivers/net/igb/e1000_defines.h   |    7 +-
 drivers/net/igb/e1000_hw.h        |    2 +-
 drivers/net/igb/e1000_mac.c       |    2 +-
 drivers/net/igb/e1000_mac.h       |    2 +-
 drivers/net/igb/e1000_mbx.c       |    2 +-
 drivers/net/igb/e1000_mbx.h       |    2 +-
 drivers/net/igb/e1000_nvm.c       |    2 +-
 drivers/net/igb/e1000_nvm.h       |    2 +-
 drivers/net/igb/e1000_phy.c       |    2 +-
 drivers/net/igb/e1000_phy.h       |    2 +-
 drivers/net/igb/e1000_regs.h      |    2 +-
 drivers/net/igb/igb.h             |    2 +-
 drivers/net/igb/igb_ethtool.c     |    2 +-
 drivers/net/igb/igb_main.c        |    2 +-
 drivers/net/ixgbe/ixgbe.h         |    1 +
 drivers/net/ixgbe/ixgbe_ethtool.c |  188 -------------------------------------
 drivers/net/ixgbe/ixgbe_main.c    |  110 ++++++++++++++++++++--
 20 files changed, 142 insertions(+), 218 deletions(-)

-- 
1.7.6


^ permalink raw reply

* [PATCH] net: wrap common patterns of rx handler code
From: Michał Mirosław @ 2011-07-09 10:47 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller
In-Reply-To: <20110709104428.GB6437@rere.qmqm.pl>

Introduce dev_skb_finish_rx_dma() and dev_skb_finish_rx_dma_refill() ---
two common patterns for rx handling as seen in various network drivers
that implement rx_copybreak idea (copying smaller packets, passing larger
ones in original skb).

The common pattern (as implemented in dev_skb_finish_rx_dma()) is:

if (packet len <= threshold)
	allocate new, smaller skb
	sync DMA buffer to cpu
	copy packet's data
	give DMA buffer back to device
	pass new skb
	reuse buffer in rx ring
else (or if skb alloc for copy failed)
	unmap DMA buffer
	pass skb
	remove buffer from rx ring
	[refill rx ring later]

This scheme is modified by some drivers to immediately refill rx slot before
passing original rx skb up the stack. Those drivers have also a problem that
they drop packets from the head of the queue when that allocation fails. This
forces unnecessary retransmits and can deadlock if the device is used for
swapping over network.  To mark this case, dev_skb_finish_rx_dma_refill()
implementing it, is marked as deprecated to encourage driver maintainers to
look into the matter.

Those functions are called from rx handler hot path and have a lot of arguments,
and so are inlined. This should allow compiler to better optimize the code with
calling code.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 include/linux/skbuff.h |  129 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 129 insertions(+), 0 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 08d4507..8f81972 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,6 +29,7 @@
 #include <linux/rcupdate.h>
 #include <linux/dmaengine.h>
 #include <linux/hrtimer.h>
+#include <linux/dma-mapping.h>
 
 /* Don't change this without changing skb_csum_unnecessary! */
 #define CHECKSUM_NONE 0
@@ -2281,5 +2282,133 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
 
 bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
 
+/**
+ * __dev_skb_finish_rx_dma - finish skb after DMA'd RX
+ * @skb: skb to finish
+ * @len: packet data length
+ * @copybreak: maximum packet size to copy
+ * @dma_dev: device used for DMA
+ * @dma_buf: DMA mapping address
+ * @dma_len: DMA mapping length
+ *
+ * This function finishes DMA mapping (sync for copied, unmap otherwise) for
+ * a packet and copies it to new skb if its size is at or below @copybreak
+ * threshold.
+ *
+ * Returns new skb or NULL if the copy wasn't made.
+ */
+static inline struct sk_buff *__dev_skb_finish_rx_dma(
+	struct sk_buff *skb, unsigned int len, unsigned int copybreak,
+	struct device *dma_dev, dma_addr_t dma_buf, size_t dma_len)
+{
+	if (len <= copybreak) {
+		struct sk_buff *skb2 = netdev_alloc_skb_ip_align(skb->dev, len);
+		if (likely(skb2)) {
+			dma_sync_single_for_cpu(dma_dev, dma_buf, dma_len,
+				DMA_FROM_DEVICE);
+			skb_copy_to_linear_data(skb2, skb->data, len);
+			dma_sync_single_for_device(dma_dev, dma_buf, dma_len,
+				DMA_FROM_DEVICE);
+			return skb2;
+		}
+	}
+
+	/* else or copy failed */
+
+	dma_unmap_single(dma_dev, dma_buf, dma_len, DMA_FROM_DEVICE);
+	return NULL;
+}
+
+/**
+ * dev_skb_finish_rx_dma - finish skb after DMA'd RX
+ * @pskb: pointer to variable holding skb to finish
+ * @len: packet data length
+ * @copybreak: maximum packet size to copy
+ * @dma_dev: device used for DMA
+ * @dma_buf: DMA mapping address
+ * @dma_len: DMA mapping length
+ *
+ * This function finishes DMA mapping (sync for copied, unmap otherwise) for
+ * a packet and copies it to new skb if its size is at or below @copybreak
+ * threshold.  Like __dev_skb_finish_rx_dma().
+ *
+ * Returns the skb - old or copied. *pskb is cleared if the skb wasn't copied.
+ */
+static inline struct sk_buff *dev_skb_finish_rx_dma(
+	struct sk_buff **pskb, unsigned int len, unsigned int copybreak,
+	struct device *dma_dev, dma_addr_t dma_buf, size_t dma_len)
+{
+	struct sk_buff *skb2;
+
+	skb2 = __dev_skb_finish_rx_dma(*pskb, len, copybreak,
+		dma_dev, dma_buf, dma_len);
+
+	if (!skb2) {
+		/* not copied */
+		skb2 = *pskb;
+		*pskb = NULL;
+	}
+
+	skb_put(skb2, len);
+	return skb2;
+}
+
+/**
+ * dev_skb_finish_rx_dma_refill - finish skb after DMA'd RX and refill the slot
+ * @pskb: pointer to variable holding skb to finish
+ * @len: packet data length
+ * @copybreak: maximum packet size to copy
+ * @ip_align: new skb's alignment offset
+ * @rx_offset: count of bytes prepended by HW before packet's data
+ * @dma_dev: device used for DMA
+ * @dma_buf: DMA mapping address
+ * @dma_len: DMA mapping length
+ *
+ * This function finishes DMA mapping (sync for copied, unmap otherwise) for
+ * a packet and copies it to new skb if its size is at or below @copybreak
+ * threshold.  Like __dev_skb_finish_rx_dma().
+ *
+ * *pskb is filled with new mapped skb if the skb wasn't copied.
+ * Returns the skb - old or copied, or NULL if refill failed.
+ *
+ * NOTE:
+ * This will effectively drop the packet in case of memory pressure. This
+ * might not be wanted when swapping over network. It's better to throttle
+ * the receiver queue (refill later) as the packet might be needed to
+ * reclaim some memory.
+ */
+static inline __deprecated struct sk_buff *dev_skb_finish_rx_dma_refill(
+	struct sk_buff **pskb, unsigned int len, unsigned int copybreak,
+	unsigned int ip_align, unsigned int rx_offset,
+	struct device *dma_dev, dma_addr_t *dma_buf, size_t dma_len)
+{
+	struct sk_buff *skb;
+
+	skb = __dev_skb_finish_rx_dma(*pskb, len, copybreak,
+		dma_dev, *dma_buf, dma_len);
+
+	if (!skb) {
+		/* not copied */
+		skb = *pskb;
+		/* netdev_alloc_skb_ip_align() */
+		*pskb = netdev_alloc_skb(skb->dev, dma_len + ip_align);
+		if (likely(*pskb))
+			skb_reserve(*pskb, ip_align + rx_offset);
+		else {
+			/* no memory - drop packet */
+			*pskb = skb;
+			skb = NULL;
+		}
+
+		*dma_buf = dma_map_single(dma_dev, (*pskb)->data - rx_offset,
+			dma_len, DMA_FROM_DEVICE);
+	}
+
+	if (likely(skb))
+		skb_put(skb, len);
+
+	return skb;
+}
+
 #endif	/* __KERNEL__ */
 #endif	/* _LINUX_SKBUFF_H */
-- 
1.7.5.4


^ permalink raw reply related

* Re: [RFC PATCH] net: clean up rx_copybreak handling
From: Michał Mirosław @ 2011-07-09 10:44 UTC (permalink / raw)
  To: David Miller; +Cc: dave, netdev
In-Reply-To: <20110709.025729.1469467150725305489.davem@davemloft.net>

On Sat, Jul 09, 2011 at 02:57:29AM -0700, David Miller wrote:
> From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Date: Sat, 9 Jul 2011 10:54:44 +0200
> > What about the patch's general idea?
> I fully support the idea behind your changes.

Let's start with the implementation then (patch will follow).

Best Regards,
Michał Mirosław

^ permalink raw reply

* Re: [RFC PATCH] net: clean up rx_copybreak handling
From: David Miller @ 2011-07-09  9:57 UTC (permalink / raw)
  To: mirq-linux; +Cc: dave, netdev
In-Reply-To: <20110709085444.GA5522@rere.qmqm.pl>

From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Sat, 9 Jul 2011 10:54:44 +0200

> What about the patch's general idea?

I fully support the idea behind your changes.

^ permalink raw reply

* Re: [PATCH 1/3] benet: Add missing comma between constant string array
From: David Miller @ 2011-07-09  9:57 UTC (permalink / raw)
  To: joe; +Cc: sathya.perla, subbu.seetharaman, ajit.khaparde, netdev,
	linux-kernel
In-Reply-To: <8c2d9b2ff796489a39408fade30fc93ed6040b3c.1310187270.git.joe@perches.com>

From: Joe Perches <joe@perches.com>
Date: Fri,  8 Jul 2011 23:20:23 -0700

> Multiple quoted strings are concatenated without comma separators.
> 
> Make the arrays const while there.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied, thanks Joe.

^ permalink raw reply

* Re: [PATCH net-next] skbuff: clear tx zero-copy flag
From: David Miller @ 2011-07-09  9:55 UTC (permalink / raw)
  To: mashirle; +Cc: mst, netdev, kvm, linux-kernel
In-Reply-To: <1310195566.25391.6.camel@localhost.localdomain>

From: Shirley Ma <mashirle@us.ibm.com>
Date: Sat, 09 Jul 2011 00:12:46 -0700

> This patch clears tx zero-copy flag as needed.
> 
> Signed-off-by: Shirley Ma <xma@us.ibm.com>

Applied, thanks.

^ permalink raw reply

* Re: [RFC PATCH] net: clean up rx_copybreak handling
From: Michał Mirosław @ 2011-07-09  8:54 UTC (permalink / raw)
  To: David Dillow; +Cc: netdev
In-Reply-To: <1310175469.26320.9.camel@obelisk.thedillows.org>

On Fri, Jul 08, 2011 at 09:37:49PM -0400, David Dillow wrote:
> On Sat, 2011-07-09 at 01:27 +0200, Michał Mirosław wrote:
> > diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
> 
> > @@ -1675,25 +1674,14 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read
> >  
> >                 pkt_len = le16_to_cpu(rx->frameLen);
> >  
> > -               if(pkt_len < rx_copybreak &&
> > -                  (new_skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
> > -                       skb_reserve(new_skb, 2);
> > -                       pci_dma_sync_single_for_cpu(tp->pdev, dma_addr,
> > -                                                   PKT_BUF_SZ,
> > -                                                   PCI_DMA_FROMDEVICE);
> > -                       skb_copy_to_linear_data(new_skb, skb->data, pkt_len);
> > -                       pci_dma_sync_single_for_device(tp->pdev, dma_addr,
> > -                                                      PKT_BUF_SZ,
> > -                                                      PCI_DMA_FROMDEVICE);
> > -                       skb_put(new_skb, pkt_len);
> > +               new_skb = dev_skb_finish_rx_dma(&rxb->skb,
> > +                       pkt_len, rx_copybreak,
> > +                       &tp->pdev->dev, dma_addr, PKT_BUF_SZ);
> 
> Needs a few more tabs in front of the arguments. It looks like
> 		new_skb = dev_skb_finish_rx_dma(&rxb->skb, pkt_len,
> 						rx_copybreak, &tp->pdev->dev,
> 						dma_addr, PKT_BUF_SZ);
> 
> would fit the style around it better.
> 
> > +               if (!rxb->skb)
> >                         typhoon_recycle_rx_skb(tp, idx);
> 
> I think you either meant
> 		if (rxb->skb)
> 			typhoon_recycle_rx_skb(tp, idx);
> 
> or to swap typhoon_{recycle,alloc}_rx_skb(). As it stands, you'll reload
> the NIC with a NULL skb pointer, and it will DMA to the old location
> when it eventually uses this descriptor.
> 
> > -               } else {
> > -                       new_skb = skb;
> > -                       skb_put(new_skb, pkt_len);
> > -                       pci_unmap_single(tp->pdev, dma_addr, PKT_BUF_SZ,
> > -                                      PCI_DMA_FROMDEVICE);
> > +               else
> >                         typhoon_alloc_rx_skb(tp, idx);

All fixed.

What about the patch's general idea?

Best Regards,
Michał Mirosław

^ permalink raw reply

* [PATCH net-next] skbuff: clear tx zero-copy flag
From: Shirley Ma @ 2011-07-09  7:12 UTC (permalink / raw)
  To: David Miller; +Cc: mst, netdev, kvm, linux-kernel

Hello Dave,

This patch clears tx zero-copy flag as needed.

Sign-off-by: Shirley Ma <xma@us.ibm.com>
---

 net/core/skbuff.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a9577a2..d220119 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -677,6 +677,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
 	if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
 		if (skb_copy_ubufs(skb, gfp_mask))
 			return NULL;
+		skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
 	}
 
 	n = skb + 1;
@@ -801,6 +802,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
 				kfree(n);
 				goto out;
 			}
+			skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
 		}
 		for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
 			skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i];
@@ -893,6 +895,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
 		if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
 			if (skb_copy_ubufs(skb, gfp_mask))
 				goto nofrags;
+			skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
 		}
 		for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
 			get_page(skb_shinfo(skb)->frags[i].page);

^ permalink raw reply related

* [PATCH 3/3] iwlagn: Add missing comma between constant string array
From: Joe Perches @ 2011-07-09  6:20 UTC (permalink / raw)
  To: Wey-Yi Guy, Intel Linux Wireless
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1310187270.git.joe@perches.com>

Multiple quoted strings are concatenated without comma separators.

Make the array const while there.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 7e6c463..de1a0c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1563,7 +1563,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 	release_firmware(ucode_raw);
 }
 
-static const char *desc_lookup_text[] = {
+static const char * const desc_lookup_text[] = {
 	"OK",
 	"FAIL",
 	"BAD_PARAM",
@@ -1587,7 +1587,7 @@ static const char *desc_lookup_text[] = {
 	"NMI_INTERRUPT_DATA_ACTION_PT",
 	"NMI_TRM_HW_ER",
 	"NMI_INTERRUPT_TRM",
-	"NMI_INTERRUPT_BREAK_POINT"
+	"NMI_INTERRUPT_BREAK_POINT",
 	"DEBUG_0",
 	"DEBUG_1",
 	"DEBUG_2",
-- 
1.7.6.131.g99019

^ permalink raw reply related

* [PATCH 2/3] iwlegacy: Add missing comma between constant string array
From: Joe Perches @ 2011-07-09  6:20 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1310187270.git.joe@perches.com>

Multiple quoted strings are concatenated without comma separators.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/iwlegacy/iwl4965-base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index 46242d2..1433466 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -1484,7 +1484,7 @@ static const char * const desc_lookup_text[] = {
 	"NMI_INTERRUPT_DATA_ACTION_PT",
 	"NMI_TRM_HW_ER",
 	"NMI_INTERRUPT_TRM",
-	"NMI_INTERRUPT_BREAK_POINT"
+	"NMI_INTERRUPT_BREAK_POINT",
 	"DEBUG_0",
 	"DEBUG_1",
 	"DEBUG_2",
-- 
1.7.6.131.g99019

^ permalink raw reply related

* [PATCH 1/3] benet: Add missing comma between constant string array
From: Joe Perches @ 2011-07-09  6:20 UTC (permalink / raw)
  To: Sathya Perla, Subbu Seetharaman, Ajit Khaparde; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1310187270.git.joe@perches.com>

Multiple quoted strings are concatenated without comma separators.

Make the arrays const while there.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/benet/be_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 696f634..4ebd700 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -44,7 +44,7 @@ static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
 };
 MODULE_DEVICE_TABLE(pci, be_dev_ids);
 /* UE Status Low CSR */
-static char *ue_status_low_desc[] = {
+static const char * const ue_status_low_desc[] = {
 	"CEV",
 	"CTX",
 	"DBUF",
@@ -79,7 +79,7 @@ static char *ue_status_low_desc[] = {
 	"MPU_INTPEND"
 };
 /* UE Status High CSR */
-static char *ue_status_hi_desc[] = {
+static const char * const ue_status_hi_desc[] = {
 	"LPCMEMHOST",
 	"MGMT_MAC",
 	"PCS0ONLINE",
@@ -103,7 +103,7 @@ static char *ue_status_hi_desc[] = {
 	"HOST7",
 	"HOST8",
 	"HOST9",
-	"NETC"
+	"NETC",
 	"Unknown",
 	"Unknown",
 	"Unknown",
-- 
1.7.6.131.g99019

^ permalink raw reply related

* [PATCH 0/3] Add missing commas
From: Joe Perches @ 2011-07-09  6:20 UTC (permalink / raw)
  To: netdev, linux-wireless; +Cc: linux-kernel

A patch to staging/gma500 found a missing comma in
arrays declarations.  Here are some others.

Joe Perches (3):
  benet: Add missing comma between constant string array
  iwlegacy: Add missing comma between constant string array
  iwlagn: Add missing comma between constant string array

 drivers/net/benet/be_main.c                  |    6 +++---
 drivers/net/wireless/iwlegacy/iwl4965-base.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c       |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.7.6.131.g99019

^ permalink raw reply

* Re: [PATCH] net/fec: gasket needs to be enabled for some i.mx
From: Shawn Guo @ 2011-07-09  5:44 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: netdev, Troy Kisky, u.kleine-koenig, Shawn Guo, David S. Miller,
	linux-arm-kernel, LW
In-Reply-To: <20110708101810.GE6069@pengutronix.de>

On Fri, Jul 08, 2011 at 12:18:10PM +0200, Sascha Hauer wrote:
> On Fri, Jul 01, 2011 at 06:11:22PM +0800, Shawn Guo wrote:
> > On the recent i.mx (mx25/50/53), there is a gasket inside fec
> > controller which needs to be enabled no matter phy works in MII
> > or RMII mode.
> > 
> > The current code enables the gasket only when phy interface is RMII.
> > It's broken when the driver works with a MII phy.  The patch uses
> > platform_device_id to distinguish the SoCs that have the gasket and
> > enables it on these SoCs for both MII and RMII mode.
> > 
> > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/mach-imx/clock-imx25.c                 |    2 +-
> >  arch/arm/mach-imx/clock-imx27.c                 |    2 +-
> >  arch/arm/mach-imx/clock-imx35.c                 |    2 +-
> >  arch/arm/mach-mx5/clock-mx51-mx53.c             |    4 +-
> >  arch/arm/plat-mxc/devices/platform-fec.c        |   17 ++++++++-------
> >  arch/arm/plat-mxc/include/mach/devices-common.h |    1 +
> >  drivers/net/fec.c                               |   26 ++++++++++++++++++++--
> >  7 files changed, 38 insertions(+), 16 deletions(-)
> > 
> > diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
> > index a65838f..5527fff 100644
> > --- a/arch/arm/mach-imx/clock-imx25.c
> > +++ b/arch/arm/mach-imx/clock-imx25.c
> > @@ -294,7 +294,7 @@ static struct clk_lookup lookups[] = {
> >  	_REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
> >  	_REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
> >  	_REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
> > -	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > +	_REGISTER_CLOCK("imx25-fec.0", NULL, fec_clk)
> >  	_REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
> >  	_REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
> >  	_REGISTER_CLOCK("imx2-wdt.0", NULL, wdt_clk)
> > diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c
> > index 583f251..d197df2 100644
> > --- a/arch/arm/mach-imx/clock-imx27.c
> > +++ b/arch/arm/mach-imx/clock-imx27.c
> > @@ -662,7 +662,7 @@ static struct clk_lookup lookups[] = {
> >  	_REGISTER_CLOCK(NULL, "brom", brom_clk)
> >  	_REGISTER_CLOCK(NULL, "emma", emma_clk)
> >  	_REGISTER_CLOCK(NULL, "slcdc", slcdc_clk)
> > -	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > +	_REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk)
> >  	_REGISTER_CLOCK(NULL, "emi", emi_clk)
> >  	_REGISTER_CLOCK(NULL, "sahara2", sahara2_clk)
> >  	_REGISTER_CLOCK(NULL, "ata", ata_clk)
> > diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
> > index 5a4cc1e..fb4007b 100644
> > --- a/arch/arm/mach-imx/clock-imx35.c
> > +++ b/arch/arm/mach-imx/clock-imx35.c
> > @@ -461,7 +461,7 @@ static struct clk_lookup lookups[] = {
> >  	_REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
> >  	_REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk)
> >  	_REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk)
> > -	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > +	_REGISTER_CLOCK("imx35-fec.0", NULL, fec_clk)
> >  	_REGISTER_CLOCK(NULL, "gpio", gpio1_clk)
> >  	_REGISTER_CLOCK(NULL, "gpio", gpio2_clk)
> >  	_REGISTER_CLOCK(NULL, "gpio", gpio3_clk)
> > diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
> > index 699b0d2..04c5a01 100644
> > --- a/arch/arm/mach-mx5/clock-mx51-mx53.c
> > +++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
> > @@ -1426,7 +1426,7 @@ static struct clk_lookup mx51_lookups[] = {
> >  	_REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
> >  	_REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
> >  	_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
> > -	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > +	_REGISTER_CLOCK("imx51-fec.0", NULL, fec_clk)
> >  	_REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk)
> >  	_REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)
> >  	_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
> > @@ -1475,7 +1475,7 @@ static struct clk_lookup mx53_lookups[] = {
> >  	_REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
> >  	_REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
> >  	_REGISTER_CLOCK(NULL, "gpt", gpt_clk)
> > -	_REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > +	_REGISTER_CLOCK("imx53-fec.0", NULL, fec_clk)
> >  	_REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
> >  	_REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
> >  	_REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
> > diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
> > index ccc789e..3790c59 100644
> > --- a/arch/arm/plat-mxc/devices/platform-fec.c
> > +++ b/arch/arm/plat-mxc/devices/platform-fec.c
> > @@ -10,40 +10,41 @@
> >  #include <mach/hardware.h>
> >  #include <mach/devices-common.h>
> >  
> > -#define imx_fec_data_entry_single(soc)					\
> > +#define imx_fec_data_entry_single(soc, _devid)				\
> >  	{								\
> > +		.devid = _devid,					\
> >  		.iobase = soc ## _FEC_BASE_ADDR,			\
> >  		.irq = soc ## _INT_FEC,					\
> >  	}
> >  
> >  #ifdef CONFIG_SOC_IMX25
> >  const struct imx_fec_data imx25_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX25);
> > +	imx_fec_data_entry_single(MX25, "imx25-fec");
> >  #endif /* ifdef CONFIG_SOC_IMX25 */
> >  
> >  #ifdef CONFIG_SOC_IMX27
> >  const struct imx_fec_data imx27_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX27);
> > +	imx_fec_data_entry_single(MX27, "imx27-fec");
> >  #endif /* ifdef CONFIG_SOC_IMX27 */
> >  
> >  #ifdef CONFIG_SOC_IMX35
> >  const struct imx_fec_data imx35_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX35);
> > +	imx_fec_data_entry_single(MX35, "imx35-fec");
> >  #endif
> >  
> >  #ifdef CONFIG_SOC_IMX50
> >  const struct imx_fec_data imx50_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX50);
> > +	imx_fec_data_entry_single(MX50, "imx50-fec");
> >  #endif
> >  
> >  #ifdef CONFIG_SOC_IMX51
> >  const struct imx_fec_data imx51_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX51);
> > +	imx_fec_data_entry_single(MX51, "imx51-fec");
> >  #endif
> >  
> >  #ifdef CONFIG_SOC_IMX53
> >  const struct imx_fec_data imx53_fec_data __initconst =
> > -	imx_fec_data_entry_single(MX53);
> > +	imx_fec_data_entry_single(MX53, "imx53-fec");
> >  #endif
> >  
> >  struct platform_device *__init imx_add_fec(
> > @@ -62,7 +63,7 @@ struct platform_device *__init imx_add_fec(
> >  		},
> >  	};
> >  
> > -	return imx_add_platform_device_dmamask("fec", 0,
> > +	return imx_add_platform_device_dmamask(data->devid, 0,
> >  			res, ARRAY_SIZE(res),
> >  			pdata, sizeof(*pdata), DMA_BIT_MASK(32));
> >  }
> > diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
> > index bf93820..6ac2450 100644
> > --- a/arch/arm/plat-mxc/include/mach/devices-common.h
> > +++ b/arch/arm/plat-mxc/include/mach/devices-common.h
> > @@ -30,6 +30,7 @@ static inline struct platform_device *imx_add_platform_device(
> >  
> >  #include <linux/fec.h>
> >  struct imx_fec_data {
> > +	const char *devid;
> >  	resource_size_t iobase;
> >  	resource_size_t irq;
> >  };
> > diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> > index 885d8ba..9161a82 100644
> > --- a/drivers/net/fec.c
> > +++ b/drivers/net/fec.c
> > @@ -66,14 +66,31 @@
> >  #define FEC_QUIRK_ENET_MAC		(1 << 0)
> >  /* Controller needs driver to swap frame */
> >  #define FEC_QUIRK_SWAP_FRAME		(1 << 1)
> > +/* Controller uses gasket */
> > +#define FEC_QUIRK_USE_GASKET		(1 << 2)
> >  
> >  static struct platform_device_id fec_devtype[] = {
> >  	{
> > -		.name = DRIVER_NAME,
> > +		.name = "imx25-fec",
> 
> Just realized that this change breaks m68k support. You shouldn't remove
> DRIVER_NAME from fec_devtype[]
> 
Right, I forgot that family.  Thanks for the reminding, Sascha.

-- 
Regards,
Shawn

^ permalink raw reply

* Re: [PATCH] net/fec: gasket needs to be enabled for some i.mx
From: Shawn Guo @ 2011-07-09  5:45 UTC (permalink / raw)
  To: Troy Kisky
  Cc: Shawn Guo, Sascha Hauer, netdev, linux-arm-kernel,
	u.kleine-koenig, LW, David S. Miller
In-Reply-To: <4E174E91.2090609@boundarydevices.com>

On Fri, Jul 08, 2011 at 11:38:09AM -0700, Troy Kisky wrote:
> On 7/8/2011 3:18 AM, Sascha Hauer wrote:
> > On Fri, Jul 01, 2011 at 06:11:22PM +0800, Shawn Guo wrote:
> >> On the recent i.mx (mx25/50/53), there is a gasket inside fec
> >> controller which needs to be enabled no matter phy works in MII
> >> or RMII mode.
> >>
> >> The current code enables the gasket only when phy interface is RMII.
> >> It's broken when the driver works with a MII phy.  The patch uses
> >> platform_device_id to distinguish the SoCs that have the gasket and
> >> enables it on these SoCs for both MII and RMII mode.
> >>
> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 
> While you're making changes, you can change this to
> Reported-by: Troy Kisky
> 
Ok.

-- 
Regards,
Shawn


^ permalink raw reply

* I need your assistance
From: leung  cheung @ 2011-07-09  4:02 UTC (permalink / raw)



Hello,

Compliment of the day to you. I am sending this brief letter to solicit 
your partnership to transfer $22,500,000.00 US Dollars from Hong Kong to 
your country. You will be entitled to 40% after compliting the transaction 
while I will be entitled to 60% as the sole initiator of this mutual 
proposal. I shall send you more information and procedures when I receive 
a positive response from you.

Best Regards,

Mr. Leung Cheung
Email: leungcheung18@helixnet.cn



^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox