Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 3/6] ibmveth: Add ethtool TSO handlers
From: Jeff Garzik @ 2007-08-07 21:50 UTC (permalink / raw)
  To: Brian King; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <200708061942.l76JgSnp016148@d03av04.boulder.ibm.com>

Brian King wrote:
> Add handlers for get_tso and get_ufo to prevent errors being printed
> by ethtool.
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
> 
>  drivers/net/ibmveth.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff -puN drivers/net/ibmveth.c~ibmveth_ethtool_get_tso drivers/net/ibmveth.c
> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_ethtool_get_tso	2007-07-19 11:18:38.000000000 -0500
> +++ linux-2.6-bjking1/drivers/net/ibmveth.c	2007-07-19 11:18:38.000000000 -0500
> @@ -759,7 +759,9 @@ static const struct ethtool_ops netdev_e
>  	.get_tx_csum		= ethtool_op_get_tx_csum,
>  	.set_tx_csum		= ibmveth_set_tx_csum,
>  	.get_rx_csum		= ibmveth_get_rx_csum,
> -	.set_rx_csum		= ibmveth_set_rx_csum
> +	.set_rx_csum		= ibmveth_set_rx_csum,
> +	.get_tso			= ethtool_op_get_tso,
> +	.get_ufo			= ethtool_op_get_ufo

ACK, once you add a comma to the end of the final initializer

As you see from this patch, the practice of -not- having commas at the 
end of a list of struct initializers is not patch-friendly, since you 
must touch an unrelated line each time you patch the end of the struct. 
  For named initializers particularly, the lack of a comma is even more 
useless.

So, it might tweak some C perfectionists, but adding that 
seemingly-useless comma at the end of the last entry reduces maintenance 
headache and makes patch reviews slightly more clear.

	Jeff

^ permalink raw reply

* Re: [PATCH 4/6] ibmveth: Add ethtool driver stats hooks
From: Jeff Garzik @ 2007-08-07 21:50 UTC (permalink / raw)
  To: Brian King; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <200708061942.l76JgZRK020999@d03av03.boulder.ibm.com>

Brian King wrote:
> Add ethtool hooks to ibmveth to retrieve driver statistics.
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
> 
>  drivers/net/ibmveth.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 52 insertions(+), 1 deletion(-)
> 
> diff -puN drivers/net/ibmveth.c~ibmveth_ethtool_driver_stats drivers/net/ibmveth.c
> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_ethtool_driver_stats	2007-07-19 11:18:41.000000000 -0500
> +++ linux-2.6-bjking1/drivers/net/ibmveth.c	2007-07-19 11:18:41.000000000 -0500
> @@ -112,6 +112,28 @@ MODULE_DESCRIPTION("IBM i/pSeries Virtua
>  MODULE_LICENSE("GPL");
>  MODULE_VERSION(ibmveth_driver_version);
>  
> +struct ibmveth_stat {
> +	char name[ETH_GSTRING_LEN];
> +	int offset;
> +};
> +
> +#define IBMVETH_STAT_OFF(stat) offsetof(struct ibmveth_adapter, stat)
> +#define IBMVETH_GET_STAT(a, off) *((u64 *)(((unsigned long)(a)) + off))
> +
> +struct ibmveth_stat ibmveth_stats[] = {
> +	{ "replenish_task_cycles", IBMVETH_STAT_OFF(replenish_task_cycles) },
> +	{ "replenish_no_mem", IBMVETH_STAT_OFF(replenish_no_mem) },
> +	{ "replenish_add_buff_failure", IBMVETH_STAT_OFF(replenish_add_buff_failure) },
> +	{ "replenish_add_buff_success", IBMVETH_STAT_OFF(replenish_add_buff_success) },
> +	{ "rx_invalid_buffer", IBMVETH_STAT_OFF(rx_invalid_buffer) },
> +	{ "rx_no_buffer", IBMVETH_STAT_OFF(rx_no_buffer) },
> +	{ "tx_multidesc_send", IBMVETH_STAT_OFF(tx_multidesc_send) },
> +	{ "tx_linearized", IBMVETH_STAT_OFF(tx_linearized) },
> +	{ "tx_linearize_failed", IBMVETH_STAT_OFF(tx_linearize_failed) },
> +	{ "tx_map_failed", IBMVETH_STAT_OFF(tx_map_failed) },
> +	{ "tx_send_failed", IBMVETH_STAT_OFF(tx_send_failed) }
> +};
> +
>  /* simple methods of getting data from the current rxq entry */
>  static inline int ibmveth_rxq_pending_buffer(struct ibmveth_adapter *adapter)
>  {
> @@ -751,6 +773,32 @@ static u32 ibmveth_get_rx_csum(struct ne
>  	return adapter->rx_csum;
>  }
>  
> +static void ibmveth_get_strings(struct net_device *dev, u32 stringset, u8 *data)
> +{
> +	int i;
> +
> +	if (stringset != ETH_SS_STATS)
> +		return;
> +
> +	for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++, data += ETH_GSTRING_LEN)
> +		memcpy(data, ibmveth_stats[i].name, ETH_GSTRING_LEN);
> +}
> +
> +static int ibmveth_get_stats_count(struct net_device *dev)
> +{
> +	return ARRAY_SIZE(ibmveth_stats);
> +}
> +
> +static void ibmveth_get_ethtool_stats(struct net_device *dev,
> +				      struct ethtool_stats *stats, u64 *data)
> +{
> +	int i;
> +	struct ibmveth_adapter *adapter = dev->priv;
> +
> +	for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++)
> +		data[i] = IBMVETH_GET_STAT(adapter, ibmveth_stats[i].offset);
> +}
> +
>  static const struct ethtool_ops netdev_ethtool_ops = {
>  	.get_drvinfo		= netdev_get_drvinfo,
>  	.get_settings		= netdev_get_settings,
> @@ -761,7 +809,10 @@ static const struct ethtool_ops netdev_e
>  	.get_rx_csum		= ibmveth_get_rx_csum,
>  	.set_rx_csum		= ibmveth_set_rx_csum,
>  	.get_tso			= ethtool_op_get_tso,
> -	.get_ufo			= ethtool_op_get_ufo
> +	.get_ufo			= ethtool_op_get_ufo,
> +	.get_strings		= ibmveth_get_strings,
> +	.get_stats_count		= ibmveth_get_stats_count,
> +	.get_ethtool_stats	= ibmveth_get_ethtool_stats

ACK, modulo comma-at-end-of-initializer per previous email

^ permalink raw reply

* Re: [PATCH 6/6] ibmveth: Remove use of bitfields
From: Jeff Garzik @ 2007-08-07 21:56 UTC (permalink / raw)
  To: Brian King; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <200708061942.l76JgmxI031698@d03av01.boulder.ibm.com>

Brian King wrote:
> Removes the use of bitfields from the ibmveth driver. This results
> in slightly smaller object code.
> 
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
> 
>  linux-2.6-bjking1/drivers/net/ibmveth.c |   90 ++++++++++++++++----------------
>  linux-2.6-bjking1/drivers/net/ibmveth.h |   56 ++++++++-----------
>  2 files changed, 68 insertions(+), 78 deletions(-)

strong ACK :)

Though I also encourage you to avoid #defines for named constants, in 
favor of

enum {
	IBMVETH_BUF_VALID	= (1U << 31),
	IBMVETH_BUF_TOGGLE	= (1U << 30),
	IBMVETH_BUF_NO_CSUM	= (1U << 25),
	IBMVETH_BUF_CSUM_GOOD	= (1U << 24),
	IBMVETH_BUF_LEN_MASK	= 0x00FFFFFF,
};

This illustrates:

1) The "1 << n" notation is FAR easier to read and compare with data 
sheets.  You're just adding to the trouble by requiring the reviewer's 
brain to convert hex numbers to bits, even if most engineers can do this 
in their sleep.

2) The named constants are available to the C compiler, which is more 
friendly to debuggers.  It also supplies type information to the C compiler.

3) Similar to #2, wading through C pre-processor output is much easier 
when the symbols don't disappear.

These are recommendations, not requirements, but I've found these 
techniques superior to cpp in many other drivers.

	Jeff

^ permalink raw reply

* Re: [PATCH 68] drivers/net/s2io.c: kmalloc + memset conversion to k[cz]alloc
From: Jeff Garzik @ 2007-08-07 21:57 UTC (permalink / raw)
  To: Mariusz Kozlowski; +Cc: linux-kernel, kernel-janitors, Andrew Morton, netdev
In-Reply-To: <200707312356.58934.m.kozlowski@tuxland.pl>

Mariusz Kozlowski wrote:
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
> 
>  drivers/net/s2io.c | 235587 -> 235340 (-247 bytes)
>  drivers/net/s2io.o | 460768 -> 460120 (-648 bytes)
> 
>  drivers/net/s2io.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)

ACK but didn't apply, please wait 24-48 hours (so that s2io fixes go 
upstream), then rediff and resend



^ permalink raw reply

* Re: [PATCH 69] drivers/net/sb1250-mac.c: kmalloc + memset conversion to kcalloc
From: Jeff Garzik @ 2007-08-07 21:57 UTC (permalink / raw)
  To: Mariusz Kozlowski; +Cc: linux-kernel, kernel-janitors, Andrew Morton, netdev
In-Reply-To: <200707312358.36567.m.kozlowski@tuxland.pl>

Mariusz Kozlowski wrote:
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
> 
>  drivers/net/sb1250-mac.c | 76286 -> 76199 (-87 bytes)
> 
>  drivers/net/sb1250-mac.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

applied



^ permalink raw reply

* Re: [PATCH 76] drivers/net/via-velocity.c: mostly kmalloc + memset conversion to kcalloc
From: Jeff Garzik @ 2007-08-07 21:57 UTC (permalink / raw)
  To: Mariusz Kozlowski
  Cc: linux-kernel, kernel-janitors, Andrew Morton, romieu, netdev
In-Reply-To: <200708010011.50979.m.kozlowski@tuxland.pl>

Mariusz Kozlowski wrote:
> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
> 
>  drivers/net/via-velocity.c | 88263 -> 88120 (-143 bytes)
>  drivers/net/via-velocity.o | 254264 -> 253828 (-436 bytes)
> 
>  drivers/net/via-velocity.c |   24 ++++++++++--------------
>  1 file changed, 10 insertions(+), 14 deletions(-)

applied



^ permalink raw reply

* [PATCH] xen-netfront: remove dead code
From: Jeremy Fitzhardinge @ 2007-08-07 21:56 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kernel Mailing List, NetDev, Adrian Bunk, Michal Piotrowski

This patch removes some residual dead code left over from removing the
"flip" receive mode.  This patch doesn't change the generated output
at all, since gcc already realized it was dead.

This resolves the "regression" reported by Adrian.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>

---
 drivers/net/xen-netfront.c |   37 ++-----------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

===================================================================
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -209,11 +209,9 @@ static void xennet_alloc_rx_buffers(stru
 	struct page *page;
 	int i, batch_target, notify;
 	RING_IDX req_prod = np->rx.req_prod_pvt;
-	struct xen_memory_reservation reservation;
 	grant_ref_t ref;
 	unsigned long pfn;
 	void *vaddr;
-	int nr_flips;
 	struct xen_netif_rx_request *req;
 
 	if (unlikely(!netif_carrier_ok(dev)))
@@ -263,7 +261,7 @@ no_skb:
 		np->rx_target = np->rx_max_target;
 
  refill:
-	for (nr_flips = i = 0; ; i++) {
+	for (i = 0; ; i++) {
 		skb = __skb_dequeue(&np->rx_batch);
 		if (skb == NULL)
 			break;
@@ -292,38 +290,7 @@ no_skb:
 		req->gref = ref;
 	}
 
-	if (nr_flips != 0) {
-		reservation.extent_start = np->rx_pfn_array;
-		reservation.nr_extents   = nr_flips;
-		reservation.extent_order = 0;
-		reservation.address_bits = 0;
-		reservation.domid        = DOMID_SELF;
-
-		if (!xen_feature(XENFEAT_auto_translated_physmap)) {
-			/* After all PTEs have been zapped, flush the TLB. */
-			np->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] =
-				UVMF_TLB_FLUSH|UVMF_ALL;
-
-			/* Give away a batch of pages. */
-			np->rx_mcl[i].op = __HYPERVISOR_memory_op;
-			np->rx_mcl[i].args[0] = XENMEM_decrease_reservation;
-			np->rx_mcl[i].args[1] = (unsigned long)&reservation;
-
-			/* Zap PTEs and give away pages in one big
-			 * multicall. */
-			(void)HYPERVISOR_multicall(np->rx_mcl, i+1);
-
-			/* Check return status of HYPERVISOR_memory_op(). */
-			if (unlikely(np->rx_mcl[i].result != i))
-				panic("Unable to reduce memory reservation\n");
-		} else {
-			if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
-						 &reservation) != i)
-				panic("Unable to reduce memory reservation\n");
-		}
-	} else {
-		wmb();		/* barrier so backend seens requests */
-	}
+	wmb();		/* barrier so backend seens requests */
 
 	/* Above is a suitable barrier to ensure backend will see requests. */
 	np->rx.req_prod_pvt = req_prod + i;


^ permalink raw reply

* Re: [PATCH 2/6] ibmveth: Implement ethtool hooks to enable/disable checksum offload
From: Brian King @ 2007-08-07 22:07 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <46B8E891.80403@garzik.org>

Jeff Garzik wrote:
> Brian King wrote:
>> This patch adds the appropriate ethtool hooks to allow for enabling/disabling
>> of hypervisor assisted checksum offload for TCP.
>>
>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>> ---
>>
>>  linux-2.6-bjking1/drivers/net/ibmveth.c |  118 +++++++++++++++++++++++++++++++-
>>  linux-2.6-bjking1/drivers/net/ibmveth.h |    1 
>>  2 files changed, 117 insertions(+), 2 deletions(-)
>>
>> diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool drivers/net/ibmveth.c
>> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool	2007-08-01 14:55:14.000000000 -0500
>> +++ linux-2.6-bjking1/drivers/net/ibmveth.c	2007-08-01 14:55:14.000000000 -0500
>> @@ -641,12 +641,125 @@ static u32 netdev_get_link(struct net_de
>>  	return 1;
>>  }
>>  
>> +static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
>> +{
>> +	struct ibmveth_adapter *adapter = dev->priv;
>> +
>> +	if (data)
>> +		adapter->rx_csum = 1;
>> +	else {
>> +		adapter->rx_csum = 0;
>> +		dev->features &= ~NETIF_F_IP_CSUM;
> 
> why does this RX-related code clear a TX-related flag?

Its related to how the pSeries firmware works. The firmware provides an interface
to enable "checksum offload", which means both tx and rx checksum offload from
the firmware's point of view. The firmware does not support enabling checksum
offload for only rx. If I disable it for rx I have to disable it for tx as
well, otherwise the firmware will reject all future tx buffers I throw at it
that are not checksummed.

-Brian

-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center

^ permalink raw reply

* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Jeff Garzik @ 2007-08-07 22:15 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Michael Chan, davem, netdev, eliezert, lusinsky, eilong
In-Reply-To: <200708020006.13457.mb@bu3sch.de>

Michael Buesch wrote:
> On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
>> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
>> +{
>> +	struct net_device *dev = dev_instance;
> 
> You need to check if dev==NULL and bail out.
> Another driver sharing the IRQ with this might choose to pass the dev
> pointer as NULL.

NAK that advice:  It is pointless having such a check in the hottest of 
driver hot paths, since a large majority of drivers do not have such a 
check.

It is better to fix the extremely rare oddball that passes NULL to 
request_irq(), than to update all drivers to be slower due to the oddballs.


>> +	struct bnx2x *bp = netdev_priv(dev);
> 
> No check if the device actually _did_ generate the IRQ? Sharing...

Not for MSI


>> +static irqreturn_t bnx2x_msix_fp_int(int irq, void *fp_cookie)
>> +{
>> +
>> +	struct bnx2x_fastpath *fp = fp_cookie;
> 
> Check if fp==NULL

NAK

>> +	struct bnx2x *bp = fp->bp;
>> +	struct net_device *dev = bp->dev;
> 
> No share protection either?

MSI


>> +static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
>> +{
>> +	struct net_device *dev = dev_instance;
> 
> Check if dev==NULL

NAK


>> +	struct bnx2x *bp = netdev_priv(dev);
>> +	u16 status = bnx2x_ack_int(bp);
>> +
>> +	if (unlikely(status == 0)) {
> 
> That's not unlikely.

in this case, agreed

the other comments seem fairly sane, and indeed should be considered for 
the existing drivers as well.

	Jeff



^ permalink raw reply

* Re: [PATCH 2/6] ibmveth: Implement ethtool hooks to enable/disable checksum offload
From: Jeff Garzik @ 2007-08-07 22:16 UTC (permalink / raw)
  To: brking; +Cc: linuxppc-dev, rcjenn, santil, netdev
In-Reply-To: <46B8ED10.1060701@linux.vnet.ibm.com>

Brian King wrote:
> Jeff Garzik wrote:
>> Brian King wrote:
>>> This patch adds the appropriate ethtool hooks to allow for enabling/disabling
>>> of hypervisor assisted checksum offload for TCP.
>>>
>>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>>> ---
>>>
>>>  linux-2.6-bjking1/drivers/net/ibmveth.c |  118 +++++++++++++++++++++++++++++++-
>>>  linux-2.6-bjking1/drivers/net/ibmveth.h |    1 
>>>  2 files changed, 117 insertions(+), 2 deletions(-)
>>>
>>> diff -puN drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool drivers/net/ibmveth.c
>>> --- linux-2.6/drivers/net/ibmveth.c~ibmveth_csum_offload_ethtool	2007-08-01 14:55:14.000000000 -0500
>>> +++ linux-2.6-bjking1/drivers/net/ibmveth.c	2007-08-01 14:55:14.000000000 -0500
>>> @@ -641,12 +641,125 @@ static u32 netdev_get_link(struct net_de
>>>  	return 1;
>>>  }
>>>  
>>> +static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
>>> +{
>>> +	struct ibmveth_adapter *adapter = dev->priv;
>>> +
>>> +	if (data)
>>> +		adapter->rx_csum = 1;
>>> +	else {
>>> +		adapter->rx_csum = 0;
>>> +		dev->features &= ~NETIF_F_IP_CSUM;
>> why does this RX-related code clear a TX-related flag?
> 
> Its related to how the pSeries firmware works. The firmware provides an interface
> to enable "checksum offload", which means both tx and rx checksum offload from
> the firmware's point of view. The firmware does not support enabling checksum
> offload for only rx. If I disable it for rx I have to disable it for tx as
> well, otherwise the firmware will reject all future tx buffers I throw at it
> that are not checksummed.

ACK once you add a comment describing this :)

^ permalink raw reply

* Re: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
From: Jeff Garzik @ 2007-08-07 22:20 UTC (permalink / raw)
  To: Sivakumar Subramani; +Cc: netdev, support
In-Reply-To: <Pine.GSO.4.10.10708060525530.4004-100000@guinness>

Sivakumar Subramani wrote:
> - Making MSIX as default intr_type
> - Driver will test MSI-X by issuing test MSI-X vector and if fails it will
>   fallback to INTA
> 
> Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com>
> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>

This patch series looks a bit big to apply this far past the merge 
window.  It changes behavior in the middle of a -rc stream, which is 
something to avoid since we are deep into "bug fixes only" mode at this 
point.

I'm open to suggestions, otherwise I can apply these to netdev#upstream 
(queued for 2.6.24).

	Jeff



^ permalink raw reply

* Re: Please pull 'upstream-jgarzik' branch of wireless-2.6
From: Jeff Garzik @ 2007-08-07 22:21 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev
In-Reply-To: <20070806201649.GK6442@tuxdriver.com>

John W. Linville wrote:
> These are intended for 2.6.24...
> 
> ---
> 
> The following changes since commit fdc8f43b5e49b64b251bb48da95193a13ac0132f:
>   Michael Buesch (1):
>         softmac: Fix deadlock of wx_set_essid with assoc work
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git upstream-jgarzik
> 
> Bill Nottingham (1):
>       remove gratuitous space in airo module description
> 
> Faidon Liambotis (2):
>       Kconfig: order options
>       Kconfig: remove references of pcmcia-cs
> 
> Mariusz Kozlowski (1):
>       drivers/net/wireless/prism54/oid_mgt.c: kmalloc + memset conversion to kzalloc
> 
> Matthias Kaehlcke (1):
>       Use mutex instead of semaphore in the Host AP driver
> 
> Ulrich Kunitz (1):
>       zd1211rw: monitor all packets
> 
> Yoann Padioleau (1):
>       dev->priv to netdev_priv(dev), for drivers/net/wireless
> 
>  drivers/net/wireless/Kconfig               |   85 +++++++++++----------------
>  drivers/net/wireless/airo.c                |    4 +-
>  drivers/net/wireless/arlan-proc.c          |   14 ++--
>  drivers/net/wireless/hostap/hostap_cs.c    |    2 +-
>  drivers/net/wireless/hostap/hostap_hw.c    |   16 +++---
>  drivers/net/wireless/hostap/hostap_ioctl.c |   14 ++--
>  drivers/net/wireless/hostap/hostap_wlan.h  |    3 +-
>  drivers/net/wireless/orinoco_tmd.c         |    2 +-
>  drivers/net/wireless/prism54/isl_ioctl.c   |    6 +-
>  drivers/net/wireless/prism54/oid_mgt.c     |    4 +-
>  drivers/net/wireless/ray_cs.c              |   66 +++++++++++-----------
>  drivers/net/wireless/strip.c               |    2 +-
>  drivers/net/wireless/wl3501_cs.c           |   66 +++++++++++-----------
>  drivers/net/wireless/zd1211rw/zd_chip.h    |    5 --
>  drivers/net/wireless/zd1211rw/zd_mac.c     |   44 ++++++++++++--
>  15 files changed, 172 insertions(+), 161 deletions(-)

pulled into #upstream



^ permalink raw reply

* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Michael Buesch @ 2007-08-07 22:20 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Michael Chan, davem, netdev, eliezert, lusinsky, eilong
In-Reply-To: <46B8EF13.40109@garzik.org>

On Wednesday 08 August 2007 00:15:47 Jeff Garzik wrote:
> Michael Buesch wrote:
> > On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
> >> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> >> +{
> >> +	struct net_device *dev = dev_instance;
> > 
> > You need to check if dev==NULL and bail out.
> > Another driver sharing the IRQ with this might choose to pass the dev
> > pointer as NULL.
> 
> NAK that advice:  It is pointless having such a check in the hottest of 
> driver hot paths, since a large majority of drivers do not have such a 
> check.
> 
> It is better to fix the extremely rare oddball that passes NULL to 
> request_irq(), than to update all drivers to be slower due to the oddballs.

Ah, well. IMO one should better go safe than Oops. ;)
It's not that an if branch takes more than 2 or 3 CPU cycles at worst.
But well, if you don't like it, I can live without it, too.

-- 
Greetings Michael.

^ permalink raw reply

* Re: Please pull 'libertas-upstream' branch of wireless-2.6
From: Jeff Garzik @ 2007-08-07 22:22 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20070806203005.GL6442-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

John W. Linville wrote:
> Got a big patch bomb from the libertas guys.  I tried to cherry-pick
> some of the fixes for 2.6.23, but they either were fixes to problems
> in new code or all the code cleanups made them difficult for me to
> intelligently backport.
> 
> So, this is intended for 2.6.24...
> 
> ---
> 
> The following changes since commit d4ac2477fad0f2680e84ec12e387ce67682c5c13:
>   Linus Torvalds (1):
>         Linux 2.6.23-rc2
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-upstream

This is missing the patch.  I looked at it locally, but please do send a 
patch for review with each push, no matter how big.

pulled into #upstream

^ permalink raw reply

* Re: [PATCH] xen-netfront: remove dead code
From: Jeff Garzik @ 2007-08-07 22:25 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
	Michal Piotrowski
In-Reply-To: <46B8EA9A.5020704@goop.org>

Jeremy Fitzhardinge wrote:
> This patch removes some residual dead code left over from removing the
> "flip" receive mode.  This patch doesn't change the generated output
> at all, since gcc already realized it was dead.
> 
> This resolves the "regression" reported by Adrian.
> 
> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
> Cc: Adrian Bunk <bunk@stusta.de>
> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
> 
> ---
>  drivers/net/xen-netfront.c |   37 ++-----------------------------------
>  1 file changed, 2 insertions(+), 35 deletions(-)

Please send drivers/net/* through me and netdev...

	Jeff



^ permalink raw reply

* Re: [PATCH RFC]: napi_struct V5
From: Roland Dreier @ 2007-08-07 22:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, shemminger, jgarzik, hadi, rusty
In-Reply-To: <20070805.232423.21363072.davem@davemloft.net>

Thanks for looking at ipoib... overall looks fine, just a few comments.

 > --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
 > +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
 > @@ -281,63 +281,58 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
 >  			   wc->status, wr_id, wc->vendor_err);
 >  }
 >  
 > -int ipoib_poll(struct net_device *dev, int *budget)
 > +int ipoib_poll(struct napi_struct *napi, int budget)

 > +poll_more:
 > +	while (done < budget) {
 > +		int max = (budget - done);
 > +
 >  		t = min(IPOIB_NUM_WC, max);

I think this is the only place where max is used now.  Might as well
kill it and put budget-done in directly.  That would get rid of the
strange-looking parens in the "max =" line too.

 >  		n = ib_poll_cq(priv->cq, t, priv->ibwc);
 >  
 > -		for (i = 0; i < n; ++i) {
 > +		for (i = 0; i < n; i++) {

it might be nicer to avoid noise like this in the patch.

 > +	if (done < budget) {
 > +		netif_rx_complete(dev, napi);
 >  		if (unlikely(ib_req_notify_cq(priv->cq,
 >  					      IB_CQ_NEXT_COMP |
 >  					      IB_CQ_REPORT_MISSED_EVENTS)) &&
 > -		    netif_rx_reschedule(dev, 0))
 > -			return 1;
 > -
 > -		return 0;
 > +		    netif_rx_reschedule(napi))
 > +			goto poll_more;

this goto back to the polling loop is a change in behavior.  When we
were tuning NAPI, we found that returning in the missed event case and
letting the NAPI core call the poll routine later actually performed
better, because it allowed more work to pile up.

So could the code just look like:

		netif_rx_complete(dev, napi);
 		if (unlikely(ib_req_notify_cq(priv->cq,
 					      IB_CQ_NEXT_COMP |
 					      IB_CQ_REPORT_MISSED_EVENTS)))
			netif_rx_reschedule(napi);

and then just return done in all cases?

It doesn't seem like the return value of netif_rx_reschedule() matters
in what we would want to do.  The only thing it's used for in the old
code is to decide what the poll routine should return.

 - R.

^ permalink raw reply

* Re: [PATCH] xen-netfront: remove dead code
From: Jeremy Fitzhardinge @ 2007-08-07 22:37 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Linus Torvalds, Linux Kernel Mailing List, NetDev, Adrian Bunk,
	Michal Piotrowski
In-Reply-To: <46B8F149.3090706@garzik.org>

Jeff Garzik wrote:
> Please send drivers/net/* through me and netdev... 

Sure.  Did you pick this patch up?

Thanks,
    J

^ permalink raw reply

* RE: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
From: Ramkrishna Vepa @ 2007-08-07 22:59 UTC (permalink / raw)
  To: Jeff Garzik, Sivakumar Subramani; +Cc: netdev, support
In-Reply-To: <46B8F01B.1080308@garzik.org>

Jeff,

Go ahead and apply these patches to netdev#upstream (queued for 2.6.24).
Thanks,

Ram

> -----Original Message-----
> From: Jeff Garzik [mailto:jeff@garzik.org]
> Sent: Tuesday, August 07, 2007 3:20 PM
> To: Sivakumar Subramani
> Cc: netdev@vger.kernel.org; support
> Subject: Re: [PATCH 2.6.23 1/3]S2IO: Making MSIX as default intr_type
> 
> Sivakumar Subramani wrote:
> > - Making MSIX as default intr_type
> > - Driver will test MSI-X by issuing test MSI-X vector and if fails
it
> will
> >   fallback to INTA
> >
> > Signed-off-by: Sivakumar Subramani
<sivakumar.subramani@neterion.com>
> > Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
> 
> This patch series looks a bit big to apply this far past the merge
> window.  It changes behavior in the middle of a -rc stream, which is
> something to avoid since we are deep into "bug fixes only" mode at
this
> point.
> 
> I'm open to suggestions, otherwise I can apply these to
netdev#upstream
> (queued for 2.6.24).
> 
> 	Jeff
> 


^ permalink raw reply

* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Roland Dreier @ 2007-08-07 23:04 UTC (permalink / raw)
  To: Michael Buesch
  Cc: Michael Chan, davem, jeff, netdev, eliezert, lusinsky, eilong
In-Reply-To: <200708020006.13457.mb@bu3sch.de>

 > > +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
 > > +{
 > > +	struct net_device *dev = dev_instance;
 > 
 > You need to check if dev==NULL and bail out.
 > Another driver sharing the IRQ with this might choose to pass the dev
 > pointer as NULL.

I don't really understand this.  If another driver is sharing the IRQ
with a different device pointer (or even NULL), then that driver's
handler is the one that would be called.  It's certainly the case that
an interrupt handler can be called for a shared interrupt generated by
another device, but a driver will never get a cookie back into its
interrupt handler different than the one it passed to request_irq().

A NULL check couldn't really help anything -- because if one driver's
dev_id can get passed into another driver's interrupt handler, the
non-NULL case would be even worse, because you would have one driver
poking into another driver's data structure.  But fortunately the
kernel is smart enough not to create this mess.

(And also, MSI-X interrupts are never shared so this is doubly
irrelevant in this particular case)

 - R.

^ permalink raw reply

* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: Christoph Hellwig @ 2007-08-07 23:04 UTC (permalink / raw)
  To: Michael Buesch
  Cc: Jeff Garzik, Michael Chan, davem, netdev, eliezert, lusinsky,
	eilong
In-Reply-To: <200708080020.35701.mb@bu3sch.de>

On Wed, Aug 08, 2007 at 12:20:35AM +0200, Michael Buesch wrote:
> On Wednesday 08 August 2007 00:15:47 Jeff Garzik wrote:
> > Michael Buesch wrote:
> > > On Wednesday 01 August 2007 10:31:17 Michael Chan wrote:
> > >> +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> > >> +{
> > >> +	struct net_device *dev = dev_instance;
> > > 
> > > You need to check if dev==NULL and bail out.
> > > Another driver sharing the IRQ with this might choose to pass the dev
> > > pointer as NULL.
> > 
> > NAK that advice:  It is pointless having such a check in the hottest of 
> > driver hot paths, since a large majority of drivers do not have such a 
> > check.
> > 
> > It is better to fix the extremely rare oddball that passes NULL to 
> > request_irq(), than to update all drivers to be slower due to the oddballs.
> 
> Ah, well. IMO one should better go safe than Oops. ;)
> It's not that an if branch takes more than 2 or 3 CPU cycles at worst.
> But well, if you don't like it, I can live without it, too.

Please take a look at kernel/irq/handle.c.  The irq handler is
always called with the right dev_id argument.  Everything would be a complete
nightmare to handle because you usually need to access the device private
data to check whether the shared irq is for this device.

^ permalink raw reply

* Re: [PATCH RFC]: napi_struct V5
From: David Miller @ 2007-08-07 23:06 UTC (permalink / raw)
  To: rdreier; +Cc: netdev, shemminger, jgarzik, hadi, rusty
In-Reply-To: <adasl6vq8d1.fsf@cisco.com>

From: Roland Dreier <rdreier@cisco.com>
Date: Tue, 07 Aug 2007 15:37:30 -0700

>  >  		n = ib_poll_cq(priv->cq, t, priv->ibwc);
>  >  
>  > -		for (i = 0; i < n; ++i) {
>  > +		for (i = 0; i < n; i++) {
> 
> it might be nicer to avoid noise like this in the patch.

That one was just too much of an eye sore to ignore and it
effect my ability to audit the change I was making.

I mean, this is one of the first precise examples of kinds of
programming that lead to subtle bugs mentioned in The Practice of
Programming.

So this is staying in the patch, sorry.

> this goto back to the polling loop is a change in behavior.  When we
> were tuning NAPI, we found that returning in the missed event case and
> letting the NAPI core call the poll routine later actually performed
> better, because it allowed more work to pile up.

You weren't using your quantum, which is what you're supposed to do.

Sometimes using your quantum correctly won't perform optimally, but in
the interest of fairness and what NAPI wants, that is what you're
supposed to do, process work until you hit budget or there is no
more work.

Look, I'm not going to back down to every single tweak in every
driver.  All the drivers should handle this case consistently, and if
I have to edit every single driver to make this patch that is exactly
what I am going to do and enforce.

If you patch the ipoib driver behavior back afterwards, I will NAK
that patch every single time unless you make EVERY SINGLE OTHER DRIVER
do the same and thus retain the consistency.

^ permalink raw reply

* Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
From: David Miller @ 2007-08-07 23:08 UTC (permalink / raw)
  To: hch; +Cc: mb, jeff, mchan, netdev, eliezert, lusinsky, eilong
In-Reply-To: <20070807230458.GA9883@infradead.org>

From: Christoph Hellwig <hch@infradead.org>
Date: Wed, 8 Aug 2007 00:04:59 +0100

> Please take a look at kernel/irq/handle.c.  The irq handler is
> always called with the right dev_id argument.  Everything would be a complete
> nightmare to handle because you usually need to access the device private
> data to check whether the shared irq is for this device.

Absolutely.

I can't believe we're even discussing something so obvious and
wasting everyone's time.

^ permalink raw reply

* Re: [PATCH] SMSC LAN911x and LAN921x vendor driver
From: Peter Korsgaard @ 2007-08-07 23:09 UTC (permalink / raw)
  To: Steve.Glendinning
  Cc: Bahadir Balban, Bill Gatliff, Dustin Mcintire, ian.saturley,
	netdev
In-Reply-To: <87hcnioppf.fsf@p4.be.48ers.dk>

>>>>> "Peter" == Peter Korsgaard <jacmet@sunsite.dk> writes:

Hi,

 Peter> I'll give your driver a try and report back.

Ok, the driver seems to be working (after fixing up the accessor
routines for my hw setup) and performance is comparable to Dustin's
driver.

It would be nice if the driver would enable the byte swapping support
in the hw if it detects the wrong endian - Like this:

Index: linux/drivers/net/smsc911x.c
===================================================================
--- linux.orig/drivers/net/smsc911x.c
+++ linux/drivers/net/smsc911x.c
@@ -1787,6 +1787,13 @@
 		return -ENODEV;
 	}
 
+	/* check endian */
+	if (smsc911x_reg_read(pdata, BYTE_TEST) == 0x43218765) {
+		SMSC_TRACE("Byte test looks swapped, inverting");
+		smsc911x_reg_write(~smsc911x_reg_read(pdata, ENDIAN),
+				   pdata, ENDIAN);
+	}
+
 	/* Default generation to zero (all workarounds apply) */
 	pdata->generation = 0;

-- 
Bye, Peter Korsgaard


^ permalink raw reply

* [ofa-general] [PATCH 0/14] nes: NetEffect 10Gb RNIC Driver
From: ggrundstrom @ 2007-08-08  0:22 UTC (permalink / raw)
  To: rdreier; +Cc: netdev, ewg, general

NetEffect is proud to announce the following series of patches which contain the source code for the NE020 10Gb RNIC adapter.  The driver is split into two components - a kernel driver module and a userspace library.

The code can also be found in the following git trees.
git.openfabrics.org/~glenn/libnes.git
git.openfabrics.org/~glenn/ofed_1_2.git
git.openfabrics.org/~glenn/ofascripts.git
git.openfabrics.org/~glenn/ofed_1_2_scripts.git


Requirements
============
* NE020 hardware
* RHEL4u4 or FC5
* OFED 1.2 GA
* OFED 1.2 version of MVAPICH2 
 
 
Known issues
============
* DAPL only works with 1 process per node due to lack of loopback
* MPI over DAPL must use MPI shared memory loopback
 
 
Plans for next release
======================
* Plan on adding verbs loopback to enable DAPL loopback
* Increase robustness and stability
 
 
What we tested
==============
The performance results are meant to be broadly representative. 
Results can vary depending on switches used, system configuration, OS used, etc.
 
Configuration notes:
All two node tests were performed back-to-back i.e. no switch Multinode
testing was performed using a high performance, low latency cut-through switch.
 
Platform: CentOS x86_64
 
1.    cbench rotate latency and bandwidth using mvapich2 over OFA verbs:
 
      Rotate Latency: 6.67 us
      Rotate Bandwidth: 9.3 Gpbs
 
2.    OSU bandwidth and latency tests using mvapich2 over OFA verbs:
 
      OSU Latency: 6.74 us
      OSU Bi-Bandwidth: 14.4 Gbps
 
3.    Perftest (rdma_bw Uni-dir/Bi-dir and rdma_lat)
 
      RDMA Bandwidth Uni-directional:  8.9  Gpbs
      RDMA Bandwidth Bi-directional : 15.09 Gpbs
      RDMA Latency                  :  5.95 us
 
4.    NIC Testing
 
      Iperf 4 stream Bi-directional test
 
Iperf -c <Srvr IP Addr> -d -M -N -i 4 -P 4 (Jumbo packets enabled) --> 10.76 Gbps
      
NetPerf
netperf -H <Srvr IP Addr> -T1,1 -t TCP_STREAM -l 60 -C -c (Jumbo packets enabled) --> 6.2 Gbps
 
 


Thanks,
Glenn.

^ permalink raw reply

* [git patches] net driver fixes
From: Jeff Garzik @ 2007-08-08  0:38 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: netdev, LKML


Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-linus

to receive the following updates:

 drivers/net/atl1/atl1_main.c                |    4 +--
 drivers/net/ehea/ehea.h                     |    2 +-
 drivers/net/ehea/ehea_main.c                |   44 ++++++++++----------------
 drivers/net/ibmveth.c                       |   27 +++++++++-------
 drivers/net/ibmveth.h                       |    3 --
 drivers/net/phy/phy.c                       |    4 +-
 drivers/net/r8169.c                         |   24 ++++++++++-----
 drivers/net/sis190.c                        |    3 ++
 drivers/net/smc91x.h                        |    4 +--
 drivers/net/ucc_geth_ethtool.c              |    1 -
 drivers/net/ucc_geth_mii.c                  |    3 +-
 drivers/net/wireless/bcm43xx/bcm43xx_phy.c  |    2 +-
 drivers/net/wireless/rtl8187_dev.c          |    2 +-
 drivers/net/wireless/zd1211rw/zd_mac.c      |    2 +-
 fs/compat_ioctl.c                           |    3 --
 net/ieee80211/softmac/ieee80211softmac_wx.c |   11 +++++--
 16 files changed, 69 insertions(+), 70 deletions(-)

Brian King (1):
      ibmveth: Fix rx pool deactivate oops

Domen Puncer (2):
      ucc_geth: fix section mismatch
      phy layer: fix phy_mii_ioctl for autonegotiation

Francois Romieu (1):
      r8169: avoid needless NAPI poll scheduling

Ingo Molnar (1):
      atl1: use spin_trylock_irqsave()

Jan Altenberg (1):
      ucc_geth: remove get_perm_addr from ucc_geth_ethtool.c

John W. Linville (1):
      Revert "[PATCH] bcm43xx: Fix deviation from specifications in set_baseband_attenuation"

Mariusz Kozlowski (1):
      drivers/net/ibmveth.c: memset fix

Masakazu Mokuno (1):
      remove duplicated ioctl entries in compat_ioctl.c

Michael Buesch (1):
      softmac: Fix deadlock of wx_set_essid with assoc work

Michael Wu (1):
      rtl8187: ensure priv->hwaddr is always valid

Neil Muller (1):
      sis190 check for ISA bridge on SiS966

Paul Mundt (1):
      net: smc91x: Build fixes for general sh boards.

Roger So (1):
      r8169: PHY power-on fix

Thomas Klein (3):
      ehea: Fix workqueue handling
      ehea: Simplify resource usage check
      ehea: Eliminated some compiler warnings

Ulrich Kunitz (1):
      zd1211rw: fix filter for PSPOLL frames

diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389..3c1984e 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 		}
 	}
 
-	local_irq_save(flags);
-	if (!spin_trylock(&adapter->lock)) {
+	if (!spin_trylock_irqsave(&adapter->lock, flags)) {
 		/* Can't get lock - tell upper layer to requeue */
-		local_irq_restore(flags);
 		dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
 		return NETDEV_TX_LOCKED;
 	}
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8ee2c2c..d67f97b 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0072"
+#define DRV_VERSION	"EHEA_0073"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 58702f5..9756211 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1326,7 +1326,6 @@ static void write_swqe2_TSO(struct sk_buff *skb,
 	u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
 	int skb_data_size = skb->len - skb->data_len;
 	int headersize;
-	u64 tmp_addr;
 
 	/* Packet is TCP with TSO enabled */
 	swqe->tx_control |= EHEA_SWQE_TSO;
@@ -1347,9 +1346,8 @@ static void write_swqe2_TSO(struct sk_buff *skb,
 			/* set sg1entry data */
 			sg1entry->l_key = lkey;
 			sg1entry->len = skb_data_size - headersize;
-
-			tmp_addr = (u64)(skb->data + headersize);
-			sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+			sg1entry->vaddr =
+				ehea_map_vaddr(skb->data + headersize);
 			swqe->descriptors++;
 		}
 	} else
@@ -1362,7 +1360,6 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
 	int skb_data_size = skb->len - skb->data_len;
 	u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
 	struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
-	u64 tmp_addr;
 
 	/* Packet is any nonTSO type
 	 *
@@ -1379,8 +1376,8 @@ static void write_swqe2_nonTSO(struct sk_buff *skb,
 			/* copy sg1entry data */
 			sg1entry->l_key = lkey;
 			sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
-			tmp_addr = (u64)(skb->data + SWQE2_MAX_IMM);
-			sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+			sg1entry->vaddr =
+				ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
 			swqe->descriptors++;
 		}
 	} else {
@@ -1395,7 +1392,6 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
 	struct ehea_vsgentry *sg_list, *sg1entry, *sgentry;
 	skb_frag_t *frag;
 	int nfrags, sg1entry_contains_frag_data, i;
-	u64 tmp_addr;
 
 	nfrags = skb_shinfo(skb)->nr_frags;
 	sg1entry = &swqe->u.immdata_desc.sg_entry;
@@ -1417,9 +1413,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
 			/* copy sg1entry data */
 			sg1entry->l_key = lkey;
 			sg1entry->len = frag->size;
-			tmp_addr =  (u64)(page_address(frag->page)
-					  + frag->page_offset);
-			sg1entry->vaddr = ehea_map_vaddr(tmp_addr);
+			sg1entry->vaddr =
+				ehea_map_vaddr(page_address(frag->page)
+					       + frag->page_offset);
 			swqe->descriptors++;
 			sg1entry_contains_frag_data = 1;
 		}
@@ -1431,10 +1427,9 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
 
 			sgentry->l_key = lkey;
 			sgentry->len = frag->size;
-
-			tmp_addr = (u64)(page_address(frag->page)
-					 + frag->page_offset);
-			sgentry->vaddr = ehea_map_vaddr(tmp_addr);
+			sgentry->vaddr =
+				ehea_map_vaddr(page_address(frag->page)
+					       + frag->page_offset);
 			swqe->descriptors++;
 		}
 	}
@@ -2165,24 +2160,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
 	return ret;
 }
 
-static void ehea_remove_adapter_mr (struct ehea_adapter *adapter)
+static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
 {
-	int i;
-
-	for (i=0; i < EHEA_MAX_PORTS; i++)
-		if (adapter->port[i])
-			return;
+	if (adapter->active_ports)
+		return;
 
 	ehea_rem_mr(&adapter->mr);
 }
 
-static int ehea_add_adapter_mr (struct ehea_adapter *adapter)
+static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
 {
-	int i;
-
-	for (i=0; i < EHEA_MAX_PORTS; i++)
-		if (adapter->port[i])
-			return 0;
+	if (adapter->active_ports)
+		return 0;
 
 	return ehea_reg_kernel_mr(adapter, &adapter->mr);
 }
@@ -3099,6 +3088,7 @@ out:
 
 static void __exit ehea_module_exit(void)
 {
+	destroy_workqueue(ehea_driver_wq);
 	driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
 	ibmebus_unregister_driver(&ehea_driver);
 	ehea_destroy_busmap();
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index d96eb72..acba90f 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -963,7 +963,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 {
 	int rc, i;
 	struct net_device *netdev;
-	struct ibmveth_adapter *adapter = NULL;
+	struct ibmveth_adapter *adapter;
 
 	unsigned char *mac_addr_p;
 	unsigned int *mcastFilterSize_p;
@@ -997,7 +997,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
 	SET_MODULE_OWNER(netdev);
 
 	adapter = netdev->priv;
-	memset(adapter, 0, sizeof(adapter));
 	dev->dev.driver_data = netdev;
 
 	adapter->vdev = dev;
@@ -1280,24 +1279,28 @@ const char * buf, size_t count)
 			int i;
 			/* Make sure there is a buffer pool with buffers that
 			   can hold a packet of the size of the MTU */
-			for(i = 0; i<IbmVethNumBufferPools; i++) {
+			for (i = 0; i < IbmVethNumBufferPools; i++) {
 				if (pool == &adapter->rx_buff_pool[i])
 					continue;
 				if (!adapter->rx_buff_pool[i].active)
 					continue;
-				if (mtu < adapter->rx_buff_pool[i].buff_size) {
-					pool->active = 0;
-					h_free_logical_lan_buffer(adapter->
-								  vdev->
-								  unit_address,
-								  pool->
-								  buff_size);
-				}
+				if (mtu <= adapter->rx_buff_pool[i].buff_size)
+					break;
 			}
-			if (pool->active) {
+
+			if (i == IbmVethNumBufferPools) {
 				ibmveth_error_printk("no active pool >= MTU\n");
 				return -EPERM;
 			}
+
+			pool->active = 0;
+			if (netif_running(netdev)) {
+				adapter->pool_config = 1;
+				ibmveth_close(netdev);
+				adapter->pool_config = 0;
+				if ((rc = ibmveth_open(netdev)))
+					return rc;
+			}
 		}
 	} else if (attr == &veth_num_attr) {
 		if (value <= 0 || value > IBMVETH_MAX_POOL_COUNT)
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index bb69cca..72cc15a 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -73,9 +73,6 @@ static inline long h_send_logical_lan(unsigned long unit_address,
 #define h_change_logical_lan_mac(ua, mac) \
   plpar_hcall_norets(H_CHANGE_LOGICAL_LAN_MAC, ua, mac)
 
-#define h_free_logical_lan_buffer(ua, bufsize) \
-  plpar_hcall_norets(H_FREE_LOGICAL_LAN_BUFFER, ua, bufsize)
-
 #define IbmVethNumBufferPools 5
 #define IBMVETH_BUFF_OH 22 /* Overhead: 14 ethernet header + 8 opaque handle */
 #define IBMVETH_MAX_MTU 68
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f71dab3..e323efd 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -261,7 +261,7 @@ void phy_sanitize_settings(struct phy_device *phydev)
 
 	/* Sanitize settings based on PHY capabilities */
 	if ((features & SUPPORTED_Autoneg) == 0)
-		phydev->autoneg = 0;
+		phydev->autoneg = AUTONEG_DISABLE;
 
 	idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
 			features);
@@ -374,7 +374,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
 		if (mii_data->phy_id == phydev->addr) {
 			switch(mii_data->reg_num) {
 			case MII_BMCR:
-				if (val & (BMCR_RESET|BMCR_ANENABLE))
+				if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
 					phydev->autoneg = AUTONEG_DISABLE;
 				else
 					phydev->autoneg = AUTONEG_ENABLE;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c9333b9..b85ab4a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -725,6 +725,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
 
 	auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
 
+	if (tp->mac_version == RTL_GIGA_MAC_VER_12) {
+		/* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
+		mdio_write(ioaddr, 0x1f, 0x0000);
+		mdio_write(ioaddr, 0x0e, 0x0000);
+	}
+
 	tp->phy_auto_nego_reg = auto_nego;
 	tp->phy_1000_ctrl_reg = giga_ctrl;
 
@@ -2760,14 +2766,16 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 			rtl8169_check_link_status(dev, tp, ioaddr);
 
 #ifdef CONFIG_R8169_NAPI
-		RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
-		tp->intr_mask = ~tp->napi_event;
-
-		if (likely(netif_rx_schedule_prep(dev)))
-			__netif_rx_schedule(dev);
-		else if (netif_msg_intr(tp)) {
-			printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
-			       dev->name, status);
+		if (status & tp->napi_event) {
+			RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
+			tp->intr_mask = ~tp->napi_event;
+
+			if (likely(netif_rx_schedule_prep(dev)))
+				__netif_rx_schedule(dev);
+			else if (netif_msg_intr(tp)) {
+				printk(KERN_INFO "%s: interrupt %04x in poll\n",
+				       dev->name, status);
+			}
 		}
 		break;
 #else
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f..d470b19 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 		  pci_name(pdev));
 
 	isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
+	if (!isa_bridge)
+		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
+
 	if (!isa_bridge) {
 		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
 			  pci_name(pdev));
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f842944..6ff3a16 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -299,7 +299,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 
 #define SMC_CAN_USE_8BIT       1
 #define SMC_CAN_USE_16BIT      1
-#define SMC_CAN_USE_32BIT      1
+#define SMC_CAN_USE_32BIT      0
 
 #define SMC_inb(a, r)          inb((a) + (r))
 #define SMC_inw(a, r)          inw((a) + (r))
@@ -310,8 +310,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 
 #endif  /* BOARDS */
 
-#define set_irq_type(irq, type) do {} while (0)
-
 #elif   defined(CONFIG_M32R)
 
 #define SMC_CAN_USE_8BIT	0
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index a8994c7..64bef7c 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -379,7 +379,6 @@ static const struct ethtool_ops uec_ethtool_ops = {
 	.get_stats_count        = uec_get_stats_count,
 	.get_strings            = uec_get_strings,
 	.get_ethtool_stats      = uec_get_ethtool_stats,
-	.get_perm_addr          = ethtool_op_get_perm_addr,
 };
 
 void uec_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 5f8c2d3..6c257b8 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -272,7 +272,8 @@ int __init uec_mdio_init(void)
 	return of_register_platform_driver(&uec_mdio_driver);
 }
 
-void __exit uec_mdio_exit(void)
+/* called from __init ucc_geth_init, therefore can not be __exit */
+void uec_mdio_exit(void)
 {
 	of_unregister_platform_driver(&uec_mdio_driver);
 }
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index d779199..b37f1e3 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -1638,7 +1638,7 @@ void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
 		return;
 	}
 
-	if (phy->analog == 1) {
+	if (phy->analog > 1) {
 		value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C;
 		value |= (baseband_attenuation << 2) & 0x003C;
 	} else {
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index cea8589..e61c6d5 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
 		return -EOPNOTSUPP;
 	}
 
-	priv->hwaddr = conf->mac_addr;
+	priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;
 
 	return 0;
 }
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index f6c487a..26869d1 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -822,7 +822,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
 		cs->control |= ZD_CS_MULTICAST;
 
 	/* PS-POLL */
-	if (stype == IEEE80211_STYPE_PSPOLL)
+	if (ftype == IEEE80211_FTYPE_CTL && stype == IEEE80211_STYPE_PSPOLL)
 		cs->control |= ZD_CS_PS_POLL_FRAME;
 
 	/* Unicast data frames over the threshold should have RTS */
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 2bc1428..a6c9078 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -3161,12 +3161,9 @@ COMPATIBLE_IOCTL(SIOCSIWSENS)
 COMPATIBLE_IOCTL(SIOCGIWSENS)
 COMPATIBLE_IOCTL(SIOCSIWRANGE)
 COMPATIBLE_IOCTL(SIOCSIWPRIV)
-COMPATIBLE_IOCTL(SIOCGIWPRIV)
 COMPATIBLE_IOCTL(SIOCSIWSTATS)
-COMPATIBLE_IOCTL(SIOCGIWSTATS)
 COMPATIBLE_IOCTL(SIOCSIWAP)
 COMPATIBLE_IOCTL(SIOCGIWAP)
-COMPATIBLE_IOCTL(SIOCSIWSCAN)
 COMPATIBLE_IOCTL(SIOCSIWRATE)
 COMPATIBLE_IOCTL(SIOCGIWRATE)
 COMPATIBLE_IOCTL(SIOCSIWRTS)
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index f13937b..d054e92 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -74,8 +74,8 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
 	struct ieee80211softmac_auth_queue_item *authptr;
 	int length = 0;
 
+check_assoc_again:
 	mutex_lock(&sm->associnfo.mutex);
-
 	/* Check if we're already associating to this or another network
 	 * If it's another network, cancel and start over with our new network
 	 * If it's our network, ignore the change, we're already doing it!
@@ -98,13 +98,18 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev,
 				cancel_delayed_work(&authptr->work);
 			sm->associnfo.bssvalid = 0;
 			sm->associnfo.bssfixed = 0;
-			flush_scheduled_work();
 			sm->associnfo.associating = 0;
 			sm->associnfo.associated = 0;
+			/* We must unlock to avoid deadlocks with the assoc workqueue
+			 * on the associnfo.mutex */
+			mutex_unlock(&sm->associnfo.mutex);
+			flush_scheduled_work();
+			/* Avoid race! Check assoc status again. Maybe someone started an
+			 * association while we flushed. */
+			goto check_assoc_again;
 		}
 	}
 
-
 	sm->associnfo.static_essid = 0;
 	sm->associnfo.assoc_wait = 0;
 

^ permalink raw reply related


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