Netdev List
 help / color / mirror / Atom feed
* Re: openvswitch/flow WAS ( Re: [rfc] Merging the Open vSwitch datapath
From: Ben Pfaff @ 2010-10-15 16:18 UTC (permalink / raw)
  To: ovs-team; +Cc: jamal, Jesse Gross, netdev
In-Reply-To: <1287142292.3642.19.camel@bigi>

[adding ovs-team]

On Fri, Oct 15, 2010 at 07:31:32AM -0400, jamal wrote:
> 
> Sorry, slightly off topic - and this old (catching up 
> with netdev randomly going backwards)..
> 
> I was curious after seeing the exchange with Eric D. on
> the tunnels and how you have your own tree so i glossed 
> over what your project is doing.
> 
> It seems to me that you reinvented things that exist in 
> Linux already such as bridging, tunnels and what really
> caught my attention: ability to do flows (tc actions).
> It is possible Linux is missing something you wanted or was
> not efficient enough? 
> [For example: I couldnt see anything you needed
> on flow-action management that Linux couldnt do already
> (with already very nice well structured netlink APIs)]

^ permalink raw reply

* Re: [PATCH net-next] net: allocate skbs on local node
From: Christoph Lameter @ 2010-10-15 16:57 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Tom Herbert, Andrew Morton, David Miller, netdev, Michael Chan,
	Eilon Greenstein, Christoph Hellwig, Pekka Enberg, David Rientjes
In-Reply-To: <1287072352.2712.84.camel@edumazet-laptop>

On Thu, 14 Oct 2010, Eric Dumazet wrote:

> > Some results running netper TCP_RR test with 200 instances, 1 byte
> > request and response on 16 core AMD using bnx2x with one 16 queues,
> > one for each CPU.
> >
> > SLAB
> >
> > Without patch 553570 tps at 86% CPU
> > With patch 791883 tps at 93% CPU
> >
> > SLUB
> >
> > Without patch 704879 tps at 95% CPU
> > With patch 775278 tps at 92% CPU

Shows one basic difference between SLAB and SLUB: SLAB always needs to go
the slow path when allocating from other nodes. SLUB allows other nodes to
use the fast path. First alloc will be slow but it will switch the "local
queue" to the new node ("queue" switching fast because the queue is
simply a linked list from the page struct of objects within the page).
Second and following access will be fast and coming from that node.

But the requirement that objects on the per page queue are only within the
page also limits the size of the queue and often requires more slow path
use on free....



^ permalink raw reply

* Re: [PATCH] sctp: implement SIOCINQ ioctl() (take 3 bis)
From: David Miller @ 2010-10-15 16:59 UTC (permalink / raw)
  To: flameeyes; +Cc: netdev, linux-sctp
In-Reply-To: <1287152557.465.24.camel@yamato.local>

From: Diego Elio Pettenò <flameeyes@gmail.com>
Date: Fri, 15 Oct 2010 16:22:37 +0200

> Il giorno ven, 01/10/2010 alle 11.56 +0200, Diego Elio Pettenò ha
> scritto:
>> 
>> 
>> This simple patch copies the current approach for SIOCINQ ioctl() from
>> DCCP
>> into SCTP so that the userland code working with SCTP can use a
>> similar
>> interface across different protocols to know how much space to
>> allocate for
>> a buffer. 
> 
> Any news on getting this one in? Pretty please? :)

I'm pretty sure it's in the net-next-2.6, is it not?

^ permalink raw reply

* RE: [PATCH net-next] tipc: cleanup function namespace
From: Jon Maloy @ 2010-10-15 16:59 UTC (permalink / raw)
  To: Neil Horman, Stephen Hemminger
  Cc: Paul Gortmaker, David Miller, netdev@vger.kernel.org,
	allan.stephens@windriver.com
In-Reply-To: <20101015110122.GD22294@hmsreliant.think-freely.org>

<...>
> > > diff --git a/Documentation/feature-removal-schedule.txt 
> > > b/Documentation/feature-removal-schedule.txt
> > > index f456389..1def37e 100644
> > > --- a/Documentation/feature-removal-schedule.txt
> > > +++ b/Documentation/feature-removal-schedule.txt
> > > @@ -573,3 +573,15 @@ Why:	Hareware scan is the prefer 
> method for iwlwifi devices for
> > >  Who:	Wey-Yi Guy <wey-yi.w.guy@intel.com>
> > >  
> > >  ----------------------------
> > > +
> > > +What:	TIPC: Delete all code and exported symbols 
> specific to Native API
> > > +When:	March 2011
> > > +Why:	The TIPC Native API, as described here:
> > > +	
> http://tipc.sourceforge.net/doc/tipc_1.7_prog_guide.html#native_api
> > > +	is implemented by exporting a bunch of otherwise unused 
> functions
> > > +	for possible modular linkage by custom end-user code.  This goes
> > > +	against the general concept that the kernel should not be libc.
> > > +
> > > +Who:	Paul Gortmaker <paul.gortmaker@windriver.com>
> > > +	
> > > +----------------------------
> > 
> > Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>

^ permalink raw reply

* Re: [PATCH] sctp: implement SIOCINQ ioctl() (take 3 bis)
From: Diego Elio Pettenò @ 2010-10-15 17:08 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-sctp
In-Reply-To: <20101015.095940.39172218.davem@davemloft.net>

Il giorno ven, 15/10/2010 alle 09.59 -0700, David Miller ha scritto:
> 
> I'm pretty sure it's in the net-next-2.6, is it not? 

Ah yes it is, sorry, I was mislead by the presence in -rc8 of the other
SCTP patches that came afterwards (and because it has been since August
I'm dragging this patch around).

Thank you very much!

-- 
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/

If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/



^ permalink raw reply

* [PATCH net-next] vxge: make functions local and remove dead code
From: Stephen Hemminger @ 2010-10-15 17:21 UTC (permalink / raw)
  To: Ramkrishna, "Vepa <ramkrishna.vepa",
	Sivakumar Subramani, Sreenivasa Honnur
  Cc: netdev

Use results of make namespacecheck to make functions local and
remove code that is not used.

Also rename initialize_ethtool_ops to vxge_initialize_ethtool_ops.

Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/vxge/vxge-config.c  |  332 +++++++++++++++++++++++++++++-----------
 drivers/net/vxge/vxge-config.h  |  227 ---------------------------
 drivers/net/vxge/vxge-ethtool.c |    2 
 drivers/net/vxge/vxge-main.c    |   64 ++++---
 drivers/net/vxge/vxge-main.h    |   59 -------
 drivers/net/vxge/vxge-traffic.c |  101 +-----------
 drivers/net/vxge/vxge-traffic.h |  134 ----------------
 7 files changed, 304 insertions(+), 615 deletions(-)

--- a/drivers/net/vxge/vxge-config.c	2010-10-15 09:10:06.686399147 -0700
+++ b/drivers/net/vxge/vxge-config.c	2010-10-15 10:15:51.420682586 -0700
@@ -20,6 +20,179 @@
 #include "vxge-traffic.h"
 #include "vxge-config.h"
 
+static enum vxge_hw_status
+__vxge_hw_fifo_create(
+	struct __vxge_hw_vpath_handle *vpath_handle,
+	struct vxge_hw_fifo_attr *attr);
+
+static enum vxge_hw_status
+__vxge_hw_fifo_abort(
+	struct __vxge_hw_fifo *fifoh);
+
+static enum vxge_hw_status
+__vxge_hw_fifo_reset(
+	struct __vxge_hw_fifo *ringh);
+
+static enum vxge_hw_status
+__vxge_hw_fifo_delete(
+	struct __vxge_hw_vpath_handle *vpath_handle);
+
+static struct __vxge_hw_blockpool_entry *
+__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
+			u32 size);
+
+static void
+__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
+			struct __vxge_hw_blockpool_entry *entry);
+
+static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
+					void *block_addr,
+					u32 length,
+					struct pci_dev *dma_h,
+					struct pci_dev *acc_handle);
+
+static enum vxge_hw_status
+__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
+			struct __vxge_hw_blockpool  *blockpool,
+			u32 pool_size,
+			u32 pool_max);
+
+static void
+__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool  *blockpool);
+
+static void *
+__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
+			u32 size,
+			struct vxge_hw_mempool_dma *dma_object);
+
+static void
+__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
+			void *memblock,
+			u32 size,
+			struct vxge_hw_mempool_dma *dma_object);
+
+
+static struct __vxge_hw_channel*
+__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
+			enum __vxge_hw_channel_type type, u32 length,
+			u32 per_dtr_space, void *userdata);
+
+static void
+__vxge_hw_channel_free(
+	struct __vxge_hw_channel *channel);
+
+static enum vxge_hw_status
+__vxge_hw_channel_initialize(
+	struct __vxge_hw_channel *channel);
+
+static enum vxge_hw_status
+__vxge_hw_channel_reset(
+	struct __vxge_hw_channel *channel);
+
+static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp);
+
+static enum vxge_hw_status
+__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
+
+static enum vxge_hw_status
+__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
+
+static void
+__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
+
+static void
+__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_card_info_get(
+	u32 vp_id,
+	struct vxge_hw_vpath_reg __iomem *vpath_reg,
+	struct vxge_hw_device_hw_info *hw_info);
+
+static enum vxge_hw_status
+__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
+
+static void
+__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
+
+static enum vxge_hw_status
+__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
+
+static enum vxge_hw_status
+__vxge_hw_device_register_poll(
+	void __iomem	*reg,
+	u64 mask, u32 max_millis);
+
+static inline enum vxge_hw_status
+__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
+			  u64 mask, u32 max_millis)
+{
+	__vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
+	wmb();
+
+	__vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
+	wmb();
+
+	return  __vxge_hw_device_register_poll(addr, mask, max_millis);
+}
+
+static struct vxge_hw_mempool*
+__vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size,
+			 u32 item_size,	u32 private_size, u32 items_initial,
+			 u32 items_max,	struct vxge_hw_mempool_cbs *mp_callback,
+			 void *userdata);
+static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
+			  struct vxge_hw_vpath_stats_hw_info *hw_stats);
+
+static enum vxge_hw_status
+vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle);
+
+static enum vxge_hw_status
+__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
+
+static u64
+__vxge_hw_vpath_pci_func_mode_get(u32  vp_id,
+				  struct vxge_hw_vpath_reg __iomem *vpath_reg);
+
+static u32
+__vxge_hw_vpath_func_id_get(u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_addr_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
+			 u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
+
+
+static enum vxge_hw_status
+__vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_fw_ver_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
+			   struct vxge_hw_device_hw_info *hw_info);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id);
+
+static void
+__vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
+			     u32 operation, u32 offset,	u64 *stat);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath	*vpath,
+				  struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
+
+static enum vxge_hw_status
+__vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath	*vpath,
+				  struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
+
 /*
  * __vxge_hw_channel_allocate - Allocate memory for channel
  * This function allocates required memory for the channel and various arrays
@@ -190,7 +363,7 @@ __vxge_hw_device_pci_e_init(struct __vxg
  * Will poll certain register for specified amount of time.
  * Will poll until masked bit is not cleared.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
 {
 	u64 val64;
@@ -221,7 +394,7 @@ __vxge_hw_device_register_poll(void __io
  * in progress
  * This routine checks the vpath reset in progress register is turned zero
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
 {
 	enum vxge_hw_status status;
@@ -236,7 +409,7 @@ __vxge_hw_device_vpath_reset_in_prog_che
  * This routine sets the swapper and reads the toc pointer and returns the
  * memory mapped address of the toc
  */
-struct vxge_hw_toc_reg __iomem *
+static struct vxge_hw_toc_reg __iomem *
 __vxge_hw_device_toc_get(void __iomem *bar0)
 {
 	u64 val64;
@@ -779,7 +952,7 @@ exit:
  * vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port
  * Get the Statistics on aggregate port
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *hldev, u32 port,
 				   struct vxge_hw_xmac_aggr_stats *aggr_stats)
 {
@@ -814,7 +987,7 @@ exit:
  * vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port
  * Get the Statistics on port
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *hldev, u32 port,
 				   struct vxge_hw_xmac_port_stats *port_stats)
 {
@@ -952,20 +1125,6 @@ u32 vxge_hw_device_trace_level_get(struc
 	return 0;
 #endif
 }
-/*
- * vxge_hw_device_debug_mask_get - Get the debug mask
- * This routine returns the current debug mask set
- */
-u32 vxge_hw_device_debug_mask_get(struct __vxge_hw_device *hldev)
-{
-#if defined(VXGE_DEBUG_TRACE_MASK) || defined(VXGE_DEBUG_ERR_MASK)
-	if (hldev == NULL)
-		return 0;
-	return hldev->debug_module_mask;
-#else
-	return 0;
-#endif
-}
 
 /*
  * vxge_hw_getpause_data -Pause frame frame generation and reception.
@@ -1090,7 +1249,7 @@ __vxge_hw_ring_block_next_pointer_set(u8
  *             first block
  * Returns the dma address of the first RxD block
  */
-u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
+static u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
 {
 	struct vxge_hw_mempool_dma *dma_object;
 
@@ -1252,7 +1411,7 @@ exit:
  * This function creates Ring and initializes it.
  *
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp,
 		      struct vxge_hw_ring_attr *attr)
 {
@@ -1363,7 +1522,7 @@ exit:
  * __vxge_hw_ring_abort - Returns the RxD
  * This function terminates the RxDs of ring
  */
-enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
+static enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
 {
 	void *rxdh;
 	struct __vxge_hw_channel *channel;
@@ -1392,7 +1551,7 @@ enum vxge_hw_status __vxge_hw_ring_abort
  * __vxge_hw_ring_reset - Resets the ring
  * This function resets the ring during vpath reset operation
  */
-enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
+static enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct __vxge_hw_channel *channel;
@@ -1419,7 +1578,7 @@ exit:
  * __vxge_hw_ring_delete - Removes the ring
  * This function freeup the memory pool and removes the ring
  */
-enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
+static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
 {
 	struct __vxge_hw_ring *ring = vp->vpath->ringh;
 
@@ -1438,7 +1597,7 @@ enum vxge_hw_status __vxge_hw_ring_delet
  * __vxge_hw_mempool_grow
  * Will resize mempool up to %num_allocate value.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate,
 		       u32 *num_allocated)
 {
@@ -1527,7 +1686,7 @@ exit:
  * with size enough to hold %items_initial number of items. Memory is
  * DMA-able but client must map/unmap before interoperating with the device.
  */
-struct vxge_hw_mempool*
+static struct vxge_hw_mempool*
 __vxge_hw_mempool_create(
 	struct __vxge_hw_device *devh,
 	u32 memblock_size,
@@ -1644,7 +1803,7 @@ exit:
 /*
  * vxge_hw_mempool_destroy
  */
-void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
+static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
 {
 	u32 i, j;
 	struct __vxge_hw_device *devh = mempool->devh;
@@ -1700,7 +1859,7 @@ __vxge_hw_device_fifo_config_check(struc
  * __vxge_hw_device_vpath_config_check - Check vpath configuration.
  * Check the vpath configuration
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config)
 {
 	enum vxge_hw_status status;
@@ -1922,7 +2081,7 @@ vxge_hw_device_config_default_get(struct
  * _hw_legacy_swapper_set - Set the swapper bits for the legacy secion.
  * Set the swapper bits appropriately for the lagacy section.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg)
 {
 	u64 val64;
@@ -1977,7 +2136,7 @@ __vxge_hw_legacy_swapper_set(struct vxge
  * __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath.
  * Set the swapper bits appropriately for the vpath.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg)
 {
 #ifndef __BIG_ENDIAN
@@ -1996,7 +2155,7 @@ __vxge_hw_vpath_swapper_set(struct vxge_
  * __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc.
  * Set the swapper bits appropriately for the vpath.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_kdfc_swapper_set(
 	struct vxge_hw_legacy_reg __iomem *legacy_reg,
 	struct vxge_hw_vpath_reg __iomem *vpath_reg)
@@ -2021,28 +2180,6 @@ __vxge_hw_kdfc_swapper_set(
 }
 
 /*
- * vxge_hw_mgmt_device_config - Retrieve device configuration.
- * Get device configuration. Permits to retrieve at run-time configuration
- * values that were used to initialize and configure the device.
- */
-enum vxge_hw_status
-vxge_hw_mgmt_device_config(struct __vxge_hw_device *hldev,
-			   struct vxge_hw_device_config *dev_config, int size)
-{
-
-	if ((hldev == NULL) || (hldev->magic != VXGE_HW_DEVICE_MAGIC))
-		return VXGE_HW_ERR_INVALID_DEVICE;
-
-	if (size != sizeof(struct vxge_hw_device_config))
-		return VXGE_HW_ERR_VERSION_CONFLICT;
-
-	memcpy(dev_config, &hldev->config,
-		sizeof(struct vxge_hw_device_config));
-
-	return VXGE_HW_OK;
-}
-
-/*
  * vxge_hw_mgmt_reg_read - Read Titan register.
  */
 enum vxge_hw_status
@@ -2438,7 +2575,7 @@ exit:
  * __vxge_hw_fifo_abort - Returns the TxD
  * This function terminates the TxDs of fifo
  */
-enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
+static enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
 {
 	void *txdlh;
 
@@ -2466,7 +2603,7 @@ enum vxge_hw_status __vxge_hw_fifo_abort
  * __vxge_hw_fifo_reset - Resets the fifo
  * This function resets the fifo during vpath reset operation
  */
-enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
+static enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 
@@ -2501,7 +2638,7 @@ enum vxge_hw_status __vxge_hw_fifo_delet
  *                          in pci config space.
  * Read from the vpath pci config space.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath,
 			 u32 phy_func_0, u32 offset, u32 *val)
 {
@@ -2542,7 +2679,7 @@ exit:
  * __vxge_hw_vpath_func_id_get - Get the function id of the vpath.
  * Returns the function number of the vpath.
  */
-u32
+static u32
 __vxge_hw_vpath_func_id_get(u32 vp_id,
 	struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
 {
@@ -2573,7 +2710,7 @@ __vxge_hw_read_rts_ds(struct vxge_hw_vpa
  * __vxge_hw_vpath_card_info_get - Get the serial numbers,
  * part number and product description.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_card_info_get(
 	u32 vp_id,
 	struct vxge_hw_vpath_reg __iomem *vpath_reg,
@@ -2695,7 +2832,7 @@ __vxge_hw_vpath_card_info_get(
  * __vxge_hw_vpath_fw_ver_get - Get the fw version
  * Returns FW Version
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_fw_ver_get(
 	u32 vp_id,
 	struct vxge_hw_vpath_reg __iomem *vpath_reg,
@@ -2789,7 +2926,7 @@ exit:
  * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode
  * Returns pci function mode
  */
-u64
+static u64
 __vxge_hw_vpath_pci_func_mode_get(
 	u32  vp_id,
 	struct vxge_hw_vpath_reg __iomem *vpath_reg)
@@ -2995,7 +3132,7 @@ exit:
  * __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath
  *               from MAC address table.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_addr_get(
 	u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
 	u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN])
@@ -3347,7 +3484,7 @@ __vxge_hw_vpath_mgmt_read(
  * This routine checks the vpath_rst_in_prog register to see if
  * adapter completed the reset process for the vpath
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath)
 {
 	enum vxge_hw_status status;
@@ -3365,7 +3502,7 @@ __vxge_hw_vpath_reset_check(struct __vxg
  * __vxge_hw_vpath_reset
  * This routine resets the vpath on the device
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3383,7 +3520,7 @@ __vxge_hw_vpath_reset(struct __vxge_hw_d
  * __vxge_hw_vpath_sw_reset
  * This routine resets the vpath structures
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -3408,7 +3545,7 @@ exit:
  * This routine configures the prc registers of virtual path using the config
  * passed
  */
-void
+static void
 __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3480,7 +3617,7 @@ __vxge_hw_vpath_prc_configure(struct __v
  * This routine configures the kdfc registers of virtual path using the
  * config passed
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3553,7 +3690,7 @@ exit:
  * __vxge_hw_vpath_mac_configure
  * This routine configures the mac of virtual path using the config passed
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3621,7 +3758,7 @@ __vxge_hw_vpath_mac_configure(struct __v
  * This routine configures the tim registers of virtual path using the config
  * passed
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3897,7 +4034,7 @@ vxge_hw_vpath_tti_ci_set(struct __vxge_h
  * This routine is the final phase of init which initializes the
  * registers of the vpath using the configuration passed.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	u64 val64;
@@ -3966,7 +4103,7 @@ exit:
  * This routine is the initial phase of init which resets the vpath and
  * initializes the software support structures.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id,
 			struct vxge_hw_vp_config *config)
 {
@@ -4022,7 +4159,7 @@ exit:
  * __vxge_hw_vp_terminate - Terminate Virtual Path structure
  * This routine closes all channels it opened and freeup memory
  */
-void
+static void
 __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, u32 vp_id)
 {
 	struct __vxge_hw_virtualpath *vpath;
@@ -4384,7 +4521,7 @@ vxge_hw_vpath_enable(struct __vxge_hw_vp
  * Enable the DMA vpath statistics. The function is to be called to re-enable
  * the adapter to update stats into the host memory
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vp)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -4409,7 +4546,7 @@ exit:
  * __vxge_hw_vpath_stats_access - Get the statistics from the given location
  *                           and offset and perform an operation
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
 			     u32 operation, u32 offset, u64 *stat)
 {
@@ -4445,7 +4582,7 @@ vpath_stats_access_exit:
 /*
  * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_xmac_tx_stats_get(
 	struct __vxge_hw_virtualpath *vpath,
 	struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats)
@@ -4478,9 +4615,9 @@ exit:
 /*
  * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath,
-			struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
+				  struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
 {
 	u64 *val64;
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -4509,9 +4646,9 @@ exit:
 /*
  * __vxge_hw_vpath_stats_get - Get the vpath hw statistics.
  */
-enum vxge_hw_status __vxge_hw_vpath_stats_get(
-			struct __vxge_hw_virtualpath *vpath,
-			struct vxge_hw_vpath_stats_hw_info *hw_stats)
+static enum vxge_hw_status
+__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
+			  struct vxge_hw_vpath_stats_hw_info *hw_stats)
 {
 	u64 val64;
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -4643,6 +4780,32 @@ exit:
 	return status;
 }
 
+
+static void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
+					unsigned long size)
+{
+	gfp_t flags;
+	void *vaddr;
+
+	if (in_interrupt())
+		flags = GFP_ATOMIC | GFP_DMA;
+	else
+		flags = GFP_KERNEL | GFP_DMA;
+
+	vaddr = kmalloc((size), flags);
+
+	vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
+}
+
+static void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
+			     struct pci_dev **p_dma_acch)
+{
+	unsigned long misaligned = *(unsigned long *)p_dma_acch;
+	u8 *tmp = (u8 *)vaddr;
+	tmp -= misaligned;
+	kfree((void *)tmp);
+}
+
 /*
  * __vxge_hw_blockpool_create - Create block pool
  */
@@ -4845,12 +5008,11 @@ void __vxge_hw_blockpool_blocks_remove(s
  * vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async
  * Adds a block to block pool
  */
-void vxge_hw_blockpool_block_add(
-			struct __vxge_hw_device *devh,
-			void *block_addr,
-			u32 length,
-			struct pci_dev *dma_h,
-			struct pci_dev *acc_handle)
+static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
+					void *block_addr,
+					u32 length,
+					struct pci_dev *dma_h,
+					struct pci_dev *acc_handle)
 {
 	struct __vxge_hw_blockpool  *blockpool;
 	struct __vxge_hw_blockpool_entry  *entry = NULL;
--- a/drivers/net/vxge/vxge-config.h	2010-10-15 09:10:06.766402819 -0700
+++ b/drivers/net/vxge/vxge-config.h	2010-10-15 10:14:19.925408165 -0700
@@ -183,11 +183,6 @@ struct vxge_hw_device_version {
 	char    version[VXGE_HW_FW_STRLEN];
 };
 
-u64
-__vxge_hw_vpath_pci_func_mode_get(
-	u32 vp_id,
-	struct vxge_hw_vpath_reg __iomem *vpath_reg);
-
 /**
  * struct vxge_hw_fifo_config - Configuration of fifo.
  * @enable: Is this fifo to be commissioned
@@ -1426,9 +1421,6 @@ struct vxge_hw_rth_hash_types {
 	u8 hash_type_ipv6ex_en;
 };
 
-u32
-vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
-
 void vxge_hw_device_debug_set(
 	struct __vxge_hw_device *devh,
 	enum vxge_debug_level level,
@@ -1440,9 +1432,6 @@ vxge_hw_device_error_level_get(struct __
 u32
 vxge_hw_device_trace_level_get(struct __vxge_hw_device *devh);
 
-u32
-vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
-
 /**
  * vxge_hw_ring_rxd_size_get	- Get the size of ring descriptor.
  * @buf_mode: Buffer mode (1, 3 or 5)
@@ -1817,60 +1806,10 @@ struct vxge_hw_vpath_attr {
 	struct vxge_hw_fifo_attr	fifo_attr;
 };
 
-enum vxge_hw_status
-__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
-			struct __vxge_hw_blockpool  *blockpool,
-			u32 pool_size,
-			u32 pool_max);
-
-void
-__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool  *blockpool);
-
-struct __vxge_hw_blockpool_entry *
-__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
-			u32 size);
-
-void
-__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
-			struct __vxge_hw_blockpool_entry *entry);
-
-void *
-__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
-			u32 size,
-			struct vxge_hw_mempool_dma *dma_object);
-
-void
-__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
-			void *memblock,
-			u32 size,
-			struct vxge_hw_mempool_dma *dma_object);
-
-enum vxge_hw_status
-__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
-
-enum vxge_hw_status
-__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
-
-enum vxge_hw_status
-vxge_hw_mgmt_device_config(struct __vxge_hw_device *devh,
-		struct vxge_hw_device_config	*dev_config, int size);
-
 enum vxge_hw_status __devinit vxge_hw_device_hw_info_get(
 	void __iomem *bar0,
 	struct vxge_hw_device_hw_info *hw_info);
 
-enum vxge_hw_status
-__vxge_hw_vpath_fw_ver_get(
-	u32	vp_id,
-	struct vxge_hw_vpath_reg __iomem *vpath_reg,
-	struct vxge_hw_device_hw_info *hw_info);
-
-enum vxge_hw_status
-__vxge_hw_vpath_card_info_get(
-	u32 vp_id,
-	struct vxge_hw_vpath_reg __iomem *vpath_reg,
-	struct vxge_hw_device_hw_info *hw_info);
-
 enum vxge_hw_status __devinit vxge_hw_device_config_default_get(
 	struct vxge_hw_device_config *device_config);
 
@@ -1954,38 +1893,6 @@ out:
 	return vaddr;
 }
 
-extern void vxge_hw_blockpool_block_add(
-			struct __vxge_hw_device *devh,
-			void *block_addr,
-			u32 length,
-			struct pci_dev *dma_h,
-			struct pci_dev *acc_handle);
-
-static inline void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
-					unsigned long size)
-{
-	gfp_t flags;
-	void *vaddr;
-
-	if (in_interrupt())
-		flags = GFP_ATOMIC | GFP_DMA;
-	else
-		flags = GFP_KERNEL | GFP_DMA;
-
-	vaddr = kmalloc((size), flags);
-
-	vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
-}
-
-static inline void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
-			struct pci_dev **p_dma_acch)
-{
-	unsigned long misaligned = *(unsigned long *)p_dma_acch;
-	u8 *tmp = (u8 *)vaddr;
-	tmp -= misaligned;
-	kfree((void *)tmp);
-}
-
 /*
  * __vxge_hw_mempool_item_priv - will return pointer on per item private space
  */
@@ -2010,40 +1917,6 @@ __vxge_hw_mempool_item_priv(
 			    (*memblock_item_idx) * mempool->items_priv_size;
 }
 
-enum vxge_hw_status
-__vxge_hw_mempool_grow(
-	struct vxge_hw_mempool *mempool,
-	u32 num_allocate,
-	u32 *num_allocated);
-
-struct vxge_hw_mempool*
-__vxge_hw_mempool_create(
-	struct __vxge_hw_device *devh,
-	u32 memblock_size,
-	u32 item_size,
-	u32 private_size,
-	u32 items_initial,
-	u32 items_max,
-	struct vxge_hw_mempool_cbs *mp_callback,
-	void *userdata);
-
-struct __vxge_hw_channel*
-__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
-			enum __vxge_hw_channel_type type, u32 length,
-			u32 per_dtr_space, void *userdata);
-
-void
-__vxge_hw_channel_free(
-	struct __vxge_hw_channel *channel);
-
-enum vxge_hw_status
-__vxge_hw_channel_initialize(
-	struct __vxge_hw_channel *channel);
-
-enum vxge_hw_status
-__vxge_hw_channel_reset(
-	struct __vxge_hw_channel *channel);
-
 /*
  * __vxge_hw_fifo_txdl_priv - Return the max fragments allocated
  * for the fifo.
@@ -2065,9 +1938,6 @@ enum vxge_hw_status vxge_hw_vpath_open(
 	struct vxge_hw_vpath_attr *attr,
 	struct __vxge_hw_vpath_handle **vpath_handle);
 
-enum vxge_hw_status
-__vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog);
-
 enum vxge_hw_status vxge_hw_vpath_close(
 	struct __vxge_hw_vpath_handle *vpath_handle);
 
@@ -2089,54 +1959,9 @@ enum vxge_hw_status vxge_hw_vpath_mtu_se
 	struct __vxge_hw_vpath_handle *vpath_handle,
 	u32 new_mtu);
 
-enum vxge_hw_status vxge_hw_vpath_stats_enable(
-	struct __vxge_hw_vpath_handle *vpath_handle);
-
-enum vxge_hw_status
-__vxge_hw_vpath_stats_access(
-	struct __vxge_hw_virtualpath	*vpath,
-	u32			operation,
-	u32			offset,
-	u64			*stat);
-
-enum vxge_hw_status
-__vxge_hw_vpath_xmac_tx_stats_get(
-	struct __vxge_hw_virtualpath	*vpath,
-	struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
-
-enum vxge_hw_status
-__vxge_hw_vpath_xmac_rx_stats_get(
-	struct __vxge_hw_virtualpath	*vpath,
-	struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
-
-enum vxge_hw_status
-__vxge_hw_vpath_stats_get(
-	struct __vxge_hw_virtualpath *vpath,
-	struct vxge_hw_vpath_stats_hw_info *hw_stats);
-
 void
 vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp);
 
-enum vxge_hw_status
-__vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config);
-
-void
-__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
-
-enum vxge_hw_status
-__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
-
-enum vxge_hw_status
-__vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg);
-
-enum vxge_hw_status
-__vxge_hw_kdfc_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg,
-	struct vxge_hw_vpath_reg __iomem *vpath_reg);
-
-enum vxge_hw_status
-__vxge_hw_device_register_poll(
-	void __iomem	*reg,
-	u64 mask, u32 max_millis);
 
 #ifndef readq
 static inline u64 readq(void __iomem *addr)
@@ -2168,62 +1993,12 @@ static inline void __vxge_hw_pio_mem_wri
 	writel(val, addr);
 }
 
-static inline enum vxge_hw_status
-__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
-			  u64 mask, u32 max_millis)
-{
-	enum vxge_hw_status status = VXGE_HW_OK;
-
-	__vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
-	wmb();
-	__vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
-	wmb();
-
-	status = __vxge_hw_device_register_poll(addr, mask, max_millis);
-	return status;
-}
-
-struct vxge_hw_toc_reg __iomem *
-__vxge_hw_device_toc_get(void __iomem *bar0);
-
-enum vxge_hw_status
-__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
-
-void
-__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
-
-void
-__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
-
 enum vxge_hw_status
 vxge_hw_device_flick_link_led(struct __vxge_hw_device *devh, u64 on_off);
 
 enum vxge_hw_status
-__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
-
-enum vxge_hw_status
-__vxge_hw_vpath_pci_read(
-	struct __vxge_hw_virtualpath	*vpath,
-	u32			phy_func_0,
-	u32			offset,
-	u32			*val);
-
-enum vxge_hw_status
-__vxge_hw_vpath_addr_get(
-	u32 vp_id,
-	struct vxge_hw_vpath_reg __iomem *vpath_reg,
-	u8 (macaddr)[ETH_ALEN],
-	u8 (macaddr_mask)[ETH_ALEN]);
-
-u32
-__vxge_hw_vpath_func_id_get(
-	u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
-
-enum vxge_hw_status
-__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
-
-enum vxge_hw_status
 vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
+
 /**
  * vxge_debug
  * @level: level of debug verbosity.
--- a/drivers/net/vxge/vxge-main.c	2010-10-15 09:10:06.734401351 -0700
+++ b/drivers/net/vxge/vxge-main.c	2010-10-15 10:13:44.000142249 -0700
@@ -82,6 +82,16 @@ module_param_array(bw_percentage, uint,
 
 static struct vxge_drv_config *driver_config;
 
+static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
+					     struct macInfo *mac);
+static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
+					     struct macInfo *mac);
+static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac);
+static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
+static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
+static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
+static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
+
 static inline int is_vxge_card_up(struct vxgedev *vdev)
 {
 	return test_bit(__VXGE_STATE_CARD_UP, &vdev->state);
@@ -138,7 +148,7 @@ static inline void VXGE_COMPLETE_ALL_RX(
  * This function is called during interrupt context to notify link up state
  * change.
  */
-void
+static void
 vxge_callback_link_up(struct __vxge_hw_device *hldev)
 {
 	struct net_device *dev = hldev->ndev;
@@ -162,7 +172,7 @@ vxge_callback_link_up(struct __vxge_hw_d
  * This function is called during interrupt context to notify link down state
  * change.
  */
-void
+static void
 vxge_callback_link_down(struct __vxge_hw_device *hldev)
 {
 	struct net_device *dev = hldev->ndev;
@@ -354,7 +364,7 @@ static inline void vxge_post(int *dtr_cn
  * If the interrupt is because of a received frame or if the receive ring
  * contains fresh as yet un-processed frames, this function is called.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
 		 u8 t_code, void *userdata)
 {
@@ -531,7 +541,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *
  * freed and frees all skbs whose data have already DMA'ed into the NICs
  * internal memory.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
 		enum vxge_hw_fifo_tcode t_code, void *userdata,
 		struct sk_buff ***skb_ptr, int nr_skb, int *more)
@@ -1246,7 +1256,7 @@ static int vxge_set_mac_addr(struct net_
  *
  * Enables the interrupts for the vpath
 */
-void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
+static void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
 {
 	struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
 	int msix_id = 0;
@@ -1279,7 +1289,7 @@ void vxge_vpath_intr_enable(struct vxged
  *
  * Disables the interrupts for the vpath
 */
-void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
+static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
 {
 	struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
 	int msix_id;
@@ -1553,7 +1563,7 @@ out:
  *
  * driver may reset the chip on events of serr, eccerr, etc
  */
-int vxge_reset(struct vxgedev *vdev)
+static int vxge_reset(struct vxgedev *vdev)
 {
 	return do_vxge_reset(vdev, VXGE_LL_FULL_RESET);
 }
@@ -1724,7 +1734,7 @@ static enum vxge_hw_status vxge_rth_conf
 	return status;
 }
 
-int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
+static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
 {
 	struct vxge_mac_addrs *new_mac_entry;
 	u8 *mac_address = NULL;
@@ -1757,7 +1767,8 @@ int vxge_mac_list_add(struct vxge_vpath
 }
 
 /* Add a mac address to DA table */
-enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
+static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
+					     struct macInfo *mac)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct vxge_vpath *vpath;
@@ -1782,7 +1793,7 @@ enum vxge_hw_status vxge_add_mac_addr(st
 	return status;
 }
 
-int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
+static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
 {
 	struct list_head *entry, *next;
 	u64 del_mac = 0;
@@ -1807,7 +1818,8 @@ int vxge_mac_list_del(struct vxge_vpath
 	return FALSE;
 }
 /* delete a mac address from DA table */
-enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
+static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
+					     struct macInfo *mac)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct vxge_vpath *vpath;
@@ -1854,7 +1866,7 @@ static vxge_search_mac_addr_in_da_table(
 }
 
 /* Store all vlan ids from the list to the vid table */
-enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
+static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct vxgedev *vdev = vpath->vdev;
@@ -1874,7 +1886,7 @@ enum vxge_hw_status vxge_restore_vpath_v
 }
 
 /* Store all mac addresses from the list to the DA table */
-enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
+static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct macInfo mac_info;
@@ -1916,7 +1928,7 @@ enum vxge_hw_status vxge_restore_vpath_m
 }
 
 /* reset vpaths */
-enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
+static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 	struct vxge_vpath *vpath;
@@ -1948,7 +1960,7 @@ enum vxge_hw_status vxge_reset_all_vpath
 }
 
 /* close vpaths */
-void vxge_close_vpaths(struct vxgedev *vdev, int index)
+static void vxge_close_vpaths(struct vxgedev *vdev, int index)
 {
 	struct vxge_vpath *vpath;
 	int i;
@@ -1966,7 +1978,7 @@ void vxge_close_vpaths(struct vxgedev *v
 }
 
 /* open vpaths */
-int vxge_open_vpaths(struct vxgedev *vdev)
+static int vxge_open_vpaths(struct vxgedev *vdev)
 {
 	struct vxge_hw_vpath_attr attr;
 	enum vxge_hw_status status;
@@ -2517,7 +2529,7 @@ static void vxge_poll_vp_lockup(unsigned
  * Return value: '0' on success and an appropriate (-)ve integer as
  * defined in errno.h file on failure.
  */
-int
+static int
 vxge_open(struct net_device *dev)
 {
 	enum vxge_hw_status status;
@@ -2721,7 +2733,7 @@ out0:
 }
 
 /* Loop throught the mac address list and delete all the entries */
-void vxge_free_mac_add_list(struct vxge_vpath *vpath)
+static void vxge_free_mac_add_list(struct vxge_vpath *vpath)
 {
 
 	struct list_head *entry, *next;
@@ -2745,7 +2757,7 @@ static void vxge_napi_del_all(struct vxg
 	}
 }
 
-int do_vxge_close(struct net_device *dev, int do_io)
+static int do_vxge_close(struct net_device *dev, int do_io)
 {
 	enum vxge_hw_status status;
 	struct vxgedev *vdev;
@@ -2856,7 +2868,7 @@ int do_vxge_close(struct net_device *dev
  * Return value: '0' on success and an appropriate (-)ve integer as
  * defined in errno.h file on failure.
  */
-int
+static int
 vxge_close(struct net_device *dev)
 {
 	do_vxge_close(dev, 1);
@@ -3113,10 +3125,10 @@ static const struct net_device_ops vxge_
 #endif
 };
 
-int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
-				   struct vxge_config *config,
-				   int high_dma, int no_of_vpath,
-				   struct vxgedev **vdev_out)
+static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
+					  struct vxge_config *config,
+					  int high_dma, int no_of_vpath,
+					  struct vxgedev **vdev_out)
 {
 	struct net_device *ndev;
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -3164,7 +3176,7 @@ int __devinit vxge_device_register(struc
 
 	ndev->watchdog_timeo = VXGE_LL_WATCH_DOG_TIMEOUT;
 
-	initialize_ethtool_ops(ndev);
+	vxge_initialize_ethtool_ops(ndev);
 
 	/* Allocate memory for vpath */
 	vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) *
@@ -3249,7 +3261,7 @@ _out0:
  *
  * This function will unregister and free network device
  */
-void
+static void
 vxge_device_unregister(struct __vxge_hw_device *hldev)
 {
 	struct vxgedev *vdev;
--- a/drivers/net/vxge/vxge-main.h	2010-10-15 09:10:06.802404471 -0700
+++ b/drivers/net/vxge/vxge-main.h	2010-10-15 10:13:51.232396166 -0700
@@ -396,64 +396,7 @@ struct vxge_tx_priv {
 		mod_timer(&timer, (jiffies + exp)); \
 	} while (0);
 
-int __devinit vxge_device_register(struct __vxge_hw_device *devh,
-				    struct vxge_config *config,
-				    int high_dma, int no_of_vpath,
-				    struct vxgedev **vdev);
-
-void vxge_device_unregister(struct __vxge_hw_device *devh);
-
-void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id);
-
-void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id);
-
-void vxge_callback_link_up(struct __vxge_hw_device *devh);
-
-void vxge_callback_link_down(struct __vxge_hw_device *devh);
-
-enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
-	struct macInfo *mac);
-
-int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
-
-int vxge_reset(struct vxgedev *vdev);
-
-enum vxge_hw_status
-vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
-	u8 t_code, void *userdata);
-
-enum vxge_hw_status
-vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
-	enum vxge_hw_fifo_tcode t_code, void *userdata,
-	struct sk_buff ***skb_ptr, int nr_skbs, int *more);
-
-int vxge_close(struct net_device *dev);
-
-int vxge_open(struct net_device *dev);
-
-void vxge_close_vpaths(struct vxgedev *vdev, int index);
-
-int vxge_open_vpaths(struct vxgedev *vdev);
-
-enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
-
-enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
-	struct macInfo *mac);
-
-enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
-	struct macInfo *mac);
-
-int vxge_mac_list_add(struct vxge_vpath *vpath,
-	struct macInfo *mac);
-
-void vxge_free_mac_add_list(struct vxge_vpath *vpath);
-
-enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
-
-enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
-
-int do_vxge_close(struct net_device *dev, int do_io);
-extern void initialize_ethtool_ops(struct net_device *ndev);
+extern void vxge_initialize_ethtool_ops(struct net_device *ndev);
 /**
  * #define VXGE_DEBUG_INIT: debug for initialization functions
  * #define VXGE_DEBUG_TX	 : debug transmit related functions
--- a/drivers/net/vxge/vxge-traffic.c	2010-10-15 09:10:06.750402084 -0700
+++ b/drivers/net/vxge/vxge-traffic.c	2010-10-15 09:36:10.750557049 -0700
@@ -17,6 +17,13 @@
 #include "vxge-config.h"
 #include "vxge-main.h"
 
+static enum vxge_hw_status
+__vxge_hw_device_handle_error(struct __vxge_hw_device *hldev,
+			      u32 vp_id, enum vxge_hw_event type);
+static enum vxge_hw_status
+__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
+			      u32 skip_alarms);
+
 /*
  * vxge_hw_vpath_intr_enable - Enable vpath interrupts.
  * @vp: Virtual Path handle.
@@ -513,7 +520,7 @@ exit:
  * Link up indication handler. The function is invoked by HW when
  * Titan indicates that the link is up for programmable amount of time.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev)
 {
 	/*
@@ -538,7 +545,7 @@ exit:
  * Link down indication handler. The function is invoked by HW when
  * Titan indicates that the link is down.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev)
 {
 	/*
@@ -564,7 +571,7 @@ exit:
  *
  * Handle error.
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 __vxge_hw_device_handle_error(
 		struct __vxge_hw_device *hldev,
 		u32 vp_id,
@@ -646,7 +653,7 @@ void vxge_hw_device_clear_tx_rx(struct _
  * it swaps the reserve and free arrays.
  *
  */
-enum vxge_hw_status
+static enum vxge_hw_status
 vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh)
 {
 	void **tmp_arr;
@@ -692,7 +699,8 @@ _alloc_after_swap:
  * Posts a dtr to work array.
  *
  */
-void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh)
+static void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel,
+				     void *dtrh)
 {
 	vxge_assert(channel->work_arr[channel->post_index] == NULL);
 
@@ -1658,37 +1666,6 @@ exit:
 }
 
 /**
- * vxge_hw_vpath_vid_get_next - Get the next vid entry for this vpath
- *               from vlan id table.
- * @vp: Vpath handle.
- * @vid: Buffer to return vlan id
- *
- * Returns the next vlan id in the list for this vpath.
- * see also: vxge_hw_vpath_vid_get
- *
- */
-enum vxge_hw_status
-vxge_hw_vpath_vid_get_next(struct __vxge_hw_vpath_handle *vp, u64 *vid)
-{
-	u64 data;
-	enum vxge_hw_status status = VXGE_HW_OK;
-
-	if (vp == NULL) {
-		status = VXGE_HW_ERR_INVALID_HANDLE;
-		goto exit;
-	}
-
-	status = __vxge_hw_vpath_rts_table_get(vp,
-			VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY,
-			VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_VID,
-			0, vid, &data);
-
-	*vid = VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_VLAN_ID(*vid);
-exit:
-	return status;
-}
-
-/**
  * vxge_hw_vpath_vid_delete - Delete the vlan id entry for this vpath
  *               to vlan id table.
  * @vp: Vpath handle.
@@ -1898,9 +1875,9 @@ exit:
  * Process vpath alarms.
  *
  */
-enum vxge_hw_status __vxge_hw_vpath_alarm_process(
-			struct __vxge_hw_virtualpath *vpath,
-			u32 skip_alarms)
+static enum vxge_hw_status
+__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
+			      u32 skip_alarms)
 {
 	u64 val64;
 	u64 alarm_status;
@@ -2265,36 +2242,6 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
 }
 
 /**
- * vxge_hw_vpath_msix_clear - Clear MSIX Vector.
- * @vp: Virtual Path handle.
- * @msix_id:  MSI ID
- *
- * The function clears the msix interrupt for the given msix_id
- *
- * Returns: 0,
- * Otherwise, VXGE_HW_ERR_WRONG_IRQ if the msix index is out of range
- * status.
- * See also:
- */
-void
-vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id)
-{
-	struct __vxge_hw_device *hldev = vp->vpath->hldev;
-	if (hldev->config.intr_mode ==
-			VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
-		__vxge_hw_pio_mem_write32_upper(
-			(u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
-				&hldev->common_reg->
-					clr_msix_one_shot_vec[msix_id%4]);
-	} else {
-		__vxge_hw_pio_mem_write32_upper(
-			(u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
-				&hldev->common_reg->
-					clear_msix_mask_vect[msix_id%4]);
-	}
-}
-
-/**
  * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector.
  * @vp: Virtual Path handle.
  * @msix_id:  MSI ID
@@ -2316,22 +2263,6 @@ vxge_hw_vpath_msix_unmask(struct __vxge_
 }
 
 /**
- * vxge_hw_vpath_msix_mask_all - Mask all MSIX vectors for the vpath.
- * @vp: Virtual Path handle.
- *
- * The function masks all msix interrupt for the given vpath
- *
- */
-void
-vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vp)
-{
-
-	__vxge_hw_pio_mem_write32_upper(
-		(u32)vxge_bVALn(vxge_mBIT(vp->vpath->vp_id), 0, 32),
-		&vp->vpath->hldev->common_reg->set_msix_mask_all_vect);
-}
-
-/**
  * vxge_hw_vpath_inta_mask_tx_rx - Mask Tx and Rx interrupts.
  * @vp: Virtual Path handle.
  *
--- a/drivers/net/vxge/vxge-traffic.h	2010-10-15 09:10:06.834405939 -0700
+++ b/drivers/net/vxge/vxge-traffic.h	2010-10-15 10:14:43.870258247 -0700
@@ -1749,14 +1749,6 @@ vxge_hw_mrpcim_stats_access(
 	u64 *stat);
 
 enum vxge_hw_status
-vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *devh, u32 port,
-				   struct vxge_hw_xmac_aggr_stats *aggr_stats);
-
-enum vxge_hw_status
-vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *devh, u32 port,
-				   struct vxge_hw_xmac_port_stats *port_stats);
-
-enum vxge_hw_status
 vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh,
 			      struct vxge_hw_xmac_stats *xmac_stats);
 
@@ -2117,49 +2109,10 @@ struct __vxge_hw_ring_rxd_priv {
 #endif
 };
 
-/* ========================= RING PRIVATE API ============================= */
-u64
-__vxge_hw_ring_first_block_address_get(
-	struct __vxge_hw_ring *ringh);
-
-enum vxge_hw_status
-__vxge_hw_ring_create(
-	struct __vxge_hw_vpath_handle *vpath_handle,
-	struct vxge_hw_ring_attr *attr);
-
-enum vxge_hw_status
-__vxge_hw_ring_abort(
-	struct __vxge_hw_ring *ringh);
-
-enum vxge_hw_status
-__vxge_hw_ring_reset(
-	struct __vxge_hw_ring *ringh);
-
-enum vxge_hw_status
-__vxge_hw_ring_delete(
-	struct __vxge_hw_vpath_handle *vpath_handle);
-
 /* ========================= FIFO PRIVATE API ============================= */
 
 struct vxge_hw_fifo_attr;
 
-enum vxge_hw_status
-__vxge_hw_fifo_create(
-	struct __vxge_hw_vpath_handle *vpath_handle,
-	struct vxge_hw_fifo_attr *attr);
-
-enum vxge_hw_status
-__vxge_hw_fifo_abort(
-	struct __vxge_hw_fifo *fifoh);
-
-enum vxge_hw_status
-__vxge_hw_fifo_reset(
-	struct __vxge_hw_fifo *ringh);
-
-enum vxge_hw_status
-__vxge_hw_fifo_delete(
-	struct __vxge_hw_vpath_handle *vpath_handle);
-
 struct vxge_hw_mempool_cbs {
 	void (*item_func_alloc)(
 			struct vxge_hw_mempool *mempoolh,
@@ -2169,10 +2122,6 @@ struct vxge_hw_mempool_cbs {
 			u32			is_last);
 };
 
-void
-__vxge_hw_mempool_destroy(
-	struct vxge_hw_mempool *mempool);
-
 #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath)				\
 		((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
 
@@ -2195,61 +2144,10 @@ __vxge_hw_vpath_rts_table_set(
 	u64			data2);
 
 enum vxge_hw_status
-__vxge_hw_vpath_reset(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_sw_reset(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
 __vxge_hw_vpath_enable(
 	struct __vxge_hw_device *devh,
 	u32			vp_id);
 
-void
-__vxge_hw_vpath_prc_configure(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_kdfc_configure(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_mac_configure(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_tim_configure(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_initialize(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vp_initialize(
-	struct __vxge_hw_device *devh,
-	u32			vp_id,
-	struct vxge_hw_vp_config	*config);
-
-void
-__vxge_hw_vp_terminate(
-	struct __vxge_hw_device *devh,
-	u32			vp_id);
-
-enum vxge_hw_status
-__vxge_hw_vpath_alarm_process(
-	struct __vxge_hw_virtualpath	*vpath,
-	u32			skip_alarms);
-
 void vxge_hw_device_intr_enable(
 	struct __vxge_hw_device *devh);
 
@@ -2321,11 +2219,6 @@ vxge_hw_vpath_vid_get(
 	u64			*vid);
 
 enum vxge_hw_status
-vxge_hw_vpath_vid_get_next(
-	struct __vxge_hw_vpath_handle *vpath_handle,
-	u64			*vid);
-
-enum vxge_hw_status
 vxge_hw_vpath_vid_delete(
 	struct __vxge_hw_vpath_handle *vpath_handle,
 	u64			vid);
@@ -2387,16 +2280,9 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
 void vxge_hw_device_flush_io(struct __vxge_hw_device *devh);
 
 void
-vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vpath_handle,
-			 int msix_id);
-
-void
 vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle,
 			  int msix_id);
 
-void
-vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vpath_handle);
-
 enum vxge_hw_status vxge_hw_vpath_intr_enable(
 				struct __vxge_hw_vpath_handle *vpath_handle);
 
@@ -2415,12 +2301,6 @@ vxge_hw_channel_msix_mask(struct __vxge_
 void
 vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id);
 
-enum vxge_hw_status
-vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh);
-
-void
-vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh);
-
 void
 vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel,
 				 void **dtrh);
@@ -2436,18 +2316,4 @@ vxge_hw_channel_dtr_count(struct __vxge_
 void
 vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id);
 
-/* ========================== PRIVATE API ================================= */
-
-enum vxge_hw_status
-__vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev);
-
-enum vxge_hw_status
-__vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev);
-
-enum vxge_hw_status
-__vxge_hw_device_handle_error(
-		struct __vxge_hw_device *hldev,
-		u32 vp_id,
-		enum vxge_hw_event type);
-
 #endif
--- a/drivers/net/vxge/vxge-ethtool.c	2010-10-15 09:10:06.718400615 -0700
+++ b/drivers/net/vxge/vxge-ethtool.c	2010-10-15 10:13:39.927999492 -0700
@@ -1142,7 +1142,7 @@ static const struct ethtool_ops vxge_eth
 	.get_ethtool_stats	= vxge_get_ethtool_stats,
 };
 
-void initialize_ethtool_ops(struct net_device *ndev)
+void vxge_initialize_ethtool_ops(struct net_device *ndev)
 {
 	SET_ETHTOOL_OPS(ndev, &vxge_ethtool_ops);
 }

^ permalink raw reply

* large divisor for flow classifier
From: Jonathan Thibault @ 2010-10-15 18:14 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

 It appears that when setting a fairly large divisor on the flow classifier for sfq, traffic stops altogether.

On my machine, anything above divisor 2200 seems to stop all traffic.  If I want to be fair between hosts (but not flows) for a large network (say 6000 hosts), I run into problems.  Obviously the rates here are quite low but this is just an example.

I also tested on a real interface with the same results.

Example that works:

tc qdisc add dev ifb0 root handle 3: htb default 10
  tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
    tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
      tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
      tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
      tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 1024

Example that doesn't work:

tc qdisc add dev ifb0 root handle 3: htb default 10
  tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
    tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
      tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
      tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
      tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 6144

Jonathan

^ permalink raw reply

* RFD: OF device tree vs. PHY flags.
From: David Daney @ 2010-10-15 18:18 UTC (permalink / raw)
  To: Grant Likely, devicetree-discuss, Netdev

I am in the process of planning a conversion of Octeon SOC platform code 
to use the OF device tree in the Linux kernel.

One issue that I have encountered, is that for some boards, we need to 
pass a non-zero flags argument to the phy_attach_direct() method.  The 
value of the flags is board dependent, so it would make some sense to 
encode its value in the device tree itself.  The flags I am interested 
in control the configuration of clocking modes and status LED connections.

I would suggest the following:

o Add a new property to "ethernet-phy" dts bindings called 
"linux,flags".  It would contain a comma separated string of flag names. 
  Something like "led-mode1,clock-mode2".  The semantics of the flag 
names would be interpreted by the PHY driver...

o Add a new function pointer to struct phy_driver: u32 
(*of_parse_flags)(struct phy_device *phydev).  This would parse and 
return the flags value for the "linux,flags" property from the 
device_node associated with the particular PHY device in question.

o Modify of_phy_connect() to do something like the following:

.
.
.
	if (phy->driver && phy->driver->of_parse_flags)
		flags |= phy->driver->of_parse_flags(phy);
.
.
.

o Perhaps add some helper functions to of_mdio.c to assist in parsing 
the "linux,flags" properties string.

o Any extra code in the PHY drivers and struct phy_driver would be 
protected by #ifdef CONFIG_OF

How does this sound?

Any suggestions as for improvements, or better names for things?


Thanks,
David Daney

^ permalink raw reply

* Re: [PATCH net-next 4/8] tg3: Add EEE support
From: Matt Carlson @ 2010-10-15 18:19 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Matthew Carlson, davem@davemloft.net, netdev@vger.kernel.org,
	andy@greyhouse.net
In-Reply-To: <1287152246.2267.14.camel@achroite.uk.solarflarecom.com>

On Fri, Oct 15, 2010 at 07:17:26AM -0700, Ben Hutchings wrote:
> On Thu, 2010-10-14 at 13:37 -0700, Matt Carlson wrote:
> > This patch adds Energy Efficient Ethernet (EEE) support for the 5718
> > device ID and the 57765 B0 asic revision.
> [...]
> > +/* Clause 45 expansion registers */
> > +#define TG3_CL45_D7_EEEADV_CAP		0x003c
> > +#define TG3_CL45_D7_EEEADV_CAP_100TX	0x0002
> > +#define TG3_CL45_D7_EEEADV_CAP_1000T	0x0004
> 
> I assume this is going to be a standard register, so I think it should
> be defined in <linux/mdio.h>.

O.K.  I'll make the change and respin this patch.

> > +#define TG3_CL45_D7_EEERES_STAT                0x803e
> > +#define TG3_CL45_D7_EEERES_STAT_LP_100TX	0x0002
> > +#define TG3_CL45_D7_EEERES_STAT_LP_1000T	0x0004
> 
> 0x803e not 0x003e?

I'm checking on this one.  EEE works with this patch in place.  Maybe I
can make this a definition that takes a standard clause 45 register as
an input though.

> Also Dave suggested there should be an ethtool interface to control EEE
> <http://thread.gmane.org/gmane.linux.network/164141/focus=165143>.

I don't see any ETH_FLAG definition for this in ethtool.h yet.  Is this
the way everyone wanted to go?


^ permalink raw reply

* Re: [PATCH] PCI: MSI: Remove unsafe and unnecessary hardware access
From: Emil S Tantilov @ 2010-10-15 18:26 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Jesse Barnes, Michael Chan, Matthew Wilcox, linux-pci, NetDev,
	Tantilov, Emil S, Jesse Brandeburg, Kirsher, Jeffrey T
In-Reply-To: <1276802196.2083.12.camel@achroite.uk.solarflarecom.com>

On Thu, Jun 17, 2010 at 12:16 PM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> During suspend on an SMP system, {read,write}_msi_msg_desc() may be
> called to mask and unmask interrupts on a device that is already in a
> reduced power state.  At this point memory-mapped registers including
> MSI-X tables are not accessible, and config space may not be fully
> functional either.
>
> While a device is in a reduced power state its interrupts are
> effectively masked and its MSI(-X) state will be restored when it is
> brought back to D0.  Therefore these functions can simply read and
> write msi_desc::msg for devices not in D0.
>
> Further, read_msi_msg_desc() should only ever be used to update a
> previously written message, so it can always read msi_desc::msg
> and never needs to touch the hardware.
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> On Mon, 2010-06-14 at 18:13 -0700, Michael Chan wrote:
>> I'm debugging the bnx2 driver which doesn't work after suspend/resume if
>> it is running in MSI-X mode.  The problem is that during suspend, the
>> MSI-X vectors are disabled by the following sequence on x86:
>>
>> take_cpu_down() -> cpu_disable_common() -> fixup_irqs()
>>
>> The MSI-X address/data used to disable the vectors are remembered in the
>> above sequence. During resume, these address/data are then programmed
>> back to the device during pci_restore_state(), causing all the vectors
>> to remain disabled.
>
> That's not quite what I see.  What I see is that the message is read
> back from the table *after* the driver's suspend method has been called.
> At this point the device is already in D3 and memory-mapped registers
> are not accessible, so we get random bits as the message.  At least,
> that's what I see happening with the sfc driver.
>
>> Some drivers call free_irq() during suspend and request_irq() during
>> resume, and that should avoid the problem.  bnx2 and some other drivers
>> do not do that.  These drivers rely on pci_restore_state() to restore
>> the MSI-X vectors to the same working state before suspend.
>>
>> What's the right way to fix this?  Thanks.
>
> This is my attempt, which works for sfc.  See if it works for bnx2.
>
> Ben.
>
>  drivers/pci/msi.c |   34 +++++++++++-----------------------
>  1 files changed, 11 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 77b68ea..03f04dc 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -196,30 +196,15 @@ void unmask_msi_irq(unsigned int irq)
>  void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
>  {
>        struct msi_desc *entry = get_irq_desc_msi(desc);
> -       if (entry->msi_attrib.is_msix) {
> -               void __iomem *base = entry->mask_base +
> -                       entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
>
> -               msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR);
> -               msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR);
> -               msg->data = readl(base + PCI_MSIX_ENTRY_DATA);
> -       } else {
> -               struct pci_dev *dev = entry->dev;
> -               int pos = entry->msi_attrib.pos;
> -               u16 data;
> +       /* We do not touch the hardware (which may not even be
> +        * accessible at the moment) but return the last message
> +        * written.  Assert that this is valid, assuming that
> +        * valid messages are not all-zeroes. */
> +       BUG_ON(!(entry->msg.address_hi | entry->msg.address_lo |
> +                entry->msg.data));
>
> -               pci_read_config_dword(dev, msi_lower_address_reg(pos),
> -                                       &msg->address_lo);
> -               if (entry->msi_attrib.is_64) {
> -                       pci_read_config_dword(dev, msi_upper_address_reg(pos),
> -                                               &msg->address_hi);
> -                       pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
> -               } else {
> -                       msg->address_hi = 0;
> -                       pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
> -               }
> -               msg->data = data;
> -       }
> +       *msg = entry->msg;
>  }
>
>  void read_msi_msg(unsigned int irq, struct msi_msg *msg)
> @@ -232,7 +217,10 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
>  void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
>  {
>        struct msi_desc *entry = get_irq_desc_msi(desc);
> -       if (entry->msi_attrib.is_msix) {
> +
> +       if (entry->dev->current_state != PCI_D0) {

This check exposed a problem in ixgb (patch is on the way) where
pci_disable_device() was not being called in ixgb_remove(). As a
result the current_state was set to PCI_UNKNOWN and the interface
failed to work on subsequent load of the driver.

Even though the problem was in ixgb, it made me wonder about this
check as the presumption here (low power state) may not always be
true. Like in the case of unloading a driver, which sets
dev->current_state to PCI_UNKNOWN which is not a representation of the
_real_ state of the device (actual state could be D0).

BTW - quick search shows other drivers that could potentially suffer
the faith of ixgb due to lack of pci_disable_device() call on removal.

Thanks,
Emil

^ permalink raw reply

* [PATCH] net/core:  Allow tagged VLAN packets to flow through VETH devices.
From: Ben Greear @ 2010-10-15 18:35 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

When there are VLANs on a VETH device, the packets being transmitted
through the VETH device may be 4 bytes bigger than MTU.  A check
in dev_forward_skb did not take this into account and so dropped
these packets.

This patch is needed at least as far back as 2.6.34.7 and should
be considered for -stable.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 7f52603... 9fa308b... M	net/core/dev.c
 net/core/dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 7f52603..9fa308b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1485,7 +1485,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
 	nf_reset(skb);
 
 	if (!(dev->flags & IFF_UP) ||
-	    (skb->len > (dev->mtu + dev->hard_header_len))) {
+	    (skb->len > (dev->mtu + dev->hard_header_len + VLAN_HLEN))) {
 		kfree_skb(skb);
 		return NET_RX_DROP;
 	}
-- 
1.6.2.5


^ permalink raw reply related

* (unknown), 
From: WESTERN UNION OFFICE. @ 2010-10-15 19:15 UTC (permalink / raw)


We have been trying to reach you since the past few days,
as my associate has helped me to send your first payment
of $7,500 USD to you as instructed by Mr. David Cameron
the United Kingdom prime minister after the last G20
meeting that was held in United Kingdom, making you one
of the beneficiaries. Here is the information below.

MONEY TRANSFER CONTROL NUMBER: 0224873876
SENDER NAME: Jame w. Barry
AMOUNT: $7,500 USD

I told him to keep sending you $7,500 USD twice a week
until the FULL payment of ($820000.00 United State Dollars)
is completed.

A certificate will be made to change the Receiver Name as
stated by the British prime minister, send your Full Names
and address via Email to: Mr Garry Moore
Mail:mr.garrymoore009@gmail.com
The money will not reflect until the clearance certificate is
issue to you by the G20 committee.

Click your reply botton to contact Mr. Garry Moore for your
clearance certificate.






^ permalink raw reply

* Re: Documentation for IP_TRANSPARENT?
From: Balazs Scheidler @ 2010-10-15 19:40 UTC (permalink / raw)
  To: mtk.manpages; +Cc: KOVACS Krisztian, David Miller, linux-net, netdev
In-Reply-To: <AANLkTika83PJ_KkmE+3Rhi4JgTjEZHTDzV-hcyz_UCWB@mail.gmail.com>

On Wed, 2010-10-13 at 07:16 +0200, Michael Kerrisk wrote:
> Hello Bazsi
> 
> A long time after your mail, I've now added the text you supplied
> below. The changes are now available via git, and will be in
> man-pages-3.29. However, I have a few small questions that you can
> maybe clarify. See below.
> 
> On Tue, Dec 9, 2008 at 2:17 PM, Balazs Scheidler <bazsi@balabit.hu> wrote:
> > Hi,
> >
> > On Mon, 2008-11-24 at 11:06 -0500, Michael Kerrisk wrote:
> >> Hello Krisztian,
> >>
> >> Your 2.6.27 patch adds  the IP_TRANSPARENT socket option.  Could you
> >> please supply some documentation (plain text is fine) suitable for
> >> inclusion in the ip(7) man page.
> >
> > Although it was Krisztian who originally submitted the patches, but I
> > also did some things about them, so here I gave the documentation part a
> > spin.
> >
> > There are some other related options, that are undocumented right now,
> > so I tried to give documentation on those as well.
> >
> > IP_FREEBIND
> >        Enable binding to IP addresses that do not currently exist. When
> >        enabled on a TCP or UDP socket, the bind(2) call referencing a
> >        non-existing IP address will succeed. This functionality is useful
> >        if the specified IP address is dynamic (e.g. assigned to a PPP device)
> >        and is down at the time when the application is trying to bind to it.
> >        This setsockopt is the per-socket equivalent to ip_nonlocal_bind sysctl.
> >
> > IP_TRANSPARENT
> >        Enable transparent proxying on this socket. This socket option allows
> >        the calling application to bind to a non-local IP address and operate
> >        both as a client and a server with the foreign address as the local
> >        endpoint. NOTE: this requires that routing be set up in a way that
> >        packets going to the foreign address are routed through the tproxy box.
> 
> Can you say a few words explaining what is meant by "tproxy box".

tproxy box is the computer running the transparent proxy application,
ie. the one calling the IP_TRANSPARENT socket option.

> 
> Also, should one write "TProxy" here, analogous with "TProxy" below?

yes.

> 
> >        Enabling this socket option requires superuser privileges
> >        (more specifically the CAP_NET_ADMIN capability).
> >
> >        TProxy redirection with the iptables TPROXY target also requires that
> >        this option be set on the redirected socket.
> 
> In iptables(8), I find no mention of TPROXY. Is it just that the
> iptables(8) man page is not up to date?

AFAIR in iptables the man page is automatically generated from snippets
supplied with extensions.

Checking the iptables git tree, there's such a man page snippet for the
TPROXY target here:

http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=blob;f=extensions/libxt_TPROXY.man;hb=HEAD

I'm not 100% percent sure why it doesn't get into the iptables manual
page in your case. On my system, it seems to be included though:

$ man iptables | grep TPROXY
   TPROXY


> 
> > IP_RECVORIGDSTADDR
> >        Enables the IP_ORIGDSTADDR ancillary message in recvmsg(2) in which
> >        the kernel returns the original destination address of a datagram. The
> >        ancillary message contains a "struct sockaddr_in" instance.
> 
> Do you happen to know of any userspace test code that demonstrates the
> use of IP_RECVORIGDSTADDR?

Well, the one I have has too much cruft around it and many layers of
indirection, not really good for a sample code.

Pattern-wise it is the same as IP_RECVTTL, e.g. you set
IP_RECVORIGDSTADDR via setsockopt and then you get an ancillary message
with recvmsg() with the cmsg_level == IPPROTO_IP and cmsg_type ==
IP_ORIGDSTADDR

There's a similar sample in cmsg(3)

If you still need a sample, let me know and I'll cook something up.

> 
> Thanks for this documentation, and sorry it took so long to make its
> way into man-pages.

No problem :) I could use these interfaces ever since :)

-- 
Bazsi



^ permalink raw reply

* Re: Linux Plumbers Conference: User-visible Network Issues Mini-Conf
From: Matt Domsch @ 2010-10-15 19:50 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1B9798A3396AB0429545ADFEA207931510536C7C8E@AUSX7MCPS302.AMER.DELL.COM>

At the Linux Plumbers Conference [1] November 3-5, 2010 in Cambridge,
MA, we have a half-day mini-conference [2] set aside on Thursday
morning (so as to follow immediately, but not conflict with netconf)
to discuss "User-visible Network Issues" - challenges that users face,
that could benefit from both userspace and kernel enhancements to make
their lives easier.

Accepted topics are:

* Challenges in Mobile Networking 
Challenges that we have with networking in the mobile space.
Led by Dan Williams

* Network Device Naming 
Which of my NICs is eth0? 
Led by Matt Domsch 
 
* Scaling techniques in the stack for servers with high connection rates 
This talk will describe some techniques for scaling front end
servers. In particular, we will describe the the use of SO_REUSEPORT
in scaling servers for high connection rates with a single listening
port.
Led by Ying Cai

* Simplifying network configuration for VMs by harmonizing multiple Bridging, QOS, DCB and CNA implementations 
Led by Shyam Iyer

While I'm sure the individual topics will generate great discussion,
it will be vital that members of the netdev community be present to
represent the kernel developers' perspectives on the problems and to
help brainstorm solutions.  Most of these topics have significant
kernel components to them, and without additional kernel developer
participation, I fear we would just be talking to ourselves, but no
real progress made.  I invite you to attend LPC, and this
mini-conf in particular, and lend your expertise.

If you would attend LPC, except that the conference fee is a burden,
please let me know.  I have at least one pass available for mini-conf
participants.

Thanks,
Matt

[1] http://www.linuxplumbersconf.org/2010/
[2] http://www.linuxplumbersconf.org/2010/ocw/events/LPC2010MC/tracks/63

-- 
Matt Domsch
Technology Strategist
Dell | Office of the CTO

^ permalink raw reply

* Re: large divisor for flow classifier
From: Eric Dumazet @ 2010-10-15 20:01 UTC (permalink / raw)
  To: Jonathan Thibault; +Cc: Patrick McHardy, netdev
In-Reply-To: <4CB899F7.0@navigue.com>

Le vendredi 15 octobre 2010 à 14:14 -0400, Jonathan Thibault a écrit :
> It appears that when setting a fairly large divisor on the flow classifier for sfq, traffic stops altogether.
> 
> On my machine, anything above divisor 2200 seems to stop all traffic.  If I want to be fair between hosts (but not flows) for a large network (say 6000 hosts), I run into problems.  Obviously the rates here are quite low but this is just an example.
> 
> I also tested on a real interface with the same results.
> 
> Example that works:
> 
> tc qdisc add dev ifb0 root handle 3: htb default 10
>   tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
>     tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
>       tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
>       tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
>       tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 1024
> 
> Example that doesn't work:
> 
> tc qdisc add dev ifb0 root handle 3: htb default 10
>   tc class add dev ifb0 parent 3: classid 3:1 htb rate 80kbit
>     tc class add dev ifb0 parent 3:1 classid 3:10 htb rate 80kbit
>       tc qdisc add dev ifb0 parent 3:10 handle 310: sfq perturb 10
>       tc filter add dev ifb0 parent 3: protocol all prio 1 u32 match mark 0x000 0xf00 flowid 3:10
>       tc filter add dev ifb0 parent 310: protocol all handle 0x310 flow hash keys dst divisor 6144
> 

SFQ is limited to a 1024 divisor

You might try following patch :

(8192 is the smallest power of two greater than 6144)

sizeof(struct sfq_sched_data) becomes 0x2ccc instead of 0x10cc

keep in mind hash distribution is not perfect.

What would be the real rate ?


diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 3cf478d..c4a53d6 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -77,7 +77,7 @@
 	It is easy to increase these values, but not in flight.  */
 
 #define SFQ_DEPTH		128
-#define SFQ_HASH_DIVISOR	1024
+#define SFQ_HASH_DIVISOR	8192
 
 /* This type should contain at least SFQ_DEPTH*2 values */
 typedef unsigned char sfq_index;



^ permalink raw reply related

* Re: [PATCH] PCI: MSI: Remove unsafe and unnecessary hardware access
From: Jesse Barnes @ 2010-10-15 20:06 UTC (permalink / raw)
  To: Emil S Tantilov
  Cc: Ben Hutchings, Michael Chan, Matthew Wilcox, linux-pci, NetDev,
	Tantilov, Emil S, Jesse Brandeburg, Kirsher, Jeffrey T
In-Reply-To: <AANLkTi=F19SdRNfhQe_R9sqwqCbFtAUCFu+09KFgzdAK@mail.gmail.com>

On Fri, 15 Oct 2010 11:26:08 -0700
Emil S Tantilov <emils.tantilov@gmail.com> wrote:

> On Thu, Jun 17, 2010 at 12:16 PM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > During suspend on an SMP system, {read,write}_msi_msg_desc() may be
> > called to mask and unmask interrupts on a device that is already in a
> > reduced power state.  At this point memory-mapped registers including
> > MSI-X tables are not accessible, and config space may not be fully
> > functional either.
> >
> > While a device is in a reduced power state its interrupts are
> > effectively masked and its MSI(-X) state will be restored when it is
> > brought back to D0.  Therefore these functions can simply read and
> > write msi_desc::msg for devices not in D0.
> >
> > Further, read_msi_msg_desc() should only ever be used to update a
> > previously written message, so it can always read msi_desc::msg
> > and never needs to touch the hardware.
> >
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
> > On Mon, 2010-06-14 at 18:13 -0700, Michael Chan wrote:
> >> I'm debugging the bnx2 driver which doesn't work after suspend/resume if
> >> it is running in MSI-X mode.  The problem is that during suspend, the
> >> MSI-X vectors are disabled by the following sequence on x86:
> >>
> >> take_cpu_down() -> cpu_disable_common() -> fixup_irqs()
> >>
> >> The MSI-X address/data used to disable the vectors are remembered in the
> >> above sequence. During resume, these address/data are then programmed
> >> back to the device during pci_restore_state(), causing all the vectors
> >> to remain disabled.
> >
> > That's not quite what I see.  What I see is that the message is read
> > back from the table *after* the driver's suspend method has been called.
> > At this point the device is already in D3 and memory-mapped registers
> > are not accessible, so we get random bits as the message.  At least,
> > that's what I see happening with the sfc driver.
> >
> >> Some drivers call free_irq() during suspend and request_irq() during
> >> resume, and that should avoid the problem.  bnx2 and some other drivers
> >> do not do that.  These drivers rely on pci_restore_state() to restore
> >> the MSI-X vectors to the same working state before suspend.
> >>
> >> What's the right way to fix this?  Thanks.
> >
> > This is my attempt, which works for sfc.  See if it works for bnx2.
> >
> > Ben.
> >
> >  drivers/pci/msi.c |   34 +++++++++++-----------------------
> >  1 files changed, 11 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> > index 77b68ea..03f04dc 100644
> > --- a/drivers/pci/msi.c
> > +++ b/drivers/pci/msi.c
> > @@ -196,30 +196,15 @@ void unmask_msi_irq(unsigned int irq)
> >  void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
> >  {
> >        struct msi_desc *entry = get_irq_desc_msi(desc);
> > -       if (entry->msi_attrib.is_msix) {
> > -               void __iomem *base = entry->mask_base +
> > -                       entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
> >
> > -               msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR);
> > -               msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR);
> > -               msg->data = readl(base + PCI_MSIX_ENTRY_DATA);
> > -       } else {
> > -               struct pci_dev *dev = entry->dev;
> > -               int pos = entry->msi_attrib.pos;
> > -               u16 data;
> > +       /* We do not touch the hardware (which may not even be
> > +        * accessible at the moment) but return the last message
> > +        * written.  Assert that this is valid, assuming that
> > +        * valid messages are not all-zeroes. */
> > +       BUG_ON(!(entry->msg.address_hi | entry->msg.address_lo |
> > +                entry->msg.data));
> >
> > -               pci_read_config_dword(dev, msi_lower_address_reg(pos),
> > -                                       &msg->address_lo);
> > -               if (entry->msi_attrib.is_64) {
> > -                       pci_read_config_dword(dev, msi_upper_address_reg(pos),
> > -                                               &msg->address_hi);
> > -                       pci_read_config_word(dev, msi_data_reg(pos, 1), &data);
> > -               } else {
> > -                       msg->address_hi = 0;
> > -                       pci_read_config_word(dev, msi_data_reg(pos, 0), &data);
> > -               }
> > -               msg->data = data;
> > -       }
> > +       *msg = entry->msg;
> >  }
> >
> >  void read_msi_msg(unsigned int irq, struct msi_msg *msg)
> > @@ -232,7 +217,10 @@ void read_msi_msg(unsigned int irq, struct msi_msg *msg)
> >  void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg)
> >  {
> >        struct msi_desc *entry = get_irq_desc_msi(desc);
> > -       if (entry->msi_attrib.is_msix) {
> > +
> > +       if (entry->dev->current_state != PCI_D0) {
> 
> This check exposed a problem in ixgb (patch is on the way) where
> pci_disable_device() was not being called in ixgb_remove(). As a
> result the current_state was set to PCI_UNKNOWN and the interface
> failed to work on subsequent load of the driver.
> 
> Even though the problem was in ixgb, it made me wonder about this
> check as the presumption here (low power state) may not always be
> true. Like in the case of unloading a driver, which sets
> dev->current_state to PCI_UNKNOWN which is not a representation of the
> _real_ state of the device (actual state could be D0).
> 
> BTW - quick search shows other drivers that could potentially suffer
> the faith of ixgb due to lack of pci_disable_device() call on removal.

Yeah we just ran into this in the DRM layer as well; which does a
pci_enable_device but never calls _disable, so we're stuck with
potentially stale state.

I came up with the below to address that, but really I don't like the
idea of nested pci_enable_device() calls at all.  But I haven't looked
at the latest Wireless USB stuff to see if those drivers still rely on
it.

-- 
Jesse Barnes, Intel Open Source Technology Center

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7fa3cbd..37facc1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -994,6 +994,18 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
 	int err;
 	int i, bars = 0;
 
+	/*
+	 * Power state could be unknown at this point, either due to a fresh
+	 * boot or a device removal call.  So get the current power state
+	 * so that things like MSI message writing will behave as expected
+	 * (e.g. if the device really is in D0 at enable time).
+	 */
+	if (dev->pm_cap) {
+		u16 pmcsr;
+		pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
+		dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
+	}
+
 	if (atomic_add_return(1, &dev->enable_cnt) > 1)
 		return 0;		/* already enabled */
 

^ permalink raw reply related

* pull request: wireless-next-2.6 2010-10-15
From: John W. Linville @ 2010-10-15 20:40 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Dave,

Here is the latest batch of updates intended for 2.6.37.  As usual,
it is primarily a bunch of driver updates and fixes to code already
in -next.  This also includes a batch of Bluetooth updates courtesy
of Gustavo Padovan.  There is also the movement of the wl1251 driver
out of the wl12xx directory.  This is a prelude to the expansion of
the wl1271 code to cover some new hardware, all of which is actually
largely unrelated to wl1251.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 7662ff46b7b3678162ce125903115e4ab0607a2d:

  ixgbe: DCB: remove DCB check config (2010-10-15 09:27:38 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git for-davem

Andrei Emeltchenko (4):
      Bluetooth: remove extra newline from debug output
      Bluetooth: check L2CAP length in first ACL fragment
      Bluetooth: check for l2cap header in start fragment
      Bluetooth: clean up rfcomm code

Ben Greear (9):
      mac80211: Improve mlme probe response log messages.
      wireless: Set some stats used by /proc/net/wireless (wext)
      ath5k: Print out opmode in debugfs.
      ath5k: Adjust opmode when interfaces are removed.
      wireless: Print wiphy name in sysfs.
      ath5k: Move debugfs under ieee80211/[wiphy-name]
      ath9k: Fix potential use-after-free.
      ath9k: Remove bf_dmacontext.
      ath9k: Null out references to stale pointers.

Björn Smedman (3):
      mac80211: minstrel_ht A-MPDU fix
      ath9k: A-MPDU rate control info fix
      ath9k: built-in rate control A-MPDU fix

Christian Lamparter (5):
      mac80211: fix possible null-pointer de-reference
      mac80211: temporarily disable reorder release timer
      carl9170: common error path for bad frames
      carl9170: remove stale rx error path
      carl9170: A-MPDU frame type filter

David Vrabel (2):
      Bluetooth: HCI devices are either BR/EDR or AMP radios
      Bluetooth: Support SDIO devices that are AMP controllers

Felix Fietkau (14):
      ath9k_hw: store the clock rate in common data on channel changes
      ath5k: store the clock rate in common data on channel changes
      ath9k_hw: move the cycle counter tracking to ath
      ath5k: use the common cycle counter / listen time implementation
      cfg80211: add channel utilization stats to the survey command
      ath9k: add compile time checking for the size of the channel list
      ath9k: implement channel utilization stats for survey
      ath9k: do not track cycle counter updates in powersave mode
      ath9k_hw: fix division by zero in the ANI monitor code
      ath9k_hw: fix PHY counter overflow handling in ANI v1
      ath9k: add missing locking around ath9k_hw_proc_mib_event
      ath9k: make rate control debugfs stats per station
      ath9k: remove sc->cur_rate_table and sc->cur_rate_mode
      ath9k_hw: remove enum wireless_mode and its users

Gerrit Renker (1):
      wext: fix alignment problem in serializing 'struct iw_point'

Gustavo F. Padovan (4):
      Bluetooth: remove unused variable from cmtp
      Bluetooth: make batostr() print in the right order
      Bluetooth: Use the proper error value from bt_skb_send_alloc()
      Bluetooth: update MAINTAINERS for Bluetooth subsys

Haijun Liu (1):
      Bluetooth: Update conf_state before send config_req out

Helmut Schaa (6):
      rt2x00: Shortcut link state updates when not operating as STA
      rt2x00: Optimize unmapping of skbs
      rt2x00: Use proper type for rxwi_w2 in rt2800_agc_to_rssi
      rt2x00: Use unlikely for error case in rt2x00queue_write_tx_frame
      rt2x00: Remove superfluous initialization of qidx
      rt2x00: Fix tx status handling in rt2800pci

Ivo van Doorn (7):
      rt2x00: Simplify Queue function arguments
      rt2x00: Move watchdog work to kernel work_queue
      rt2x00: Validate MCS on RX path
      rt2x00: Fix dead queue when skb allocation failed
      rt2x00: Make queue_entry flags access atomic
      rt2x00: Don't perform watchdog checks on empty queue
      rt2x00: Fix URB error handling

Jiri Slaby (1):
      WIRELESS: at76c50x, remove unneeded NULL check

Joe Perches (1):
      ath5k: fix build break from "ath5k: Print out opmode in debugfs"

Johan Hedberg (1):
      Bluetooth: Don't clear the blacklist when closing the HCI device

Johannes Berg (32):
      iwlagn: rename iwl_commit_rxon
      iwlwifi: introduce post_scan hook
      iwl3945: use iwl3945_commit_rxon
      iwlwifi: move chain settings to agn
      iwlwifi: rename iwl_mac_beacon_update
      iwlwifi: remove verify_signature eeprom operation
      iwlwifi: move agn specific station code there
      iwlwifi: move tx fail code to agn
      iwlwifi: remove spurious exports
      iwlwifi: remove agn rates info there
      iwlwifi: move iwl_toggle_rx_ant to agn
      iwlwifi: move iwl_dump_csr to agn
      iwlwifi: move iwl_dump_fh to agn
      iwlwifi: remove set_ct_kill operation
      iwlwifi: remove set_pwr_src operation
      iwlwifi: remove apm_ops.stop
      iwlwifi: clean up declarations
      iwlwifi: remove iwl_check_bits
      iwlwifi: fix dual-mode scanning
      Revert "wireless: Use first phyX name available when registering phy devices."
      mac80211: don't kmalloc 16 bytes
      iwl3945: fix queue allocation
      cfg80211: notify drivers about frame registrations
      mac80211: add probe request filter flag
      mac80211: fix SMPS request
      iwlwifi: allow probe-after-rx on 2.4 GHz
      iwlwifi: rename ibss_beacon variable
      iwlwifi: clean up some beacon handling
      iwlwifi: rewrite RXON checks
      iwlwifi: blink LED in IBSS mode
      iwlagn: check beacon frame size
      radiotap: fix vendor namespace parsing

John W. Linville (4):
      Merge branch 'wireless-next' of git://git.kernel.org/.../luca/wl12xx
      Merge branch 'wireless-next-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6
      Merge branch 'master' of git://git.kernel.org/.../padovan/bluetooth-next-2.6 into for-davem
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Jouni Malinen (1):
      ath9k: Set RX filter for Probe Request based on filter flag

Julia Lawall (1):
      drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure

Kalle Valo (3):
      wl1251: create a copy of wl12xx_80211.h for wl1251
      wl1251: move to it's own directory
      wl1251: update the new location to the maintainers file

Karl Beldan (1):
      Bluetooth: hci_uart: Fix typo in stats for sco tx

Luis R. Rodriguez (1):
      ath9k_hw: remove AR9003 2.0 support

Mat Martineau (4):
      Bluetooth: Validate PSM values in calls to connect() and bind()
      Bluetooth: Add common code for stream-oriented recvmsg()
      Bluetooth: Use common SOCK_STREAM receive code in RFCOMM
      Bluetooth: Use a stream-oriented recvmsg with SOCK_STREAM L2CAP sockets.

Mohammed Shafi Shajakhan (1):
      ath9k: Fix documentation in rate control

Nobuhiro Iwamatsu (2):
      Bluetooth: Add support Bluetooth controller of MacbookPro 6,2
      Bluetooth: Add support Bluetooth controller of MacbookPro 7,1

Ohad Ben-Cohen (2):
      wl1271: sdio: enable runtime PM
      wl1271: sdio: add suspend/resume support

Paul Fox (1):
      libertas: Communicate USB transfer errors

Rafał Miłecki (8):
      b43: N-PHY: grab more info about new channel
      b43: N-PHY: store info about current channel's type
      b43: N-PHY: fix logic in band switching
      b43: N-PHY: prepare for rev3+ channel tables
      b43: N-PHY: replace N-specific radio_chanspec with common code
      b43: N-PHY: fix typo: read table when caching IQ LO calibration (do not write)
      b43: N-PHY: put radio-specific code in separated file
      b43: N-PHY: put 2056-radio's specific code in separated file

Rajkumar Manoharan (1):
      ath9k_htc: set probe request rx filter

Shanyu Zhao (2):
      iwlagn: fix default calibration table size
      iwlagn: add temperature offset calib for 6000g2

Steve deRosier (1):
      mac80211: Update mesh constants to approved IEEE ANA values

Wey-Yi Guy (6):
      iwlagn: no version check for experimental uCode
      iiwlagn: always download priority table
      iwlagn: prio_tbl need to download before calibration
      iwlgn: need longer tx queue stuck timer for coex devices
      iwlagn: 6050 ops should be used;
      iwlwifi: move agn only eeprom functions to separate file

Yuri Kululin (1):
      Bluetooth: Fix RFCOMM RPN negotiation

 MAINTAINERS                                        |    8 +-
 drivers/bluetooth/btmrvl_main.c                    |    4 +-
 drivers/bluetooth/btsdio.c                         |    8 +
 drivers/bluetooth/btusb.c                          |    6 +
 drivers/bluetooth/hci_ldisc.c                      |    2 +-
 drivers/net/wireless/Kconfig                       |    1 +
 drivers/net/wireless/Makefile                      |    1 +
 drivers/net/wireless/at76c50x-usb.c                |    3 +-
 drivers/net/wireless/ath/ath.h                     |   16 +
 drivers/net/wireless/ath/ath5k/ani.c               |   41 +-
 drivers/net/wireless/ath/ath5k/ani.h               |    5 +-
 drivers/net/wireless/ath/ath5k/ath5k.h             |    2 +-
 drivers/net/wireless/ath/ath5k/base.c              |   71 +-
 drivers/net/wireless/ath/ath5k/debug.c             |   49 +-
 drivers/net/wireless/ath/ath5k/debug.h             |   12 -
 drivers/net/wireless/ath/ath5k/pcu.c               |   13 +-
 drivers/net/wireless/ath/ath5k/phy.c               |    1 +
 drivers/net/wireless/ath/ath9k/ani.c               |  101 +-
 drivers/net/wireless/ath/ath9k/ani.h               |    8 -
 .../net/wireless/ath/ath9k/ar9003_2p0_initvals.h   | 1784 --------------------
 drivers/net/wireless/ath/ath9k/ar9003_hw.c         |  162 +--
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |    7 +-
 drivers/net/wireless/ath/ath9k/ath9k.h             |    7 +-
 drivers/net/wireless/ath/ath9k/beacon.c            |   21 +-
 drivers/net/wireless/ath/ath9k/debug.c             |   93 -
 drivers/net/wireless/ath/ath9k/debug.h             |   21 -
 drivers/net/wireless/ath/ath9k/htc_drv_init.c      |   12 +-
 drivers/net/wireless/ath/ath9k/htc_drv_main.c      |    1 +
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c      |    3 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   66 +-
 drivers/net/wireless/ath/ath9k/hw.h                |   21 +-
 drivers/net/wireless/ath/ath9k/init.c              |   16 +-
 drivers/net/wireless/ath/ath9k/main.c              |  179 ++-
 drivers/net/wireless/ath/ath9k/rc.c                |  184 ++-
 drivers/net/wireless/ath/ath9k/rc.h                |   26 +-
 drivers/net/wireless/ath/ath9k/recv.c              |   10 +-
 drivers/net/wireless/ath/ath9k/reg.h               |   14 -
 drivers/net/wireless/ath/ath9k/xmit.c              |   38 +-
 drivers/net/wireless/ath/carl9170/rx.c             |   89 +-
 drivers/net/wireless/ath/carl9170/wlan.h           |   14 +-
 drivers/net/wireless/ath/debug.c                   |   29 +
 drivers/net/wireless/ath/debug.h                   |   10 +
 drivers/net/wireless/ath/hw.c                      |   59 +
 drivers/net/wireless/ath/reg.h                     |   11 +
 drivers/net/wireless/b43/Makefile                  |    2 +
 drivers/net/wireless/b43/phy_common.h              |    5 +-
 drivers/net/wireless/b43/phy_n.c                   |  128 +-
 drivers/net/wireless/b43/phy_n.h                   |  218 +---
 drivers/net/wireless/b43/radio_2055.c              | 1332 +++++++++++++++
 drivers/net/wireless/b43/radio_2055.h              |  254 +++
 drivers/net/wireless/b43/radio_2056.c              |   43 +
 drivers/net/wireless/b43/radio_2056.h              |   42 +
 drivers/net/wireless/b43/tables_nphy.c             | 1311 +--------------
 drivers/net/wireless/b43/tables_nphy.h             |   59 +-
 drivers/net/wireless/iwlwifi/Makefile              |    2 +-
 drivers/net/wireless/iwlwifi/iwl-1000.c            |    7 +-
 drivers/net/wireless/iwlwifi/iwl-3945.c            |   76 +-
 drivers/net/wireless/iwlwifi/iwl-3945.h            |    9 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c            |   27 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c            |   14 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c            |   62 +-
 drivers/net/wireless/iwlwifi/iwl-agn-calib.c       |    2 +-
 .../iwlwifi/{iwl-calib.h => iwl-agn-calib.h}       |    4 +
 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c      |  454 +++++
 drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c        |    9 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c         |  372 ++++-
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c          |   69 +
 drivers/net/wireless/iwlwifi/iwl-agn-rs.h          |   10 -
 drivers/net/wireless/iwlwifi/iwl-agn-rx.c          |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-sta.c         |  716 ++++++++
 drivers/net/wireless/iwlwifi/iwl-agn-tt.c          |    5 -
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |   40 +
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c       |   28 +
 drivers/net/wireless/iwlwifi/iwl-agn.c             |  106 +-
 drivers/net/wireless/iwlwifi/iwl-agn.h             |   71 +
 drivers/net/wireless/iwlwifi/iwl-commands.h        |   13 +-
 drivers/net/wireless/iwlwifi/iwl-core.c            |  531 +-----
 drivers/net/wireless/iwlwifi/iwl-core.h            |   49 +-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c         |    1 -
 drivers/net/wireless/iwlwifi/iwl-dev.h             |   16 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom.c          |  381 +----
 drivers/net/wireless/iwlwifi/iwl-eeprom.h          |    8 +-
 drivers/net/wireless/iwlwifi/iwl-helpers.h         |    5 -
 drivers/net/wireless/iwlwifi/iwl-rx.c              |    1 -
 drivers/net/wireless/iwlwifi/iwl-scan.c            |   12 +-
 drivers/net/wireless/iwlwifi/iwl-sta.c             |  725 +--------
 drivers/net/wireless/iwlwifi/iwl-sta.h             |   35 +-
 drivers/net/wireless/iwlwifi/iwl-tx.c              |   38 -
 drivers/net/wireless/iwlwifi/iwl3945-base.c        |   97 +-
 drivers/net/wireless/libertas/if_usb.c             |    4 +-
 drivers/net/wireless/p54/eeprom.c                  |    4 +-
 drivers/net/wireless/rt2x00/rt2400pci.c            |    2 +-
 drivers/net/wireless/rt2x00/rt2500pci.c            |    2 +-
 drivers/net/wireless/rt2x00/rt2800lib.c            |    2 +-
 drivers/net/wireless/rt2x00/rt2800pci.c            |    4 +-
 drivers/net/wireless/rt2x00/rt2x00.h               |   18 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c            |   87 +-
 drivers/net/wireless/rt2x00/rt2x00lib.h            |   11 +-
 drivers/net/wireless/rt2x00/rt2x00link.c           |   12 +-
 drivers/net/wireless/rt2x00/rt2x00pci.c            |    2 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c          |   56 +-
 drivers/net/wireless/rt2x00/rt2x00usb.c            |   54 +-
 drivers/net/wireless/wl1251/Kconfig                |   33 +
 drivers/net/wireless/wl1251/Makefile               |    6 +
 .../wireless/{wl12xx/wl1251_acx.c => wl1251/acx.c} |    8 +-
 .../wireless/{wl12xx/wl1251_acx.h => wl1251/acx.h} |    2 +-
 .../{wl12xx/wl1251_boot.c => wl1251/boot.c}        |   12 +-
 .../{wl12xx/wl1251_boot.h => wl1251/boot.h}        |    0
 .../wireless/{wl12xx/wl1251_cmd.c => wl1251/cmd.c} |   10 +-
 .../wireless/{wl12xx/wl1251_cmd.h => wl1251/cmd.h} |    0
 .../{wl12xx/wl1251_debugfs.c => wl1251/debugfs.c}  |    6 +-
 .../{wl12xx/wl1251_debugfs.h => wl1251/debugfs.h}  |    0
 .../{wl12xx/wl1251_event.c => wl1251/event.c}      |    8 +-
 .../{wl12xx/wl1251_event.h => wl1251/event.h}      |    0
 .../{wl12xx/wl1251_init.c => wl1251/init.c}        |    8 +-
 .../{wl12xx/wl1251_init.h => wl1251/init.h}        |    0
 .../wireless/{wl12xx/wl1251_io.c => wl1251/io.c}   |    4 +-
 .../wireless/{wl12xx/wl1251_io.h => wl1251/io.h}   |    0
 .../{wl12xx/wl1251_main.c => wl1251/main.c}        |   20 +-
 .../wireless/{wl12xx/wl1251_ps.c => wl1251/ps.c}   |    8 +-
 .../wireless/{wl12xx/wl1251_ps.h => wl1251/ps.h}   |    2 +-
 .../wireless/{wl12xx/wl1251_reg.h => wl1251/reg.h} |    0
 .../wireless/{wl12xx/wl1251_rx.c => wl1251/rx.c}   |   10 +-
 .../wireless/{wl12xx/wl1251_rx.h => wl1251/rx.h}   |    0
 .../{wl12xx/wl1251_sdio.c => wl1251/sdio.c}        |    0
 .../wireless/{wl12xx/wl1251_spi.c => wl1251/spi.c} |    4 +-
 .../wireless/{wl12xx/wl1251_spi.h => wl1251/spi.h} |    6 +-
 .../wireless/{wl12xx/wl1251_tx.c => wl1251/tx.c}   |    8 +-
 .../wireless/{wl12xx/wl1251_tx.h => wl1251/tx.h}   |    2 +-
 drivers/net/wireless/{wl12xx => wl1251}/wl1251.h   |    0
 drivers/net/wireless/wl1251/wl12xx_80211.h         |  156 ++
 drivers/net/wireless/wl12xx/Kconfig                |   34 -
 drivers/net/wireless/wl12xx/Makefile               |    9 -
 drivers/net/wireless/wl12xx/wl1271_sdio.c          |   43 +-
 include/linux/ieee80211.h                          |   71 +-
 include/linux/mmc/sdio_ids.h                       |    1 +
 include/linux/nl80211.h                            |   15 +
 include/linux/wireless.h                           |    2 +-
 include/net/bluetooth/bluetooth.h                  |    2 +
 include/net/bluetooth/hci.h                        |    2 +-
 include/net/bluetooth/rfcomm.h                     |    5 -
 include/net/cfg80211.h                             |   31 +
 include/net/mac80211.h                             |    9 +-
 net/bluetooth/af_bluetooth.c                       |  109 ++
 net/bluetooth/cmtp/core.c                          |    6 +-
 net/bluetooth/hci_core.c                           |    1 -
 net/bluetooth/hci_sysfs.c                          |   21 +-
 net/bluetooth/hidp/core.c                          |    8 +-
 net/bluetooth/l2cap.c                              |   56 +-
 net/bluetooth/lib.c                                |    4 +-
 net/bluetooth/rfcomm/core.c                        |   39 +-
 net/bluetooth/rfcomm/sock.c                        |  104 +--
 net/bluetooth/rfcomm/tty.c                         |    4 +-
 net/mac80211/cfg.c                                 |   22 +-
 net/mac80211/ht.c                                  |    2 +
 net/mac80211/ieee80211_i.h                         |    4 +-
 net/mac80211/iface.c                               |    9 +-
 net/mac80211/main.c                                |    3 +
 net/mac80211/mesh_plink.c                          |   17 +-
 net/mac80211/mlme.c                                |   18 +-
 net/mac80211/rc80211_minstrel_ht.c                 |    7 +-
 net/mac80211/rx.c                                  |   24 +
 net/mac80211/wep.c                                 |    8 +-
 net/wireless/core.c                                |   54 +-
 net/wireless/mlme.c                                |   23 +-
 net/wireless/nl80211.c                             |   15 +
 net/wireless/radiotap.c                            |   58 +-
 net/wireless/sysfs.c                               |    9 +
 net/wireless/wext-compat.c                         |    4 +
 169 files changed, 5491 insertions(+), 6553 deletions(-)
 delete mode 100644 drivers/net/wireless/ath/ath9k/ar9003_2p0_initvals.h
 create mode 100644 drivers/net/wireless/b43/radio_2055.c
 create mode 100644 drivers/net/wireless/b43/radio_2055.h
 create mode 100644 drivers/net/wireless/b43/radio_2056.c
 create mode 100644 drivers/net/wireless/b43/radio_2056.h
 rename drivers/net/wireless/iwlwifi/{iwl-calib.h => iwl-agn-calib.h} (95%)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-agn-sta.c
 create mode 100644 drivers/net/wireless/wl1251/Kconfig
 create mode 100644 drivers/net/wireless/wl1251/Makefile
 rename drivers/net/wireless/{wl12xx/wl1251_acx.c => wl1251/acx.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_acx.h => wl1251/acx.h} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_boot.c => wl1251/boot.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_boot.h => wl1251/boot.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_cmd.c => wl1251/cmd.c} (98%)
 rename drivers/net/wireless/{wl12xx/wl1251_cmd.h => wl1251/cmd.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_debugfs.c => wl1251/debugfs.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_debugfs.h => wl1251/debugfs.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_event.c => wl1251/event.c} (97%)
 rename drivers/net/wireless/{wl12xx/wl1251_event.h => wl1251/event.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_init.c => wl1251/init.c} (98%)
 rename drivers/net/wireless/{wl12xx/wl1251_init.h => wl1251/init.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_io.c => wl1251/io.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_io.h => wl1251/io.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_main.c => wl1251/main.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_ps.c => wl1251/ps.c} (97%)
 rename drivers/net/wireless/{wl12xx/wl1251_ps.h => wl1251/ps.h} (97%)
 rename drivers/net/wireless/{wl12xx/wl1251_reg.h => wl1251/reg.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_rx.c => wl1251/rx.c} (97%)
 rename drivers/net/wireless/{wl12xx/wl1251_rx.h => wl1251/rx.h} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_sdio.c => wl1251/sdio.c} (100%)
 rename drivers/net/wireless/{wl12xx/wl1251_spi.c => wl1251/spi.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_spi.h => wl1251/spi.h} (96%)
 rename drivers/net/wireless/{wl12xx/wl1251_tx.c => wl1251/tx.c} (99%)
 rename drivers/net/wireless/{wl12xx/wl1251_tx.h => wl1251/tx.h} (99%)
 rename drivers/net/wireless/{wl12xx => wl1251}/wl1251.h (100%)
 create mode 100644 drivers/net/wireless/wl1251/wl12xx_80211.h

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2010-10-15.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH net-next] bonding: make bond_resend_igmp_join_requests_delayed static
From: Stephen Hemminger @ 2010-10-15 21:02 UTC (permalink / raw)
  To: David Miller, Jay Vosburgh, netdev; +Cc: bonding-devel


Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/bonding/bond_main.c	2010-10-15 13:52:01.747192520 -0700
+++ b/drivers/net/bonding/bond_main.c	2010-10-15 13:52:39.004286643 -0700
@@ -914,7 +914,7 @@ static void bond_resend_igmp_join_reques
 	read_unlock(&bond->lock);
 }
 
-void bond_resend_igmp_join_requests_delayed(struct work_struct *work)
+static void bond_resend_igmp_join_requests_delayed(struct work_struct *work)
 {
 	struct bonding *bond = container_of(work, struct bonding,
 							mcast_work.work);

^ permalink raw reply

* [PATCH net-next] vmxnet3: make bit twiddle routines inline
From: Stephen Hemminger @ 2010-10-15 21:06 UTC (permalink / raw)
  To: Shreyas Bhatewara, David S. Miller; +Cc: VMware, Inc., netdev

Gcc doesn't usually handle inline across compilation units, and the
functions don't have to be global in scope. Move the set/reset flag
functions int the existing vmxnet3 header.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/vmxnet3/vmxnet3_drv.c |   17 -----------------
 drivers/net/vmxnet3/vmxnet3_int.h |   17 ++++++++++++++---
 2 files changed, 14 insertions(+), 20 deletions(-)

--- a/drivers/net/vmxnet3/vmxnet3_drv.c	2010-10-15 13:58:23.378722695 -0700
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c	2010-10-15 13:59:32.724873755 -0700
@@ -1548,23 +1548,6 @@ vmxnet3_free_irqs(struct vmxnet3_adapter
 	}
 }
 
-
-inline void set_flag_le16(__le16 *data, u16 flag)
-{
-	*data = cpu_to_le16(le16_to_cpu(*data) | flag);
-}
-
-inline void set_flag_le64(__le64 *data, u64 flag)
-{
-	*data = cpu_to_le64(le64_to_cpu(*data) | flag);
-}
-
-inline void reset_flag_le64(__le64 *data, u64 flag)
-{
-	*data = cpu_to_le64(le64_to_cpu(*data) & ~flag);
-}
-
-
 static void
 vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 {
--- a/drivers/net/vmxnet3/vmxnet3_int.h	2010-10-15 13:58:23.390723065 -0700
+++ b/drivers/net/vmxnet3/vmxnet3_int.h	2010-10-15 13:59:46.329296549 -0700
@@ -353,9 +353,20 @@ struct vmxnet3_adapter {
 #define VMXNET3_MAX_ETH_HDR_SIZE    22
 #define VMXNET3_MAX_SKB_BUF_SIZE    (3*1024)
 
-void set_flag_le16(__le16 *data, u16 flag);
-void set_flag_le64(__le64 *data, u64 flag);
-void reset_flag_le64(__le64 *data, u64 flag);
+static inline void set_flag_le16(__le16 *data, u16 flag)
+{
+	*data = cpu_to_le16(le16_to_cpu(*data) | flag);
+}
+
+static inline void set_flag_le64(__le64 *data, u64 flag)
+{
+	*data = cpu_to_le64(le64_to_cpu(*data) | flag);
+}
+
+static inline void reset_flag_le64(__le64 *data, u64 flag)
+{
+	*data = cpu_to_le64(le64_to_cpu(*data) & ~flag);
+}
 
 int
 vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter);

^ permalink raw reply

* [PATCH net-next] pch_gbe: make local functions static
From: Stephen Hemminger @ 2010-10-15 21:09 UTC (permalink / raw)
  To: David Miller, Masayuki Ohtake; +Cc: netdev

Make routines that are only used in one file static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/pch_gbe/pch_gbe.h      |    4 +---
 drivers/net/pch_gbe/pch_gbe_api.c  |    2 +-
 drivers/net/pch_gbe/pch_gbe_main.c |   26 +++++++++++++++-----------
 3 files changed, 17 insertions(+), 15 deletions(-)

--- a/drivers/net/pch_gbe/pch_gbe.h	2010-10-15 13:56:27.823153599 -0700
+++ b/drivers/net/pch_gbe/pch_gbe.h	2010-10-15 13:56:34.519359889 -0700
@@ -644,9 +644,7 @@ extern void pch_gbe_free_tx_resources(st
 extern void pch_gbe_free_rx_resources(struct pch_gbe_adapter *adapter,
 				       struct pch_gbe_rx_ring *rx_ring);
 extern void pch_gbe_update_stats(struct pch_gbe_adapter *adapter);
-extern int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg);
-extern void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg,
-				int data);
+
 /* pch_gbe_param.c */
 extern void pch_gbe_check_options(struct pch_gbe_adapter *adapter);
 
--- a/drivers/net/pch_gbe/pch_gbe_api.c	2010-10-15 13:54:46.088037739 -0700
+++ b/drivers/net/pch_gbe/pch_gbe_api.c	2010-10-15 13:54:57.484377021 -0700
@@ -97,7 +97,7 @@ static const struct pch_gbe_functions pc
  * pch_gbe_plat_init_function_pointers - Init func ptrs
  * @hw:	Pointer to the HW structure
  */
-void pch_gbe_plat_init_function_pointers(struct pch_gbe_hw *hw)
+static void pch_gbe_plat_init_function_pointers(struct pch_gbe_hw *hw)
 {
 	/* Set PHY parameter */
 	hw->phy.reset_delay_us     = PCH_GBE_PHY_RESET_DELAY_US;
--- a/drivers/net/pch_gbe/pch_gbe_main.c	2010-10-15 13:54:03.014763090 -0700
+++ b/drivers/net/pch_gbe/pch_gbe_main.c	2010-10-15 13:57:16.992669897 -0700
@@ -85,6 +85,9 @@ const char pch_driver_version[] = DRV_VE
 
 static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT;
 
+static int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg);
+static void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg,
+			       int data);
 /**
  * pch_gbe_mac_read_mac_addr - Read MAC address
  * @hw:	            Pointer to the HW structure
@@ -114,7 +117,7 @@ s32 pch_gbe_mac_read_mac_addr(struct pch
  * @reg:	Pointer of register
  * @busy:	Busy bit
  */
-void pch_gbe_wait_clr_bit(void *reg, u32 bit)
+static void pch_gbe_wait_clr_bit(void *reg, u32 bit)
 {
 	u32 tmp;
 	/* wait busy */
@@ -130,7 +133,7 @@ void pch_gbe_wait_clr_bit(void *reg, u32
  * @addr:   Pointer to the MAC address
  * @index:  MAC address array register
  */
-void pch_gbe_mac_mar_set(struct pch_gbe_hw *hw, u8 * addr, u32 index)
+static void pch_gbe_mac_mar_set(struct pch_gbe_hw *hw, u8 * addr, u32 index)
 {
 	u32 mar_low, mar_high, adrmask;
 
@@ -161,7 +164,7 @@ void pch_gbe_mac_mar_set(struct pch_gbe_
  * pch_gbe_mac_reset_hw - Reset hardware
  * @hw:	Pointer to the HW structure
  */
-void pch_gbe_mac_reset_hw(struct pch_gbe_hw *hw)
+static void pch_gbe_mac_reset_hw(struct pch_gbe_hw *hw)
 {
 	/* Read the MAC address. and store to the private data */
 	pch_gbe_mac_read_mac_addr(hw);
@@ -180,7 +183,7 @@ void pch_gbe_mac_reset_hw(struct pch_gbe
  * @hw:	Pointer to the HW structure
  * @mar_count: Receive address registers
  */
-void pch_gbe_mac_init_rx_addrs(struct pch_gbe_hw *hw, u16 mar_count)
+static void pch_gbe_mac_init_rx_addrs(struct pch_gbe_hw *hw, u16 mar_count)
 {
 	u32 i;
 
@@ -206,9 +209,9 @@ void pch_gbe_mac_init_rx_addrs(struct pc
  * @mar_used_count: The first MAC Address register free to program
  * @mar_total_num:  Total number of supported MAC Address Registers
  */
-void pch_gbe_mac_mc_addr_list_update(struct pch_gbe_hw *hw,
-				     u8 *mc_addr_list, u32 mc_addr_count,
-				     u32 mar_used_count, u32 mar_total_num)
+static void pch_gbe_mac_mc_addr_list_update(struct pch_gbe_hw *hw,
+					    u8 *mc_addr_list, u32 mc_addr_count,
+					    u32 mar_used_count, u32 mar_total_num)
 {
 	u32 i, adrmask;
 
@@ -285,7 +288,7 @@ s32 pch_gbe_mac_force_mac_fc(struct pch_
  * @hw:     Pointer to the HW structure
  * @wu_evt: Wake up event
  */
-void pch_gbe_mac_set_wol_event(struct pch_gbe_hw *hw, u32 wu_evt)
+static void pch_gbe_mac_set_wol_event(struct pch_gbe_hw *hw, u32 wu_evt)
 {
 	u32 addr_mask;
 
@@ -359,7 +362,7 @@ u16 pch_gbe_mac_ctrl_miim(struct pch_gbe
  * pch_gbe_mac_set_pause_packet - Set pause packet
  * @hw:   Pointer to the HW structure
  */
-void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
+static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
 {
 	unsigned long tmp2, tmp3;
 
@@ -482,7 +485,7 @@ static int pch_gbe_init_phy(struct pch_g
  *	0:	Successfully
  *	Negative value:	Failed
  */
-int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg)
+static int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg)
 {
 	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
 	struct pch_gbe_hw *hw = &adapter->hw;
@@ -498,7 +501,8 @@ int pch_gbe_mdio_read(struct net_device
  * @reg:    Access location
  * @data:   Write data
  */
-void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg, int data)
+static void pch_gbe_mdio_write(struct net_device *netdev,
+			       int addr, int reg, int data)
 {
 	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
 	struct pch_gbe_hw *hw = &adapter->hw;

^ permalink raw reply

* Re: large divisor for flow classifier
From: Jarek Poplawski @ 2010-10-15 21:10 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Jonathan Thibault, Patrick McHardy, netdev
In-Reply-To: <1287172905.2799.8.camel@edumazet-laptop>

Eric Dumazet wrote:
> Le vendredi 15 octobre 2010 à 14:14 -0400, Jonathan Thibault a écrit :
>> It appears that when setting a fairly large divisor on the flow classifier for sfq, traffic stops altogether.
>>
>> On my machine, anything above divisor 2200 seems to stop all traffic.  If I want to be fair between hosts (but not flows) for a large network (say 6000 hosts), I run into problems.  Obviously the rates here are quite low but this is just an example.
...
> SFQ is limited to a 1024 divisor
> 
> You might try following patch :
> 
> (8192 is the smallest power of two greater than 6144)
> 
> sizeof(struct sfq_sched_data) becomes 0x2ccc instead of 0x10cc
> 
> keep in mind hash distribution is not perfect.
> 
> What would be the real rate ?
> 
> 
> diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
> index 3cf478d..c4a53d6 100644
> --- a/net/sched/sch_sfq.c
> +++ b/net/sched/sch_sfq.c
> @@ -77,7 +77,7 @@
>  	It is easy to increase these values, but not in flight.  */
>  
>  #define SFQ_DEPTH		128
> -#define SFQ_HASH_DIVISOR	1024
> +#define SFQ_HASH_DIVISOR	8192

Because of low SFQ_DEPTH, which limits its queue to 127 packets,
SFQ isn't suitable for serving so many users. There is sch_drr as
a replacement, alas more complex and undocumented, but google should
help you enough.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13d2a1d2b032de08d7dcab6a1edcd47802681f96

Jarek P.

^ permalink raw reply

* RE: [PATCH net-next] vmxnet3: make bit twiddle routines inline
From: Shreyas Bhatewara @ 2010-10-15 21:14 UTC (permalink / raw)
  To: Stephen Hemminger, David S. Miller; +Cc: VMware, Inc., netdev@vger.kernel.org
In-Reply-To: <20101015140620.63d0a615@nehalam>

Thanks for the change Stephen. Looks good.


Acked-by: Shreyas Bhatewara <sbhatewara@vmware.com>



> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Friday, October 15, 2010 2:06 PM
> To: Shreyas Bhatewara; David S. Miller
> Cc: VMware, Inc.; netdev@vger.kernel.org
> Subject: [PATCH net-next] vmxnet3: make bit twiddle routines inline
> 
> Gcc doesn't usually handle inline across compilation units, and the
> functions don't have to be global in scope. Move the set/reset flag
> functions int the existing vmxnet3 header.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |   17 -----------------
>  drivers/net/vmxnet3/vmxnet3_int.h |   17 ++++++++++++++---
>  2 files changed, 14 insertions(+), 20 deletions(-)
> 
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c	2010-10-15 13:58:23.378722695
> -0700
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c	2010-10-15 13:59:32.724873755
> -0700
> @@ -1548,23 +1548,6 @@ vmxnet3_free_irqs(struct vmxnet3_adapter
>  	}
>  }
> 
> -
> -inline void set_flag_le16(__le16 *data, u16 flag)
> -{
> -	*data = cpu_to_le16(le16_to_cpu(*data) | flag);
> -}
> -
> -inline void set_flag_le64(__le64 *data, u64 flag)
> -{
> -	*data = cpu_to_le64(le64_to_cpu(*data) | flag);
> -}
> -
> -inline void reset_flag_le64(__le64 *data, u64 flag)
> -{
> -	*data = cpu_to_le64(le64_to_cpu(*data) & ~flag);
> -}
> -
> -
>  static void
>  vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group
> *grp)
>  {
> --- a/drivers/net/vmxnet3/vmxnet3_int.h	2010-10-15 13:58:23.390723065
> -0700
> +++ b/drivers/net/vmxnet3/vmxnet3_int.h	2010-10-15 13:59:46.329296549
> -0700
> @@ -353,9 +353,20 @@ struct vmxnet3_adapter {
>  #define VMXNET3_MAX_ETH_HDR_SIZE    22
>  #define VMXNET3_MAX_SKB_BUF_SIZE    (3*1024)
> 
> -void set_flag_le16(__le16 *data, u16 flag);
> -void set_flag_le64(__le64 *data, u64 flag);
> -void reset_flag_le64(__le64 *data, u64 flag);
> +static inline void set_flag_le16(__le16 *data, u16 flag)
> +{
> +	*data = cpu_to_le16(le16_to_cpu(*data) | flag);
> +}
> +
> +static inline void set_flag_le64(__le64 *data, u64 flag)
> +{
> +	*data = cpu_to_le64(le64_to_cpu(*data) | flag);
> +}
> +
> +static inline void reset_flag_le64(__le64 *data, u64 flag)
> +{
> +	*data = cpu_to_le64(le64_to_cpu(*data) & ~flag);
> +}
> 
>  int
>  vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter);

^ permalink raw reply

* Re: [PATCH net-next] vmxnet3: make bit twiddle routines inline
From: Harvey Harrison @ 2010-10-15 21:22 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Shreyas Bhatewara, David S. Miller, VMware, Inc., netdev
In-Reply-To: <20101015140620.63d0a615@nehalam>

On Fri, Oct 15, 2010 at 2:06 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> +static inline void set_flag_le16(__le16 *data, u16 flag)
> +{
> +       *data = cpu_to_le16(le16_to_cpu(*data) | flag);
> +}
> +

Instead of swapping twice on BE machines, why not:

*data |= cpu_to_le16(flag);

Which may even get done away with at compile time if flag is a constant.

Similarly for the others.

Cheers,

Harvey

^ permalink raw reply

* Re: [PATCH net-next 3/5] tipc: Optimizations to bearer enabling logic
From: Paul Gortmaker @ 2010-10-15 21:31 UTC (permalink / raw)
  To: Neil Horman; +Cc: davem, netdev, allan.stephens
In-Reply-To: <20101015110033.GC22294@hmsreliant.think-freely.org>

On 10-10-15 07:00 AM, Neil Horman wrote:

[...]

> This definately looks more concise, but I don't see why its necessecary to drop
> the tipc_net_lock around the call to enable_bearer.  The only caler of
> tipc_register_media sets the enable_bearer pointer to the enable_bearer
> function, and  I' don't see any path through that function which would
> potentially retake that lock.  In fact it seems dropping it might be dangerous,
> if other paths (like from cfg_named_msg_event), tried to enable a bearer in
> parallel with a user space directive from the netlink socket).  With out the
> protection of tipc_net_lock, you could use the same eth_bearer twice, and
> corrupt that array.

I think it would be protected by config_lock. but in the end if it is
just an academic optimization that really isn't in a hot code path
anyway, and if it just adds more confusion than real world value, then
I'm fine with just dropping this on the floor (and deleting the extra
memset in a cleanup patch) -- it won't be the 1st time doing this with
these carry forward patches, and I'm sure it won't be the last.

Thanks,
Paul.

> 
> Neil
> 



^ permalink raw reply

* Re: VLAN packets silently dropped in promiscuous mode
From: Jesse Gross @ 2010-10-15 21:33 UTC (permalink / raw)
  To: Guillaume Gaudonville; +Cc: Roger Luethi, netdev, Patrick McHardy
In-Reply-To: <4CB81BF1.1050906@6wind.com>

On Fri, Oct 15, 2010 at 2:16 AM, Guillaume Gaudonville
<guillaume.gaudonville@6wind.com> wrote:
> Jesse Gross wrote:
>>
>> On Thu, Sep 30, 2010 at 1:07 AM, Roger Luethi <rl@hellgate.ch> wrote:
>>
>>>
>>> On Wed, 29 Sep 2010 10:44:26 -0700, Jesse Gross wrote:
>>>
>>>>
>>>> On Wed, Sep 29, 2010 at 4:37 AM, Roger Luethi <rl@hellgate.ch> wrote:
>>>>
>>>>>
>>>>> I noticed packets for unknown VLANs getting silently dropped even in
>>>>> promiscuous mode (this is true only for the hardware accelerated path).
>>>>> netif_nit_deliver was introduced specifically to prevent that, but the
>>>>> function gets called only _after_ packets from unknown VLANs have been
>>>>> dropped.
>>>>>
>>>>
>>>> Some drivers are fixing this on a case by case basis by disabling
>>>> hardware accelerated VLAN stripping when in promiscuous mode, i.e.:
>>>>
>>>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f6c01819979afbfec7e0b15fe52371b8eed87e8
>>>>
>>>> However, at this point it is more or less random which drivers do
>>>> this.  It would obviously be much better if it were consistent.
>>>>
>>>
>>> My understanding is this. Hardware VLAN tagging and stripping can always
>>> be
>>> enabled. The kernel passes 802.1Q information along with the stripped
>>> header to libpcap which reassembles the original header where necessary.
>>> Works for me.
>>>
>>
>> Sorry, I misread your original post as saying that the VLAN header
>> gets dropped, rather than the entire packet.  I agree that this is how
>> it should work but not necessarily how it does work (again, depending
>> on the driver).  Here's the problem that I was talking about:
>>
>> Most drivers have a snippet of code that looks something like this
>> (taken from ixgbe):
>>
>> if (adapter->vlgrp && is_vlan && (tag & VLAN_VID_MASK))
>>        vlan_gro_receive(napi, adapter->vlgrp, tag, skb);
>> else
>>        napi_gro_receive(napi, skb);
>>
>> At this point the VLAN has already been stripped in hardware.  If
>> there is no VLAN group configured on the device then we hit the second
>> case.  The VLAN header was removed from the SKB and the tag variable
>> is unused.  It is no longer possible for libpcap to reconstruct the
>> header because the information was thrown away (even the fact that
>> there was a VLAN tag at all).
>>
>> There are a couple ways to fix this:
>>
>> * Turn off VLAN stripping when in promiscuous mode (as done by the ixgbe
>> driver)
>>
>
> This is not totally true: if changing the MTU ixgbe_change_mtu will call:
> ixgbe_reinit_locked--> ixgbe_up --> ixgbe_configure:
>                --> ixgbe_set_rx_mode: flag IFF_PROMISC is tested
> ixgbe_vlan_filter_enable is not called
>                --> ixgbe_restore_vlan --> ixgbe_vlan_rx_register: flag
> IFF_PROMISC is not tested ixgbe_vlan_filter_enable
>                     will be called.
>
> In fact it should happen each time we configure something which needs a
> reset of the device. Why don't add a test
> on flag promiscuous directly in ixgbe_vlan_filter_enable? Or do it on each
> call, if we want to allow a device in promiscuous
> mode to enable this feature.
>
> What do you think?

I can believe that there are paths that lead to this not working
correctly.  That was actually my larger point: this is something that
is commonly not implemented correctly in drivers.  Rather than try to
study every driver my goal is to just avoid the problem completely by
handling vlan acceleration centrally in the networking core.  I sent
out an RFC patch series a few days ago that should solve this problem:

http://marc.info/?l=linux-netdev&m=128700022614170&w=3

^ 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