* Re: [PATCH NEXT 0/4]netxen: bug fixes
From: David Miller @ 2010-05-13 6:29 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman
In-Reply-To: <1273657985-13405-1-git-send-email-amit.salecha@qlogic.com>
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Wed, 12 May 2010 02:53:01 -0700
> Series of 4 patches to fix diagnostic tools access and register usage
> for NX3031.
> Please apply them on net-next branch.
All applied, thank you.
^ permalink raw reply
* Re: [PATCH 0/6] ipv6: ip6mr: support multiple independant multicast routing instances
From: David Miller @ 2010-05-13 6:31 UTC (permalink / raw)
To: kaber; +Cc: netdev
In-Reply-To: <1273586551-3521-1-git-send-email-kaber@trash.net>
From: kaber@trash.net
Date: Tue, 11 May 2010 16:02:25 +0200
> The following patches add support for multiple independant IPv6 multicast
> routing instances. This can be useful to seperate traffic when building
> a multicast router that is serving multiple independant networks.
>
> The patchset is pretty much a straight forward port from IPv4 with no
> significant differences.
...
> These patches have been tested using pim6sd and mrd6.
>
> Please apply or pull from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kaber/ipmr-2.6.git master
Pulled, thanks!
^ permalink raw reply
* Re: [net-next-2.6 PATCH 01/12] e1000e: use static params to save stack space (part 2)
From: David Miller @ 2010-05-13 6:31 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan, jesse.brandeburg
In-Reply-To: <20100511005801.30827.50808.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 17:59:10 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> A couple stack cleanups missed in an earlier patch from Jesse.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 02/12] e1000e: bad state after running ethtool diagnostics with AMT enabled
From: David Miller @ 2010-05-13 6:31 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511005929.30827.30176.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 17:59:31 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> When running ethtool online diagnostics with no open interface, there is a
> short period of time where the driver relinquishes control of the adapter
> during which time AMT (manageability firmware) can put the adapter into an
> unknown state resulting in such things as link test failure, hardware hang,
> reporting an incorrect link speed, etc. Resetting the adapter during an
> open() resolves this by putting the adapter into a quiescent state.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 03/12] e1000e: initialize manageability (IPMI) pass-through in 82574/82583
From: David Miller @ 2010-05-13 6:31 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511005949.30827.62576.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 17:59:51 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> 82574/82583 uses different registers/bits to setup manageability filters
> than all other parts supported by e1000e; set them accordingly for IPMI
> pass-through. Rename the function to better reflect what it does.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 04/12] e1000e: s/w initiated LSC MSI-X interrupts not generated; no transmit
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010008.30827.45897.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:00:10 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> In MSI-X mode when an IMPI SoL session was active (i.e. the PHY reset was
> blocked), the LSC interrupt generated by s/w to start the watchdog which
> started the transmitter was not getting fired by the hardware because bit
> 24 (the 'other' cause bit) also needed to be set. Without an active SoL
> session, the PHY was reset which caused the h/w to fire the LSC interrupt.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 05/12] e1000e: cleanup multiple common exit points
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010029.30827.82837.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:00:31 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> ...in e1000_update_nvm_checksum_ich8lan().
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 06/12] e1000e: Remove EN_MAC_ADDR_FILTER check from enable_mng_pass_thru check
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010048.30827.12737.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:00:50 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> Patch addresses issues when manageability passthrough is enabled, but the
> MAC_ADDR_FILTER bit is not set in the MANC register.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 07/12] e1000e: Cleanup e1000_sw_lcd_config_ich8lan()
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010108.30827.47964.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:01:10 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> After every reset all ICH/PCH parts call this function which acquires the
> swflag, performs a workaround on applicable parts and releases the swflag.
> There is no reason for parts for which this workaround is not applicable
> to acquire and release the swflag so the function should just return
> without doing anything for these parts. This also provides for the
> indentation of most of the function contents to be shifted left cleaning up
> the code.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 08/12] e1000e: Incorrect function pointer set for force_speed_duplex on 82577
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010128.30827.12447.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:01:30 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> The force_speed_duplex function pointer was incorrectly set. Instead of
> calling the 82577-specific version it was calling the m88 version which,
> among other incorrect things, reset the PHY causing autonegotiation to be
> re-enabled in the PHY resulting in the link defaulting to half-duplex.
> The 82577-specific force_speed_duplex function also had an issue where
> it disabled Auto-MDI-X which caused the link to not come up.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 09/12] e1000e: fix checks for manageability enabled and management pass-through
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010150.30827.4384.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:01:51 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> The mac->arc_subsystem was being incorrectly used to flag whether or not
> manageability was enabled when it should only be used to state whether the
> ARC (Host interface) subsystem is available on a particular MAC _and_ only
> valid when any manageability is enabled. The ARC subsystem is currently
> only available on 80003es2lan and 82573 parts supported by the driver.
>
> A new flag, has_fwsm, is introduced to be used when checking if
> manageability is enabled but only on parts that acutally have an FWSM
> register. While the above parts have an FWSM register, there are other
> parts that have FWSM but do not have support for the ARC subsystem,
> namely 82571/2 and ICHx/PCH.
>
> And then there are parts that have manageability, but do not have either
> FWSM register or support for the ARC subsystem - these are 82574 and 82583.
>
> For 80003es2lan, 82571/2/3 and ICH/PCH parts, this patch makes no
> functional changes, it only corrects the usage of the manageability flags.
> For 82574 and 82583, it fixes the incorrect accesses of the non-existent
> FWSM register and ARC subsystem as well as corrects the check for
> management pass-through.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 10/12] e1000e: move settting of flow control refresh timer to link setup code
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010210.30827.6899.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:02:12 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> The flow control refresh timer value needs to be saved off so that it can
> be programmed into the approrpiate register when applicable but without a
> reset, e.g. when changing flow control parameters via ethtool.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 11/12] e1000e: Fix/cleanup PHY reset code for ICHx/PCHx
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010230.30827.69868.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:02:32 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> i) Fixes a bug where e1000_sw_lcd_config_ich8lan() was calling
> e1000_lan_init_done_ich8lan() to poll the STATUS.LAN_INIT_DONE bit to
> make sure the MAC had completed the PHY configuration. However,
> e1000_lan_init_done_ich8lan() had already been called in one of the two
> places where PHY reset occurs for ICHx/PCHx parts, which caused the second
> call to busy-wait for 150 msec because the LAN_INIT_DONE bit had already
> been checked and cleared.
>
> ii) Cleanup the two separate PHY reset code paths, i.e. the full-chip reset
> in e1000_reset_hw_ich8lan() and the PHY-only reset in
> e1000_phy_hw_reset_ich8lan(). There was duplicate code in both paths to be
> performed post-reset that are now combined into one new function -
> e1000_post_phy_reset_ich8lan(). This cleanup also included moving the
> clearing of the PHY Reset Asserted bit in the STATUS register (now done for
> all ICH/PCH parts) and the check for the indication from h/w that basic
> configuration has completed back to where it previously was in
> e1000_get_cfg_done_ich8lan().
>
> iii) Corrected a few comments
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 12/12] e1000e: add PCI device id to enable support for 82567V-4
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bruce.w.allan
In-Reply-To: <20100511010250.30827.86831.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 10 May 2010 18:02:52 -0700
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1273543089-10938-1-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:07 -0700
> HW VLAN extraction needs to be configured through FW to work correctly in
> virtualization environments. Remove the direct register manipulation and
> rely on FW.
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 2/3] cxgb4: report the PCIe link speed
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1273543089-10938-2-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:08 -0700
> Report the PCIe link speed (2.5 or 5 Gbps).
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1273543089-10938-3-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:09 -0700
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH v3 0/4] xfrm: add x86 CONFIG_COMPAT support
From: David Miller @ 2010-05-13 6:41 UTC (permalink / raw)
To: fw; +Cc: netdev, johannes
In-Reply-To: <1270506431-25578-1-git-send-email-fw@strlen.de>
I'm officially deferring this patch set for now, sorry.
I can't see applying this if it will fix only some subset of
known applications. We need buy-in on the read/write vfs ops
override so we can do this properly.
Thanks for all of your efforts Florian.
^ permalink raw reply
* Re: [PATCH] rndis_host: Poll status channel before control channel
From: David Miller @ 2010-05-13 6:42 UTC (permalink / raw)
To: ben; +Cc: dbrownell, john.carr, netdev, vzeeaxwl, herton
In-Reply-To: <1271718508.2197.12.camel@localhost>
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 20 Apr 2010 00:08:28 +0100
> Some RNDIS devices don't respond on the control channel until polled
> on the status channel. In particular, this was reported to be the
> case for the 2Wire HomePortal 1000SW.
>
> This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
> which is reported to be needed for use with some Windows Mobile devices
> and which is currently applied by Mandriva.
>
> Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> ---
> Note that this change hasn't yet been tested with any other RNDIS
> devices. John, can you confirm whether this also handles the WinMob
> devices?
Still waiting for this to get tested. Is there really nobody in the
world with RNDIS devices who can test this patch? If so, maybe that's
a good reason to not apply it :-))))
^ permalink raw reply
* Re: [PATCH] skge: use the DMA state API instead of the pci equivalents
From: David Miller @ 2010-05-13 6:43 UTC (permalink / raw)
To: fujita.tomonori; +Cc: netdev, shemminger
In-Reply-To: <20100428095730K.fujita.tomonori@lab.ntt.co.jp>
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Wed, 28 Apr 2010 09:57:04 +0900
> This replace the PCI DMA state API (include/linux/pci-dma.h) with the
> DMA equivalents since the PCI DMA state API will be obsolete.
>
> No functional change.
>
> For further information about the background:
>
> http://marc.info/?l=linux-netdev&m=127037540020276&w=2
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Stephen, ping? How did the testing go?
^ permalink raw reply
* [PATCH 1/3] net: init_vlan should not copy slave or master flags
From: John Fastabend @ 2010-05-13 7:31 UTC (permalink / raw)
To: andy, fubar, nhorman, bonding-devel, netdev; +Cc: john.r.fastabend
The vlan device should not copy the slave or master flags from
the real device. It is not in the bond until added nor is it
a master.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/8021q/vlan_dev.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index b5249c5..c13d8a3 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -708,7 +708,8 @@ static int vlan_dev_init(struct net_device *dev)
netif_carrier_off(dev);
/* IFF_BROADCAST|IFF_MULTICAST; ??? */
- dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI);
+ dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
+ IFF_MASTER | IFF_SLAVE);
dev->iflink = real_dev->ifindex;
dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
(1<<__LINK_STATE_DORMANT))) |
^ permalink raw reply related
* [PATCH 2/3] net: fix conflict between null_or_orig and null_or_bond
From: John Fastabend @ 2010-05-13 7:31 UTC (permalink / raw)
To: andy, fubar, nhorman, bonding-devel, netdev; +Cc: john.r.fastabend
In-Reply-To: <20100513073106.3528.45412.stgit@jf-dev2-dcblab>
If a skb is received on an inactive bond that does not meet
the special cases checked for by skb_bond_should_drop it should
only be delivered to exact matches as the comment in
netif_receive_skb() says.
However because null_or_bond could also be null this is not
always true. This patch renames null_or_bond to orig_or_bond
and initializes it to orig_dev. This keeps the intent of
null_or_bond to pass frames received on VLAN interfaces stacked
on bonding interfaces without invalidating the statement for
null_or_orig.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/core/dev.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 32611c8..3dc691d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2784,7 +2784,7 @@ static int __netif_receive_skb(struct sk_buff *skb)
struct net_device *orig_dev;
struct net_device *master;
struct net_device *null_or_orig;
- struct net_device *null_or_bond;
+ struct net_device *orig_or_bond;
int ret = NET_RX_DROP;
__be16 type;
@@ -2857,10 +2857,10 @@ ncls:
* device that may have registered for a specific ptype. The
* handler may have to adjust skb->dev and orig_dev.
*/
- null_or_bond = NULL;
+ orig_or_bond = orig_dev;
if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) &&
(vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) {
- null_or_bond = vlan_dev_real_dev(skb->dev);
+ orig_or_bond = vlan_dev_real_dev(skb->dev);
}
type = skb->protocol;
@@ -2868,7 +2868,7 @@ ncls:
&ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) {
if (ptype->type == type && (ptype->dev == null_or_orig ||
ptype->dev == skb->dev || ptype->dev == orig_dev ||
- ptype->dev == null_or_bond)) {
+ ptype->dev == orig_or_bond)) {
if (pt_prev)
ret = deliver_skb(skb, pt_prev, orig_dev);
pt_prev = ptype;
^ permalink raw reply related
* [PATCH 3/3] net: deliver skbs on inactive slaves to exact matches
From: John Fastabend @ 2010-05-13 7:31 UTC (permalink / raw)
To: andy, fubar, nhorman, bonding-devel, netdev; +Cc: john.r.fastabend
In-Reply-To: <20100513073106.3528.45412.stgit@jf-dev2-dcblab>
Currently, the accelerated receive path for VLAN's will
drop packets if the real device is an inactive slave and
is not one of the special pkts tested for in
skb_bond_should_drop(). This behavior is different then
the non-accelerated path and for pkts over a bonded vlan.
For example,
vlanx -> bond0 -> ethx
will be dropped in the vlan path and not delivered to any
packet handlers at all. However,
bond0 -> vlanx -> ethx
and
bond0 -> ethx
will be delivered to handlers that match the exact dev,
because the VLAN path checks the real_dev which is not a
slave and netif_recv_skb() doesn't drop frames but only
delivers them to exact matches.
This patch adds a sk_buff flag which is used for tagging
skbs that would previously been dropped and allows the
skb to continue to skb_netif_recv(). Here we add
logic to check for the bond_should_drop flag and if it
is set only deliver to handlers that match exactly. This
makes both paths above consistent and gives pkt handlers
a way to identify skbs that come from inactive slaves.
Without this patch in some configurations skbs will be
delivered to handlers with exact matches and in others
be dropped out right in the vlan path.
I have tested the following 4 configurations in failover modes
and load balancing modes.
# bond0 -> ethx
# vlanx -> bond0 -> ethx
# bond0 -> vlanx -> ethx
# bond0 -> ethx
|
vlanx -> --
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
include/linux/skbuff.h | 8 +++++++-
net/8021q/vlan_core.c | 8 ++++++--
net/core/dev.c | 23 +++++++++++++++++++----
3 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c9525bc..5ba4fd5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -379,8 +379,14 @@ struct sk_buff {
kmemcheck_bitfield_begin(flags2);
__u16 queue_mapping:16;
-#ifdef CONFIG_IPV6_NDISC_NODETYPE
+#if defined(CONFIG_IPV6_NDISC_NODETYPE) && \
+ (defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE))
+ __u8 ndisc_nodetype:2,
+ bond_should_drop:1;
+#elif defined(CONFIG_IPV6_NDISC_NODETYPE)
__u8 ndisc_nodetype:2;
+#elif defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE)
+ __u8 bond_should_drop:1;
#endif
kmemcheck_bitfield_end(flags2);
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index c584a0a..57ac2d3 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -11,8 +11,10 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
if (netpoll_rx(skb))
return NET_RX_DROP;
+#if defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE)
if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
- goto drop;
+ skb->bond_should_drop = 1;
+#endif
skb->skb_iif = skb->dev->ifindex;
__vlan_hwaccel_put_tag(skb, vlan_tci);
@@ -83,8 +85,10 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
{
struct sk_buff *p;
+#if defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE)
if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
- goto drop;
+ skb->bond_should_drop = 1;
+#endif
skb->skb_iif = skb->dev->ifindex;
__vlan_hwaccel_put_tag(skb, vlan_tci);
diff --git a/net/core/dev.c b/net/core/dev.c
index 3dc691d..92fdff4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2782,11 +2782,13 @@ static int __netif_receive_skb(struct sk_buff *skb)
{
struct packet_type *ptype, *pt_prev;
struct net_device *orig_dev;
- struct net_device *master;
struct net_device *null_or_orig;
struct net_device *orig_or_bond;
int ret = NET_RX_DROP;
__be16 type;
+#if defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE)
+ struct net_device *master;
+#endif
if (!skb->tstamp.tv64)
net_timestamp(skb);
@@ -2801,15 +2803,28 @@ static int __netif_receive_skb(struct sk_buff *skb)
if (!skb->skb_iif)
skb->skb_iif = skb->dev->ifindex;
+ /*
+ * bonding note: skbs received on inactive slaves should only
+ * be delivered to pkt handlers that are exact matches. Also
+ * the bond_should_drop flag will be set. If packet handlers
+ * are sensitive to duplicate packets these skbs will need to
+ * be dropped at the handler. The vlan accel path may have
+ * already set the bond_should_drop flag.
+ */
null_or_orig = NULL;
orig_dev = skb->dev;
+#if defined(CONFIG_BONDING) || defined(CONFIG_BONDING_MODULE)
master = ACCESS_ONCE(orig_dev->master);
- if (master) {
- if (skb_bond_should_drop(skb, master))
+ if (skb->bond_should_drop)
+ null_or_orig = orig_dev;
+ else if (master) {
+ if (skb_bond_should_drop(skb, master)) {
+ skb->bond_should_drop = 1;
null_or_orig = orig_dev; /* deliver only exact match */
- else
+ } else
skb->dev = master;
}
+#endif
__get_cpu_var(softnet_data).processed++;
^ permalink raw reply related
* Re: [PATCH net-next-2.6 2/2] bonding: allow user-controlled output slave selection
From: John Fastabend @ 2010-05-13 7:32 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: Jay Vosburgh, Neil Horman, netdev@vger.kernel.org
In-Reply-To: <20100512221408.GI7497@gospo.rdu.redhat.com>
Andy Gospodarek wrote:
> On Wed, May 12, 2010 at 12:41:54PM -0700, Jay Vosburgh wrote:
>> Neil Horman <nhorman@tuxdriver.com> wrote:
>>
>>> On Tue, May 11, 2010 at 01:09:39PM -0700, Jay Vosburgh wrote:
>>>> Andy Gospodarek <andy@greyhouse.net> wrote:
>>>>
>>>>> This patch give the user the ability to control the output slave for
>>>>> round-robin and active-backup bonding. Similar functionality was
>>>>> discussed in the past, but Jay Vosburgh indicated he would rather see a
>>>>> feature like this added to existing modes rather than creating a
>>>>> completely new mode. Jay's thoughts as well as Neil's input surrounding
>>>>> some of the issues with the first implementation pushed us toward a
>>>>> design that relied on the queue_mapping rather than skb marks.
>>>>> Round-robin and active-backup modes were chosen as the first users of
>>>>> this slave selection as they seemed like the most logical choices when
>>>>> considering a multi-switch environment.
>>>>>
>>>>> Round-robin mode works without any modification, but active-backup does
>>>>> require inclusion of the first patch in this series and setting
>>>>> the 'keep_all' flag. This will allow reception of unicast traffic on
>>>>> any of the backup interfaces.
>>>> Yes, I did think that the mark business fit better into existing
>>>> modes (I thought of it as kind of a new hash for xor and 802.3ad modes).
>>>> I also didn't expect to see so much new stuff (this, as well as the FCOE
>>>> special cases being discussed elsewhere) being shoehorned into the
>>>> active-backup mode. I'm not so sure that adding so many special cases
>>>> to active-backup is a good thing.
>>>>
>>>> Now, I'm starting to wonder if you were right, and it would be
>>>> better overall to have a "manual" mode that would hopefully satisfy this
>>>> case as well as the FCOE special case. I don't think either of these is
>>>> a bad use case, I'm just not sure the right way to handle them is
>>>> another special knob in active-backup mode (either directly, or
>>>> implicitly in __netif_receive_skb), which wasn't what I expected to see.
>>>>
>>> I honestly don't think a separate mode is warranted here. While I'm not opposed
>>> to adding a new mode, I really think doing so is no different from overloading
>>> an existing mode. I say that because to add a new mode in which we explicitly
>>> expect traffic to be directed to various slaves requires that we implement a
>>> policy for frames which have no queue mapping determined on egress. Any policy
>>> I can think of is really an approximation of an existing policy, so we may as
>>> well reuse the policy code that we already have in place. About the only way a
>>> separate mode makes sense is in the 'passthrough' queue mode you document below.
>>> In this model, in which queue ids map to slaves in a 1:1 fashion it doesn't make
>>> senes.
>> One goal I'm hoping to achieve is something that would satisfy
>> both the queue map stuff that you're looking for, and would meet the
>> needs of the FCOE people who also want to disable the duplicate
>> suppression (i.e., permit incoming traffic on the inactive slave) for a
>> different special case.
>>
>> The FCOE proposal revolves around, essentially, active-backup
>> mode, but permitting incoming traffic on the inactive slave. At the
>> moment, the patches attempt to special case things such that only
>> dev_add_pack listeners directly bound to the inactive slave are checked
>> (to permit the FCOE traffic to pass on the inactive slave, but still
>> dropping IP, as ip_rcv is a wildcard bind).
>>
>> Your keep_all patch is, by and large, the same thing, except
>> that it permits anything to come in on the "inactive" slave, and it's a
>> switch that has to be turned on.
>>
>> This seems like needless duplication to me; I'd prefer to see a
>> single solution that handles both cases instead of two special cases
>> that each do 90% of what the other does.
>>
>> As far as a new mode goes, one major reason I think a separate
>> mode is warranted is the semantics: with either of these changes (to
>> permit more or less regular use of the "inactive" slaves), the mode
>> isn't really an "active-backup" mode any longer; there is no "inactive"
>> or "backup" slave. I think of this as being a major change of
>> functionality, not simply a minor option.
>>
>> Hence my thought that "active-backup" could stay as a "true" hot
>> standby mode (backup slaves are just that: for backup, only), and this
>> new mode would be the place to do the special queue-map / FCOE /
>> whatever that isn't really a hot standby configuration any longer.
>>
>> As far as the behavior of the new mode (your concern about its
>> policy map approximations), in the end, it would probably act pretty
>> much like active-backup with your patch applied: traffic goes out the
>> active slave, unless directed otherwise. It's a lot less complicated
>> than I had feared.
>>
>
> It's beginning to sound like the 'FCoE use-case' and the one Neil and I
> are proposing are quite similar. The main goal of both is to have the
> option to have multiple slaves send and receive traffic during the
> steady-state, but in the event of a failover all traffic would run on a
> single interface.
>
I believe they are similar although I never considered using FCoE over a
device that is actually in the bond. For example the current FCoE use
case is,
bond0 ------> ethx
|
vlan-fcoe --> |
Here vlan-fcoe is not a slave of bond0. With the keep_all patch this
would work plus an additional configuration,
bond0 --> vlan-fcoe1 ---> ethx
\ |
\ --- vlan-fcoe2 ---> |
Here both vlan-fcoe1 and vlan-fcoe2 are slaves of bond0.
Even with the keep_all patch it still seems a little inconsistent to
drop a packet outright if it is received on an inactive slave and
destined for a vlan on the bond and then to deliver the packet to
devices that have exact matches if it is received on an inactive slave
but destined for the bond device. I'll post a patch in just a moment
that hopefully illustrates what I see as an unexpected side effect.
> The implementation proposed with this patch is a bit different that the
> 'mark-mode' patch you may recall I posted a few months ago. It created
> a new mode that essentially did exactly what you are describing --
> transmit on the primary interface unless pushed to another interface via
> info in the skb and receive on all interfaces. We initially did not
> create a new mode based on your reservations about the previous
> mark-mode patch and went the direction of enhancing one or two modes
> initially (figuring it would be good to run before walking), with the
> idea that other modes could take care of this output slave selection
> logic in the future.
>
>
>>>> I presume you're overloading active-backup because it's not
>>>> etherchannel, 802.3ad, etc, and just talks right to the switch. For the
>>>> regular load balance modes, I still think overlay into the existing
>>>> modes is preferable (more on that later); I'm thinking of "manual"
>>>> instead of another tweak to active-backup.
>>>>
>>>> If users want to have actual hot-standby functionality, then
>>>> active-backup would do that, and nothing else (and it can be multi-queue
>>>> aware, but only one slave active at a time).
>>>>
>>> Yes, but active backup doesn't provide prefered output path selection in and of
>>> itself. Thats the feature here.
>> I understand that; I'm suggesting that active-backup should
>> provide no service other than hot standby, and not be overloaded into a
>> manual load balancing scheme (both for your use, and for FCOE).
>>
>> Maybe I'm worrying too much about defending the purity of the
>> active-backup mode; I understand what you're trying to do a little
>> better now, and yes, the "manual" mode I think of (in your queue mapping
>> scheme, not the other doodads I talked about) would basically be
>> active-backup with your queue mapper, minus the duplicate suppressor.
>>
>
> It doesn't matter terribly to me which direction is taken. Again, a
> major reason this route was proposed was that you were not as keen on
> creating a new mode as I was at the time of that patch posting. It's
> somewhat understandable as once a mode is added it's tough to take away,
> but when one sees how much we are really changing the way active-backup
> might behave in some cases maybe it makes sense to use a new mode?
>
> I guess I like the idea of adding this output selection to existing
> modes because it at least gives us the option to use queue maps to
> select output interfaces for more than a mode that looks like
> present-day active-backup minus the duplicate suppression. I'm happy to
> code-up a patch that creates a new mode, but before I go do that and
> test it, I'd like to know we have come to an agreement on the direction
> for the future.
>
>>>> Users who want the set of bonded slaves to look like a big
>>>> multiqueue buffet could use this "manual" mode and set things up however
>>>> they want. One way to set it up is simply that the bond is N queues
>>>> wide, where N is the total of the queue counts of all the slaves. If a
>>>> slave fails, N gets smaller, and the user code has to deal with that.
>>>> Since the queue count of a device can't change dynamically, the bond
>>>> would have to actually be set up with some big number of queues, and
>>>> then only a subset is actually active (or there is some sort of wrap).
>>>>
>>>> In such an implementation, each slave would have a range of
>>>> queue IDs, not necessarily just one. I'm a bit leery of exposing an API
>>>> where each slave is one queue ID, as it could make transitioning to real
>>>> multi-queue awareness difficult.
>>>>
>>> I'm sorry, what exactly do you mean when you say 'real' multi queue
>>> awareness? How is this any less real than any other implementation? The
>>> approach you outline above isn't any more or less valid than this one.
>> That was my misunderstanding of how you planned to handle
>> things. I had thought this patch was simply a scheme to use the queue
>> IDs for slave selection, without any method to further perform queue
>> selection on the slave itself (I hadn't thought of placing a tc action
>> on the slave itself, which you described later on). I had been thinking
>> in terms of schemes to expose all of the slave queues on the bonding
>> device.
>
> It wasn't our original intention either. I didn't mention it in my
> original post as it wasn't really the intent of our patch, but a nice
> side-effect for the informed user. :) Obviously a bit more testing could
> take place and we could add more examples to the documentation for the
> nice side-effect feature of this patch, but since this wasn't our
> original intent and we didn't test it, we did not advertise it.
>
>> So, I don't see any issues with the queue mapping part. I still
>> want to find a common solution for FCOE / your patch with regards to the
>> duplicate suppressor.
>
> Understood.
>
>>> While we're on the subject, Andy and I did discuss a model simmilar to what you
>>> describe above (what I'll refer to as a queue id passthrough model), in which
>>> you can tell the bonding driver to map a frame to a queue, and the bonding
>>> driver doesn't really do anything with the queue id other than pass to the slave
>>> device for hardware based multiqueue tx handling. While we could do that, its
>>> my feeling such a model isn't the way to go for two primary reasons:
>>>
>>> 1) Inconsistent behavior. Such an implementation makes assumptions regarding
>>> queue id specification within a driver. For example, What if one of the slaves
>>> reserves some fixed number of low order queues for a sepecific purpose, and as
>>> such general use queues begin an at offset from zero, while other slaves do not.
>>> While its easy to accomidate such needs when writing the tc filters, if a slave
>>> fails over, such a bias would change output traffic behavior, as the bonding
>>> driver can't be clearly informed of such a bias. Likewise, what if a slave
>>> driver allocates more queues than it actually supports in hardware (like the
>>> implementation you propose, ixgbe IIRC actually does this). If slaves handled
>>> unimplemented tx queues different (if one wrapped queues, while the other simply
>>> dropped frames to unimplemented queues for instance). A failover would change
>>> traffic patterns dramatically.
>>>
>>> 2) Need. While (1) can pretty easily be managed with a few configuration
>>> guidelines (output queues on slaves have to be configured identically, lets
>>> chaos and madness befall you, etc), theres really no reason to bind users to
>>> such a system. We're using tc filters to set the queue id on skbs enqueued to
>>> the bonding driver, theres absolutely no reason you can add addition filters to
>>> the slaves directly. Since the bonding driver uses dev_queue_xmit to send a
>>> frame to a slave, it has the opportunity to pass through another set of queuing
>>> diciplines and filters that can reset and re-assign the skbs queue mapping. So
>>> with the approach in this patch you can get both direct output control without
>>> sacrificing actual hardware tx output queue control. With a passthrough model,
>>> you save a bit of filter configuration, but at the expense of having to be much
>>> more careful about how you configure your slave nics, and detecting such errors
>>> in configuration would be rather difficult to track down, as it would require
>>> the generation of traffic that hit the right filter after a failover.
>> I don't disagree with any of this. One thought I do have is
>> that Eric Dumazet, I believe, has mentioned that the read lock in
>> bonding is a limiting factor on 10G performance. In the far distant
>> future when bonding is RCU, going through the lock(s) on the tc actions
>> of the slave could have the same net effect, and in such a case, a
>> qdisc-less path may be of benefit. Not a concern for today, I suspect.
>>
>>>> There might also be a way to tie it in to the new RPS code on
>>>> the receive side.
>>>>
>>>> If the slaves all have the same MAC and attach to a single
>>>> switch via etherchannel, then it all looks pretty much like a single big
>>>> honkin' multiqueue device. The switch probably won't map the flows back
>>>> the same way, though.
>>>>
>>> I agree, they probably wont. Receive side handling wasn't really our focus here
>>> though. Thats largely why we chose round robin and active backup as our first
>>> modes to use this with. They are already written to expect frames on either
>>> interface.
>>>
>>>> If the slaves are on discrete switches (without etherchannel),
>>>> things become more complicated. If the slaves have the same MAC, then
>>>> the switches will be irritated about seeing that same MAC coming in from
>>>> multiple places. If the slaves have different MACs, then ARP has the
>>>> same sort of issues.
>>>>
>>>> In thinking about it, if it's linux bonding at both ends, there
>>>> could be any number of discrete switches in the path, and it wouldn't
>>>> matter as long as the linux end can work things out, e.g.,
>>>>
>>>> -- switch 1 --
>>>> hostA / \ hostB
>>>> bond ---- switch 2 ---- bond
>>>> \ /
>>>> -- switch 3 --
>>>>
>>>> For something like this, the switches would never share MAC
>>>> information for the bonding slaves. The issue here then becomes more of
>>>> detecting link failures (it would require either a "trunk failover" type
>>>> of function on the switch, or some kind of active probe between the
>>>> bonds).
>>>>
>>>> Now, I realize that I'm babbling a bit, as from reading your
>>>> description, this isn't necessarily your target topology (which sounded
>>>> more like a case of slave A can reach only network X, and slave B can
>>>> reach anywhere, so sending to network X should use slave A
>>>> preferentially), or, as long as I'm doing ASCII-art,
>>>>
>>>> --- switch 1 ---- network X
>>>> hostA / /
>>>> bond ---- switch 2 -+-- anywhere
>>>>
>>>> Is that an accurate representation? Or is it something a bit
>>>> different, e.g.,
>>>>
>>>> --- switch 1 ---- network X -\
>>>> hostA / /
>>>> bond ---- switch 2 ---- anywhere --
>>>>
>>>> I.e., the "anywhere" connects back to network X from the
>>>> outside, so to speak. Or, oh, maybe I'm missing it entirely, and you're
>>>> thinking of something like this:
>>>>
>>>> --- switch 1 --- VPN --- web site
>>>> hostA / /
>>>> bond ---- switch 2 - Internet -/
>>>>
>>>> Where you prefer to hit "web site" via the VPN (perhaps it's a
>>>> more efficient or secure path), but can do it from the public network at
>>>> large if necessary.
>>>>
>>> Yes, this one. I think the other models are equally interesting, but this model
>>> in which either path had universal reachabilty, but for some classes of traffic
>>> one path is preferred over the other is the one we had in mind.
>>>
>>>> Now, regardless of the above, your first patch ("keep_all") is
>>>> to deal with the reverse problem, if this is a piggyback on top of
>>>> active-backup mode: how to get packets back, when both channels can be
>>>> active simultaneously. That actually dovetails to a degree with work
>>>> I've been doing lately, but the solution there probably isn't what
>>>> you're looking for (there's a user space daemon to do path finding, and
>>>> the "bond IP" address is piggybacked on the slaves' MAC addresses, which
>>>> are not changed; the "bond IP" set exists in a separate subnet all its
>>>> own).
>>>>
>>>> As I said, I'm not convinced that the "keep_all" option to
>>>> active-backup is really better than just a "manual" mode that lacks the
>>>> dup suppression and expects the user to set everything up.
>>>>
>>>> As for the round-robin change in this patch, if I'm reading it
>>>> right, then the way it works is that the packets are round-robined,
>>>> unless there's a queue id passed in, in which case it's assigned to the
>>>> slave mapped to that queue id. I'm not entirely sure why you picked
>>>> round-robin mode for that over balance-xor; it doesn't seem to fit well
>>>> with the description in the documentation. Or is it just sort of a
>>>> demonstrator?
>>>>
>>> It was selected because round robin allows transmits on any interface already,
>>> and expects frames on any interface, so it was a 'safe' choice. I would think
>>> balance-xor would also work. Ideally it would be nice to get more modes
>>> supporting this mechanism.
>> I think that this should work for balance-xor and 802.3ad. The
>> only limitation for 802.3ad is that the spec requires "conversations" to
>> not be striped or to skip around in a manner that could lead to out of
>> order delivery.
>
> Agreed. Checking would probably also have to be done to make sure that
> we were not trasmitting on an inactive aggregator.
>
>> I'm not so sure about the alb/tlb modes; at first thought, I
>> think it could have conflicts with the internal balancing done within
>> the modes (if, e.g., the tc action put traffic for the same destination
>> on two slaves).
>>
>
> TLB and ALB modes would certainly have to be done differently. It
> should not be terribly difficult to move from the existing hashing
> that's done to one that relies on the queue_mapping, but it will take a
> bit to make sure it's not a complete hack.
>
> We decided against doing that for all modes on the first pass as it
> seemed like the active-backup and round-robin were the most-likely
> users. We also wanted present the code early rather that spending time
> supporting this on every-mode to find out that it just wasn't rational
> to do it on some of them.
>
>>>> I do like one other aspect of the patch, and that's the concept
>>>> of overlaying the queue map on top of the balance algorithm. So, e.g.,
>>>> balance-xor would do its usual thing, unless the packet is queue mapped,
>>>> in which case the packet's assignment is obeyed. The balance-xor could
>>>> even optionally do its xor across the full set of all slaves output
>>>> queues instead of just across the slaves. Round-robin can operate
>>>> similarly. For those modes, a "balance by queue vs. balance by slave"
>>>> seems like a reasonable knob to have.
>>> Not sure what you mean here. In the model implemented by this patch, there is
>>> one output queue per slave, and as such, balance by queue == balance by slave.
>>> That would make sense in the model you describe earlier in this note, but not in
>>> the model presented by this patch.
>> Yes, I was thinking about what I had described; again,
>> predicated on my misunderstanding of how it all worked.
>>
>>>> I do understand that you're proposing something relatively
>>>> simple, and I'm thinking out loud about alternate or additional
>>>> implementation details. Some of this is "ooh ahh what if", but we also
>>>> don't want to end up with something that's forwards incompatible, and
>>>> I'm hoping to find one solution to multiple problems.
>>>>
>>> For clarification, can you ennumerate what other problems you are trying to
>>> solve with this feature, or features simmilar to this? From this email, the one
>>> that I most clearly see is the desire to allow a passthrough mode of queue
>>> selection, which I think I've noted can be done already (even without this
>>> patch), by attaching additional tc filters to the slaves output queues directly.
>>> What else do you have in mind?
>> As I said above, I hadn't thought of stacking tc actions on to
>> the slaves directly, so I was thinking on ways to expose the slave
>> queues.
>>
>> I still find something intriguing about a round-robin or xor
>> mode that robins/xors through all of the slave queues, though, but that
>> should be something separate (I'm not sure if such a scheme is actually
>> "better", either).
>>
>> -J
It would be best if there was a solution for the FCoE use case that
works with the current bonding modes including 802.3ad. There is switch
support to run mpio FCoE while doing link aggregation on the LAN side
that we should support. I'm not sure the keep_all patch would be good
in this case Jay I think you mentioned this at some point, but I missed
the conclusion? Although maybe it would be OK I'll think about it some
more tomorrow.
Thanks,
John
>>
>> ---
>> -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" 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: [ath5k-devel] [PATCH] [ath5k][leds] Ability to disable leds support. If leds support enabled do not force mac802.11 leds layer selection.
From: Dmytro Milinevskyy @ 2010-05-13 7:36 UTC (permalink / raw)
To: Pavel Roskin
Cc: ath5k-devel, Kalle Valo, linux-wireless, GeunSik Lim, Jiri Slaby,
Greg Kroah-Hartman, John W. Linville, Keng-Yu Lin, netdev,
Jiri Kosina, Johannes Berg, Shahar Or, linux-kernel,
Luca Verdesca
In-Reply-To: <1273679336.10823.15.camel@mj>
Hello, Pavel.
I will rework the patch considering your suggestions.
> I'm not sure this complexity is needed. Are you going to support LEDs
> if CONFIG_LEDS_CLASS is disabled?
If there's any other place in driver that might want use LEDs w/o
exporting the interface to the userspace.
-- Dima Milinevskyy
On Wed, May 12, 2010 at 6:48 PM, Pavel Roskin <proski@gnu.org> wrote:
> On Wed, 2010-04-07 at 21:58 +0300, Dmytro Milinevskyy wrote:
>
>> Here is the patch to disable ath5k leds support on build stage.
>> However if the leds support was enabled do not force selection of 802.11 leds layer.
>
> The idea is good, but the implementation could be improved.
>
> There are too many preprocessor conditionals in your patch.
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> /*
>> * These match net80211 definitions (not used in
>> * mac80211).
>> @@ -939,11 +940,7 @@ enum ath5k_power_mode {
>> #define AR5K_LED_AUTH 2 /*IEEE80211_S_AUTH*/
>> #define AR5K_LED_ASSOC 3 /*IEEE80211_S_ASSOC*/
>> #define AR5K_LED_RUN 4 /*IEEE80211_S_RUN*/
>
> It should be OK to leave the constants defined even if they are not
> used.
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> /* LED functions */
>> extern int ath5k_init_leds(struct ath5k_softc *sc);
>> extern void ath5k_led_enable(struct ath5k_softc *sc);
>> extern void ath5k_led_off(struct ath5k_softc *sc);
>> extern void ath5k_unregister_leds(struct ath5k_softc *sc);
>> +#endif
>
> You could add inline functions for the case when CONFIG_ATH5K_LEDS is
> not defined. That would avoid may conditionals in the code.
>
>> /* GPIO Functions */
>> +#ifdef CONFIG_ATH5K_LEDS
>> extern void ath5k_hw_set_ledstate(struct ath5k_hw *ah, unsigned int state);
>> +#endif
>
> The same comment applies.
>
> Also, there is nothing wrong with having an external declaration that is
> not used in some particular configuration.
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> /* turn on HW LEDs */
>> ath5k_hw_set_ledstate(ah, AR5K_LED_INIT);
>> +#endif
>
> This is avoidable by having an inline ath5k_hw_set_ledstate() that does
> nothing.
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev));
>> struct ath5k_softc *sc = hw->priv;
>>
>> ath5k_led_off(sc);
>> +#endif
>
> Even this is avoidable if ath5k_led_off() does nothing. gcc should be
> smart enough to optimize out unneeded function calls.
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> /*
>> * State for LED triggers
>> */
>> struct ath5k_led
>> {
>> +#ifdef CONFIG_LEDS_CLASS
>
> I'm not sure this complexity is needed. Are you going to support LEDs
> if CONFIG_LEDS_CLASS is disabled?
>
>> +#ifdef CONFIG_ATH5K_LEDS
>> unsigned int led_pin, /* GPIO pin for driving LED */
>> led_on; /* pin setting for LED on */
>> +#endif
>>
>> struct tasklet_struct restq; /* reset tasklet */
>>
>> @@ -164,7 +172,9 @@ struct ath5k_softc {
>> spinlock_t rxbuflock;
>> u32 *rxlink; /* link ptr in last RX desc */
>> struct tasklet_struct rxtq; /* rx intr tasklet */
>> +#ifdef CONFIG_ATH5K_LEDS
>> struct ath5k_led rx_led; /* rx led */
>> +#endif
>
> You may want to group those fields together to make the code more
> readable.
>
>> --- a/drivers/net/wireless/ath/ath5k/led.c
>> +++ b/drivers/net/wireless/ath/ath5k/led.c
>
> I wonder if you could omit led.c completely in the Makefile. If there
> are some parts of led.c that are needed without CONFIG_ATH5K_LEDS, maybe
> they belong elsewhere?
>
> --
> Regards,
> Pavel Roskin
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox