Netdev List
 help / color / mirror / Atom feed
* Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35
From: Masayuki Ohtake @ 2010-10-05 12:09 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w, Samuel Ortiz,
	margie.foster-ral2JQCrhuEAvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA, Wolfgang Grandegger,
	yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w, Christian Pellegrin,
	Tomoya MORINAGA, meego-dev-WXzIur8shnEAvxtiuMwx3w,
	David S. Miller, joel.clark-ral2JQCrhuEAvxtiuMwx3w,
	qi.wang-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <4CAB0732.3010400@pengutronix.de>

Hi Marc,

On Tuesday, October 05, 2010 8:08 PM, Marc Kleine-Budde wrote:
> If FIFO is working you might also think about NAPI.

I think NAPI isn't necessary for our CAN driver.
NAPI is for high-speed networking.
CAN is NOT high-speed.

In fact, some accepted CAN drivers don't have NAPI.

Thanks, Ohtake(OKISemi)

^ permalink raw reply

* Re: checkentry function
From: Eric Dumazet @ 2010-10-05 12:07 UTC (permalink / raw)
  To: Nicola Padovano
  Cc: Jan Engelhardt, Stephen Hemminger, netfilter-devel, netdev
In-Reply-To: <AANLkTim+5kETTN3sbo-woUAEN71woJb1eG9TX04tcyKW@mail.gmail.com>

Le mardi 05 octobre 2010 à 13:46 +0200, Nicola Padovano a écrit :
> On Tue, Oct 5, 2010 at 1:32 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
> > On Tuesday 2010-10-05 13:16, Nicola Padovano wrote:
> >>>
> >>> Could you read source code of _current_ existing modules , and use
> >>> copy/paste ?
> >>>
> >>> static int hashlimit_mt_check(const struct xt_mtchk_param *par)
> >>> {
> >>> ...
> >>> }
> >>
> >>as i've written in a previously mail this is the checkentry function
> >>that i use in my source code to check if the iptables command line is
> >>a right line.
> >>
> >>[CHECK_ENTRY_CODE]
> >>static bool xt_tarpit_check(const char *tablename, const void *entry,
> >>                           const struct xt_target *target, void *targinfo,
> >>                           unsigned int hook_mask)
> >>
> >>i don't know what "static int hashlimit_mt_check(const struct
> >>xt_mtchk_param *par)" is...
> >
> > It's the proper function header.
> >
> 
> this is the whole code:
> 
> [WHOLE_CODE]

> [/WHOLE_CODE]
> 

Nicola

For the second and last time, could you please _read_ _current_ kernel
source code, and correct your code, before asking us ?

We do not support prehistoric kernels.

Thank you

Dont ask us if you are not able to find hashlimit_mt_check() or any
checkentry function in current kernel sources.

# find net/netfilter/ | xargs grep -n _check
net/netfilter/nf_conntrack_proto_dccp.c:596:	if (net->ct.sysctl_checksum && hooknum == NF_INET_PRE_ROUTING &&
net/netfilter/nf_conntrack_proto_dccp.c:597:	    nf_checksum_partial(skb, hooknum, dataoff, cscov, IPPROTO_DCCP,
net/netfilter/xt_connmark.c:77:static int connmark_tg_check(const struct xt_tgchk_param *par)
net/netfilter/xt_connmark.c:107:static int connmark_mt_check(const struct xt_mtchk_param *par)
net/netfilter/xt_connmark.c:127:	.checkentry     = connmark_tg_check,
net/netfilter/xt_connmark.c:138:	.checkentry     = connmark_mt_check,
net/netfilter/xt_CT.c:57:static int xt_ct_tg_check(const struct xt_tgchk_param *par)
net/netfilter/xt_CT.c:149:	.checkentry	= xt_ct_tg_check,
...


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

^ permalink raw reply

* Re: checkentry function
From: Jan Engelhardt @ 2010-10-05 12:03 UTC (permalink / raw)
  To: Nicola Padovano; +Cc: Eric Dumazet, Stephen Hemminger, netfilter-devel, netdev
In-Reply-To: <AANLkTim+5kETTN3sbo-woUAEN71woJb1eG9TX04tcyKW@mail.gmail.com>


On Tuesday 2010-10-05 13:46, Nicola Padovano wrote:
>On Tue, Oct 5, 2010 at 1:32 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
>> On Tuesday 2010-10-05 13:16, Nicola Padovano wrote:
>>>>
>>>> Could you read source code of _current_ existing modules , and use
>>>> copy/paste ?
>>>>
>>>> static int hashlimit_mt_check(const struct xt_mtchk_param *par)
>>>> {
>>>> ...
>>>> }
>>>
>
>this is the whole code:
>
>[WHOLE_CODE]
>static bool xt_function_check(const char *tablename, const void *entry,
>                            const struct xt_target *target, void *targinfo,
>                            unsigned int hook_mask)
>{
>
>  if (strcmp(tablename, "filter"))
>  {
>    printk(KERN_INFO "!=filter %s\n",tablename);
>    return false;
>  }
>
>  return true;
>}

And as Stephen said, the proper type for current kernels
is
(static) bool xt_function_check(const struct xt_mtchk_param *par).

If you are compiling against such, you should have gotten appropriate
warnings from gcc.


^ permalink raw reply

* Re: checkentry function
From: Nicola Padovano @ 2010-10-05 11:46 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Eric Dumazet, Stephen Hemminger, netfilter-devel, netdev
In-Reply-To: <alpine.LNX.2.01.1010051331550.4582@obet.zrqbmnf.qr>

On Tue, Oct 5, 2010 at 1:32 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
> On Tuesday 2010-10-05 13:16, Nicola Padovano wrote:
>>>
>>> Could you read source code of _current_ existing modules , and use
>>> copy/paste ?
>>>
>>> static int hashlimit_mt_check(const struct xt_mtchk_param *par)
>>> {
>>> ...
>>> }
>>
>>as i've written in a previously mail this is the checkentry function
>>that i use in my source code to check if the iptables command line is
>>a right line.
>>
>>[CHECK_ENTRY_CODE]
>>static bool xt_tarpit_check(const char *tablename, const void *entry,
>>                           const struct xt_target *target, void *targinfo,
>>                           unsigned int hook_mask)
>>
>>i don't know what "static int hashlimit_mt_check(const struct
>>xt_mtchk_param *par)" is...
>
> It's the proper function header.
>

this is the whole code:

[WHOLE_CODE]
static void function_target(const struct sk_buff *oskb,
		       struct rtable *ort)
{
...
}


/*
 * target function, called everyone the rule is satisfied
 * standard behaviour: NF_DROP
 */
static unsigned int xt_tar_target(struct sk_buff *skb,
                                  const struct net_device *in,
                                  const struct net_device *out,
                                  unsigned int hooknum,
                                  const struct xt_target *target,
                                  const void *targinfo)
{
  struct rtable *rt         = (void *)skb->_skb_refdst;
  function_target(skb,rt);
  return NF_DROP;
}

/*
 * xt_tarpit_check, it allows only:
 * 1. raw table & PRE_ROUTING hook or
 * 2. filter table & (LOCAL_IN or FORWARD) hook
 */
static bool xt_function_check(const char *tablename, const void *entry,
                            const struct xt_target *target, void *targinfo,
                            unsigned int hook_mask)
{

  if (strcmp(tablename, "filter"))
  {
    printk(KERN_INFO "!=filter %s\n",tablename);
    return false;
  }

  return true;
}


static struct xt_target xt_tar_reg = {
  .name       = "FUN",               /* target name */
  .family     = AF_INET,             /* level 3 protocol */
  .proto      = IPPROTO_TCP,         /* we recognize only tcp protocol */
  .target     = xt_tar_target,       /* pointer to target function */
  .checkentry = xt_function_check,     /* pointer to check-entry function */
  .me         = THIS_MODULE,
};

/*
 * initing module function
 */
static int __init xt_tar_init(void)
{
  return xt_register_target(&xt_tar_reg);
}

/*
 * delete module
 */
static void __exit xt_tar_exit(void)
{
  xt_unregister_target(&xt_tar_reg);
  printk(KERN_INFO "TARPIT> !!!exit!!! \n");
}

module_init(xt_tar_init);
module_exit(xt_tar_exit);

/* information about the module and its author */
MODULE_DESCRIPTION("TARPIT target, info: http://npadovano.altervista.org");
MODULE_AUTHOR("Nicola Padovano <nicola.padovano@gmail.com>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("xt_TAR");

[/WHOLE_CODE]

-- 
Nicola Padovano
e-mail: nicola.padovano@gmail.com
web: http://npadovano.altervista.org

"My only ambition is not be anything at all; it seems the most
sensible thing" (C. Bukowski)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: checkentry function
From: Jan Engelhardt @ 2010-10-05 11:32 UTC (permalink / raw)
  To: Nicola Padovano; +Cc: Eric Dumazet, Stephen Hemminger, netfilter-devel, netdev
In-Reply-To: <AANLkTinVtz0VuLkOY5d8QjdvLMXOFD2EaWp_kSBbMJBW@mail.gmail.com>

On Tuesday 2010-10-05 13:16, Nicola Padovano wrote:
>>
>> Could you read source code of _current_ existing modules , and use
>> copy/paste ?
>>
>> static int hashlimit_mt_check(const struct xt_mtchk_param *par)
>> {
>> ...
>> }
>
>as i've written in a previously mail this is the checkentry function
>that i use in my source code to check if the iptables command line is
>a right line.
>
>[CHECK_ENTRY_CODE]
>static bool xt_tarpit_check(const char *tablename, const void *entry,
>                           const struct xt_target *target, void *targinfo,
>                           unsigned int hook_mask)
>
>i don't know what "static int hashlimit_mt_check(const struct
>xt_mtchk_param *par)" is...

It's the proper function header.

^ permalink raw reply

* [net-next-2.6 PATCH] ixgbe: Use affinity_hint when Flow Director is enabled
From: Jeff Kirsher @ 2010-10-05 11:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Peter P Waskiewicz Jr, Jeff Kirsher

From: Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com>

Use the new infrastructure to balance interrupts for flow
alignment when ATR or Flow Director are enabled.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe.h      |    2 ++
 drivers/net/ixgbe/ixgbe_main.c |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 5cebc37..a8c47b0 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -31,6 +31,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
+#include <linux/cpumask.h>
 #include <linux/aer.h>
 
 #include "ixgbe_type.h"
@@ -241,6 +242,7 @@ struct ixgbe_q_vector {
 	u8 tx_itr;
 	u8 rx_itr;
 	u32 eitr;
+	cpumask_var_t affinity_mask;
 };
 
 /* Helper macros to switch between ints/sec and what the register uses.
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index c35e13c..95dbf60 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1433,6 +1433,21 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter)
 			q_vector->eitr = adapter->rx_eitr_param;
 
 		ixgbe_write_eitr(q_vector);
+		/* If Flow Director is enabled, set interrupt affinity */
+		if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) ||
+		    (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) {
+			/*
+			 * Allocate the affinity_hint cpumask, assign the mask
+			 * for this vector, and set our affinity_hint for
+			 * this irq.
+			 */
+			if (!alloc_cpumask_var(&q_vector->affinity_mask,
+			                       GFP_KERNEL))
+				return;
+			cpumask_set_cpu(v_idx, q_vector->affinity_mask);
+			irq_set_affinity_hint(adapter->msix_entries[v_idx].vector,
+			                      q_vector->affinity_mask);
+		}
 	}
 
 	if (adapter->hw.mac.type == ixgbe_mac_82598EB)
@@ -3816,6 +3831,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 	u32 rxctrl;
 	u32 txdctl;
 	int i, j;
+	int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
 
 	/* signal that we are down to the interrupt handler */
 	set_bit(__IXGBE_DOWN, &adapter->state);
@@ -3854,6 +3870,15 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 
 	ixgbe_napi_disable_all(adapter);
 
+	/* Cleanup the affinity_hint CPU mask memory and callback */
+	for (i = 0; i < num_q_vectors; i++) {
+		struct ixgbe_q_vector *q_vector = adapter->q_vector[i];
+		/* clear the affinity_mask in the IRQ descriptor */
+		irq_set_affinity_hint(adapter->msix_entries[i]. vector, NULL);
+		/* release the CPU mask memory */
+		free_cpumask_var(q_vector->affinity_mask);
+	}
+
 	if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE ||
 	    adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)
 		cancel_work_sync(&adapter->fdir_reinit_task);


^ permalink raw reply related

* [PATCH 3/3] e1000e.txt: Add e1000e documentation
From: Jeff Kirsher @ 2010-10-05 11:17 UTC (permalink / raw)
  To: rdunlap; +Cc: netdev, linux-doc, gospo, bphilips, Jeff Kirsher
In-Reply-To: <20101005111643.23000.38976.stgit@localhost.localdomain>

Adds documentation for the e1000e networking driver.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 Documentation/networking/e1000e.txt |  303 +++++++++++++++++++++++++++++++++++
 1 files changed, 303 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/networking/e1000e.txt

diff --git a/Documentation/networking/e1000e.txt b/Documentation/networking/e1000e.txt
new file mode 100644
index 0000000..a3c6e01
--- /dev/null
+++ b/Documentation/networking/e1000e.txt
@@ -0,0 +1,303 @@
+Linux* Driver for Intel(R) Network Connection
+===============================================================
+
+Intel Gigabit Linux driver.
+Copyright(c) 1999 - 2010 Intel Corporation.
+
+Contents
+========
+
+- Identifying Your Adapter
+- Command Line Parameters
+- Additional Configurations
+- Support
+
+Identifying Your Adapter
+========================
+
+The e1000e driver supports all PCI Express Intel(R) Gigabit Network
+Connections, except those that are 82575, 82576 and 82580-based*.
+
+* NOTE: The Intel(R) PRO/1000 P Dual Port Server Adapter is supported by
+  the e1000 driver, not the e1000e driver due to the 82546 part being used
+  behind a PCI Express bridge.
+
+For more information on how to identify your adapter, go to the Adapter &
+Driver ID Guide at:
+
+    http://support.intel.com/support/go/network/adapter/idguide.htm
+
+For the latest Intel network drivers for Linux, refer to the following
+website.  In the search field, enter your adapter name or type, or use the
+networking link on the left to search for your adapter:
+
+    http://support.intel.com/support/go/network/adapter/home.htm
+
+Command Line Parameters
+=======================
+
+The default value for each parameter is generally the recommended setting,
+unless otherwise noted.
+
+NOTES:  For more information about the InterruptThrottleRate,
+        RxIntDelay, TxIntDelay, RxAbsIntDelay, and TxAbsIntDelay
+        parameters, see the application note at:
+        http://www.intel.com/design/network/applnots/ap450.htm
+
+InterruptThrottleRate
+---------------------
+Valid Range:   0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative,
+                                   4=simplified balancing)
+Default Value: 3
+
+The driver can limit the amount of interrupts per second that the adapter
+will generate for incoming packets. It does this by writing a value to the
+adapter that is based on the maximum amount of interrupts that the adapter
+will generate per second.
+
+Setting InterruptThrottleRate to a value greater or equal to 100
+will program the adapter to send out a maximum of that many interrupts
+per second, even if more packets have come in. This reduces interrupt
+load on the system and can lower CPU utilization under heavy load,
+but will increase latency as packets are not processed as quickly.
+
+The driver has two adaptive modes (setting 1 or 3) in which
+it dynamically adjusts the InterruptThrottleRate value based on the traffic
+that it receives. After determining the type of incoming traffic in the last
+timeframe, it will adjust the InterruptThrottleRate to an appropriate value
+for that traffic.
+
+The algorithm classifies the incoming traffic every interval into
+classes.  Once the class is determined, the InterruptThrottleRate value is
+adjusted to suit that traffic type the best. There are three classes defined:
+"Bulk traffic", for large amounts of packets of normal size; "Low latency",
+for small amounts of traffic and/or a significant percentage of small
+packets; and "Lowest latency", for almost completely small packets or
+minimal traffic.
+
+In dynamic conservative mode, the InterruptThrottleRate value is set to 4000
+for traffic that falls in class "Bulk traffic". If traffic falls in the "Low
+latency" or "Lowest latency" class, the InterruptThrottleRate is increased
+stepwise to 20000. This default mode is suitable for most applications.
+
+For situations where low latency is vital such as cluster or
+grid computing, the algorithm can reduce latency even more when
+InterruptThrottleRate is set to mode 1. In this mode, which operates
+the same as mode 3, the InterruptThrottleRate will be increased stepwise to
+70000 for traffic in class "Lowest latency".
+
+In simplified mode the interrupt rate is based on the ratio of Tx and
+Rx traffic.  If the bytes per second rate is approximately equal the
+interrupt rate will drop as low as 2000 interrupts per second.  If the
+traffic is mostly transmit or mostly receive, the interrupt rate could
+be as high as 8000.
+
+Setting InterruptThrottleRate to 0 turns off any interrupt moderation
+and may improve small packet latency, but is generally not suitable
+for bulk throughput traffic.
+
+NOTE:  InterruptThrottleRate takes precedence over the TxAbsIntDelay and
+       RxAbsIntDelay parameters.  In other words, minimizing the receive
+       and/or transmit absolute delays does not force the controller to
+       generate more interrupts than what the Interrupt Throttle Rate
+       allows.
+
+NOTE:  When e1000e is loaded with default settings and multiple adapters
+       are in use simultaneously, the CPU utilization may increase non-
+       linearly.  In order to limit the CPU utilization without impacting
+       the overall throughput, we recommend that you load the driver as
+       follows:
+
+           modprobe e1000e InterruptThrottleRate=3000,3000,3000
+
+       This sets the InterruptThrottleRate to 3000 interrupts/sec for
+       the first, second, and third instances of the driver.  The range
+       of 2000 to 3000 interrupts per second works on a majority of
+       systems and is a good starting point, but the optimal value will
+       be platform-specific.  If CPU utilization is not a concern, use
+       RX_POLLING (NAPI) and default driver settings.
+
+RxIntDelay
+----------
+Valid Range:   0-65535 (0=off)
+Default Value: 0
+
+This value delays the generation of receive interrupts in units of 1.024
+microseconds.  Receive interrupt reduction can improve CPU efficiency if
+properly tuned for specific network traffic.  Increasing this value adds
+extra latency to frame reception and can end up decreasing the throughput
+of TCP traffic.  If the system is reporting dropped receives, this value
+may be set too high, causing the driver to run out of available receive
+descriptors.
+
+CAUTION:  When setting RxIntDelay to a value other than 0, adapters may
+          hang (stop transmitting) under certain network conditions.  If
+          this occurs a NETDEV WATCHDOG message is logged in the system
+          event log.  In addition, the controller is automatically reset,
+          restoring the network connection.  To eliminate the potential
+          for the hang ensure that RxIntDelay is set to 0.
+
+RxAbsIntDelay
+-------------
+Valid Range:   0-65535 (0=off)
+Default Value: 8
+
+This value, in units of 1.024 microseconds, limits the delay in which a
+receive interrupt is generated.  Useful only if RxIntDelay is non-zero,
+this value ensures that an interrupt is generated after the initial
+packet is received within the set amount of time.  Proper tuning,
+along with RxIntDelay, may improve traffic throughput in specific network
+conditions.
+
+TxIntDelay
+----------
+Valid Range:   0-65535 (0=off)
+Default Value: 8
+
+This value delays the generation of transmit interrupts in units of
+1.024 microseconds.  Transmit interrupt reduction can improve CPU
+efficiency if properly tuned for specific network traffic.  If the
+system is reporting dropped transmits, this value may be set too high
+causing the driver to run out of available transmit descriptors.
+
+TxAbsIntDelay
+-------------
+Valid Range:   0-65535 (0=off)
+Default Value: 32
+
+This value, in units of 1.024 microseconds, limits the delay in which a
+transmit interrupt is generated.  Useful only if TxIntDelay is non-zero,
+this value ensures that an interrupt is generated after the initial
+packet is sent on the wire within the set amount of time.  Proper tuning,
+along with TxIntDelay, may improve traffic throughput in specific
+network conditions.
+
+Copybreak
+---------
+Valid Range:   0-xxxxxxx (0=off)
+Default Value: 256
+
+Driver copies all packets below or equaling this size to a fresh Rx
+buffer before handing it up the stack.
+
+This parameter is different than other parameters, in that it is a
+single (not 1,1,1 etc.) parameter applied to all driver instances and
+it is also available during runtime at
+/sys/module/e1000e/parameters/copybreak
+
+SmartPowerDownEnable
+--------------------
+Valid Range: 0-1
+Default Value:  0 (disabled)
+
+Allows PHY to turn off in lower power states. The user can set this parameter
+in supported chipsets.
+
+KumeranLockLoss
+---------------
+Valid Range: 0-1
+Default Value: 1 (enabled)
+
+This workaround skips resetting the PHY at shutdown for the initial
+silicon releases of ICH8 systems.
+
+IntMode
+-------
+Valid Range: 0-2 (0=legacy, 1=MSI, 2=MSI-X)
+Default Value: 2
+
+Allows changing the interrupt mode at module load time, without requiring a
+recompile. If the driver load fails to enable a specific interrupt mode, the
+driver will try other interrupt modes, from least to most compatible.  The
+interrupt order is MSI-X, MSI, Legacy.  If specifying MSI (IntMode=1)
+interrupts, only MSI and Legacy will be attempted.
+
+CrcStripping
+------------
+Valid Range: 0-1
+Default Value: 1 (enabled)
+
+Strip the CRC from received packets before sending up the network stack.  If
+you have a machine with a BMC enabled but cannot receive IPMI traffic after
+loading or enabling the driver, try disabling this feature.
+
+WriteProtectNVM
+---------------
+Valid Range: 0-1
+Default Value: 1 (enabled)
+
+Set the hardware to ignore all write/erase cycles to the GbE region in the
+ICHx NVM (non-volatile memory).  This feature can be disabled by the
+WriteProtectNVM module parameter (enabled by default) only after a hardware
+reset, but the machine must be power cycled before trying to enable writes.
+
+Note: the kernel boot option iomem=relaxed may need to be set if the kernel
+config option CONFIG_STRICT_DEVMEM=y, if the root user wants to write the
+NVM from user space via ethtool.
+
+Additional Configurations
+=========================
+
+  Jumbo Frames
+  ------------
+  Jumbo Frames support is enabled by changing the MTU to a value larger than
+  the default of 1500.  Use the ifconfig command to increase the MTU size.
+  For example:
+
+       ifconfig eth<x> mtu 9000 up
+
+  This setting is not saved across reboots.
+
+  Notes:
+
+  - The maximum MTU setting for Jumbo Frames is 9216.  This value coincides
+    with the maximum Jumbo Frames size of 9234 bytes.
+
+  - Using Jumbo Frames at 10 or 100 Mbps is not supported and may result in
+    poor performance or loss of link.
+
+  - Some adapters limit Jumbo Frames sized packets to a maximum of
+    4096 bytes and some adapters do not support Jumbo Frames.
+
+
+  Ethtool
+  -------
+  The driver utilizes the ethtool interface for driver configuration and
+  diagnostics, as well as displaying statistical information.  We
+  strongly recommend downloading the latest version of Ethtool at:
+
+  http://sourceforge.net/projects/gkernel.
+
+  Speed and Duplex
+  ----------------
+  Speed and Duplex are configured through the Ethtool* utility. For
+  instructions,  refer to the Ethtool man page.
+
+  Enabling Wake on LAN* (WoL)
+  ---------------------------
+  WoL is configured through the Ethtool* utility. For instructions on
+  enabling WoL with Ethtool, refer to the Ethtool man page.
+
+  WoL will be enabled on the system during the next shut down or reboot.
+  For this driver version, in order to enable WoL, the e1000e driver must be
+  loaded when shutting down or rebooting the system.
+
+  In most cases Wake On LAN is only supported on port A for multiple port
+  adapters. To verify if a port supports Wake on LAN run ethtool eth<X>.
+
+
+Support
+=======
+
+For general information, go to the Intel support website at:
+
+    www.intel.com/support/
+
+or the Intel Wired Networking project hosted by Sourceforge at:
+
+    http://sourceforge.net/projects/e1000
+
+If an issue is identified with the released source code on the supported
+kernel with a supported adapter, email the specific information related
+to the issue to e1000-devel@lists.sf.net
+


^ permalink raw reply related

* [PATCH 2/3] e1000.txt: Update e1000 documentation
From: Jeff Kirsher @ 2010-10-05 11:17 UTC (permalink / raw)
  To: rdunlap; +Cc: netdev, linux-doc, gospo, bphilips, Jeff Kirsher
In-Reply-To: <20101005111643.23000.38976.stgit@localhost.localdomain>

Updated the e1000 networking driver documentation.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 Documentation/networking/e1000.txt |  373 +++++++++---------------------------
 1 files changed, 96 insertions(+), 277 deletions(-)

diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt
index 2df7186..d9271e7 100644
--- a/Documentation/networking/e1000.txt
+++ b/Documentation/networking/e1000.txt
@@ -1,82 +1,35 @@
 Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters
 ===============================================================
 
-September 26, 2006
-
+Intel Gigabit Linux driver.
+Copyright(c) 1999 - 2010 Intel Corporation.
 
 Contents
 ========
 
-- In This Release
 - Identifying Your Adapter
-- Building and Installation
 - Command Line Parameters
 - Speed and Duplex Configuration
 - Additional Configurations
-- Known Issues
 - Support
 
-
-In This Release
-===============
-
-This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family
-of Adapters.  This driver includes support for Itanium(R)2-based systems.
-
-For questions related to hardware requirements, refer to the documentation
-supplied with your Intel PRO/1000 adapter. All hardware requirements listed
-apply to use with Linux.
-
-The following features are now available in supported kernels:
- - Native VLANs
- - Channel Bonding (teaming)
- - SNMP
-
-Channel Bonding documentation can be found in the Linux kernel source:
-/Documentation/networking/bonding.txt
-
-The driver information previously displayed in the /proc filesystem is not
-supported in this release.  Alternatively, you can use ethtool (version 1.6
-or later), lspci, and ifconfig to obtain the same information.
-
-Instructions on updating ethtool can be found in the section "Additional
-Configurations" later in this document.
-
-NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100
-support.
-
-
 Identifying Your Adapter
 ========================
 
 For more information on how to identify your adapter, go to the Adapter &
 Driver ID Guide at:
 
-    http://support.intel.com/support/network/adapter/pro100/21397.htm
+    http://support.intel.com/support/go/network/adapter/idguide.htm
 
 For the latest Intel network drivers for Linux, refer to the following
 website.  In the search field, enter your adapter name or type, or use the
 networking link on the left to search for your adapter:
 
-    http://downloadfinder.intel.com/scripts-df/support_intel.asp
-
+    http://support.intel.com/support/go/network/adapter/home.htm
 
 Command Line Parameters
 =======================
 
-If the driver is built as a module, the  following optional parameters
-are used by entering them on the command line with the modprobe command
-using this syntax:
-
-     modprobe e1000 [<option>=<VAL1>,<VAL2>,...]
-
-For example, with two PRO/1000 PCI adapters, entering:
-
-     modprobe e1000 TxDescriptors=80,128
-
-loads the e1000 driver with 80 TX descriptors for the first adapter and
-128 TX descriptors for the second adapter.
-
 The default value for each parameter is generally the recommended setting,
 unless otherwise noted.
 
@@ -89,10 +42,6 @@ NOTES:  For more information about the AutoNeg, Duplex, and Speed
         parameters, see the application note at:
         http://www.intel.com/design/network/applnots/ap450.htm
 
-        A descriptor describes a data buffer and attributes related to
-        the data buffer.  This information is accessed by the hardware.
-
-
 AutoNeg
 -------
 (Supported only on adapters with copper connections)
@@ -106,7 +55,6 @@ Duplex parameters must not be specified.
 NOTE:  Refer to the Speed and Duplex section of this readme for more
        information on the AutoNeg parameter.
 
-
 Duplex
 ------
 (Supported only on adapters with copper connections)
@@ -119,7 +67,6 @@ set to auto-negotiate, the board auto-detects the correct duplex.  If the
 link partner is forced (either full or half), Duplex defaults to half-
 duplex.
 
-
 FlowControl
 -----------
 Valid Range:   0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
@@ -128,16 +75,16 @@ Default Value: Reads flow control settings from the EEPROM
 This parameter controls the automatic generation(Tx) and response(Rx)
 to Ethernet PAUSE frames.
 
-
 InterruptThrottleRate
 ---------------------
 (not supported on Intel(R) 82542, 82543 or 82544-based adapters)
-Valid Range:   0,1,3,100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
+Valid Range:   0,1,3,4,100-100000 (0=off, 1=dynamic, 3=dynamic conservative,
+                                   4=simplified balancing)
 Default Value: 3
 
 The driver can limit the amount of interrupts per second that the adapter
-will generate for incoming packets. It does this by writing a value to the 
-adapter that is based on the maximum amount of interrupts that the adapter 
+will generate for incoming packets. It does this by writing a value to the
+adapter that is based on the maximum amount of interrupts that the adapter
 will generate per second.
 
 Setting InterruptThrottleRate to a value greater or equal to 100
@@ -146,37 +93,43 @@ per second, even if more packets have come in. This reduces interrupt
 load on the system and can lower CPU utilization under heavy load,
 but will increase latency as packets are not processed as quickly.
 
-The default behaviour of the driver previously assumed a static 
-InterruptThrottleRate value of 8000, providing a good fallback value for 
-all traffic types,but lacking in small packet performance and latency. 
-The hardware can handle many more small packets per second however, and 
+The default behaviour of the driver previously assumed a static
+InterruptThrottleRate value of 8000, providing a good fallback value for
+all traffic types,but lacking in small packet performance and latency.
+The hardware can handle many more small packets per second however, and
 for this reason an adaptive interrupt moderation algorithm was implemented.
 
 Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in which
-it dynamically adjusts the InterruptThrottleRate value based on the traffic 
+it dynamically adjusts the InterruptThrottleRate value based on the traffic
 that it receives. After determining the type of incoming traffic in the last
-timeframe, it will adjust the InterruptThrottleRate to an appropriate value 
+timeframe, it will adjust the InterruptThrottleRate to an appropriate value
 for that traffic.
 
 The algorithm classifies the incoming traffic every interval into
-classes.  Once the class is determined, the InterruptThrottleRate value is 
-adjusted to suit that traffic type the best. There are three classes defined: 
+classes.  Once the class is determined, the InterruptThrottleRate value is
+adjusted to suit that traffic type the best. There are three classes defined:
 "Bulk traffic", for large amounts of packets of normal size; "Low latency",
 for small amounts of traffic and/or a significant percentage of small
-packets; and "Lowest latency", for almost completely small packets or 
+packets; and "Lowest latency", for almost completely small packets or
 minimal traffic.
 
-In dynamic conservative mode, the InterruptThrottleRate value is set to 4000 
-for traffic that falls in class "Bulk traffic". If traffic falls in the "Low 
-latency" or "Lowest latency" class, the InterruptThrottleRate is increased 
+In dynamic conservative mode, the InterruptThrottleRate value is set to 4000
+for traffic that falls in class "Bulk traffic". If traffic falls in the "Low
+latency" or "Lowest latency" class, the InterruptThrottleRate is increased
 stepwise to 20000. This default mode is suitable for most applications.
 
 For situations where low latency is vital such as cluster or
 grid computing, the algorithm can reduce latency even more when
 InterruptThrottleRate is set to mode 1. In this mode, which operates
-the same as mode 3, the InterruptThrottleRate will be increased stepwise to 
+the same as mode 3, the InterruptThrottleRate will be increased stepwise to
 70000 for traffic in class "Lowest latency".
 
+In simplified mode the interrupt rate is based on the ratio of Tx and
+Rx traffic.  If the bytes per second rate is approximately equal, the
+interrupt rate will drop as low as 2000 interrupts per second.  If the
+traffic is mostly transmit or mostly receive, the interrupt rate could
+be as high as 8000.
+
 Setting InterruptThrottleRate to 0 turns off any interrupt moderation
 and may improve small packet latency, but is generally not suitable
 for bulk throughput traffic.
@@ -212,8 +165,6 @@ NOTE:  When e1000 is loaded with default settings and multiple adapters
        be platform-specific.  If CPU utilization is not a concern, use
        RX_POLLING (NAPI) and default driver settings.
 
-
-
 RxDescriptors
 -------------
 Valid Range:   80-256 for 82542 and 82543-based adapters
@@ -225,15 +176,14 @@ by the driver.  Increasing this value allows the driver to buffer more
 incoming packets, at the expense of increased system memory utilization.
 
 Each descriptor is 16 bytes.  A receive buffer is also allocated for each
-descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending 
+descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
 on the MTU setting. The maximum MTU size is 16110.
 
-NOTE:  MTU designates the frame size.  It only needs to be set for Jumbo 
-       Frames.  Depending on the available system resources, the request 
-       for a higher number of receive descriptors may be denied.  In this 
+NOTE:  MTU designates the frame size.  It only needs to be set for Jumbo
+       Frames.  Depending on the available system resources, the request
+       for a higher number of receive descriptors may be denied.  In this
        case, use a lower number.
 
-
 RxIntDelay
 ----------
 Valid Range:   0-65535 (0=off)
@@ -254,7 +204,6 @@ CAUTION:  When setting RxIntDelay to a value other than 0, adapters may
           restoring the network connection.  To eliminate the potential
           for the hang ensure that RxIntDelay is set to 0.
 
-
 RxAbsIntDelay
 -------------
 (This parameter is supported only on 82540, 82545 and later adapters.)
@@ -268,7 +217,6 @@ packet is received within the set amount of time.  Proper tuning,
 along with RxIntDelay, may improve traffic throughput in specific network
 conditions.
 
-
 Speed
 -----
 (This parameter is supported only on adapters with copper connections.)
@@ -280,7 +228,6 @@ Speed forces the line speed to the specified value in megabits per second
 partner is set to auto-negotiate, the board will auto-detect the correct
 speed.  Duplex should also be set when Speed is set to either 10 or 100.
 
-
 TxDescriptors
 -------------
 Valid Range:   80-256 for 82542 and 82543-based adapters
@@ -295,6 +242,36 @@ NOTE:  Depending on the available system resources, the request for a
        higher number of transmit descriptors may be denied.  In this case,
        use a lower number.
 
+TxDescriptorStep
+----------------
+Valid Range:    1 (use every Tx Descriptor)
+		4 (use every 4th Tx Descriptor)
+
+Default Value:  1 (use every Tx Descriptor)
+
+On certain non-Intel architectures, it has been observed that intense TX
+traffic bursts of short packets may result in an improper descriptor
+writeback. If this occurs, the driver will report a "TX Timeout" and reset
+the adapter, after which the transmit flow will restart, though data may
+have stalled for as much as 10 seconds before it resumes.
+
+The improper writeback does not occur on the first descriptor in a system
+memory cache-line, which is typically 32 bytes, or 4 descriptors long.
+
+Setting TxDescriptorStep to a value of 4 will ensure that all TX descriptors
+are aligned to the start of a system memory cache line, and so this problem
+will not occur.
+
+NOTES: Setting TxDescriptorStep to 4 effectively reduces the number of
+       TxDescriptors available for transmits to 1/4 of the normal allocation.
+       This has a possible negative performance impact, which may be
+       compensated for by allocating more descriptors using the TxDescriptors
+       module parameter.
+
+       There are other conditions which may result in "TX Timeout", which will
+       not be resolved by the use of the TxDescriptorStep parameter. As the
+       issue addressed by this parameter has never been observed on Intel
+       Architecture platforms, it should not be used on Intel platforms.
 
 TxIntDelay
 ----------
@@ -307,7 +284,6 @@ efficiency if properly tuned for specific network traffic.  If the
 system is reporting dropped transmits, this value may be set too high
 causing the driver to run out of available transmit descriptors.
 
-
 TxAbsIntDelay
 -------------
 (This parameter is supported only on 82540, 82545 and later adapters.)
@@ -330,6 +306,35 @@ Default Value: 1
 A value of '1' indicates that the driver should enable IP checksum
 offload for received packets (both UDP and TCP) to the adapter hardware.
 
+Copybreak
+---------
+Valid Range:   0-xxxxxxx (0=off)
+Default Value: 256
+Usage: insmod e1000.ko copybreak=128
+
+Driver copies all packets below or equaling this size to a fresh Rx
+buffer before handing it up the stack.
+
+This parameter is different than other parameters, in that it is a
+single (not 1,1,1 etc.) parameter applied to all driver instances and
+it is also available during runtime at
+/sys/module/e1000/parameters/copybreak
+
+SmartPowerDownEnable
+--------------------
+Valid Range: 0-1
+Default Value:  0 (disabled)
+
+Allows PHY to turn off in lower power states. The user can turn off
+this parameter in supported chipsets.
+
+KumeranLockLoss
+---------------
+Valid Range: 0-1
+Default Value: 1 (enabled)
+
+This workaround skips resetting the PHY at shutdown for the initial
+silicon releases of ICH8 systems.
 
 Speed and Duplex Configuration
 ==============================
@@ -385,40 +390,9 @@ If the link partner is forced to a specific speed and duplex, then this
 parameter should not be used.  Instead, use the Speed and Duplex parameters
 previously mentioned to force the adapter to the same speed and duplex.
 
-
 Additional Configurations
 =========================
 
-  Configuring the Driver on Different Distributions
-  -------------------------------------------------
-  Configuring a network driver to load properly when the system is started
-  is distribution dependent.  Typically, the configuration process involves
-  adding an alias line to /etc/modules.conf or /etc/modprobe.conf as well
-  as editing other system startup scripts and/or configuration files.  Many
-  popular Linux distributions ship with tools to make these changes for you.
-  To learn the proper way to configure a network device for your system,
-  refer to your distribution documentation.  If during this process you are
-  asked for the driver or module name, the name for the Linux Base Driver
-  for the Intel(R) PRO/1000 Family of Adapters is e1000.
-
-  As an example, if you install the e1000 driver for two PRO/1000 adapters
-  (eth0 and eth1) and set the speed and duplex to 10full and 100half, add
-  the following to modules.conf or or modprobe.conf:
-
-       alias eth0 e1000
-       alias eth1 e1000
-       options e1000 Speed=10,100 Duplex=2,1
-
-  Viewing Link Messages
-  ---------------------
-  Link messages will not be displayed to the console if the distribution is
-  restricting system messages.  In order to see network driver link messages
-  on your console, set dmesg to eight by entering the following:
-
-       dmesg -n 8
-
-  NOTE: This setting is not saved across reboots.
-
   Jumbo Frames
   ------------
   Jumbo Frames support is enabled by changing the MTU to a value larger than
@@ -437,9 +411,11 @@ Additional Configurations
    setting in a different location.
 
   Notes:
-
-  - To enable Jumbo Frames, increase the MTU size on the interface beyond
-    1500.
+  Degradation in throughput performance may be observed in some Jumbo frames
+  environments. If this is observed, increasing the application's socket buffer
+  size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help.
+  See the specific application manual and /usr/src/linux*/Documentation/
+  networking/ip-sysctl.txt for more details.
 
   - The maximum MTU setting for Jumbo Frames is 16110.  This value coincides
     with the maximum Jumbo Frames size of 16128.
@@ -447,40 +423,11 @@ Additional Configurations
   - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or
     loss of link.
 
-  - Some Intel gigabit adapters that support Jumbo Frames have a frame size
-    limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes.
-    The adapters with this limitation are based on the Intel(R) 82571EB,
-    82572EI, 82573L and 80003ES2LAN controller.  These correspond to the
-    following product names:
-     Intel(R) PRO/1000 PT Server Adapter
-     Intel(R) PRO/1000 PT Desktop Adapter
-     Intel(R) PRO/1000 PT Network Connection
-     Intel(R) PRO/1000 PT Dual Port Server Adapter
-     Intel(R) PRO/1000 PT Dual Port Network Connection
-     Intel(R) PRO/1000 PF Server Adapter
-     Intel(R) PRO/1000 PF Network Connection
-     Intel(R) PRO/1000 PF Dual Port Server Adapter
-     Intel(R) PRO/1000 PB Server Connection
-     Intel(R) PRO/1000 PL Network Connection
-     Intel(R) PRO/1000 EB Network Connection with I/O Acceleration
-     Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration
-     Intel(R) PRO/1000 PT Quad Port Server Adapter
-
   - Adapters based on the Intel(R) 82542 and 82573V/E controller do not
     support Jumbo Frames. These correspond to the following product names:
      Intel(R) PRO/1000 Gigabit Server Adapter
      Intel(R) PRO/1000 PM Network Connection
 
-  - The following adapters do not support Jumbo Frames:
-     Intel(R) 82562V 10/100 Network Connection
-     Intel(R) 82566DM Gigabit Network Connection
-     Intel(R) 82566DC Gigabit Network Connection
-     Intel(R) 82566MM Gigabit Network Connection
-     Intel(R) 82566MC Gigabit Network Connection
-     Intel(R) 82562GT 10/100 Network Connection
-     Intel(R) 82562G 10/100 Network Connection
-
-
   Ethtool
   -------
   The driver utilizes the ethtool interface for driver configuration and
@@ -490,142 +437,14 @@ Additional Configurations
   The latest release of ethtool can be found from
   http://sourceforge.net/projects/gkernel.
 
-  NOTE: Ethtool 1.6 only supports a limited set of ethtool options.  Support
-  for a more complete ethtool feature set can be enabled by upgrading
-  ethtool to ethtool-1.8.1.
-
   Enabling Wake on LAN* (WoL)
   ---------------------------
-  WoL is configured through the Ethtool* utility.  Ethtool is included with
-  all versions of Red Hat after Red Hat 7.2.  For other Linux distributions,
-  download and install Ethtool from the following website:
-  http://sourceforge.net/projects/gkernel.
-
-  For instructions on enabling WoL with Ethtool, refer to the website listed
-  above.
+  WoL is configured through the Ethtool* utility.
 
   WoL will be enabled on the system during the next shut down or reboot.
   For this driver version, in order to enable WoL, the e1000 driver must be
   loaded when shutting down or rebooting the system.
 
-  Wake On LAN is only supported on port A for the following devices:
-  Intel(R) PRO/1000 PT Dual Port Network Connection
-  Intel(R) PRO/1000 PT Dual Port Server Connection
-  Intel(R) PRO/1000 PT Dual Port Server Adapter
-  Intel(R) PRO/1000 PF Dual Port Server Adapter
-  Intel(R) PRO/1000 PT Quad Port Server Adapter
-
-  NAPI
-  ----
-  NAPI (Rx polling mode) is enabled in the e1000 driver.
-
-  See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
-
-
-Known Issues
-============
-
-Dropped Receive Packets on Half-duplex 10/100 Networks
-------------------------------------------------------
-If you have an Intel PCI Express adapter running at 10mbps or 100mbps, half-
-duplex, you may observe occasional dropped receive packets.  There are no
-workarounds for this problem in this network configuration.  The network must
-be updated to operate in full-duplex, and/or 1000mbps only.
-
-Jumbo Frames System Requirement
--------------------------------
-Memory allocation failures have been observed on Linux systems with 64 MB
-of RAM or less that are running Jumbo Frames.  If you are using Jumbo
-Frames, your system may require more than the advertised minimum
-requirement of 64 MB of system memory.
-
-Performance Degradation with Jumbo Frames
------------------------------------------
-Degradation in throughput performance may be observed in some Jumbo frames
-environments.  If this is observed, increasing the application's socket
-buffer size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values
-may help.  See the specific application manual and
-/usr/src/linux*/Documentation/
-networking/ip-sysctl.txt for more details.
-
-Jumbo Frames on Foundry BigIron 8000 switch
--------------------------------------------
-There is a known issue using Jumbo frames when connected to a Foundry
-BigIron 8000 switch.  This is a 3rd party limitation.  If you experience
-loss of packets, lower the MTU size.
-
-Allocating Rx Buffers when Using Jumbo Frames 
----------------------------------------------
-Allocating Rx buffers when using Jumbo Frames on 2.6.x kernels may fail if 
-the available memory is heavily fragmented. This issue may be seen with PCI-X 
-adapters or with packet split disabled. This can be reduced or eliminated 
-by changing the amount of available memory for receive buffer allocation, by
-increasing /proc/sys/vm/min_free_kbytes. 
-
-Multiple Interfaces on Same Ethernet Broadcast Network
-------------------------------------------------------
-Due to the default ARP behavior on Linux, it is not possible to have
-one system on two IP networks in the same Ethernet broadcast domain
-(non-partitioned switch) behave as expected.  All Ethernet interfaces
-will respond to IP traffic for any IP address assigned to the system.
-This results in unbalanced receive traffic.
-
-If you have multiple interfaces in a server, either turn on ARP
-filtering by entering:
-
-    echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
-(this only works if your kernel's version is higher than 2.4.5),
-
-NOTE: This setting is not saved across reboots.  The configuration
-change can be made permanent by adding the line:
-    net.ipv4.conf.all.arp_filter = 1
-to the file /etc/sysctl.conf
-
-      or,
-
-install the interfaces in separate broadcast domains (either in
-different switches or in a switch partitioned to VLANs).
-
-82541/82547 can't link or are slow to link with some link partners
------------------------------------------------------------------
-There is a known compatibility issue with 82541/82547 and some
-low-end switches where the link will not be established, or will
-be slow to establish.  In particular, these switches are known to
-be incompatible with 82541/82547:
-
-    Planex FXG-08TE
-    I-O Data ETG-SH8
-
-To workaround this issue, the driver can be compiled with an override
-of the PHY's master/slave setting.  Forcing master or forcing slave
-mode will improve time-to-link.
-
-    # make CFLAGS_EXTRA=-DE1000_MASTER_SLAVE=<n>
-
-Where <n> is:
-
-    0 = Hardware default
-    1 = Master mode
-    2 = Slave mode
-    3 = Auto master/slave
-
-Disable rx flow control with ethtool
-------------------------------------
-In order to disable receive flow control using ethtool, you must turn
-off auto-negotiation on the same command line.
-
-For example:
-
-   ethtool -A eth? autoneg off rx off
-
-Unplugging network cable while ethtool -p is running
-----------------------------------------------------
-In kernel versions 2.5.50 and later (including 2.6 kernel), unplugging
-the network cable while ethtool -p is running will cause the system to
-become unresponsive to keyboard commands, except for control-alt-delete.
-Restarting the system appears to be the only remedy.
-
-
 Support
 =======
 


^ permalink raw reply related

* [PATCH 1/3] ixgbevf.txt: Update ixgbevf documentation
From: Jeff Kirsher @ 2010-10-05 11:16 UTC (permalink / raw)
  To: rdunlap; +Cc: netdev, linux-doc, gospo, bphilips, Jeff Kirsher

Update the documentation for the ixgbevf (ixgbe virtual
function driver).

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 Documentation/networking/ixgbevf.txt |   40 +++-------------------------------
 1 files changed, 3 insertions(+), 37 deletions(-)
 mode change 100755 => 100644 Documentation/networking/ixgbevf.txt

diff --git a/Documentation/networking/ixgbevf.txt b/Documentation/networking/ixgbevf.txt
old mode 100755
new mode 100644
index 19015de..21dd5d1
--- a/Documentation/networking/ixgbevf.txt
+++ b/Documentation/networking/ixgbevf.txt
@@ -1,19 +1,16 @@
 Linux* Base Driver for Intel(R) Network Connection
 ==================================================
 
-November 24, 2009
+Intel Gigabit Linux driver.
+Copyright(c) 1999 - 2010 Intel Corporation.
 
 Contents
 ========
 
-- In This Release
 - Identifying Your Adapter
 - Known Issues/Troubleshooting
 - Support
 
-In This Release
-===============
-
 This file describes the ixgbevf Linux* Base Driver for Intel Network
 Connection.
 
@@ -33,7 +30,7 @@ Identifying Your Adapter
 For more information on how to identify your adapter, go to the Adapter &
 Driver ID Guide at:
 
-    http://support.intel.com/support/network/sb/CS-008441.htm
+    http://support.intel.com/support/go/network/adapter/idguide.htm
 
 Known Issues/Troubleshooting
 ============================
@@ -57,34 +54,3 @@ or the Intel Wired Networking project hosted by Sourceforge at:
 If an issue is identified with the released source code on the supported
 kernel with a supported adapter, email the specific information related
 to the issue to e1000-devel@lists.sf.net
-
-License
-=======
-
-Intel 10 Gigabit Linux driver.
-Copyright(c) 1999 - 2009 Intel Corporation.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms and conditions of the GNU General Public License,
-version 2, as published by the Free Software Foundation.
-
-This program is distributed in the hope it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
-The full GNU General Public License is included in this distribution in
-the file called "COPYING".
-
-Trademarks
-==========
-
-Intel, Itanium, and Pentium are trademarks or registered trademarks of
-Intel Corporation or its subsidiaries in the United States and other
-countries.
-
-* Other names and brands may be claimed as the property of others.


^ permalink raw reply related

* Re: checkentry function
From: Nicola Padovano @ 2010-10-05 11:16 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Stephen Hemminger, netfilter-devel, netdev
In-Reply-To: <1286259838.2457.11.camel@edumazet-laptop>

>
> Because xxx_check() signature is not the one you use.
>
> Could you read source code of _current_ existing modules , and use
> copy/paste ?
>
> static int hashlimit_mt_check(const struct xt_mtchk_param *par)
> {
> ...
> }

as i've written in a previously mail this is the checkentry function
that i use in my source code to check if the iptables command line is
a right line.

[CHECK_ENTRY_CODE]
static bool xt_tarpit_check(const char *tablename, const void *entry,
                           const struct xt_target *target, void *targinfo,
                           unsigned int hook_mask)
{
 if (strcmp(tablename, "filter"))   {
   printk(KERN_INFO "DEBUG: the tablename (not FILTER) is %s\n",tablename);
   return false;
 }
return true;
}
[/CHECK_ENTRY_CODE]

but it doesn't work...NOTE: the module goes inside the function but
the tablename value is a wrong one (also if I set "-t filter" option
in the iptables command line)

i don't know what "static int hashlimit_mt_check(const struct
xt_mtchk_param *par)" is...

thank you

-- 
Nicola Padovano
e-mail: nicola.padovano@gmail.com
web: http://npadovano.altervista.org

"My only ambition is not be anything at all; it seems the most
sensible thing" (C. Bukowski)

^ permalink raw reply

* [net-2.6 PATCH] MAINTAINERS: update Intel LAN Ethernet info
From: Jeff Kirsher @ 2010-10-05 11:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, gospo, bphilips, Jeff Kirsher

- Add ixgbevf and docs files to the maintainers file

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 MAINTAINERS |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 44e6595..20a03b9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3050,16 +3050,27 @@ L:	netdev@vger.kernel.org
 S:	Maintained
 F:	drivers/net/ixp2000/
 
-INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/igbvf/ixgb/ixgbe)
+INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/igbvf/ixgb/ixgbe/ixgbevf)
 M:	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
 M:	Jesse Brandeburg <jesse.brandeburg@intel.com>
 M:	Bruce Allan <bruce.w.allan@intel.com>
-M:	Alex Duyck <alexander.h.duyck@intel.com>
+M:	Carolyn Wyborny <carolyn.wyborny@intel.com>
+M:	Don Skidmore <donald.c.skidmore@intel.com>
+M:	Greg Rose <gregory.v.rose@intel.com>
 M:	PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
+M:	Alex Duyck <alexander.h.duyck@intel.com>
 M:	John Ronciak <john.ronciak@intel.com>
 L:	e1000-devel@lists.sourceforge.net
 W:	http://e1000.sourceforge.net/
 S:	Supported
+F:	Documentation/networking/e100.txt
+F:	Documentation/networking/e1000.txt
+F:	Documentation/networking/e1000e.txt
+F:	Documentation/networking/igb.txt
+F:	Documentation/networking/igbvf.txt
+F:	Documentation/networking/ixgb.txt
+F:	Documentation/networking/ixgbe.txt
+F:	Documentation/networking/ixgbevf.txt
 F:	drivers/net/e100.c
 F:	drivers/net/e1000/
 F:	drivers/net/e1000e/
@@ -3067,6 +3078,7 @@ F:	drivers/net/igb/
 F:	drivers/net/igbvf/
 F:	drivers/net/ixgb/
 F:	drivers/net/ixgbe/
+F:	drivers/net/ixgbevf/
 
 INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
 L:	linux-wireless@vger.kernel.org


^ permalink raw reply related

* Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35
From: Marc Kleine-Budde @ 2010-10-05 11:08 UTC (permalink / raw)
  To: Masayuki Ohtake
  Cc: Wolfgang Grandegger, andrew.chih.howe.khor, qi.wang,
	margie.foster, netdev, linux-kernel, yong.y.wang, socketcan-core,
	kok.howg.ewe, joel.clark, Tomoya MORINAGA, meego-dev,
	David S. Miller, Christian Pellegrin, Samuel Ortiz
In-Reply-To: <000401cb6477$25a0eba0$66f8800a@maildom.okisemi.com>

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

On 10/05/2010 12:21 PM, Masayuki Ohtake wrote:
> Hi Wolfgang,
> 
> I could confirm below.
> With FIFO mode, it is able to receive packet with in-order.
> We are now implementing FIFO mode.

If FIFO is working you might also think about NAPI.

cheers, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply

* Re: [PATCH] SIW: Module initialization
From: Bart Van Assche @ 2010-10-05 10:57 UTC (permalink / raw)
  To: Bernard Metzler
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1286261640-5121-1-git-send-email-bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org>

On Tue, Oct 5, 2010 at 8:54 AM, Bernard Metzler <bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org> wrote:
> +static int loopback_enabled;
> +module_param(loopback_enabled, int, 0644);
> +MODULE_PARM_DESC(loopback_enabled, "enable_loopback");

A minor comment: since kernel 2.6.31 the type "bool" can be used for
boolean kernel module parameters.

> + * TODO: Dynamic device management (network device registration/removal).

The current implementation is such that one siw device is created for
each network device found at kernel module load time. That means that
you force the user to load the siw kernel module after all other
kernel modules that register a network device. I'm not sure that's a
good idea.

> +                       if (!siw_device) {
> +                               siw_device = siw_p;
> +                               siw_p->next = NULL;
> +                       } else {
> +                               siw_p->next = siw_device->next;
> +                               siw_device->next = siw_p;
> +                       }

Why a custom linked list implementation instead of using <linux/list.h> ?

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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

* Re: Linux Kernel Development - A Practical Approach
From: Tapas Mishra @ 2010-10-05 10:49 UTC (permalink / raw)
  To: Linux Kernel Explorer; +Cc: kernelnewbies, linux-kernel, netdev, linux-fsdevel
In-Reply-To: <AANLkTim9RFG799GVEkA0GjU_th_vTv_Y8SqYb1WLBUYp@mail.gmail.com>

On Tue, Oct 5, 2010 at 12:20 AM, Linux "Kernel" Explorer
<mylinuxlab@gmail.com> wrote:
> Hello Everyone,
>
> I am reading 'Linux Kernel Development' by Robert Love these days.
>
> This book takes you on a theoretical journey of the linux kernel
> world.Though the book is good but I do have my share of concerns.
Exactly even I do have same concerns.
www.crashcourse.ca
check the above website till today this is the only most relevant
thing which I find easy to begin with.
You can then go to understand some more howtos on internet that will help.
LKD is no doubt good book but even I do not appreciate that.
Jumping directly to code in your or even  mine type of situation is
not easy having said that I would say you not to
indulge into books.If possible get some one who can easily give you a
hands on experience.
Then you will be able to understand what the text books talk.
A good advice I got from some one who works with processors is rather
than going in manuals
jump into the code you play with it and then you will gradually understand.
There may be different views but I would suggest you not to read books.

^ permalink raw reply

* Re: [patch 2/2] drivers/net/stmmac/: add HAS_IOMEM dependency
From: Peppe CAVALLARO @ 2010-10-05 10:46 UTC (permalink / raw)
  To: David Miller
  Cc: akpm@linux-foundation.org, netdev@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com
In-Reply-To: <20101003.220035.183055886.davem@davemloft.net>

Hello

On 10/04/2010 07:00 AM, David Miller wrote:
> From: akpm@linux-foundation.org
> Date: Fri, 01 Oct 2010 14:17:13 -0700
> 
>  > From: Martin Schwidefsky <schwidefsky@de.ibm.com>
>  >
>  > The stmmac driver does not compile on s390:
>  >
>  > drivers/net/stmmac/stmmac_main.c: In function 'stmmac_adjust_link':
>  > drivers/net/stmmac/stmmac_main.c:210: error: implicit declaration of function 
> 'readl'
>  > drivers/net/stmmac/stmmac_main.c:263: error: implicit declaration of function 
> 'writel'
>  > drivers/net/stmmac/stmmac_main.c: In function 'stmmac_dvr_probe':
>  > drivers/net/stmmac/stmmac_main.c:1674: error: implicit declaration of 
> function 'ioremap'
>  > drivers/net/stmmac/stmmac_main.c:1674: warning: assignment makes pointer from 
> integer without a cast
>  > drivers/net/stmmac/stmmac_main.c:1761: error: implicit declaration of 
> function 'iounmap'
>  > make[3]: *** [drivers/net/stmmac/stmmac_main.o] Error 1
>  >
>  > Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
>  > Cc: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
>  > Cc: David S. Miller <davem@davemloft.net>
>  > Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
>  > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> This got fixed by adding a dependency on CPU_SUBTYPE_ST40.

This dependency was removed in driver included in net-next Git (because
the CPU_SUBTYPE_ST40 is a dead option).

I've seen that other drivers depend on HAS_IOMEM that is always  defined
for STM and ARM targets (where the I know the stmmac is used); No
problem for me to add this new dependency to in HAS_IOMEM the stmmac's
Kconfig if actually needed.

Regards
Peppe

^ permalink raw reply

* Re: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
From: Stanislaw Gruszka @ 2010-10-05 10:43 UTC (permalink / raw)
  To: Florian Mickler
  Cc: stable-DgEjT+Ai2ygdnm+yROfE0A,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Guy, Wey-Yi, Chatre, Reinette, Intel Linux Wireless,
	John W. Linville, Berg, Johannes, Cahill, Ben M,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20101005121242.79cdafc2-mGsOIKOveelVRbCss4o9kg@public.gmane.org>

On Tue, Oct 05, 2010 at 12:12:42PM +0200, Florian Mickler wrote:
> > Unfortunately this patch is not right thing to do. If you look at
> > abort_scan work, it do nothing if STATUS_SCAN_ABORTING bit is not set.
> > That's wrong because we have to complete scan (with abort == true).
> > If STATUS_SCAN_ABORTING will be set, abort_work will send scan cancel
> > commands to hardware what is wrong if scan was not started yet.
> > 
> > What we can eventually do, except apply iwl-scan rewrite from
> > wireless-testing, is something like that:
> >  
> > iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> > 
> >   clear_bit(STATUS_SCAN_HW, &priv->status); 
> >   clear_bit(STATUS_SCANNING, &priv->status); 
> >   /* inform mac80211 scan aborted */ 
> >   set_bit(STATUS_SCAN_ABORTING, &priv->status);
> >   queue_work(priv->workqueue, &priv->scan_completed);
> > 
> > ieee80211_scan_completed
> >   
> >   if (!internal) {
> >      bool aborted = test_bit(STATUS_SCAN_ABORTING, &priv->status);
> >      ieee80211_scan_completed(priv->hw, aborted);
> > 
> >   }
> > 
> > However, I do not think we should go with that to -stable (below
> > 2.6.36). IIRC warnings showed up in current 2.6.36-rc, because of
> > some other changes in the code.
> > 
> > Stanislaw
> 
> Thx for looking at this. I suspect you know the code better than I do.. what is about the
> first jump to :done in iwlagn_request_scan()
> 
>          if (!iwl_is_ready(priv)) {
>                  IWL_WARN(priv, "request scan called when driver not ready.\n");
>                  goto done;
>          }
> 
> Does abort_scan need to do anything in that case? 

Yes, because we do not return value to mac80211 about .hw_scan failure,
we always return 0, what is completely wrong. And yes, return error can
be done instead of queueing scan_completed to improve situation - this is
one of the thing, we do in wireless-testing.

> I can't see where we set up the hardware for scanning in that case.
> (I've gone through the codepath coming from the mac80211 hw_scan) 

.hw_scan = iwl_mac_hw_scan -> iwl_scan_initiate ->
 "priv->cfg->ops->utils->request_scan" = {iwl3945,iwlang}_request_scan

Stanislaw
--
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

* Re: [v2 RFC PATCH 0/4] Implement multiqueue virtio-net
From: Krishna Kumar2 @ 2010-10-05 10:40 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: anthony, arnd, avi, davem, kvm, netdev, rusty
In-Reply-To: <20100919124443.GJ7350@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> wrote on 09/19/2010 06:14:43 PM:

> Could you document how exactly do you measure multistream bandwidth:
> netperf flags, etc?

All results were without any netperf flags or system tuning:
    for i in $list
    do
        netperf -c -C -l 60 -H 192.168.122.1 > /tmp/netperf.$$.$i &
    done
    wait
Another script processes the result files.  It also displays the
start time/end time of each iteration to make sure skew due to
parallel netperfs is minimal.

I changed the vhost functionality once more to try to get the
best model, the new model being:
1. #numtxqs=1 -> #vhosts=1, this thread handles both RX/TX.
2. #numtxqs>1 -> vhost[0] handles RX and vhost[1-MAX] handles
   TX[0-n], where MAX is 4.  Beyond numtxqs=4, the remaining TX
   queues are handled by vhost threads in round-robin fashion.

Results from here on are with these changes, and only "tuning" is
to set each vhost's affinity to CPUs[0-3] ("taskset -p f <vhost-pids>").

> Any idea where does this come from?
> Do you see more TX interrupts? RX interrupts? Exits?
> Do interrupts bounce more between guest CPUs?
> 4. Identify reasons for single netperf BW regression.

After testing various combinations of #txqs, #vhosts, #netperf
sessions, I think the drop for 1 stream is due to TX and RX for
a flow being processed on different cpus.  I did two more tests:
    1. Pin vhosts to same CPU:
        - BW drop is much lower for 1 stream case (- 5 to -8% range)
        - But performance is not so high for more sessions.
    2. Changed vhost to be single threaded:
          - No degradation for 1 session, and improvement for upto
	      8, sometimes 16 streams (5-12%).
          - BW degrades after that, all the way till 128 netperf sessions.
          - But overall CPU utilization improves.
            Summary of the entire run (for 1-128 sessions):
                txq=4:  BW: (-2.3)      CPU: (-16.5)    RCPU: (-5.3)
                txq=16: BW: (-1.9)      CPU: (-24.9)    RCPU: (-9.6)

I don't see any reasons mentioned above.  However, for higher
number of netperf sessions, I see a big increase in retransmissions:
_______________________________________
#netperf      ORG           NEW
            BW (#retr)    BW (#retr)
_______________________________________
1          70244 (0)     64102 (0)
4          21421 (0)     36570 (416)
8          21746 (0)     38604 (148)
16         21783 (0)     40632 (464)
32         22677 (0)     37163 (1053)
64         23648 (4)     36449 (2197)
128        23251 (2)     31676 (3185)
_______________________________________

Single netperf case didn't have any retransmissions so that is not
the cause for drop.  I tested ixgbe (MQ):
___________________________________________________________
#netperf      ixgbe             ixgbe (pin intrs to cpu#0 on
                                       both server/client)
            BW (#retr)          BW (#retr)
___________________________________________________________
1           3567 (117)          6000 (251)
2           4406 (477)          6298 (725)
4           6119 (1085)         7208 (3387)
8           6595 (4276)         7381 (15296)
16          6651 (11651)        6856 (30394)
___________________________________________________________

> 5. Test perf in more scenarious:
>    small packets

512 byte packets - BW drop for upto 8 (sometimes 16) netperf sessions,
but increases with #sessions:
_______________________________________________________________________________
#       BW1     BW2 (%)         CPU1    CPU2 (%)        RCPU1   RCPU2 (%)
_______________________________________________________________________________
1       4043    3800 (-6.0)     50      50 (0)          86      98 (13.9)
2       8358    7485 (-10.4)    153     178 (16.3)      230     264 (14.7)
4       20664   13567 (-34.3)   448     490 (9.3)       530     624 (17.7)
8       25198   17590 (-30.1)   967     1021 (5.5)      1085    1257 (15.8)
16      23791   24057 (1.1)     1904    2220 (16.5)     2156    2578 (19.5)
24      23055   26378 (14.4)    2807    3378 (20.3)     3225    3901 (20.9)
32      22873   27116 (18.5)    3748    4525 (20.7)     4307    5239 (21.6)
40      22876   29106 (27.2)    4705    5717 (21.5)     5388    6591 (22.3)
48      23099   31352 (35.7)    5642    6986 (23.8)     6475    8085 (24.8)
64      22645   30563 (34.9)    7527    9027 (19.9)     8619    10656 (23.6)
80      22497   31922 (41.8)    9375    11390 (21.4)    10736   13485 (25.6)
96      22509   32718 (45.3)    11271   13710 (21.6)    12927   16269 (25.8)
128     22255   32397 (45.5)    15036   18093 (20.3)    17144   21608 (26.0)
_______________________________________________________________________________
SUM:    BW: (16.7)      CPU: (20.6)     RCPU: (24.3)
_______________________________________________________________________________

> host -> guest
_______________________________________________________________________________
#       BW1     BW2 (%)         CPU1    CPU2 (%)        RCPU1   RCPU2 (%)
_______________________________________________________________________________
*1      70706   90398 (27.8)    300     327 (9.0)       140     175 (25.0)
2       20951   21937 (4.7)     188     196 (4.2)       93      103 (10.7)
4       19952   25281 (26.7)    397     496 (24.9)      210     304 (44.7)
8       18559   24992 (34.6)    802     1010 (25.9)     439     659 (50.1)
16      18882   25608 (35.6)    1642    2082 (26.7)     953     1454 (52.5)
24      19012   26955 (41.7)    2465    3153 (27.9)     1452    2254 (55.2)
32      19846   26894 (35.5)    3278    4238 (29.2)     1914    3081 (60.9)
40      19704   27034 (37.2)    4104    5303 (29.2)     2409    3866 (60.4)
48      19721   26832 (36.0)    4924    6418 (30.3)     2898    4701 (62.2)
64      19650   26849 (36.6)    6595    8611 (30.5)     3975    6433 (61.8)
80      19432   26823 (38.0)    8244    10817 (31.2)    4985    8165 (63.7)
96      20347   27886 (37.0)    9913    13017 (31.3)    5982    9860 (64.8)
128     19108   27715 (45.0)    13254   17546 (32.3)    8153    13589 (66.6)
_______________________________________________________________________________
SUM:    BW: (32.4)      CPU: (30.4)     RCPU: (62.6)
_______________________________________________________________________________
*: Sum over 7 iterations, remaining test cases are sum over 2 iterations

> guest <-> external

I haven't done this right now since I don't have a setup.  I guess
it would be limited by wire speed and gains may not be there.  I
will try to do this later when I get the setup.

> in last case:
> find some other way to measure host CPU utilization,
> try multiqueue and single queue devices
> 6. Use above to figure out what is a sane default for numtxqs

A. Summary for default I/O (16K):
#txqs=2 (#vhost=3):       BW: (37.6)      CPU: (69.2)     RCPU: (40.8)
#txqs=4 (#vhost=5):       BW: (36.9)      CPU: (60.9)     RCPU: (25.2)
#txqs=8 (#vhost=5):       BW: (41.8)      CPU: (50.0)     RCPU: (15.2)
#txqs=16 (#vhost=5):      BW: (40.4)      CPU: (49.9)     RCPU: (10.0)

B. Summary for 512 byte I/O:
#txqs=2 (#vhost=3):       BW: (31.6)      CPU: (35.7)     RCPU: (28.6)
#txqs=4 (#vhost=5):       BW: (5.7)       CPU: (27.2)     RCPU: (22.7)
#txqs=8 (#vhost=5):       BW: (-.6)       CPU: (25.1)     RCPU: (22.5)
#txqs=16 (#vhost=5):      BW: (-6.6)      CPU: (24.7)     RCPU: (21.7)

Summary:

1. Average BW increase for regular I/O is best for #txq=16 with the
   least CPU utilization increase.
2. The average BW for 512 byte I/O is best for lower #txq=2. For higher
   #txqs, BW increased only after a particular #netperf sessions - in
   my testing that limit was 32 netperf sessions.
3. Multiple txq for guest by itself doesn't seem to have any issues.
   Guest CPU% increase is slightly higher than BW improvement.  I
   think it is true for all mq drivers since more paths run in parallel
   upto the device instead of sleeping and allowing one thread to send
   all packets via qdisc_restart.
4. Having high number of txqs gives better gains and reduces cpu util
   on the guest and the host.
5. MQ is intended for server loads.  MQ should probably not be explicitly
   specified for client systems.
6. No regression with numtxqs=1 (or if mq option is not used) in any
   testing scenario.

I will send the v3 patch within a day after some more testing.

Thanks,

- KK


^ permalink raw reply

* Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35
From: Masayuki Ohtake @ 2010-10-05 10:21 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
	qi.wang-ral2JQCrhuEAvxtiuMwx3w,
	margie.foster-ral2JQCrhuEAvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
	joel.clark-ral2JQCrhuEAvxtiuMwx3w, Tomoya MORINAGA,
	meego-dev-WXzIur8shnEAvxtiuMwx3w, David S. Miller,
	Christian Pellegrin, Samuel Ortiz
In-Reply-To: <4CA5D6D7.3010608@grandegger.com>

Hi Wolfgang,

I could confirm below.
With FIFO mode, it is able to receive packet with in-order.
We are now implementing FIFO mode.

Thanks, Ohtake(OKISemi)

----- Original Message ----- 
From: "Wolfgang Grandegger" <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: "Masayuki Ohtake" <masa-korg-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Cc: <andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>; <qi.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>; <margie.foster-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>; <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>;
<yong.y.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>; <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>; <socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org>; <kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>;
"Christian Pellegrin" <chripell-VaTbYqLCNhc@public.gmane.org>; "Tomoya MORINAGA" <morinaga526-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>; <meego-dev-WXzIur8shnEAvxtiuMwx3w@public.gmane.org>;
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>; <joel.clark-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>; "Samuel Ortiz" <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Sent: Friday, October 01, 2010 9:40 PM
Subject: Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35


> On 10/01/2010 12:02 PM, Masayuki Ohtake wrote:
> > Hi Wolfgang Grandegger,
> >
> > Thank you for your comments.
> >
> > We will modify and re-post ASAP.
> >
> > I have a comment about below.
> >> In this driver you are using just *one* RX object. This means that the
> >> CPU must handle new messages as quickly as possible otherwise message
> >> losses will happen, right?. For sure, this will not make user's happy.
> >> Any chance to use more RX objects in FIFO mode?
> >
> > In case implementing with FIFO mode,
> > received packets may be our of order.
>
> Hm, FIFO means "First in First out"! It might be tricky to implement,
> though.
>
> > Because our CAN register access is slow.
> >
> > I am confirming our CAN HW spec and the possibility of our-of-order.
>
> I don't understand?
>
> Wolfgang.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" 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

* [RFC] bna: cleanup dead code and namespace issues
From: Stephen Hemminger @ 2010-10-05 10:20 UTC (permalink / raw)
  To: Rasesh Mody, Debashis Dutt, David S. Miller; +Cc: netdev

The new bna driver is full of issues that I found by running
some namespace checks:
  1. Lots of dead code relating to RSS and stats clearing
  2. Some functions which should be local, especially ones
     that risk namespace collision with other code.
  3. The table for interrupt control should be declared const.

The driver still is sloppy about namespace prefixes. It uses
bna_, bnad_, bfa_, rxf_, __rxf and cna_ prefixes. Please convert it
to have all variables and functions that are global use only
one prefix.

Compile tested only.

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

---
Patch against net-next-2.6 tree.

 drivers/net/bna/bfa_ioc.c    |    8 
 drivers/net/bna/bfa_ioc.h    |    1 
 drivers/net/bna/bfa_ioc_ct.c |    2 
 drivers/net/bna/bfa_sm.h     |    2 
 drivers/net/bna/bna.h        |  108 ----------
 drivers/net/bna/bna_ctrl.c   |  427 ++++---------------------------------------
 drivers/net/bna/bna_hw.h     |    1 
 drivers/net/bna/bna_txrx.c   |  108 +++-------
 drivers/net/bna/bnad.c       |   13 -
 drivers/net/bna/cna_fwimg.c  |    2 
 10 files changed, 90 insertions(+), 582 deletions(-)

--- a/drivers/net/bna/bfa_ioc.c	2010-10-05 18:28:08.081647186 +0900
+++ b/drivers/net/bna/bfa_ioc.c	2010-10-05 18:55:15.241670954 +0900
@@ -65,7 +65,7 @@
 			(!list_empty(&((__ioc)->mbox_mod.cmd_q)) || \
 			readl((__ioc)->ioc_regs.hfn_mbox_cmd))
 
-bool bfa_nw_auto_recover = true;
+static bool bfa_nw_auto_recover = true;
 
 /*
  * forward declarations
@@ -1276,12 +1276,6 @@ bfa_nw_ioc_auto_recover(bool auto_recove
 	bfa_nw_auto_recover = auto_recover;
 }
 
-bool
-bfa_nw_ioc_is_operational(struct bfa_ioc *ioc)
-{
-	return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op);
-}
-
 static void
 bfa_ioc_msgget(struct bfa_ioc *ioc, void *mbmsg)
 {
--- a/drivers/net/bna/bfa_ioc_ct.c	2010-10-05 18:28:08.105640040 +0900
+++ b/drivers/net/bna/bfa_ioc_ct.c	2010-10-05 18:35:37.373640864 +0900
@@ -34,7 +34,7 @@ static void bfa_ioc_ct_notify_hbfail(str
 static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
 static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
 
-struct bfa_ioc_hwif nw_hwif_ct;
+static struct bfa_ioc_hwif nw_hwif_ct;
 
 /**
  * Called from bfa_ioc_attach() to map asic specific calls.
--- a/drivers/net/bna/bna.h	2010-10-05 18:33:24.969649777 +0900
+++ b/drivers/net/bna/bna.h	2010-10-05 19:14:12.306169796 +0900
@@ -19,8 +19,7 @@
 #include "bfi_ll.h"
 #include "bna_types.h"
 
-extern u32 bna_dim_vector[][BNA_BIAS_T_MAX];
-extern u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
+extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
 
 /**
  *
@@ -344,9 +343,6 @@ do {									\
  * BNA
  */
 
-/* Internal APIs */
-void bna_adv_res_req(struct bna_res_info *res_info);
-
 /* APIs for BNAD */
 void bna_res_req(struct bna_res_info *res_info);
 void bna_init(struct bna *bna, struct bnad *bnad,
@@ -354,7 +350,6 @@ void bna_init(struct bna *bna, struct bn
 			struct bna_res_info *res_info);
 void bna_uninit(struct bna *bna);
 void bna_stats_get(struct bna *bna);
-void bna_stats_clr(struct bna *bna);
 void bna_get_perm_mac(struct bna *bna, u8 *mac);
 
 /* APIs for Rx */
@@ -376,18 +371,6 @@ void bna_rit_mod_seg_put(struct bna_rit_
  * DEVICE
  */
 
-/* Interanl APIs */
-void bna_adv_device_init(struct bna_device *device, struct bna *bna,
-			struct bna_res_info *res_info);
-
-/* APIs for BNA */
-void bna_device_init(struct bna_device *device, struct bna *bna,
-		     struct bna_res_info *res_info);
-void bna_device_uninit(struct bna_device *device);
-void bna_device_cb_port_stopped(void *arg, enum bna_cb_status status);
-int bna_device_status_get(struct bna_device *device);
-int bna_device_state_get(struct bna_device *device);
-
 /* APIs for BNAD */
 void bna_device_enable(struct bna_device *device);
 void bna_device_disable(struct bna_device *device,
@@ -397,12 +380,6 @@ void bna_device_disable(struct bna_devic
  * MBOX
  */
 
-/* APIs for DEVICE */
-void bna_mbox_mod_init(struct bna_mbox_mod *mbox_mod, struct bna *bna);
-void bna_mbox_mod_uninit(struct bna_mbox_mod *mbox_mod);
-void bna_mbox_mod_start(struct bna_mbox_mod *mbox_mod);
-void bna_mbox_mod_stop(struct bna_mbox_mod *mbox_mod);
-
 /* APIs for PORT, TX, RX */
 void bna_mbox_handler(struct bna *bna, u32 intr_status);
 void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
@@ -411,17 +388,6 @@ void bna_mbox_send(struct bna *bna, stru
  * PORT
  */
 
-/* APIs for BNA */
-void bna_port_init(struct bna_port *port, struct bna *bna);
-void bna_port_uninit(struct bna_port *port);
-int bna_port_state_get(struct bna_port *port);
-int bna_llport_state_get(struct bna_llport *llport);
-
-/* APIs for DEVICE */
-void bna_port_start(struct bna_port *port);
-void bna_port_stop(struct bna_port *port);
-void bna_port_fail(struct bna_port *port);
-
 /* API for RX */
 int bna_port_mtu_get(struct bna_port *port);
 void bna_llport_admin_up(struct bna_llport *llport);
@@ -437,12 +403,6 @@ void bna_port_pause_config(struct bna_po
 void bna_port_mtu_set(struct bna_port *port, int mtu,
 		      void (*cbfn)(struct bnad *, enum bna_cb_status));
 void bna_port_mac_get(struct bna_port *port, mac_t *mac);
-void bna_port_type_set(struct bna_port *port, enum bna_port_type type);
-void bna_port_linkcbfn_set(struct bna_port *port,
-			   void (*linkcbfn)(struct bnad *,
-					    enum bna_link_status));
-void bna_port_admin_up(struct bna_port *port);
-void bna_port_admin_down(struct bna_port *port);
 
 /* Callbacks for TX, RX */
 void bna_port_cb_tx_stopped(struct bna_port *port,
@@ -450,11 +410,6 @@ void bna_port_cb_tx_stopped(struct bna_p
 void bna_port_cb_rx_stopped(struct bna_port *port,
 			    enum bna_cb_status status);
 
-/* Callbacks for MBOX */
-void bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
-			 int status);
-void bna_port_cb_link_down(struct bna_port *port, int status);
-
 /**
  * IB
  */
@@ -464,25 +419,10 @@ void bna_ib_mod_init(struct bna_ib_mod *
 		     struct bna_res_info *res_info);
 void bna_ib_mod_uninit(struct bna_ib_mod *ib_mod);
 
-/* APIs for TX, RX */
-struct bna_ib *bna_ib_get(struct bna_ib_mod *ib_mod,
-			    enum bna_intr_type intr_type, int vector);
-void bna_ib_put(struct bna_ib_mod *ib_mod, struct bna_ib *ib);
-int bna_ib_reserve_idx(struct bna_ib *ib);
-void bna_ib_release_idx(struct bna_ib *ib, int idx);
-int bna_ib_config(struct bna_ib *ib, struct bna_ib_config *ib_config);
-void bna_ib_start(struct bna_ib *ib);
-void bna_ib_stop(struct bna_ib *ib);
-void bna_ib_fail(struct bna_ib *ib);
-void bna_ib_coalescing_timeo_set(struct bna_ib *ib, u8 coalescing_timeo);
-
 /**
  * TX MODULE AND TX
  */
 
-/* Internal APIs */
-void bna_tx_prio_changed(struct bna_tx *tx, int prio);
-
 /* APIs for BNA */
 void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
 		     struct bna_res_info *res_info);
@@ -508,10 +448,6 @@ void bna_tx_enable(struct bna_tx *tx);
 void bna_tx_disable(struct bna_tx *tx, enum bna_cleanup_type type,
 		    void (*cbfn)(void *, struct bna_tx *,
 				 enum bna_cb_status));
-enum bna_cb_status
-bna_tx_prio_set(struct bna_tx *tx, int prio,
-		void (*cbfn)(struct bnad *, struct bna_tx *,
-			     enum bna_cb_status));
 void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);
 
 /**
@@ -564,35 +500,20 @@ void bna_rx_disable(struct bna_rx *rx, e
 		    void (*cbfn)(void *, struct bna_rx *,
 				 enum bna_cb_status));
 void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
-void bna_rx_dim_reconfig(struct bna *bna, u32 vector[][BNA_BIAS_T_MAX]);
+void bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX]);
 void bna_rx_dim_update(struct bna_ccb *ccb);
 enum bna_cb_status
 bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
 		 void (*cbfn)(struct bnad *, struct bna_rx *,
 			      enum bna_cb_status));
 enum bna_cb_status
-bna_rx_ucast_add(struct bna_rx *rx, u8* ucmac,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status));
-enum bna_cb_status
-bna_rx_ucast_del(struct bna_rx *rx, u8 *ucmac,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status));
-enum bna_cb_status
 bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
 		 void (*cbfn)(struct bnad *, struct bna_rx *,
 			      enum bna_cb_status));
 enum bna_cb_status
-bna_rx_mcast_del(struct bna_rx *rx, u8 *mcmac,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status));
-enum bna_cb_status
 bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
 		     void (*cbfn)(struct bnad *, struct bna_rx *,
 				  enum bna_cb_status));
-void bna_rx_mcast_delall(struct bna_rx *rx,
-			 void (*cbfn)(struct bnad *, struct bna_rx *,
-				      enum bna_cb_status));
 enum bna_cb_status
 bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
 		enum bna_rxmode bitmask,
@@ -601,37 +522,12 @@ bna_rx_mode_set(struct bna_rx *rx, enum 
 void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
 void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
 void bna_rx_vlanfilter_enable(struct bna_rx *rx);
-void bna_rx_vlanfilter_disable(struct bna_rx *rx);
-void bna_rx_rss_enable(struct bna_rx *rx);
-void bna_rx_rss_disable(struct bna_rx *rx);
-void bna_rx_rss_reconfig(struct bna_rx *rx, struct bna_rxf_rss *rss_config);
-void bna_rx_rss_rit_set(struct bna_rx *rx, unsigned int *vectors,
-			int nvectors);
 void bna_rx_hds_enable(struct bna_rx *rx, struct bna_rxf_hds *hds_config,
 		       void (*cbfn)(struct bnad *, struct bna_rx *,
 				    enum bna_cb_status));
 void bna_rx_hds_disable(struct bna_rx *rx,
 			void (*cbfn)(struct bnad *, struct bna_rx *,
 				     enum bna_cb_status));
-void bna_rx_receive_pause(struct bna_rx *rx,
-			  void (*cbfn)(struct bnad *, struct bna_rx *,
-				       enum bna_cb_status));
-void bna_rx_receive_resume(struct bna_rx *rx,
-			   void (*cbfn)(struct bnad *, struct bna_rx *,
-					enum bna_cb_status));
-
-/* RxF APIs for RX */
-void bna_rxf_start(struct bna_rxf *rxf);
-void bna_rxf_stop(struct bna_rxf *rxf);
-void bna_rxf_fail(struct bna_rxf *rxf);
-void bna_rxf_init(struct bna_rxf *rxf, struct bna_rx *rx,
-		  struct bna_rx_config *q_config);
-void bna_rxf_uninit(struct bna_rxf *rxf);
-
-/* Callback from RXF to RX */
-void bna_rx_cb_rxf_stopped(struct bna_rx *rx, enum bna_cb_status);
-void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);
-
 /**
  * BNAD
  */
--- a/drivers/net/bna/bna_ctrl.c	2010-10-05 18:28:08.125665071 +0900
+++ b/drivers/net/bna/bna_ctrl.c	2010-10-05 19:17:51.037641382 +0900
@@ -19,6 +19,13 @@
 #include "bfa_sm.h"
 #include "bfa_wc.h"
 
+static void bna_device_cb_port_stopped(void *arg, enum bna_cb_status status);
+static void bna_adv_device_init(struct bna_device *device, struct bna *bna,
+				struct bna_res_info *res_info);
+static void bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
+				int status);
+static void bna_port_cb_link_down(struct bna_port *port, int status);
+
 /**
  * MBOX
  */
@@ -96,7 +103,7 @@ bna_ll_isr(void *llarg, struct bfi_mbmsg
 		bna_mbox_aen_callback(bna, msg);
 }
 
-void
+static void
 bna_err_handler(struct bna *bna, u32 intr_status)
 {
 	u32 init_halt;
@@ -140,7 +147,7 @@ bna_mbox_send(struct bna *bna, struct bn
 	}
 }
 
-void
+static void
 bna_mbox_flush_q(struct bna *bna, struct list_head *q)
 {
 	struct bna_mbox_qe *mb_qe = NULL;
@@ -166,18 +173,18 @@ bna_mbox_flush_q(struct bna *bna, struct
 	bna->mbox_mod.state = BNA_MBOX_FREE;
 }
 
-void
+static void
 bna_mbox_mod_start(struct bna_mbox_mod *mbox_mod)
 {
 }
 
-void
+static void
 bna_mbox_mod_stop(struct bna_mbox_mod *mbox_mod)
 {
 	bna_mbox_flush_q(mbox_mod->bna, &mbox_mod->posted_q);
 }
 
-void
+static void
 bna_mbox_mod_init(struct bna_mbox_mod *mbox_mod, struct bna *bna)
 {
 	bfa_nw_ioc_mbox_regisr(&bna->device.ioc, BFI_MC_LL, bna_ll_isr, bna);
@@ -187,7 +194,7 @@ bna_mbox_mod_init(struct bna_mbox_mod *m
 	mbox_mod->bna = bna;
 }
 
-void
+static void
 bna_mbox_mod_uninit(struct bna_mbox_mod *mbox_mod)
 {
 	mbox_mod->bna = NULL;
@@ -538,7 +545,7 @@ bna_fw_cb_llport_down(void *arg, int sta
 	bfa_fsm_send_event(llport, LLPORT_E_FWRESP_DOWN);
 }
 
-void
+static void
 bna_port_cb_llport_stopped(struct bna_port *port,
 				enum bna_cb_status status)
 {
@@ -591,7 +598,7 @@ bna_llport_fail(struct bna_llport *llpor
 	bfa_fsm_send_event(llport, LLPORT_E_FAIL);
 }
 
-int
+static int
 bna_llport_state_get(struct bna_llport *llport)
 {
 	return bfa_sm_to_state(llport_sm_table, llport->fsm);
@@ -1109,7 +1116,7 @@ bna_port_cb_chld_stopped(void *arg)
 	bfa_fsm_send_event(port, PORT_E_CHLD_STOPPED);
 }
 
-void
+static void
 bna_port_init(struct bna_port *port, struct bna *bna)
 {
 	port->bna = bna;
@@ -1137,7 +1144,7 @@ bna_port_init(struct bna_port *port, str
 	bna_llport_init(&port->llport, bna);
 }
 
-void
+static void
 bna_port_uninit(struct bna_port *port)
 {
 	bna_llport_uninit(&port->llport);
@@ -1147,13 +1154,13 @@ bna_port_uninit(struct bna_port *port)
 	port->bna = NULL;
 }
 
-int
+static int
 bna_port_state_get(struct bna_port *port)
 {
 	return bfa_sm_to_state(port_sm_table, port->fsm);
 }
 
-void
+static void
 bna_port_start(struct bna_port *port)
 {
 	port->flags |= BNA_PORT_F_DEVICE_READY;
@@ -1161,7 +1168,7 @@ bna_port_start(struct bna_port *port)
 		bfa_fsm_send_event(port, PORT_E_START);
 }
 
-void
+static void
 bna_port_stop(struct bna_port *port)
 {
 	port->stop_cbfn = bna_device_cb_port_stopped;
@@ -1171,7 +1178,7 @@ bna_port_stop(struct bna_port *port)
 	bfa_fsm_send_event(port, PORT_E_STOP);
 }
 
-void
+static void
 bna_port_fail(struct bna_port *port)
 {
 	port->flags &= ~BNA_PORT_F_DEVICE_READY;
@@ -1190,7 +1197,7 @@ bna_port_cb_rx_stopped(struct bna_port *
 	bfa_wc_down(&port->chld_stop_wc);
 }
 
-void
+static void
 bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
 			int status)
 {
@@ -1218,7 +1225,7 @@ bna_port_cb_link_up(struct bna_port *por
 	port->link_cbfn(port->bna->bnad, port->llport.link_status);
 }
 
-void
+static void
 bna_port_cb_link_down(struct bna_port *port, int status)
 {
 	port->llport.link_status = BNA_LINK_DOWN;
@@ -1293,54 +1300,6 @@ bna_port_mac_get(struct bna_port *port, 
 }
 
 /**
- * Should be called only when port is disabled
- */
-void
-bna_port_type_set(struct bna_port *port, enum bna_port_type type)
-{
-	port->type = type;
-	port->llport.type = type;
-}
-
-/**
- * Should be called only when port is disabled
- */
-void
-bna_port_linkcbfn_set(struct bna_port *port,
-		      void (*linkcbfn)(struct bnad *, enum bna_link_status))
-{
-	port->link_cbfn = linkcbfn;
-}
-
-void
-bna_port_admin_up(struct bna_port *port)
-{
-	struct bna_llport *llport = &port->llport;
-
-	if (llport->flags & BNA_LLPORT_F_ENABLED)
-		return;
-
-	llport->flags |= BNA_LLPORT_F_ENABLED;
-
-	if (llport->flags & BNA_LLPORT_F_RX_ENABLED)
-		bfa_fsm_send_event(llport, LLPORT_E_UP);
-}
-
-void
-bna_port_admin_down(struct bna_port *port)
-{
-	struct bna_llport *llport = &port->llport;
-
-	if (!(llport->flags & BNA_LLPORT_F_ENABLED))
-		return;
-
-	llport->flags &= ~BNA_LLPORT_F_ENABLED;
-
-	if (llport->flags & BNA_LLPORT_F_RX_ENABLED)
-		bfa_fsm_send_event(llport, LLPORT_E_DOWN);
-}
-
-/**
  * DEVICE
  */
 #define enable_mbox_intr(_device)\
@@ -1357,7 +1316,7 @@ do {\
 	bnad_cb_device_disable_mbox_intr((_device)->bna->bnad);\
 } while (0)
 
-const struct bna_chip_regs_offset reg_offset[] =
+static const struct bna_chip_regs_offset reg_offset[] =
 {{HOST_PAGE_NUM_FN0, HOSTFN0_INT_STATUS,
 	HOSTFN0_INT_MASK, HOST_MSIX_ERR_INDEX_FN0},
 {HOST_PAGE_NUM_FN1, HOSTFN1_INT_STATUS,
@@ -1642,7 +1601,7 @@ static struct bfa_ioc_cbfn bfa_iocll_cbf
 	bna_device_cb_iocll_reset
 };
 
-void
+static void
 bna_device_init(struct bna_device *device, struct bna *bna,
 		struct bna_res_info *res_info)
 {
@@ -1681,7 +1640,7 @@ bna_device_init(struct bna_device *devic
 	bfa_fsm_set_state(device, bna_device_sm_stopped);
 }
 
-void
+static void
 bna_device_uninit(struct bna_device *device)
 {
 	bna_mbox_mod_uninit(&device->bna->mbox_mod);
@@ -1691,7 +1650,7 @@ bna_device_uninit(struct bna_device *dev
 	device->bna = NULL;
 }
 
-void
+static void
 bna_device_cb_port_stopped(void *arg, enum bna_cb_status status)
 {
 	struct bna_device *device = (struct bna_device *)arg;
@@ -1699,7 +1658,7 @@ bna_device_cb_port_stopped(void *arg, en
 	bfa_fsm_send_event(device, DEVICE_E_PORT_STOPPED);
 }
 
-int
+static int
 bna_device_status_get(struct bna_device *device)
 {
 	return device->fsm == (bfa_fsm_t)bna_device_sm_ready;
@@ -1733,13 +1692,13 @@ bna_device_disable(struct bna_device *de
 	bfa_fsm_send_event(device, DEVICE_E_DISABLE);
 }
 
-int
+static int
 bna_device_state_get(struct bna_device *device)
 {
 	return bfa_sm_to_state(device_sm_table, device->fsm);
 }
 
-u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
+static const u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
 	{12, 20},
 	{10, 18},
 	{8, 16},
@@ -1750,7 +1709,7 @@ u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_B
 	{1, 2},
 };
 
-u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
+const u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
 	{12, 12},
 	{6, 10},
 	{5, 10},
@@ -1762,7 +1721,7 @@ u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][
 };
 
 /* device */
-void
+static void
 bna_adv_device_init(struct bna_device *device, struct bna *bna,
 		struct bna_res_info *res_info)
 {
@@ -1790,7 +1749,7 @@ bna_adv_device_init(struct bna_device *d
 
 /* utils */
 
-void
+static void
 bna_adv_res_req(struct bna_res_info *res_info)
 {
 	/* DMA memory for COMMON_MODULE */
@@ -2044,36 +2003,6 @@ bna_fw_stats_get(struct bna *bna)
 	bna->stats.txf_bmap[1] = bna->tx_mod.txf_bmap[1];
 }
 
-static void
-bna_fw_cb_stats_clr(void *arg, int status)
-{
-	struct bna *bna = (struct bna *)arg;
-
-	bfa_q_qe_init(&bna->mbox_qe.qe);
-
-	memset(bna->stats.sw_stats, 0, sizeof(struct bna_sw_stats));
-	memset(bna->stats.hw_stats, 0, sizeof(struct bfi_ll_stats));
-
-	bnad_cb_stats_clr(bna->bnad);
-}
-
-static void
-bna_fw_stats_clr(struct bna *bna)
-{
-	struct bfi_ll_stats_req ll_req;
-
-	bfi_h2i_set(ll_req.mh, BFI_MC_LL, BFI_LL_H2I_STATS_CLEAR_REQ, 0);
-	ll_req.stats_mask = htons(BFI_LL_STATS_ALL);
-	ll_req.rxf_id_mask[0] = htonl(0xffffffff);
-	ll_req.rxf_id_mask[1] =	htonl(0xffffffff);
-	ll_req.txf_id_mask[0] =	htonl(0xffffffff);
-	ll_req.txf_id_mask[1] =	htonl(0xffffffff);
-
-	bna_mbox_qe_fill(&bna->mbox_qe, &ll_req, sizeof(ll_req),
-				bna_fw_cb_stats_clr, bna);
-	bna_mbox_send(bna, &bna->mbox_qe);
-}
-
 void
 bna_stats_get(struct bna *bna)
 {
@@ -2083,22 +2012,8 @@ bna_stats_get(struct bna *bna)
 		bnad_cb_stats_get(bna->bnad, BNA_CB_FAIL, &bna->stats);
 }
 
-void
-bna_stats_clr(struct bna *bna)
-{
-	if (bna_device_status_get(&bna->device))
-		bna_fw_stats_clr(bna);
-	else {
-		memset(&bna->stats.sw_stats, 0,
-				sizeof(struct bna_sw_stats));
-		memset(bna->stats.hw_stats, 0,
-				sizeof(struct bfi_ll_stats));
-		bnad_cb_stats_clr(bna->bnad);
-	}
-}
-
 /* IB */
-void
+static void
 bna_ib_coalescing_timeo_set(struct bna_ib *ib, u8 coalescing_timeo)
 {
 	ib->ib_config.coalescing_timeo = coalescing_timeo;
@@ -2157,7 +2072,7 @@ rxf_fltr_mbox_cmd(struct bna_rxf *rxf, u
 	bna_mbox_send(rxf->rx->bna, &rxf->mbox_qe);
 }
 
-void
+static void
 __rxf_default_function_config(struct bna_rxf *rxf, enum bna_status status)
 {
 	struct bna_rx_fndb_ram *rx_fndb_ram;
@@ -2553,7 +2468,7 @@ rxf_reset_packet_filter_allmulti(struct 
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_promisc_enable(struct bna_rxf *rxf)
 {
 	struct bna *bna = rxf->rx->bna;
@@ -2584,7 +2499,7 @@ rxf_promisc_enable(struct bna_rxf *rxf)
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_promisc_disable(struct bna_rxf *rxf)
 {
 	struct bna *bna = rxf->rx->bna;
@@ -2623,7 +2538,7 @@ rxf_promisc_disable(struct bna_rxf *rxf)
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_default_enable(struct bna_rxf *rxf)
 {
 	struct bna *bna = rxf->rx->bna;
@@ -2654,7 +2569,7 @@ rxf_default_enable(struct bna_rxf *rxf)
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_default_disable(struct bna_rxf *rxf)
 {
 	struct bna *bna = rxf->rx->bna;
@@ -2693,7 +2608,7 @@ rxf_default_disable(struct bna_rxf *rxf)
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_allmulti_enable(struct bna_rxf *rxf)
 {
 	int ret = 0;
@@ -2721,7 +2636,7 @@ rxf_allmulti_enable(struct bna_rxf *rxf)
  *	0 = no h/w change
  *	1 = need h/w change
  */
-int
+static int
 rxf_allmulti_disable(struct bna_rxf *rxf)
 {
 	int ret = 0;
@@ -2745,158 +2660,7 @@ rxf_allmulti_disable(struct bna_rxf *rxf
 	return ret;
 }
 
-/* RxF <- bnad */
-void
-bna_rx_mcast_delall(struct bna_rx *rx,
-		    void (*cbfn)(struct bnad *, struct bna_rx *,
-				 enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-	struct list_head *qe;
-	struct bna_mac *mac;
-	int need_hw_config = 0;
 
-	/* Purge all entries from pending_add_q */
-	while (!list_empty(&rxf->mcast_pending_add_q)) {
-		bfa_q_deq(&rxf->mcast_pending_add_q, &qe);
-		mac = (struct bna_mac *)qe;
-		bfa_q_qe_init(&mac->qe);
-		bna_mcam_mod_mac_put(&rxf->rx->bna->mcam_mod, mac);
-	}
-
-	/* Schedule all entries in active_q for deletion */
-	while (!list_empty(&rxf->mcast_active_q)) {
-		bfa_q_deq(&rxf->mcast_active_q, &qe);
-		mac = (struct bna_mac *)qe;
-		bfa_q_qe_init(&mac->qe);
-		list_add_tail(&mac->qe, &rxf->mcast_pending_del_q);
-		need_hw_config = 1;
-	}
-
-	if (need_hw_config) {
-		rxf->cam_fltr_cbfn = cbfn;
-		rxf->cam_fltr_cbarg = rx->bna->bnad;
-		bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-		return;
-	}
-
-	if (cbfn)
-		(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-/* RxF <- Rx */
-void
-bna_rx_receive_resume(struct bna_rx *rx,
-		      void (*cbfn)(struct bnad *, struct bna_rx *,
-				   enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-
-	if (rxf->rxf_oper_state == BNA_RXF_OPER_STATE_PAUSED) {
-		rxf->oper_state_cbfn = cbfn;
-		rxf->oper_state_cbarg = rx->bna->bnad;
-		bfa_fsm_send_event(rxf, RXF_E_RESUME);
-	} else if (cbfn)
-		(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-void
-bna_rx_receive_pause(struct bna_rx *rx,
-		     void (*cbfn)(struct bnad *, struct bna_rx *,
-				  enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-
-	if (rxf->rxf_oper_state == BNA_RXF_OPER_STATE_RUNNING) {
-		rxf->oper_state_cbfn = cbfn;
-		rxf->oper_state_cbarg = rx->bna->bnad;
-		bfa_fsm_send_event(rxf, RXF_E_PAUSE);
-	} else if (cbfn)
-		(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-/* RxF <- bnad */
-enum bna_cb_status
-bna_rx_ucast_add(struct bna_rx *rx, u8 *addr,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-	struct list_head *qe;
-	struct bna_mac *mac;
-
-	/* Check if already added */
-	list_for_each(qe, &rxf->ucast_active_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			if (cbfn)
-				(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	/* Check if pending addition */
-	list_for_each(qe, &rxf->ucast_pending_add_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			if (cbfn)
-				(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	mac = bna_ucam_mod_mac_get(&rxf->rx->bna->ucam_mod);
-	if (mac == NULL)
-		return BNA_CB_UCAST_CAM_FULL;
-	bfa_q_qe_init(&mac->qe);
-	memcpy(mac->addr, addr, ETH_ALEN);
-	list_add_tail(&mac->qe, &rxf->ucast_pending_add_q);
-
-	rxf->cam_fltr_cbfn = cbfn;
-	rxf->cam_fltr_cbarg = rx->bna->bnad;
-
-	bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-
-	return BNA_CB_SUCCESS;
-}
-
-/* RxF <- bnad */
-enum bna_cb_status
-bna_rx_ucast_del(struct bna_rx *rx, u8 *addr,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-	struct list_head *qe;
-	struct bna_mac *mac;
-
-	list_for_each(qe, &rxf->ucast_pending_add_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			list_del(qe);
-			bfa_q_qe_init(qe);
-			bna_ucam_mod_mac_put(&rxf->rx->bna->ucam_mod, mac);
-			if (cbfn)
-				(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	list_for_each(qe, &rxf->ucast_active_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			list_del(qe);
-			bfa_q_qe_init(qe);
-			list_add_tail(qe, &rxf->ucast_pending_del_q);
-			rxf->cam_fltr_cbfn = cbfn;
-			rxf->cam_fltr_cbarg = rx->bna->bnad;
-			bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	return BNA_CB_INVALID_MAC;
-}
 
 /* RxF <- bnad */
 enum bna_cb_status
@@ -2978,38 +2742,6 @@ err_return:
 	return BNA_CB_FAIL;
 }
 
-/* RxF <- bnad */
-void
-bna_rx_rss_enable(struct bna_rx *rx)
-{
-	struct bna_rxf *rxf = &rx->rxf;
-
-	rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
-	rxf->rss_status = BNA_STATUS_T_ENABLED;
-	bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
-
-/* RxF <- bnad */
-void
-bna_rx_rss_disable(struct bna_rx *rx)
-{
-	struct bna_rxf *rxf = &rx->rxf;
-
-	rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
-	rxf->rss_status = BNA_STATUS_T_DISABLED;
-	bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
-
-/* RxF <- bnad */
-void
-bna_rx_rss_reconfig(struct bna_rx *rx, struct bna_rxf_rss *rss_config)
-{
-	struct bna_rxf *rxf = &rx->rxf;
-	rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
-	rxf->rss_status = BNA_STATUS_T_ENABLED;
-	rxf->rss_cfg = *rss_config;
-	bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
 
 void
 /* RxF <- bnad */
@@ -3024,68 +2756,8 @@ bna_rx_vlanfilter_enable(struct bna_rx *
 	}
 }
 
-/* RxF <- bnad */
-void
-bna_rx_vlanfilter_disable(struct bna_rx *rx)
-{
-	struct bna_rxf *rxf = &rx->rxf;
-
-	if (rxf->vlan_filter_status == BNA_STATUS_T_ENABLED) {
-		rxf->rxf_flags |= BNA_RXF_FL_VLAN_CONFIG_PENDING;
-		rxf->vlan_filter_status = BNA_STATUS_T_DISABLED;
-		bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-	}
-}
-
 /* Rx */
 
-struct bna_rxp *
-bna_rx_get_rxp(struct bna_rx *rx, int vector)
-{
-	struct bna_rxp *rxp;
-	struct list_head *qe;
-
-	list_for_each(qe, &rx->rxp_q) {
-		rxp = (struct bna_rxp *)qe;
-		if (rxp->vector == vector)
-			return rxp;
-	}
-	return NULL;
-}
-
-/*
- * bna_rx_rss_rit_set()
- * Sets the Q ids for the specified msi-x vectors in the RIT.
- * Maximum rit size supported is 64, which should be the max size of the
- * vectors array.
- */
-
-void
-bna_rx_rss_rit_set(struct bna_rx *rx, unsigned int *vectors, int nvectors)
-{
-	int i;
-	struct bna_rxp *rxp;
-	struct bna_rxq *q0 = NULL, *q1 = NULL;
-	struct bna *bna;
-	struct bna_rxf *rxf;
-
-	/* Build the RIT contents for this RX */
-	bna = rx->bna;
-
-	rxf = &rx->rxf;
-	for (i = 0; i < nvectors; i++) {
-		rxp = bna_rx_get_rxp(rx, vectors[i]);
-
-		GET_RXQS(rxp, q0, q1);
-		rxf->rit_segment->rit[i].large_rxq_id = q0->rxq_id;
-		rxf->rit_segment->rit[i].small_rxq_id = (q1 ? q1->rxq_id : 0);
-	}
-
-	rxf->rit_segment->rit_size = nvectors;
-
-	/* Subsequent call to enable/reconfig RSS will update the RIT in h/w */
-}
-
 /* Rx <- bnad */
 void
 bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo)
@@ -3102,7 +2774,7 @@ bna_rx_coalescing_timeo_set(struct bna_r
 
 /* Rx <- bnad */
 void
-bna_rx_dim_reconfig(struct bna *bna, u32 vector[][BNA_BIAS_T_MAX])
+bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX])
 {
 	int i, j;
 
@@ -3164,21 +2836,6 @@ bna_rx_dim_update(struct bna_ccb *ccb)
 }
 
 /* Tx */
-/* TX <- bnad */
-enum bna_cb_status
-bna_tx_prio_set(struct bna_tx *tx, int prio,
-		void (*cbfn)(struct bnad *, struct bna_tx *,
-			     enum bna_cb_status))
-{
-	if (tx->flags & BNA_TX_F_PRIO_LOCK)
-		return BNA_CB_FAIL;
-	else {
-		tx->prio_change_cbfn = cbfn;
-		bna_tx_prio_changed(tx, prio);
-	}
-
-	return BNA_CB_SUCCESS;
-}
 
 /* TX <- bnad */
 void
--- a/drivers/net/bna/bna_hw.h	2010-10-05 18:45:27.577646257 +0900
+++ b/drivers/net/bna/bna_hw.h	2010-10-05 18:45:32.957640709 +0900
@@ -1282,7 +1282,6 @@ struct bna_chip_regs_offset {
 	u32 fn_int_mask;
 	u32 msix_idx;
 };
-extern const struct bna_chip_regs_offset reg_offset[];
 
 struct bna_chip_regs {
 	void __iomem *page_addr;
--- a/drivers/net/bna/bna_txrx.c	2010-10-05 18:28:08.141648599 +0900
+++ b/drivers/net/bna/bna_txrx.c	2010-10-05 19:17:57.785641486 +0900
@@ -59,6 +59,10 @@ struct bna_ibidx_pool {
 };
 init_ibidx_pool(ibidx_pool);
 
+/* Callback from RXF to RX */
+static void bna_rx_cb_rxf_stopped(struct bna_rx *rx, enum bna_cb_status);
+static void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);
+
 static struct bna_intr *
 bna_intr_get(struct bna_ib_mod *ib_mod, enum bna_intr_type intr_type,
 		int vector)
@@ -195,7 +199,7 @@ bna_ib_mod_uninit(struct bna_ib_mod *ib_
 	ib_mod->bna = NULL;
 }
 
-struct bna_ib *
+static struct bna_ib *
 bna_ib_get(struct bna_ib_mod *ib_mod,
 		enum bna_intr_type intr_type,
 		int vector)
@@ -240,7 +244,7 @@ bna_ib_get(struct bna_ib_mod *ib_mod,
 	return ib;
 }
 
-void
+static void
 bna_ib_put(struct bna_ib_mod *ib_mod, struct bna_ib *ib)
 {
 	bna_intr_put(ib_mod, ib->intr);
@@ -255,7 +259,7 @@ bna_ib_put(struct bna_ib_mod *ib_mod, st
 }
 
 /* Returns index offset - starting from 0 */
-int
+static int
 bna_ib_reserve_idx(struct bna_ib *ib)
 {
 	struct bna_ib_mod *ib_mod = &ib->bna->ib_mod;
@@ -309,7 +313,7 @@ bna_ib_reserve_idx(struct bna_ib *ib)
 	return idx;
 }
 
-void
+static void
 bna_ib_release_idx(struct bna_ib *ib, int idx)
 {
 	struct bna_ib_mod *ib_mod = &ib->bna->ib_mod;
@@ -356,7 +360,7 @@ bna_ib_release_idx(struct bna_ib *ib, in
 	}
 }
 
-int
+static int
 bna_ib_config(struct bna_ib *ib, struct bna_ib_config *ib_config)
 {
 	if (ib->start_count)
@@ -374,7 +378,7 @@ bna_ib_config(struct bna_ib *ib, struct 
 	return 0;
 }
 
-void
+static void
 bna_ib_start(struct bna_ib *ib)
 {
 	struct bna_ib_blk_mem ib_cfg;
@@ -450,7 +454,7 @@ bna_ib_start(struct bna_ib *ib)
 	}
 }
 
-void
+static void
 bna_ib_stop(struct bna_ib *ib)
 {
 	u32 intx_mask;
@@ -468,7 +472,7 @@ bna_ib_stop(struct bna_ib *ib)
 	}
 }
 
-void
+static void
 bna_ib_fail(struct bna_ib *ib)
 {
 	ib->start_count = 0;
@@ -1394,7 +1398,7 @@ rxf_reset_packet_filter(struct bna_rxf *
 	rxf_reset_packet_filter_allmulti(rxf);
 }
 
-void
+static void
 bna_rxf_init(struct bna_rxf *rxf,
 		struct bna_rx *rx,
 		struct bna_rx_config *q_config)
@@ -1444,7 +1448,7 @@ bna_rxf_init(struct bna_rxf *rxf,
 	bfa_fsm_set_state(rxf, bna_rxf_sm_stopped);
 }
 
-void
+static void
 bna_rxf_uninit(struct bna_rxf *rxf)
 {
 	struct bna_mac *mac;
@@ -1476,7 +1480,7 @@ bna_rxf_uninit(struct bna_rxf *rxf)
 	rxf->rx = NULL;
 }
 
-void
+static void
 bna_rxf_start(struct bna_rxf *rxf)
 {
 	rxf->start_cbfn = bna_rx_cb_rxf_started;
@@ -1485,7 +1489,7 @@ bna_rxf_start(struct bna_rxf *rxf)
 	bfa_fsm_send_event(rxf, RXF_E_START);
 }
 
-void
+static void
 bna_rxf_stop(struct bna_rxf *rxf)
 {
 	rxf->stop_cbfn = bna_rx_cb_rxf_stopped;
@@ -1493,7 +1497,7 @@ bna_rxf_stop(struct bna_rxf *rxf)
 	bfa_fsm_send_event(rxf, RXF_E_STOP);
 }
 
-void
+static void
 bna_rxf_fail(struct bna_rxf *rxf)
 {
 	rxf->rxf_flags |= BNA_RXF_FL_FAILED;
@@ -1575,42 +1579,6 @@ bna_rx_mcast_add(struct bna_rx *rx, u8 *
 	return BNA_CB_SUCCESS;
 }
 
-enum bna_cb_status
-bna_rx_mcast_del(struct bna_rx *rx, u8 *addr,
-		 void (*cbfn)(struct bnad *, struct bna_rx *,
-			      enum bna_cb_status))
-{
-	struct bna_rxf *rxf = &rx->rxf;
-	struct list_head *qe;
-	struct bna_mac *mac;
-
-	list_for_each(qe, &rxf->mcast_pending_add_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			list_del(qe);
-			bfa_q_qe_init(qe);
-			bna_mcam_mod_mac_put(&rxf->rx->bna->mcam_mod, mac);
-			if (cbfn)
-				(*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	list_for_each(qe, &rxf->mcast_active_q) {
-		mac = (struct bna_mac *)qe;
-		if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
-			list_del(qe);
-			bfa_q_qe_init(qe);
-			list_add_tail(qe, &rxf->mcast_pending_del_q);
-			rxf->cam_fltr_cbfn = cbfn;
-			rxf->cam_fltr_cbarg = rx->bna->bnad;
-			bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-			return BNA_CB_SUCCESS;
-		}
-	}
-
-	return BNA_CB_INVALID_MAC;
-}
 
 enum bna_cb_status
 bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mclist,
@@ -1862,7 +1830,7 @@ bfa_fsm_state_decl(bna_rx, rxf_stop_wait
 bfa_fsm_state_decl(bna_rx, rxq_stop_wait,
 	struct bna_rx, enum bna_rx_event);
 
-static struct bfa_sm_table rx_sm_table[] = {
+static const struct bfa_sm_table rx_sm_table[] = {
 	{BFA_SM(bna_rx_sm_stopped), BNA_RX_STOPPED},
 	{BFA_SM(bna_rx_sm_rxf_start_wait), BNA_RX_RXF_START_WAIT},
 	{BFA_SM(bna_rx_sm_started), BNA_RX_STARTED},
@@ -2247,7 +2215,7 @@ bna_rit_create(struct bna_rx *rx)
 	}
 }
 
-int
+static int
 _rx_can_satisfy(struct bna_rx_mod *rx_mod,
 		struct bna_rx_config *rx_cfg)
 {
@@ -2272,7 +2240,7 @@ _rx_can_satisfy(struct bna_rx_mod *rx_mo
 	return 1;
 }
 
-struct bna_rxq *
+static struct bna_rxq *
 _get_free_rxq(struct bna_rx_mod *rx_mod)
 {
 	struct bna_rxq *rxq = NULL;
@@ -2286,7 +2254,7 @@ _get_free_rxq(struct bna_rx_mod *rx_mod)
 	return rxq;
 }
 
-void
+static void
 _put_free_rxq(struct bna_rx_mod *rx_mod, struct bna_rxq *rxq)
 {
 	bfa_q_qe_init(&rxq->qe);
@@ -2294,7 +2262,7 @@ _put_free_rxq(struct bna_rx_mod *rx_mod,
 	rx_mod->rxq_free_count++;
 }
 
-struct bna_rxp *
+static struct bna_rxp *
 _get_free_rxp(struct bna_rx_mod *rx_mod)
 {
 	struct list_head	*qe = NULL;
@@ -2310,7 +2278,7 @@ _get_free_rxp(struct bna_rx_mod *rx_mod)
 	return rxp;
 }
 
-void
+static void
 _put_free_rxp(struct bna_rx_mod *rx_mod, struct bna_rxp *rxp)
 {
 	bfa_q_qe_init(&rxp->qe);
@@ -2318,7 +2286,7 @@ _put_free_rxp(struct bna_rx_mod *rx_mod,
 	rx_mod->rxp_free_count++;
 }
 
-struct bna_rx *
+static struct bna_rx *
 _get_free_rx(struct bna_rx_mod *rx_mod)
 {
 	struct list_head	*qe = NULL;
@@ -2336,7 +2304,7 @@ _get_free_rx(struct bna_rx_mod *rx_mod)
 	return rx;
 }
 
-void
+static void
 _put_free_rx(struct bna_rx_mod *rx_mod, struct bna_rx *rx)
 {
 	bfa_q_qe_init(&rx->qe);
@@ -2344,7 +2312,7 @@ _put_free_rx(struct bna_rx_mod *rx_mod, 
 	rx_mod->rx_free_count++;
 }
 
-void
+static void
 _rx_init(struct bna_rx *rx, struct bna *bna)
 {
 	rx->bna = bna;
@@ -2360,7 +2328,7 @@ _rx_init(struct bna_rx *rx, struct bna *
 	rx->stop_cbarg = NULL;
 }
 
-void
+static void
 _rxp_add_rxqs(struct bna_rxp *rxp,
 		struct bna_rxq *q0,
 		struct bna_rxq *q1)
@@ -2383,7 +2351,7 @@ _rxp_add_rxqs(struct bna_rxp *rxp,
 	}
 }
 
-void
+static void
 _rxq_qpt_init(struct bna_rxq *rxq,
 		struct bna_rxp *rxp,
 		u32 page_count,
@@ -2412,7 +2380,7 @@ _rxq_qpt_init(struct bna_rxq *rxq,
 	}
 }
 
-void
+static void
 _rxp_cqpt_setup(struct bna_rxp *rxp,
 		u32 page_count,
 		u32 page_size,
@@ -2441,13 +2409,13 @@ _rxp_cqpt_setup(struct bna_rxp *rxp,
 	}
 }
 
-void
+static void
 _rx_add_rxp(struct bna_rx *rx, struct bna_rxp *rxp)
 {
 	list_add_tail(&rxp->qe, &rx->rxp_q);
 }
 
-void
+static void
 _init_rxmod_queues(struct bna_rx_mod *rx_mod)
 {
 	INIT_LIST_HEAD(&rx_mod->rx_free_q);
@@ -2460,7 +2428,7 @@ _init_rxmod_queues(struct bna_rx_mod *rx
 	rx_mod->rxp_free_count = 0;
 }
 
-void
+static void
 _rx_ctor(struct bna_rx *rx, int id)
 {
 	bfa_q_qe_init(&rx->qe);
@@ -2492,7 +2460,7 @@ bna_rx_cb_rxq_stopped_all(void *arg)
 	bfa_fsm_send_event(rx, RX_E_RXQ_STOPPED);
 }
 
-void
+static void
 bna_rx_mod_cb_rx_stopped(void *arg, struct bna_rx *rx,
 			 enum bna_cb_status status)
 {
@@ -2501,7 +2469,7 @@ bna_rx_mod_cb_rx_stopped(void *arg, stru
 	bfa_wc_down(&rx_mod->rx_stop_wc);
 }
 
-void
+static void
 bna_rx_mod_cb_rx_stopped_all(void *arg)
 {
 	struct bna_rx_mod *rx_mod = (struct bna_rx_mod *)arg;
@@ -2511,7 +2479,7 @@ bna_rx_mod_cb_rx_stopped_all(void *arg)
 	rx_mod->stop_cbfn = NULL;
 }
 
-void
+static void
 bna_rx_start(struct bna_rx *rx)
 {
 	rx->rx_flags |= BNA_RX_F_PORT_ENABLED;
@@ -2519,7 +2487,7 @@ bna_rx_start(struct bna_rx *rx)
 		bfa_fsm_send_event(rx, RX_E_START);
 }
 
-void
+static void
 bna_rx_stop(struct bna_rx *rx)
 {
 	rx->rx_flags &= ~BNA_RX_F_PORT_ENABLED;
@@ -2532,7 +2500,7 @@ bna_rx_stop(struct bna_rx *rx)
 	}
 }
 
-void
+static void
 bna_rx_fail(struct bna_rx *rx)
 {
 	/* Indicate port is not enabled, and failed */
@@ -3731,7 +3699,7 @@ bna_tx_fail(struct bna_tx *tx)
 	bfa_fsm_send_event(tx, TX_E_FAIL);
 }
 
-void
+static void
 bna_tx_prio_changed(struct bna_tx *tx, int prio)
 {
 	struct bna_txq *txq;
--- a/drivers/net/bna/bnad.c	2010-10-05 18:28:08.157640648 +0900
+++ b/drivers/net/bna/bnad.c	2010-10-05 19:11:35.125672896 +0900
@@ -28,7 +28,7 @@
 #include "bna.h"
 #include "cna.h"
 
-DEFINE_MUTEX(bnad_fwimg_mutex);
+static DEFINE_MUTEX(bnad_fwimg_mutex);
 
 /*
  * Module params
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(bnad_ioc_auto_recover, 
  */
 u32 bnad_rxqs_per_cq = 2;
 
-const u8 bnad_bcast_addr[] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+static const u8 bnad_bcast_addr[] =  {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
 /*
  * Local MACROS
@@ -684,7 +684,7 @@ bnad_enable_mbox_irq(struct bnad *bnad)
  * Called with bnad->bna_lock held b'cos of
  * bnad->cfg_flags access.
  */
-void
+static void
 bnad_disable_mbox_irq(struct bnad *bnad)
 {
 	int irq = BNAD_GET_MBOX_IRQ(bnad);
@@ -953,11 +953,6 @@ bnad_cb_stats_get(struct bnad *bnad, enu
 		  jiffies + msecs_to_jiffies(BNAD_STATS_TIMER_FREQ));
 }
 
-void
-bnad_cb_stats_clr(struct bnad *bnad)
-{
-}
-
 /* Resource allocation, free functions */
 
 static void
@@ -3211,7 +3206,7 @@ bnad_pci_remove(struct pci_dev *pdev)
 	free_netdev(netdev);
 }
 
-const struct pci_device_id bnad_pci_id_table[] = {
+static const struct pci_device_id bnad_pci_id_table[] = {
 	{
 		PCI_DEVICE(PCI_VENDOR_ID_BROCADE,
 			PCI_DEVICE_ID_BROCADE_CT),
--- a/drivers/net/bna/cna_fwimg.c	2010-10-05 18:28:08.173646664 +0900
+++ b/drivers/net/bna/cna_fwimg.c	2010-10-05 18:29:06.225688125 +0900
@@ -22,7 +22,7 @@ const struct firmware *bfi_fw;
 static u32 *bfi_image_ct_cna;
 static u32 bfi_image_ct_cna_size;
 
-u32 *
+static u32 *
 cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
 			u32 *bfi_image_size, char *fw_name)
 {
--- a/drivers/net/bna/bfa_ioc.h	2010-10-05 18:54:23.662672433 +0900
+++ b/drivers/net/bna/bfa_ioc.h	2010-10-05 18:54:30.857688208 +0900
@@ -271,7 +271,6 @@ void bfa_nw_ioc_enable(struct bfa_ioc *i
 void bfa_nw_ioc_disable(struct bfa_ioc *ioc);
 
 void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc);
-bool bfa_nw_ioc_is_operational(struct bfa_ioc *ioc);
 
 void bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr);
 void bfa_nw_ioc_hbfail_register(struct bfa_ioc *ioc,
--- a/drivers/net/bna/bfa_sm.h	2010-10-05 19:12:40.405663296 +0900
+++ b/drivers/net/bna/bfa_sm.h	2010-10-05 19:12:48.897641119 +0900
@@ -77,7 +77,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int
 	((_fsm)->fsm == (bfa_fsm_t)(_state))
 
 static inline int
-bfa_sm_to_state(struct bfa_sm_table *smt, bfa_sm_t sm)
+bfa_sm_to_state(const struct bfa_sm_table *smt, bfa_sm_t sm)
 {
 	int	i = 0;
 

^ permalink raw reply

* Re: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
From: Florian Mickler @ 2010-10-05 10:12 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: stable, linux-wireless@vger.kernel.org, Guy, Wey-Yi,
	Chatre, Reinette, Intel Linux Wireless, John W. Linville,
	Berg, Johannes, Cahill, Ben M, netdev@vger.kernel.org,
	linux-kernel
In-Reply-To: <20101005085717.GA18012@redhat.com>

On Tue, 5 Oct 2010 10:57:17 +0200
Stanislaw Gruszka <sgruszka@redhat.com> wrote:

> On Tue, Oct 05, 2010 at 08:43:05AM +0200, Florian Mickler wrote:
> > commit e7ee762cf074b0fd8eec483d0cef8fdbf0d04b81
> > 
> > 
> > Begin forwarded message:
> > On Fri, 2010-09-24 at 09:22 -0700, Florian Mickler wrote:
> > > iwl3945's scan_completed calls into the mac80211 stack which triggers a
> > > warn on if there is no scan outstanding.
> > > 
> > > This can be avoided by not calling scan_completed but abort_scan in
> > > iwl3945_request_scan  in the done: branch of the function which is used
> > > as an error out.
> > > 
> > > The done: branch seems to be an error-out branch, as, for example, if
> > > iwl_is_ready(priv) returns false  the done: branch is executed.
> > > 
> > > NOTE:
> > > I'm not familiar with the driver at all.
> > > I just quickly scanned as a reaction to
> > > 
> > > https://bugzilla.kernel.org/show_bug.cgi?id=17722
> > > 
> > > the users of scan_completed in the  iwl3945 driver and noted the odd
> > > discrepancy between the comment above this instance and the comment in
> > > mac80211 scan_completed function.
> > > Signed-off-by: Florian Mickler <florian@mickler.org>
> > Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> > > ---
> > go into wireless-2.6 and stable only, scan fix already in
> > wireless-next-2.6
> 
> > 
> > Thanks
> > Wey
> > 
> > >  drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    2 +-
> > >  drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > > index 9dd9e64..8fd00a6 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > > @@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> > >  	clear_bit(STATUS_SCAN_HW, &priv->status);
> > >  	clear_bit(STATUS_SCANNING, &priv->status);
> > >  	/* inform mac80211 scan aborted */
> > > -	queue_work(priv->workqueue, &priv->scan_completed);
> > > +	queue_work(priv->workqueue, &priv->abort_scan);
> 
> Unfortunately this patch is not right thing to do. If you look at
> abort_scan work, it do nothing if STATUS_SCAN_ABORTING bit is not set.
> That's wrong because we have to complete scan (with abort == true).
> If STATUS_SCAN_ABORTING will be set, abort_work will send scan cancel
> commands to hardware what is wrong if scan was not started yet.
> 
> What we can eventually do, except apply iwl-scan rewrite from
> wireless-testing, is something like that:
>  
> iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> 
>   clear_bit(STATUS_SCAN_HW, &priv->status); 
>   clear_bit(STATUS_SCANNING, &priv->status); 
>   /* inform mac80211 scan aborted */ 
>   set_bit(STATUS_SCAN_ABORTING, &priv->status);
>   queue_work(priv->workqueue, &priv->scan_completed);
> 
> ieee80211_scan_completed
>   
>   if (!internal) {
>      bool aborted = test_bit(STATUS_SCAN_ABORTING, &priv->status);
>      ieee80211_scan_completed(priv->hw, aborted);
> 
>   }
> 
> However, I do not think we should go with that to -stable (below
> 2.6.36). IIRC warnings showed up in current 2.6.36-rc, because of
> some other changes in the code.
> 
> Stanislaw

Thx for looking at this. I suspect you know the code better than I do.. what is about the
first jump to :done in iwlagn_request_scan()

         if (!iwl_is_ready(priv)) {
                 IWL_WARN(priv, "request scan called when driver not ready.\n");
                 goto done;
         }

Does abort_scan need to do anything in that case? 
I can't see where we set up the hardware for scanning in that case.
(I've gone through the codepath coming from the mac80211 hw_scan) 

Regards,
Flo

^ permalink raw reply

* Re: [patch v5 00/12] IPVS: SIP Persistence Engine
From: Simon Horman @ 2010-10-05 10:00 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: lvs-devel, netdev, netfilter, netfilter-devel, Jan Engelhardt,
	Stephen Hemminger, Wensong Zhang, Julian Anastasov
In-Reply-To: <4CAA215C.8040605@trash.net>

On Mon, Oct 04, 2010 at 08:47:56PM +0200, Patrick McHardy wrote:
> Am 04.10.2010 15:46, schrieb Simon Horman:
> > CODE AVAILABILITY
> > 
> > The kernel patches (12) are available in git as the pe-5 branch of
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git
> 
> Pulled, thanks Simon. I get a warning in ip_vs_pe_sip.c however,
> please send a fix for this on top.
> 
> net/netfilter/ipvs/ip_vs_pe_sip.c:11: warning: 'ip_vs_dbg_callid'
> defined but not used

Sorry about that, I will investigate and send a fix.

^ permalink raw reply

* Re: Fw: [PATCH] iwl3945: queue the right work if the scan needs to be aborted
From: Stanislaw Gruszka @ 2010-10-05  8:57 UTC (permalink / raw)
  To: Florian Mickler
  Cc: stable-DgEjT+Ai2ygdnm+yROfE0A,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Guy, Wey-Yi, Chatre, Reinette, Intel Linux Wireless,
	John W. Linville, Berg, Johannes, Cahill, Ben M,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20101005084305.52a31ed4-mGsOIKOveelVRbCss4o9kg@public.gmane.org>

On Tue, Oct 05, 2010 at 08:43:05AM +0200, Florian Mickler wrote:
> commit e7ee762cf074b0fd8eec483d0cef8fdbf0d04b81
> 
> 
> Begin forwarded message:
> On Fri, 2010-09-24 at 09:22 -0700, Florian Mickler wrote:
> > iwl3945's scan_completed calls into the mac80211 stack which triggers a
> > warn on if there is no scan outstanding.
> > 
> > This can be avoided by not calling scan_completed but abort_scan in
> > iwl3945_request_scan  in the done: branch of the function which is used
> > as an error out.
> > 
> > The done: branch seems to be an error-out branch, as, for example, if
> > iwl_is_ready(priv) returns false  the done: branch is executed.
> > 
> > NOTE:
> > I'm not familiar with the driver at all.
> > I just quickly scanned as a reaction to
> > 
> > https://bugzilla.kernel.org/show_bug.cgi?id=17722
> > 
> > the users of scan_completed in the  iwl3945 driver and noted the odd
> > discrepancy between the comment above this instance and the comment in
> > mac80211 scan_completed function.
> > Signed-off-by: Florian Mickler <florian-sVu6HhrpSfRAfugRpC6u6w@public.gmane.org>
> Acked-by: Wey-Yi Guy <wey-yi.w.guy-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> go into wireless-2.6 and stable only, scan fix already in
> wireless-next-2.6

> 
> Thanks
> Wey
> 
> >  drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    2 +-
> >  drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > index 9dd9e64..8fd00a6 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> > @@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
> >  	clear_bit(STATUS_SCAN_HW, &priv->status);
> >  	clear_bit(STATUS_SCANNING, &priv->status);
> >  	/* inform mac80211 scan aborted */
> > -	queue_work(priv->workqueue, &priv->scan_completed);
> > +	queue_work(priv->workqueue, &priv->abort_scan);

Unfortunately this patch is not right thing to do. If you look at
abort_scan work, it do nothing if STATUS_SCAN_ABORTING bit is not set.
That's wrong because we have to complete scan (with abort == true).
If STATUS_SCAN_ABORTING will be set, abort_work will send scan cancel
commands to hardware what is wrong if scan was not started yet.

What we can eventually do, except apply iwl-scan rewrite from
wireless-testing, is something like that:
 
iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)

  clear_bit(STATUS_SCAN_HW, &priv->status); 
  clear_bit(STATUS_SCANNING, &priv->status); 
  /* inform mac80211 scan aborted */ 
  set_bit(STATUS_SCAN_ABORTING, &priv->status);
  queue_work(priv->workqueue, &priv->scan_completed);

ieee80211_scan_completed
  
  if (!internal) {
     bool aborted = test_bit(STATUS_SCAN_ABORTING, &priv->status);
     ieee80211_scan_completed(priv->hw, aborted);

  }

However, I do not think we should go with that to -stable (below
2.6.36). IIRC warnings showed up in current 2.6.36-rc, because of
some other changes in the code.

Stanislaw
--
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] caif: fix two caif_connect() bugs
From: Eric Dumazet @ 2010-10-05  8:42 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Sjur Braendeland

caif_connect() might dereference a netdevice after dev_put() it.

It also doesnt check dev_get_by_index() return value and could
dereference a NULL pointer.

Fix it, using RCU to avoid taking a reference.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Sjur Braendeland <sjur.brandeland@stericsson.com>
---
 net/caif/caif_socket.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 8ce9047..4bf28f2 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -827,6 +827,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
 	long timeo;
 	int err;
 	int ifindex, headroom, tailroom;
+	unsigned int mtu;
 	struct net_device *dev;
 
 	lock_sock(sk);
@@ -896,15 +897,23 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
 		cf_sk->sk.sk_state = CAIF_DISCONNECTED;
 		goto out;
 	}
-	dev = dev_get_by_index(sock_net(sk), ifindex);
+
+	err = -ENODEV;
+	rcu_read_lock();
+	dev = dev_get_by_index_rcu(sock_net(sk), ifindex);
+	if (!dev) {
+		rcu_read_unlock();
+		goto out;
+	}
 	cf_sk->headroom = LL_RESERVED_SPACE_EXTRA(dev, headroom);
+	mtu = dev->mtu;
+	rcu_read_unlock();
+
 	cf_sk->tailroom = tailroom;
-	cf_sk->maxframe = dev->mtu - (headroom + tailroom);
-	dev_put(dev);
+	cf_sk->maxframe = mtu - (headroom + tailroom);
 	if (cf_sk->maxframe < 1) {
-		pr_warning("CAIF: %s(): CAIF Interface MTU too small (%d)\n",
-			__func__, dev->mtu);
-		err = -ENODEV;
+		pr_warning("CAIF: %s(): CAIF Interface MTU too small (%u)\n",
+			   __func__, mtu);
 		goto out;
 	}
 



^ permalink raw reply related

* [PATCH] ppp: Use a real SKB control block in fragmentation engine.
From: David Miller @ 2010-10-05  8:37 UTC (permalink / raw)
  To: netdev


Do this instead of subverting fields in skb proper.

The macros that could very easily match variable or function
names were also just asking for trouble.

Signed-off-by: David S. Miller <davem@davemloft.net>
---

Committed to net-next-2.6

 drivers/net/ppp_generic.c |   46 ++++++++++++++++++++++++--------------------
 1 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 736b917..866e221 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1547,9 +1547,11 @@ ppp_channel_push(struct channel *pch)
  * Receive-side routines.
  */
 
-/* misuse a few fields of the skb for MP reconstruction */
-#define sequence	priority
-#define BEbits		cb[0]
+struct ppp_mp_skb_parm {
+	u32		sequence;
+	u8		BEbits;
+};
+#define PPP_MP_CB(skb)	((struct ppp_mp_skb_parm *)((skb)->cb))
 
 static inline void
 ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
@@ -1878,13 +1880,13 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 		seq = (skb->data[3] << 16) | (skb->data[4] << 8)| skb->data[5];
 		mask = 0xffffff;
 	}
-	skb->BEbits = skb->data[2];
+	PPP_MP_CB(skb)->BEbits = skb->data[2];
 	skb_pull(skb, mphdrlen);	/* pull off PPP and MP headers */
 
 	/*
 	 * Do protocol ID decompression on the first fragment of each packet.
 	 */
-	if ((skb->BEbits & B) && (skb->data[0] & 1))
+	if ((PPP_MP_CB(skb)->BEbits & B) && (skb->data[0] & 1))
 		*skb_push(skb, 1) = 0;
 
 	/*
@@ -1896,7 +1898,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 		seq += mask + 1;
 	else if ((int)(seq - ppp->minseq) > (int)(mask >> 1))
 		seq -= mask + 1;	/* should never happen */
-	skb->sequence = seq;
+	PPP_MP_CB(skb)->sequence = seq;
 	pch->lastseq = seq;
 
 	/*
@@ -1932,8 +1934,8 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 	   before the start of the queue. */
 	if (skb_queue_len(&ppp->mrq) >= PPP_MP_MAX_QLEN) {
 		struct sk_buff *mskb = skb_peek(&ppp->mrq);
-		if (seq_before(ppp->minseq, mskb->sequence))
-			ppp->minseq = mskb->sequence;
+		if (seq_before(ppp->minseq, PPP_MP_CB(mskb)->sequence))
+			ppp->minseq = PPP_MP_CB(mskb)->sequence;
 	}
 
 	/* Pull completed packets off the queue and receive them. */
@@ -1963,12 +1965,12 @@ ppp_mp_insert(struct ppp *ppp, struct sk_buff *skb)
 {
 	struct sk_buff *p;
 	struct sk_buff_head *list = &ppp->mrq;
-	u32 seq = skb->sequence;
+	u32 seq = PPP_MP_CB(skb)->sequence;
 
 	/* N.B. we don't need to lock the list lock because we have the
 	   ppp unit receive-side lock. */
 	skb_queue_walk(list, p) {
-		if (seq_before(seq, p->sequence))
+		if (seq_before(seq, PPP_MP_CB(p)->sequence))
 			break;
 	}
 	__skb_queue_before(list, p, skb);
@@ -1997,22 +1999,22 @@ ppp_mp_reconstruct(struct ppp *ppp)
 	tail = NULL;
 	for (p = head; p != (struct sk_buff *) list; p = next) {
 		next = p->next;
-		if (seq_before(p->sequence, seq)) {
+		if (seq_before(PPP_MP_CB(p)->sequence, seq)) {
 			/* this can't happen, anyway ignore the skb */
 			printk(KERN_ERR "ppp_mp_reconstruct bad seq %u < %u\n",
-			       p->sequence, seq);
+			       PPP_MP_CB(p)->sequence, seq);
 			head = next;
 			continue;
 		}
-		if (p->sequence != seq) {
+		if (PPP_MP_CB(p)->sequence != seq) {
 			/* Fragment `seq' is missing.  If it is after
 			   minseq, it might arrive later, so stop here. */
 			if (seq_after(seq, minseq))
 				break;
 			/* Fragment `seq' is lost, keep going. */
 			lost = 1;
-			seq = seq_before(minseq, p->sequence)?
-				minseq + 1: p->sequence;
+			seq = seq_before(minseq, PPP_MP_CB(p)->sequence)?
+				minseq + 1: PPP_MP_CB(p)->sequence;
 			next = p;
 			continue;
 		}
@@ -2026,7 +2028,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
 		 */
 
 		/* B bit set indicates this fragment starts a packet */
-		if (p->BEbits & B) {
+		if (PPP_MP_CB(p)->BEbits & B) {
 			head = p;
 			lost = 0;
 			len = 0;
@@ -2035,7 +2037,8 @@ ppp_mp_reconstruct(struct ppp *ppp)
 		len += p->len;
 
 		/* Got a complete packet yet? */
-		if (lost == 0 && (p->BEbits & E) && (head->BEbits & B)) {
+		if (lost == 0 && (PPP_MP_CB(p)->BEbits & E) &&
+		    (PPP_MP_CB(head)->BEbits & B)) {
 			if (len > ppp->mrru + 2) {
 				++ppp->dev->stats.rx_length_errors;
 				printk(KERN_DEBUG "PPP: reconstructed packet"
@@ -2061,7 +2064,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
 		 * and we haven't found a complete valid packet yet,
 		 * we can discard up to and including this fragment.
 		 */
-		if (p->BEbits & E)
+		if (PPP_MP_CB(p)->BEbits & E)
 			head = next;
 
 		++seq;
@@ -2071,10 +2074,11 @@ ppp_mp_reconstruct(struct ppp *ppp)
 	if (tail != NULL) {
 		/* If we have discarded any fragments,
 		   signal a receive error. */
-		if (head->sequence != ppp->nextseq) {
+		if (PPP_MP_CB(head)->sequence != ppp->nextseq) {
 			if (ppp->debug & 1)
 				printk(KERN_DEBUG "  missed pkts %u..%u\n",
-				       ppp->nextseq, head->sequence-1);
+				       ppp->nextseq,
+				       PPP_MP_CB(head)->sequence-1);
 			++ppp->dev->stats.rx_dropped;
 			ppp_receive_error(ppp);
 		}
@@ -2083,7 +2087,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
 			/* copy to a single skb */
 			for (p = head; p != tail->next; p = p->next)
 				skb_copy_bits(p, 0, skb_put(skb, p->len), p->len);
-		ppp->nextseq = tail->sequence + 1;
+		ppp->nextseq = PPP_MP_CB(tail)->sequence + 1;
 		head = tail->next;
 	}
 
-- 
1.7.3.1


^ permalink raw reply related

* Re: [PATCH] caif: remove duplicated include
From: David Miller @ 2010-10-05  7:49 UTC (permalink / raw)
  To: sjur.brandeland; +Cc: nikai, netdev, linux-kernel
In-Reply-To: <81C3A93C17462B4BBD7E272753C1057919238FAF3A@EXDCVYMBSTM005.EQ1STM.local>

From: Sjur BRENDELAND <sjur.brandeland@stericsson.com>
Date: Tue, 5 Oct 2010 08:34:13 +0200

> Nicolas Kaiser wrote: 
>> Remove duplicated include.
>> 
>> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
> 
> Looks good, thanks. 
> Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>

Applied.

^ 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