* Re: [PATCH -next] bridge: fix build for CONFIG_SYSFS disabled
From: Stephen Hemminger @ 2010-05-17 17:56 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Stephen Rothwell, linux-next, LKML, netdev, davem
In-Reply-To: <20100517091756.e232bdc2.randy.dunlap@oracle.com>
On Mon, 17 May 2010 09:17:56 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Fix build when CONFIG_SYSFS is not enabled:
>
> net/bridge/br_if.c:136: error: 'struct net_bridge_port' has no member named 'sysfs_name'
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> net/bridge/br_if.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- linux-next-20100517.orig/net/bridge/br_if.c
> +++ linux-next-20100517/net/bridge/br_if.c
> @@ -133,7 +133,9 @@ static void del_nbp(struct net_bridge_po
> struct net_bridge *br = p->br;
> struct net_device *dev = p->dev;
>
> +#ifdef CONFIG_SYSFS
> sysfs_remove_link(br->ifobj, p->sysfs_name);
> +#endif
>
> dev_set_promiscuity(dev, -1);
>
I don't like peppering code with #ifdef like this.
Turns out that in this place sysfs_name is always the same
as the device name so instead:
--- a/net/bridge/br_if.c 2010-05-17 10:40:49.808031840 -0700
+++ b/net/bridge/br_if.c 2010-05-17 10:49:47.767669246 -0700
@@ -133,7 +133,7 @@ static void del_nbp(struct net_bridge_po
struct net_bridge *br = p->br;
struct net_device *dev = p->dev;
- sysfs_remove_link(br->ifobj, p->sysfs_name);
+ sysfs_remove_link(br->ifobj, p->dev->name);
dev_set_promiscuity(dev, -1);
--
^ permalink raw reply
* Re: [PATCH BUGFIX ] ipv6: fix the bug of address check
From: Stephen Hemminger @ 2010-05-17 17:31 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev@vger.kernel.org
In-Reply-To: <4BF1354A.3060003@cn.fujitsu.com>
On Mon, 17 May 2010 20:23:38 +0800
Shan Wei <shanwei@cn.fujitsu.com> wrote:
>
> If there are several IPv6 addresses with same hash value in hashlist,
> and they are all not matched with addr argument.
> In this case, ipv6_chk_addr() should return 0.
>
> This bug is introduced by commit c2e21293c054817c42eb5fa9c613d2ad51954136
> (title: ipv6: convert addrconf list to hlist).
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> net/ipv6/addrconf.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 3984f52..d8e5907 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -1291,7 +1291,7 @@ int ipv6_chk_addr(struct net *net, struct in6_addr *addr,
> }
> rcu_read_unlock_bh();
>
> - return ifp != NULL;
> + return node != NULL;
> }
> EXPORT_SYMBOL(ipv6_chk_addr);
>
Why not this instead. I don't like depending on the value of the
loop variable in the hlist_for_each()
--- a/net/ipv6/addrconf.c 2010-05-17 10:27:58.218628126 -0700
+++ b/net/ipv6/addrconf.c 2010-05-17 10:29:46.012198338 -0700
@@ -1274,7 +1274,7 @@ static int ipv6_count_addresses(struct i
int ipv6_chk_addr(struct net *net, struct in6_addr *addr,
struct net_device *dev, int strict)
{
- struct inet6_ifaddr *ifp = NULL;
+ struct inet6_ifaddr *ifp;
struct hlist_node *node;
unsigned int hash = ipv6_addr_hash(addr);
@@ -1283,15 +1283,16 @@ int ipv6_chk_addr(struct net *net, struc
if (!net_eq(dev_net(ifp->idev->dev), net))
continue;
if (ipv6_addr_equal(&ifp->addr, addr) &&
- !(ifp->flags&IFA_F_TENTATIVE)) {
- if (dev == NULL || ifp->idev->dev == dev ||
- !(ifp->scope&(IFA_LINK|IFA_HOST) || strict))
- break;
+ !(ifp->flags&IFA_F_TENTATIVE) &&
+ (dev == NULL || ifp->idev->dev == dev ||
+ !(ifp->scope&(IFA_LINK|IFA_HOST) || strict))) {
+ rcu_read_unlock_bh();
+ return 1;
}
}
- rcu_read_unlock_bh();
- return ifp != NULL;
+ rcu_read_unlock_bh();
+ return 0;
}
EXPORT_SYMBOL(ipv6_chk_addr);
--
^ permalink raw reply
* Re: TCP-MD5 checksum failure on x86_64 SMP
From: Stephen Hemminger @ 2010-05-17 17:22 UTC (permalink / raw)
To: Eric Dumazet
Cc: Bijay Singh, David Miller, <bhaskie@gmail.com>,
<bhutchings@solarflare.com>, netdev, Ilpo Järvinen
In-Reply-To: <1274072629.2299.58.camel@edumazet-laptop>
On Mon, 17 May 2010 07:03:49 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le lundi 17 mai 2010 à 03:49 +0000, Bijay Singh a écrit :
>
> > I am on quite an old kernel 2.6.27 and could not apply your patches.
> >
> > Then i moved on to the kernel 2.6.32.11 however since then I have not been able to bring up my card, this is something i need to fix before i can test you fix. Working on that.
> >
>
> Thanks again for the status report.
>
> I see bug is older than what I stated in my previous mail
>
> I could reproduce it in my lab and confirm following patch fixes it
>
> This is a stable candidate (2.6.27 kernels)
>
> Thanks
>
> [PATCH] tcp: tcp_synack_options() fix
>
> Commit 33ad798c924b4a (tcp: options clean up) introduced a problem
> if MD5+SACK+timestamps were used in initial SYN message.
>
> Some stacks (old linux for example) try to negotiate MD5+SACK+TSTAMP
> sessions, but since 20 bytes of tcp options space are not enough to
> store all the bits needed, we chose to disable timestamps in this case.
>
> We send a SYN-ACK _without_ timestamp option, but socket has timestamps
> enabled and all further outgoing messages contain a TS block, all with
> the initial timestamp of the remote peer.
>
> Fix is to really disable timestamps option for the whole session.
>
> Reported-by: Bijay Singh <Bijay.Singh@guavus.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> net/ipv4/tcp_output.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 0dda86e..b8bb226 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -667,7 +667,7 @@ static unsigned tcp_synack_options(struct sock *sk,
> u8 cookie_plus = (xvp != NULL && !xvp->cookie_out_never) ?
> xvp->cookie_plus :
> 0;
> - bool doing_ts = ireq->tstamp_ok;
> + bool doing_ts;
>
> #ifdef CONFIG_TCP_MD5SIG
> *md5 = tcp_rsk(req)->af_specific->md5_lookup(sk, req);
> @@ -680,11 +680,12 @@ static unsigned tcp_synack_options(struct sock *sk,
> * rather than TS in order to fit in better with old,
> * buggy kernels, but that was deemed to be unnecessary.
> */
> - doing_ts &= !ireq->sack_ok;
> + ireq->tstamp_ok &= !ireq->sack_ok;
> }
> #else
> *md5 = NULL;
> #endif
> + doing_ts = ireq->tstamp_ok;
>
> /* We always send an MSS option. */
> opts->mss = mss;
>
>
Make this gets back to stable as well.
--
^ permalink raw reply
* Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
From: Stephen Hemminger @ 2010-05-17 16:55 UTC (permalink / raw)
To: Chris Wright
Cc: Williams, Mitch A, davem@davemloft.net, kaber@trash.net,
arnd@arndb.de, scofeldm@cisco.com, netdev@vger.kernel.org
In-Reply-To: <20100517160732.GA8301@sequoia.sous-sol.org>
On Mon, 17 May 2010 09:07:32 -0700
Chris Wright <chrisw@sous-sol.org> wrote:
> * Williams, Mitch A (mitch.a.williams@intel.com) wrote:
> > >-----Original Message-----
> > >From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > >Sent: Monday, May 17, 2010 9:00 AM
> > >To: Chris Wright
> > >Cc: davem@davemloft.net; kaber@trash.net; Williams, Mitch A;
> > >arnd@arndb.de; scofeldm@cisco.com; netdev@vger.kernel.org
> > >Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
> > >
> > >On Fri, 14 May 2010 20:14:16 -0700
> > >Chris Wright <chrisw@sous-sol.org> wrote:
> > >
> > >> Now we have a set of nested attributes:
> > >>
> > >> IFLA_VFINFO_LIST (NESTED)
> > >> IFLA_VF_INFO (NESTED)
> > >> IFLA_VF_MAC
> > >> IFLA_VF_VLAN
> > >> IFLA_VF_TX_RATE
> > >>
> > >> This allows a single set to operate on multiple attributes if desired.
> > >> Among other things, it means a dump can be replayed to set state.
> > >>
> > >> The current interface has yet to be released, so this seems like
> > >> something to consider for 2.6.34.
> > >>
> > >> Signed-off-by: Chris Wright <chrisw@sous-sol.org
> > >> ---
> > >
> > >iproute2 update please?
> > >
> > >Also I would really like documentation on this.
>
> And a pony? ;-)
>
> Docs in what form?
>
The man page for ip.8 already has some pieces from other version.
Just fix them. I just pushed up a couple of changes.
--
^ permalink raw reply
* Re: [PATCH 0/6] sky2: update
From: David Miller @ 2010-05-17 16:55 UTC (permalink / raw)
To: shemminger; +Cc: mikem, netdev
In-Reply-To: <20100514081957.00f342d5@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 14 May 2010 08:19:57 -0700
> On Fri, 14 May 2010 03:15:01 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Thu, 13 May 2010 09:12:47 -0700
>>
>> > Bunch of patches from Mike, with some additional comments.
>>
>> All applied to net-next-2.6, thanks.
>
> The first one needs to go to net-2.6 because it a regression:
> Current code will lose multicast addresses when the automatic
> recovery from stuck chip happens. Auto recovery happens a lot
> under load on some configurations.
2.6.34 got released yesterday, so it is a moot point.
Just submit it to -stable.
^ permalink raw reply
* Re: [PATCH 1/37] drivers/net/wireless/libertas: Use kmemdup
From: Dan Williams @ 2010-05-17 16:35 UTC (permalink / raw)
To: Julia Lawall
Cc: John W. Linville, libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <Pine.LNX.4.64.1005152312060.21345-QfmoRoYWmW9knbxzx/v8hQ@public.gmane.org>
On Sat, 2010-05-15 at 23:12 +0200, Julia Lawall wrote:
> From: Julia Lawall <julia-dAYI7NvHqcQ@public.gmane.org>
>
> Use kmemdup when some other buffer is immediately copied into the
> allocated region.
>
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression from,to,size,flag;
> statement S;
> @@
>
> - to = \(kmalloc\|kzalloc\)(size,flag);
> + to = kmemdup(from,size,flag);
> if (to==NULL || ...) S
> - memcpy(to, from, size);
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia-dAYI7NvHqcQ@public.gmane.org>
Acked-by: Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/net/wireless/libertas/if_usb.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff -u -p a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -618,16 +618,14 @@ static void if_usb_receive_fwload(struct
> return;
> }
>
> - syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC);
> + syncfwheader = kmemdup(skb->data + IPFIELD_ALIGN_OFFSET,
> + sizeof(struct fwsyncheader), GFP_ATOMIC);
> if (!syncfwheader) {
> lbs_deb_usbd(&cardp->udev->dev, "Failure to allocate syncfwheader\n");
> kfree_skb(skb);
> return;
> }
>
> - memcpy(syncfwheader, skb->data + IPFIELD_ALIGN_OFFSET,
> - sizeof(struct fwsyncheader));
> -
> if (!syncfwheader->cmd) {
> lbs_deb_usb2(&cardp->udev->dev, "FW received Blk with correct CRC\n");
> lbs_deb_usb2(&cardp->udev->dev, "FW received Blk seqnum = %d\n",
--
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 -next] bridge: fix build for CONFIG_SYSFS disabled
From: Randy Dunlap @ 2010-05-17 16:17 UTC (permalink / raw)
To: Stephen Rothwell, Stephen Hemminger; +Cc: linux-next, LKML, netdev, davem
In-Reply-To: <20100517163521.649526d0.sfr@canb.auug.org.au>
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix build when CONFIG_SYSFS is not enabled:
net/bridge/br_if.c:136: error: 'struct net_bridge_port' has no member named 'sysfs_name'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
net/bridge/br_if.c | 2 ++
1 file changed, 2 insertions(+)
--- linux-next-20100517.orig/net/bridge/br_if.c
+++ linux-next-20100517/net/bridge/br_if.c
@@ -133,7 +133,9 @@ static void del_nbp(struct net_bridge_po
struct net_bridge *br = p->br;
struct net_device *dev = p->dev;
+#ifdef CONFIG_SYSFS
sysfs_remove_link(br->ifobj, p->sysfs_name);
+#endif
dev_set_promiscuity(dev, -1);
^ permalink raw reply
* Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
From: Chris Wright @ 2010-05-17 16:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Chris Wright, davem, kaber, mitch.a.williams, scofeldm,
shemminger, netdev
In-Reply-To: <201005151104.41158.arnd@arndb.de>
* Arnd Bergmann (arnd@arndb.de) wrote:
> On Saturday 15 May 2010 05:14:16 Chris Wright wrote:
> > Now we have a set of nested attributes:
> >
> > IFLA_VFINFO_LIST (NESTED)
> > IFLA_VF_INFO (NESTED)
> > IFLA_VF_MAC
> > IFLA_VF_VLAN
> > IFLA_VF_TX_RATE
> >
> > This allows a single set to operate on multiple attributes if desired.
> > Among other things, it means a dump can be replayed to set state.
> >
> > The current interface has yet to be released, so this seems like
> > something to consider for 2.6.34.
> >
> > Signed-off-by: Chris Wright <chrisw@sous-sol.org
>
> Very nice! This would be the minimum change to make the ABI conform
> to the general rules, so it would be really good to have that.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> It does make the interface a bit strange (less than before), since the
> new IFLA_VF_INFO now contains three nested attributes that each contain their
> own vf number field, and we don't require that they are identical or that
> each of the nested attributes inside VF_INFO appears only once.
>
> How about a second patch that splits out an IFLA_VF_NUMBER attribute
> and makes do_setvfinfo use nla_parse_nested instead of nla_for_each_nested
> in order to tighten the rules on this some more?
Yes, that's a great idea Arnd. I'll tighten that up.
thanks,
-chris
^ permalink raw reply
* Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
From: Chris Wright @ 2010-05-17 16:07 UTC (permalink / raw)
To: Williams, Mitch A
Cc: Stephen Hemminger, Chris Wright, davem@davemloft.net,
kaber@trash.net, arnd@arndb.de, scofeldm@cisco.com,
netdev@vger.kernel.org
In-Reply-To: <EA929A9653AAE14F841771FB1DE5A1365FF3999206@rrsmsx501.amr.corp.intel.com>
* Williams, Mitch A (mitch.a.williams@intel.com) wrote:
> >-----Original Message-----
> >From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> >Sent: Monday, May 17, 2010 9:00 AM
> >To: Chris Wright
> >Cc: davem@davemloft.net; kaber@trash.net; Williams, Mitch A;
> >arnd@arndb.de; scofeldm@cisco.com; netdev@vger.kernel.org
> >Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
> >
> >On Fri, 14 May 2010 20:14:16 -0700
> >Chris Wright <chrisw@sous-sol.org> wrote:
> >
> >> Now we have a set of nested attributes:
> >>
> >> IFLA_VFINFO_LIST (NESTED)
> >> IFLA_VF_INFO (NESTED)
> >> IFLA_VF_MAC
> >> IFLA_VF_VLAN
> >> IFLA_VF_TX_RATE
> >>
> >> This allows a single set to operate on multiple attributes if desired.
> >> Among other things, it means a dump can be replayed to set state.
> >>
> >> The current interface has yet to be released, so this seems like
> >> something to consider for 2.6.34.
> >>
> >> Signed-off-by: Chris Wright <chrisw@sous-sol.org
> >> ---
> >
> >iproute2 update please?
> >
> >Also I would really like documentation on this.
And a pony? ;-)
Docs in what form?
> Chris, have you got the iproute2 parts working, or do I need to pick it up?
>
> Thanks again for your work on this.
I've got those bits, just was waiting until patches merged.
Will send them out this afternoon.
thanks,
-chris
^ permalink raw reply
* RE: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
From: Williams, Mitch A @ 2010-05-17 16:02 UTC (permalink / raw)
To: Stephen Hemminger, Chris Wright
Cc: davem@davemloft.net, kaber@trash.net, arnd@arndb.de,
scofeldm@cisco.com, netdev@vger.kernel.org
In-Reply-To: <20100517085936.39016980@nehalam>
>-----Original Message-----
>From: Stephen Hemminger [mailto:shemminger@vyatta.com]
>Sent: Monday, May 17, 2010 9:00 AM
>To: Chris Wright
>Cc: davem@davemloft.net; kaber@trash.net; Williams, Mitch A;
>arnd@arndb.de; scofeldm@cisco.com; netdev@vger.kernel.org
>Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
>
>On Fri, 14 May 2010 20:14:16 -0700
>Chris Wright <chrisw@sous-sol.org> wrote:
>
>> Now we have a set of nested attributes:
>>
>> IFLA_VFINFO_LIST (NESTED)
>> IFLA_VF_INFO (NESTED)
>> IFLA_VF_MAC
>> IFLA_VF_VLAN
>> IFLA_VF_TX_RATE
>>
>> This allows a single set to operate on multiple attributes if desired.
>> Among other things, it means a dump can be replayed to set state.
>>
>> The current interface has yet to be released, so this seems like
>> something to consider for 2.6.34.
>>
>> Signed-off-by: Chris Wright <chrisw@sous-sol.org
>> ---
>
>iproute2 update please?
>
>Also I would really like documentation on this.
>
>
>--
Chris, have you got the iproute2 parts working, or do I need to pick it up?
Thanks again for your work on this.
-Mitch
^ permalink raw reply
* Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetric
From: Stephen Hemminger @ 2010-05-17 15:59 UTC (permalink / raw)
To: Chris Wright; +Cc: davem, kaber, mitch.a.williams, arnd, scofeldm, netdev
In-Reply-To: <20100515031416.GE15313@sequoia.sous-sol.org>
On Fri, 14 May 2010 20:14:16 -0700
Chris Wright <chrisw@sous-sol.org> wrote:
> Now we have a set of nested attributes:
>
> IFLA_VFINFO_LIST (NESTED)
> IFLA_VF_INFO (NESTED)
> IFLA_VF_MAC
> IFLA_VF_VLAN
> IFLA_VF_TX_RATE
>
> This allows a single set to operate on multiple attributes if desired.
> Among other things, it means a dump can be replayed to set state.
>
> The current interface has yet to be released, so this seems like
> something to consider for 2.6.34.
>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org
> ---
iproute2 update please?
Also I would really like documentation on this.
--
^ permalink raw reply
* Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
From: Wolfgang Grandegger @ 2010-05-17 15:41 UTC (permalink / raw)
To: Richard Cochran; +Cc: netdev, linuxppc-dev, devicetree-discuss
In-Reply-To: <ee6c3edca3ee6aa86565e59da999375f79c9de1b.1273855017.git.richard.cochran@omicron.at>
On 05/14/2010 06:46 PM, Richard Cochran wrote:
> The eTSEC includes a PTP clock with quite a few features. This patch adds
> support for the basic clock adjustment functions, plus two external time
> stamps and one alarm.
>
> Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Tested-by: Wolfgang Grandegger <wg@denx.de>
on my Freescale MPC8313 setup with ptpd and ptpv2d.
FYI: checkplatch.pl reports various errors for this patch series.
Wolfgang.
^ permalink raw reply
* Re: [PATCH v3 1/3] ptp: Added a brand new class driver for ptp clocks.
From: Wolfgang Grandegger @ 2010-05-17 15:41 UTC (permalink / raw)
To: Richard Cochran; +Cc: netdev, linuxppc-dev, devicetree-discuss
In-Reply-To: <aa2a85799677c08001b152c2921d0e55d5693ffa.1273855017.git.richard.cochran@omicron.at>
On 05/14/2010 06:45 PM, Richard Cochran wrote:
> This patch adds an infrastructure for hardware clocks that implement
> IEEE 1588, the Precision Time Protocol (PTP). A class driver offers a
> registration method to particular hardware clock drivers. Each clock is
> exposed to user space as a character device with ioctls that allow tuning
> of the PTP clock.
>
> Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Tested-by: Wolfgang Grandegger <wg@denx.de>
on my Freescale MPC8313 setup with ptpd and ptpv2d.
Wolfgang.
^ permalink raw reply
* [PATCH net-next-2.6] bonding: move slave MTU handling from sysfs
From: Jiri Pirko @ 2010-05-17 14:47 UTC (permalink / raw)
To: netdev; +Cc: davem, fubar, bonding-devel, monis
For some reason, MTU handling (storing, and restoring) is taking place in
bond_sysfs. The correct place for this code is in bond_enslave, bond_release.
So move it there.
Jirka
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e12462..2c3f9db 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1533,6 +1533,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
*/
new_slave->original_flags = slave_dev->flags;
+ /* Save slave's original mtu and then set it to match the bond */
+ new_slave->original_mtu = slave_dev->mtu;
+ res = dev_set_mtu(slave_dev, bond->dev->mtu);
+ if (res) {
+ pr_debug("Error %d calling dev_set_mtu\n", res);
+ goto err_free;
+ }
+
/*
* Save slave's original ("permanent") mac address for modes
* that need it, and for restoring it upon release, and then
@@ -1550,7 +1558,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
res = dev_set_mac_address(slave_dev, &addr);
if (res) {
pr_debug("Error %d calling set_mac_address\n", res);
- goto err_free;
+ goto err_restore_mtu;
}
}
@@ -1785,6 +1793,9 @@ err_restore_mac:
dev_set_mac_address(slave_dev, &addr);
}
+err_restore_mtu:
+ dev_set_mtu(slave_dev, new_slave->original_mtu);
+
err_free:
kfree(new_slave);
@@ -1969,6 +1980,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
dev_set_mac_address(slave_dev, &addr);
}
+ dev_set_mtu(slave_dev, slave->original_mtu);
+
slave_dev->priv_flags &= ~(IFF_MASTER_8023AD | IFF_MASTER_ALB |
IFF_SLAVE_INACTIVE | IFF_BONDING |
IFF_SLAVE_NEEDARP);
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 392e291..4e84cfc 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -220,7 +220,6 @@ static ssize_t bonding_store_slaves(struct device *d,
char command[IFNAMSIZ + 1] = { 0, };
char *ifname;
int i, res, ret = count;
- u32 original_mtu;
struct slave *slave;
struct net_device *dev = NULL;
struct bonding *bond = to_bond(d);
@@ -281,43 +280,22 @@ static ssize_t bonding_store_slaves(struct device *d,
memcpy(bond->dev->dev_addr, dev->dev_addr,
dev->addr_len);
- /* Set the slave's MTU to match the bond */
- original_mtu = dev->mtu;
- res = dev_set_mtu(dev, bond->dev->mtu);
- if (res) {
- ret = res;
- goto out;
- }
-
res = bond_enslave(bond->dev, dev);
- bond_for_each_slave(bond, slave, i)
- if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0)
- slave->original_mtu = original_mtu;
- if (res)
- ret = res;
goto out;
}
if (command[0] == '-') {
dev = NULL;
- original_mtu = 0;
bond_for_each_slave(bond, slave, i)
if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) {
dev = slave->dev;
- original_mtu = slave->original_mtu;
break;
}
if (dev) {
pr_info("%s: Removing slave %s\n",
bond->dev->name, dev->name);
- res = bond_release(bond->dev, dev);
- if (res) {
- ret = res;
- goto out;
- }
- /* set the slave MTU to the default */
- dev_set_mtu(dev, original_mtu);
+ res = bond_release(bond->dev, dev);
} else {
pr_err("unable to remove non-existent slave %s for bond %s.\n",
ifname, bond->dev->name);
^ permalink raw reply related
* Re: [PATCH net-next-2.6] can: sja1000 platform data fixes
From: Marc Kleine-Budde @ 2010-05-17 14:42 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: SocketCAN Core Mailing List, Netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4BF151D2.5030906-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3446 bytes --]
Wolfgang Grandegger wrote:
> The member "clock" of struct "sja1000_platform_data" is documented as
> "CAN bus oscillator frequency in Hz" but it's actually used as the CAN
> clock frequency, which is half of it. To avoid further confusion, this
> patch fixes it by renaming the member to "osc_freq". That way, also
> non mainline users will notice the change. The platform code for the
> relevant boards is updated accordingly. Furthermore, pre-defined
> values are now used for the members "ocr" and "cdr".
>
> Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> CC: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cheers, Marc
>
> diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
> index 4aafd5b..f490a40 100644
> --- a/arch/arm/mach-mx2/pcm970-baseboard.c
> +++ b/arch/arm/mach-mx2/pcm970-baseboard.c
> @@ -201,9 +201,9 @@ static struct resource pcm970_sja1000_resources[] = {
> };
>
> struct sja1000_platform_data pcm970_sja1000_platform_data = {
> - .clock = 16000000 / 2,
> - .ocr = 0x40 | 0x18,
> - .cdr = 0x40,
> + .osc_freq = 16000000,
> + .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL,
> + .cdr = CDR_CBP,
> };
>
> static struct platform_device pcm970_sja1000 = {
> diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
> index 2df1ec5..78ecd75 100644
> --- a/arch/arm/mach-mx3/mach-pcm037.c
> +++ b/arch/arm/mach-mx3/mach-pcm037.c
> @@ -530,9 +530,9 @@ static struct resource pcm970_sja1000_resources[] = {
> };
>
> struct sja1000_platform_data pcm970_sja1000_platform_data = {
> - .clock = 16000000 / 2,
> - .ocr = 0x40 | 0x18,
> - .cdr = 0x40,
> + .osc_freq = 16000000,
> + .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL,
> + .cdr = CDR_CBP,
> };
>
> static struct platform_device pcm970_sja1000 = {
> diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
> index b65cabb..d9fadc4 100644
> --- a/drivers/net/can/sja1000/sja1000_platform.c
> +++ b/drivers/net/can/sja1000/sja1000_platform.c
> @@ -111,7 +111,8 @@ static int sp_probe(struct platform_device *pdev)
> dev->irq = res_irq->start;
> priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED);
> priv->reg_base = addr;
> - priv->can.clock.freq = pdata->clock;
> + /* The CAN clock frequency is half the oscillator clock frequency */
> + priv->can.clock.freq = pdata->osc_freq / 2;
> priv->ocr = pdata->ocr;
> priv->cdr = pdata->cdr;
>
> diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h
> index 01ee2ae..96f8fcc 100644
> --- a/include/linux/can/platform/sja1000.h
> +++ b/include/linux/can/platform/sja1000.h
> @@ -26,7 +26,7 @@
> #define OCR_TX_SHIFT 2
>
> struct sja1000_platform_data {
> - u32 clock; /* CAN bus oscillator frequency in Hz */
> + u32 osc_freq; /* CAN bus oscillator frequency in Hz */
>
> u8 ocr; /* output control register */
> u8 cdr; /* clock divider register */
--
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 #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH] Fix SJA1000 command register writes on SMP systems
From: Wolfgang Grandegger @ 2010-05-17 14:29 UTC (permalink / raw)
To: Oliver Hartkopp
Cc: SocketCAN Core Mailing List, Linux Netdev List, David Miller,
stable-DgEjT+Ai2ygdnm+yROfE0A
In-Reply-To: <4BF12321.6080506-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
Hi Oliver,
On 05/17/2010 01:06 PM, Oliver Hartkopp wrote:
> The SJA1000 command register is concurrently written in the rx-path to free
> the receive buffer _and_ in the tx-path to start the transmission.
> On SMP systems this leads to a write stall in the tx-path, which can be
> solved by adding some locking for the command register in the SMP case.
We should explain why a write stall can happen. Here is the relavant
part from the SJA1000 data sheet, 6.4.4 COMMAND REGISTER (CMR):
"Between two commands at least one internal clock cycle is needed in
order to proceed. The internal clock is half of the external oscillator
frequency."
Wolfgang.
^ permalink raw reply
* [PATCH net-next-2.6] can: sja1000 platform data fixes
From: Wolfgang Grandegger @ 2010-05-17 14:25 UTC (permalink / raw)
To: Netdev-u79uwXL29TY76Z2rM5mHXA
Cc: SocketCAN Core Mailing List, Marc Kleine-Budde
The member "clock" of struct "sja1000_platform_data" is documented as
"CAN bus oscillator frequency in Hz" but it's actually used as the CAN
clock frequency, which is half of it. To avoid further confusion, this
patch fixes it by renaming the member to "osc_freq". That way, also
non mainline users will notice the change. The platform code for the
relevant boards is updated accordingly. Furthermore, pre-defined
values are now used for the members "ocr" and "cdr".
Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
CC: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
index 4aafd5b..f490a40 100644
--- a/arch/arm/mach-mx2/pcm970-baseboard.c
+++ b/arch/arm/mach-mx2/pcm970-baseboard.c
@@ -201,9 +201,9 @@ static struct resource pcm970_sja1000_resources[] = {
};
struct sja1000_platform_data pcm970_sja1000_platform_data = {
- .clock = 16000000 / 2,
- .ocr = 0x40 | 0x18,
- .cdr = 0x40,
+ .osc_freq = 16000000,
+ .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL,
+ .cdr = CDR_CBP,
};
static struct platform_device pcm970_sja1000 = {
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index 2df1ec5..78ecd75 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -530,9 +530,9 @@ static struct resource pcm970_sja1000_resources[] = {
};
struct sja1000_platform_data pcm970_sja1000_platform_data = {
- .clock = 16000000 / 2,
- .ocr = 0x40 | 0x18,
- .cdr = 0x40,
+ .osc_freq = 16000000,
+ .ocr = OCR_TX1_PULLDOWN | OCR_TX0_PUSHPULL,
+ .cdr = CDR_CBP,
};
static struct platform_device pcm970_sja1000 = {
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index b65cabb..d9fadc4 100644
--- a/drivers/net/can/sja1000/sja1000_platform.c
+++ b/drivers/net/can/sja1000/sja1000_platform.c
@@ -111,7 +111,8 @@ static int sp_probe(struct platform_device *pdev)
dev->irq = res_irq->start;
priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED);
priv->reg_base = addr;
- priv->can.clock.freq = pdata->clock;
+ /* The CAN clock frequency is half the oscillator clock frequency */
+ priv->can.clock.freq = pdata->osc_freq / 2;
priv->ocr = pdata->ocr;
priv->cdr = pdata->cdr;
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h
index 01ee2ae..96f8fcc 100644
--- a/include/linux/can/platform/sja1000.h
+++ b/include/linux/can/platform/sja1000.h
@@ -26,7 +26,7 @@
#define OCR_TX_SHIFT 2
struct sja1000_platform_data {
- u32 clock; /* CAN bus oscillator frequency in Hz */
+ u32 osc_freq; /* CAN bus oscillator frequency in Hz */
u8 ocr; /* output control register */
u8 cdr; /* clock divider register */
^ permalink raw reply related
* Re: [PATCH] vhost: Storage class should be before const qualifier
From: Joe Perches @ 2010-05-17 13:54 UTC (permalink / raw)
To: Tobias Klauser; +Cc: Michael S. Tsirkin, LKML, netdev
In-Reply-To: <20100517132748.GQ9489@distanz.ch>
On Mon, 2010-05-17 at 15:27 +0200, Tobias Klauser wrote:
> On 2010-05-17 at 15:13:35 +0200, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Mon, May 17, 2010 at 03:12:49PM +0200, Tobias Klauser wrote:
> > > The C99 specification states in section 6.11.5:
> > > The placement of a storage-class specifier other than at the beginning
> > > of the declaration specifiers in a declaration is an obsolescent
> > > feature.
> > > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > Just to clarify: does some compiler/checker actually barf on this?
> GCC does emit a warning if the options '-std=c99 -W -Wall' are present.
> ICC also does warn about this, though I don't know whether this depends
> on any commandline options.
Perhaps others should be converted as well.
$ grep -rPl --include=*.[ch] "^[ \t]*const\s+static" * | \
xargs sed -i -r -e 's/^[ \t]*const[ \t]+static\b/static const/g'
gives:
---
arch/arm/mach-pxa/palmtc.c | 4 +-
arch/xtensa/variants/s6000/include/variant/dmac.h | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 38 ++++++++++----------
drivers/mfd/timberdale.c | 18 +++++-----
drivers/net/wireless/iwlwifi/iwl-core.c | 4 +-
drivers/staging/hv/vmbus_drv.c | 2 +-
fs/ceph/mds_client.c | 4 +-
fs/ceph/mon_client.c | 4 +-
fs/ceph/osd_client.c | 4 +-
sound/pci/hda/patch_realtek.c | 2 +-
10 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 717d7a6..8c09d48 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -263,11 +263,11 @@ const struct matrix_keymap_data palmtc_keymap_data = {
.keymap_size = ARRAY_SIZE(palmtc_matrix_keys),
};
-const static unsigned int palmtc_keypad_row_gpios[] = {
+static const unsigned int palmtc_keypad_row_gpios[] = {
0, 9, 10, 11
};
-const static unsigned int palmtc_keypad_col_gpios[] = {
+static const unsigned int palmtc_keypad_col_gpios[] = {
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 79, 80
};
diff --git a/arch/xtensa/variants/s6000/include/variant/dmac.h b/arch/xtensa/variants/s6000/include/variant/dmac.h
index 89ab948..a24c4bb 100644
--- a/arch/xtensa/variants/s6000/include/variant/dmac.h
+++ b/arch/xtensa/variants/s6000/include/variant/dmac.h
@@ -357,7 +357,7 @@ static inline u32 s6dmac_channel_enabled(u32 dmac, int chan)
static inline void s6dmac_dp_setup_group(u32 dmac, int port,
int nrch, int frrep)
{
- const static u8 mask[4] = {0, 3, 1, 2};
+static const u8 mask[4] = {0, 3, 1, 2};
BUG_ON(dmac != S6_REG_DPDMA);
if ((port < 0) || (port > 3) || (nrch < 1) || (nrch > 4))
return;
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index cc03537..20533ce 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -60,95 +60,95 @@ extern int intel_agp_enabled;
.subdevice = PCI_ANY_ID, \
.driver_data = (unsigned long) info }
-const static struct intel_device_info intel_i830_info = {
+static const struct intel_device_info intel_i830_info = {
.is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_845g_info = {
+static const struct intel_device_info intel_845g_info = {
.is_i8xx = 1,
};
-const static struct intel_device_info intel_i85x_info = {
+static const struct intel_device_info intel_i85x_info = {
.is_i8xx = 1, .is_i85x = 1, .is_mobile = 1,
.cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_i865g_info = {
+static const struct intel_device_info intel_i865g_info = {
.is_i8xx = 1,
};
-const static struct intel_device_info intel_i915g_info = {
+static const struct intel_device_info intel_i915g_info = {
.is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_i915gm_info = {
+static const struct intel_device_info intel_i915gm_info = {
.is_i9xx = 1, .is_mobile = 1,
.cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_i945g_info = {
+static const struct intel_device_info intel_i945g_info = {
.is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_i945gm_info = {
+static const struct intel_device_info intel_i945gm_info = {
.is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1,
.has_hotplug = 1, .cursor_needs_physical = 1,
};
-const static struct intel_device_info intel_i965g_info = {
+static const struct intel_device_info intel_i965g_info = {
.is_i965g = 1, .is_i9xx = 1, .has_hotplug = 1,
};
-const static struct intel_device_info intel_i965gm_info = {
+static const struct intel_device_info intel_i965gm_info = {
.is_i965g = 1, .is_mobile = 1, .is_i965gm = 1, .is_i9xx = 1,
.is_mobile = 1, .has_fbc = 1, .has_rc6 = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_g33_info = {
+static const struct intel_device_info intel_g33_info = {
.is_g33 = 1, .is_i9xx = 1, .need_gfx_hws = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_g45_info = {
+static const struct intel_device_info intel_g45_info = {
.is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, .need_gfx_hws = 1,
.has_pipe_cxsr = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_gm45_info = {
+static const struct intel_device_info intel_gm45_info = {
.is_i965g = 1, .is_mobile = 1, .is_g4x = 1, .is_i9xx = 1,
.is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1,
.has_pipe_cxsr = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_pineview_info = {
+static const struct intel_device_info intel_pineview_info = {
.is_g33 = 1, .is_pineview = 1, .is_mobile = 1, .is_i9xx = 1,
.need_gfx_hws = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_ironlake_d_info = {
+static const struct intel_device_info intel_ironlake_d_info = {
.is_ironlake = 1, .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1,
.has_pipe_cxsr = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_ironlake_m_info = {
+static const struct intel_device_info intel_ironlake_m_info = {
.is_ironlake = 1, .is_mobile = 1, .is_i965g = 1, .is_i9xx = 1,
.need_gfx_hws = 1, .has_rc6 = 1,
.has_hotplug = 1,
};
-const static struct intel_device_info intel_sandybridge_d_info = {
+static const struct intel_device_info intel_sandybridge_d_info = {
.is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1,
.has_hotplug = 1, .is_gen6 = 1,
};
-const static struct intel_device_info intel_sandybridge_m_info = {
+static const struct intel_device_info intel_sandybridge_m_info = {
.is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1,
.has_hotplug = 1, .is_gen6 = 1,
};
-const static struct pci_device_id pciidlist[] = {
+static const struct pci_device_id pciidlist[] = {
INTEL_VGA_DEVICE(0x3577, &intel_i830_info),
INTEL_VGA_DEVICE(0x2562, &intel_845g_info),
INTEL_VGA_DEVICE(0x3582, &intel_i85x_info),
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 7f478ec..8443e52 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -77,7 +77,7 @@ timberdale_ocores_platform_data = {
.num_devices = ARRAY_SIZE(timberdale_i2c_board_info)
};
-const static __devinitconst struct resource timberdale_ocores_resources[] = {
+static const __devinitconst struct resource timberdale_ocores_resources[] = {
{
.start = OCORESOFFSET,
.end = OCORESEND,
@@ -126,7 +126,7 @@ static __devinitdata struct xspi_platform_data timberdale_xspi_platform_data = {
*/
};
-const static __devinitconst struct resource timberdale_spi_resources[] = {
+static const __devinitconst struct resource timberdale_spi_resources[] = {
{
.start = SPIOFFSET,
.end = SPIEND,
@@ -139,7 +139,7 @@ const static __devinitconst struct resource timberdale_spi_resources[] = {
},
};
-const static __devinitconst struct resource timberdale_eth_resources[] = {
+static const __devinitconst struct resource timberdale_eth_resources[] = {
{
.start = ETHOFFSET,
.end = ETHEND,
@@ -159,7 +159,7 @@ static __devinitdata struct timbgpio_platform_data
.irq_base = 200,
};
-const static __devinitconst struct resource timberdale_gpio_resources[] = {
+static const __devinitconst struct resource timberdale_gpio_resources[] = {
{
.start = GPIOOFFSET,
.end = GPIOEND,
@@ -172,7 +172,7 @@ const static __devinitconst struct resource timberdale_gpio_resources[] = {
},
};
-const static __devinitconst struct resource timberdale_mlogicore_resources[] = {
+static const __devinitconst struct resource timberdale_mlogicore_resources[] = {
{
.start = MLCOREOFFSET,
.end = MLCOREEND,
@@ -190,7 +190,7 @@ const static __devinitconst struct resource timberdale_mlogicore_resources[] = {
},
};
-const static __devinitconst struct resource timberdale_uart_resources[] = {
+static const __devinitconst struct resource timberdale_uart_resources[] = {
{
.start = UARTOFFSET,
.end = UARTEND,
@@ -203,7 +203,7 @@ const static __devinitconst struct resource timberdale_uart_resources[] = {
},
};
-const static __devinitconst struct resource timberdale_uartlite_resources[] = {
+static const __devinitconst struct resource timberdale_uartlite_resources[] = {
{
.start = UARTLITEOFFSET,
.end = UARTLITEEND,
@@ -216,7 +216,7 @@ const static __devinitconst struct resource timberdale_uartlite_resources[] = {
},
};
-const static __devinitconst struct resource timberdale_radio_resources[] = {
+static const __devinitconst struct resource timberdale_radio_resources[] = {
{
.start = RDSOFFSET,
.end = RDSEND,
@@ -250,7 +250,7 @@ static __devinitdata struct timb_radio_platform_data
}
};
-const static __devinitconst struct resource timberdale_dma_resources[] = {
+static const __devinitconst struct resource timberdale_dma_resources[] = {
{
.start = DMAOFFSET,
.end = DMAEND,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 049b652..47d1a4b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -3204,7 +3204,7 @@ void iwl_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len)
EXPORT_SYMBOL(iwl_update_stats);
#endif
-const static char *get_csr_string(int cmd)
+static const char *get_csr_string(int cmd)
{
switch (cmd) {
IWL_CMD(CSR_HW_IF_CONFIG_REG);
@@ -3275,7 +3275,7 @@ void iwl_dump_csr(struct iwl_priv *priv)
}
EXPORT_SYMBOL(iwl_dump_csr);
-const static char *get_fh_string(int cmd)
+static const char *get_fh_string(int cmd)
{
switch (cmd) {
IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG);
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 3397ef0..ece5014 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -999,7 +999,7 @@ static void __exit vmbus_exit(void)
* installed and/or configured. We don't do anything else with the table, but
* it needs to be present.
*/
-const static struct pci_device_id microsoft_hv_pci_table[] = {
+static const struct pci_device_id microsoft_hv_pci_table[] = {
{ PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
{ 0 }
};
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 24561a5..4854943 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -40,7 +40,7 @@
static void __wake_requests(struct ceph_mds_client *mdsc,
struct list_head *head);
-const static struct ceph_connection_operations mds_con_ops;
+static const struct ceph_connection_operations mds_con_ops;
/*
@@ -3031,7 +3031,7 @@ static int invalidate_authorizer(struct ceph_connection *con)
return ceph_monc_validate_auth(&mdsc->client->monc);
}
-const static struct ceph_connection_operations mds_con_ops = {
+static const struct ceph_connection_operations mds_con_ops = {
.get = con_get,
.put = con_put,
.dispatch = dispatch,
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 8fdc011..c5d3883 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -28,7 +28,7 @@
* resend any outstanding requests.
*/
-const static struct ceph_connection_operations mon_con_ops;
+static const struct ceph_connection_operations mon_con_ops;
static int __validate_auth(struct ceph_mon_client *monc);
@@ -826,7 +826,7 @@ out:
mutex_unlock(&monc->mutex);
}
-const static struct ceph_connection_operations mon_con_ops = {
+static const struct ceph_connection_operations mon_con_ops = {
.get = ceph_con_get,
.put = ceph_con_put,
.dispatch = dispatch,
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c
index 3514f71..763fdb1 100644
--- a/fs/ceph/osd_client.c
+++ b/fs/ceph/osd_client.c
@@ -16,7 +16,7 @@
#define OSD_OP_FRONT_LEN 4096
#define OSD_OPREPLY_FRONT_LEN 512
-const static struct ceph_connection_operations osd_con_ops;
+static const struct ceph_connection_operations osd_con_ops;
static int __kick_requests(struct ceph_osd_client *osdc,
struct ceph_osd *kickosd);
@@ -1552,7 +1552,7 @@ static int invalidate_authorizer(struct ceph_connection *con)
return ceph_monc_validate_auth(&osdc->client->monc);
}
-const static struct ceph_connection_operations osd_con_ops = {
+static const struct ceph_connection_operations osd_con_ops = {
.get = get_osd_con,
.put = put_osd_con,
.dispatch = dispatch,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 886d8e4..ae85771 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -14082,7 +14082,7 @@ enum {
ALC269_FIXUP_SONY_VAIO,
};
-const static struct hda_verb alc269_sony_vaio_fixup_verbs[] = {
+static const struct hda_verb alc269_sony_vaio_fixup_verbs[] = {
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
{}
};
^ permalink raw reply related
* [PATCH net-next-2.6] bonding: remove unused variable "found"
From: Jiri Pirko @ 2010-05-17 13:49 UTC (permalink / raw)
To: netdev; +Cc: davem
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index b8bec08..392e291 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -219,7 +219,7 @@ static ssize_t bonding_store_slaves(struct device *d,
{
char command[IFNAMSIZ + 1] = { 0, };
char *ifname;
- int i, res, found, ret = count;
+ int i, res, ret = count;
u32 original_mtu;
struct slave *slave;
struct net_device *dev = NULL;
@@ -245,7 +245,6 @@ static ssize_t bonding_store_slaves(struct device *d,
if (command[0] == '+') {
/* Got a slave name in ifname. Is it already in the list? */
- found = 0;
dev = __dev_get_by_name(dev_net(bond->dev), ifname);
if (!dev) {
^ permalink raw reply related
* Re: [PATCH] vhost: Storage class should be before const qualifier
From: Tobias Klauser @ 2010-05-17 13:27 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: kvm, virtualization, netdev
In-Reply-To: <20100517131335.GA12126@redhat.com>
On 2010-05-17 at 15:13:35 +0200, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Mon, May 17, 2010 at 03:12:49PM +0200, Tobias Klauser wrote:
> > The C99 specification states in section 6.11.5:
> >
> > The placement of a storage-class specifier other than at the beginning
> > of the declaration specifiers in a declaration is an obsolescent
> > feature.
> >
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
>
>
> Will apply, thanks!
> Just to clarify: does some compiler/checker actually barf on this?
GCC does emit a warning if the options '-std=c99 -W -Wall' are present.
ICC also does warn about this, though I don't know whether this depends
on any commandline options.
Cheers
Tobias
^ permalink raw reply
* Re: [PATCH] vhost: Storage class should be before const qualifier
From: Michael S. Tsirkin @ 2010-05-17 13:13 UTC (permalink / raw)
To: Tobias Klauser; +Cc: kvm, virtualization, netdev
In-Reply-To: <1274101969-21109-1-git-send-email-tklauser@distanz.ch>
On Mon, May 17, 2010 at 03:12:49PM +0200, Tobias Klauser wrote:
> The C99 specification states in section 6.11.5:
>
> The placement of a storage-class specifier other than at the beginning
> of the declaration specifiers in a declaration is an obsolescent
> feature.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Will apply, thanks!
Just to clarify: does some compiler/checker actually barf on this?
> ---
> drivers/vhost/net.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index aa88911..cd36f5f 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -626,7 +626,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl,
> }
> #endif
>
> -const static struct file_operations vhost_net_fops = {
> +static const struct file_operations vhost_net_fops = {
> .owner = THIS_MODULE,
> .release = vhost_net_release,
> .unlocked_ioctl = vhost_net_ioctl,
> --
> 1.6.3.3
^ permalink raw reply
* [PATCH] vhost: Storage class should be before const qualifier
From: Tobias Klauser @ 2010-05-17 13:12 UTC (permalink / raw)
To: mst; +Cc: kvm, virtualization, netdev, Tobias Klauser
The C99 specification states in section 6.11.5:
The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/vhost/net.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index aa88911..cd36f5f 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -626,7 +626,7 @@ static long vhost_net_compat_ioctl(struct file *f, unsigned int ioctl,
}
#endif
-const static struct file_operations vhost_net_fops = {
+static const struct file_operations vhost_net_fops = {
.owner = THIS_MODULE,
.release = vhost_net_release,
.unlocked_ioctl = vhost_net_ioctl,
--
1.6.3.3
^ permalink raw reply related
* Re: [RFC] NF: IP tables idletimer target implementation
From: Luciano Coelho @ 2010-05-17 13:09 UTC (permalink / raw)
To: ext Patrick McHardy
Cc: netdev@vger.kernel.org, Timo Teras,
Netfilter Development Mailinglist
In-Reply-To: <4BED744D.3040400@trash.net>
Hi,
Thanks for your review. I'll make the changes you proposed and
resubmit. My comments below.
On Fri, 2010-05-14 at 18:03 +0200, ext Patrick McHardy wrote:
> Please CC netfilter-devel on future submissions.
Sure, I'm sorry that I didn't do that to start with. I searched for
net/ipv4/netfilter in the MAINTAINERS file and missed the
net/*/netfilter.
> Luciano Coelho wrote:
> > It adds a file to the sysfs for each interface that is brought up. The file
> > contains the time remaining before the event is triggered. This file can
> > also be used to set the timer manually.
>
> What is this used for? It doesn't seem to smart to poll manually
> if you get an event anyways, and the timeout can already be set
> per rule.
Yes, that's true. We have some weird things happening in our userspace
and, as you mentioned below, we should probably create the timers when
the rules are set. I'll look into this and fix it, which will require
some discussions with the userspace people.
> > diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
> > index 1833bdb..91fba9a 100644
> > --- a/net/ipv4/netfilter/Kconfig
> > +++ b/net/ipv4/netfilter/Kconfig
> > @@ -204,6 +204,23 @@ config IP_NF_TARGET_REDIRECT
> >
> > To compile it as a module, choose M here. If unsure, say N.
> >
> > +config IP_NF_TARGET_IDLETIMER
>
> This should be a x_tables target, there's nothing IPv4-specific
> about it.
Yeps, I'll fix.
> > diff --git a/net/ipv4/netfilter/ipt_IDLETIMER.c b/net/ipv4/netfilter/ipt_IDLETIMER.c
> > new file mode 100644
> > index 0000000..2c5b465
> > --- /dev/null
> > +++ b/net/ipv4/netfilter/ipt_IDLETIMER.c
>
> > +
> > +#ifdef CONFIG_IP_NF_TARGET_IDLETIMER_DEBUG
> > +#define DEBUGP(format, args...) printk(KERN_DEBUG \
> > + "ipt_IDLETIMER:%s:" format "\n", \
> > + __func__ , ## args)
> > +#else
> > +#define DEBUGP(format, args...)
> > +#endif
>
> Please use pr_debug and get rid of the config option.
I'll fix it. I thought it was odd that only this module had a debug
config flag, there would certainly be a reason for it.
> > +
> > +/*
> > + * Internal timer management.
> > + */
> > +static ssize_t utimer_attr_show(struct device *dev,
> > + struct device_attribute *attr, char *buf);
> > +static ssize_t utimer_attr_store(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t count);
> > +
> > +struct utimer_t {
> > + char name[IFNAMSIZ];
> > + struct list_head entry;
> > + struct timer_list timer;
> > + struct work_struct work;
> > + struct net *net;
> > +};
> > +
> > +static LIST_HEAD(active_utimer_head);
> > +static DEFINE_SPINLOCK(list_lock);
> > +static DEVICE_ATTR(idletimer, 0644, utimer_attr_show, utimer_attr_store);
> > +
> > +static void utimer_delete(struct utimer_t *timer)
> > +{
> > + DEBUGP("Deleting timer '%s'\n", timer->name);
> > +
> > + list_del(&timer->entry);
> > + del_timer_sync(&timer->timer);
> > + put_net(timer->net);
> > + kfree(timer);
> > +}
> > +
> > +static void utimer_work(struct work_struct *work)
> > +{
> > + struct utimer_t *timer = container_of(work, struct utimer_t, work);
> > + struct net_device *netdev = NULL;
>
> Unnecessary initialization.
I'll remove it. My code was slightly different before this version and,
in that case, it required the initialization here.
> > +
> > + netdev = dev_get_by_name(timer->net, timer->name);
> > +
> > + if (netdev != NULL) {
> > + sysfs_notify(&netdev->dev.kobj, NULL,
> > + "idletimer");
> > + dev_put(netdev);
> > + }
> > +}
> > +
> > +static void utimer_expired(unsigned long data)
> > +{
> > + struct utimer_t *timer = (struct utimer_t *) data;
> > +
> > + DEBUGP("Timer '%s' expired\n", timer->name);
> > +
> > + spin_lock_bh(&list_lock);
> > + utimer_delete(timer);
> > + spin_unlock_bh(&list_lock);
> > +
> > + schedule_work(&timer->work);
>
> Use after free, utimer_delete() frees the timer.
Indeed! Thanks for pointint it out! I'll fix it.
> > +}
> > +
> > +static struct utimer_t *utimer_create(const char *name,
> > + struct net *net)
> > +{
> > + struct utimer_t *timer;
> > +
> > + timer = kmalloc(sizeof(struct utimer_t), GFP_ATOMIC);
> > + if (timer == NULL)
> > + return NULL;
> > +
> > + list_add(&timer->entry, &active_utimer_head);
> > + strlcpy(timer->name, name, sizeof(timer->name));
> > + timer->net = get_net(net);
>
> How does this handle namespace exit?
Hmmm... very good point. I'll have to investigate and fix this.
> > +
> > + init_timer(&timer->timer);
> > + timer->timer.function = utimer_expired;
> > + timer->timer.data = (unsigned long) timer;
>
> setup_timer()
Yup.
> > +
> > + INIT_WORK(&timer->work, utimer_work);
> > +
> > + DEBUGP("Created timer '%s'\n", timer->name);
> > +
> > + return timer;
> > +}
> > +
> > +static struct utimer_t *__utimer_find(const char *name, const struct net *net)
> > +{
> > + struct utimer_t *entry;
> > +
> > + list_for_each_entry(entry, &active_utimer_head, entry) {
> > + if (!strcmp(name, entry->name) && net == entry->net)
> > + return entry;
> > + }
> > +
> > + return NULL;
> > +}
> > +
> > +static void utimer_modify(const char *name,
> > + struct net *net,
> > + unsigned long expires)
> > +{
> > + struct utimer_t *timer;
> > +
> > + DEBUGP("Modifying timer '%s'\n", name);
> > + spin_lock_bh(&list_lock);
> > + timer = __utimer_find(name, net);
>
> So you're scanning the list up to twice per packet? That seems
> highly suboptimal, why not create the timer when the rule is
> created and only update the timeout? You could use the interfaces
> specified in struct ipt_ip.
Yes, indeed. This is very suboptimal. I'll try to fix it at the same
time when trying to get rid of the reading/writing to the sysfs file (as
per your second comment above).
> > + if (timer == NULL)
> > + timer = utimer_create(name, net);
> > + mod_timer(&timer->timer, expires);
> > + spin_unlock_bh(&list_lock);
> > +}
> > +
> > +static ssize_t utimer_attr_show(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct utimer_t *timer;
> > + struct net_device *netdev = to_net_dev(dev);
> > + unsigned long expires = 0;
> > +
> > + spin_lock_bh(&list_lock);
> > + timer = __utimer_find(netdev->name, dev_net(netdev));
> > + if (timer)
> > + expires = timer->timer.expires;
> > + spin_unlock_bh(&list_lock);
> > +
> > + if (expires)
> > + return sprintf(buf, "%lu\n", (expires-jiffies) / HZ);
> > +
> > + return sprintf(buf, "0\n");
> > +}
> > +
> > +static ssize_t utimer_attr_store(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t count)
> > +{
> > + int expires;
> > + struct net_device *netdev = to_net_dev(dev);
> > +
> > + if (sscanf(buf, "%d", &expires) == 1) {
> > + if (expires > 0)
>
> Using %u seems better.
Right. Will fix.
> > + utimer_modify(netdev->name,
> > + dev_net(netdev),
> > + jiffies+HZ*(unsigned long)expires);
> > + }
> > +
> > + return count;
> > +}
> > +
> > +static int utimer_notifier_call(struct notifier_block *this,
> > + unsigned long event, void *ptr)
> > +{
> > + struct net_device *netdev = ptr;
> > + int ret;
> > +
> > + switch (event) {
> > + case NETDEV_UP:
> > + DEBUGP("NETDEV_UP: %s\n", netdev->name);
> > + ret = device_create_file(&netdev->dev,
> > + &dev_attr_idletimer);
> > + WARN_ON(ret);
> > +
> > + break;
> > + case NETDEV_DOWN:
> > + DEBUGP("NETDEV_DOWN: %s\n", netdev->name);
> > + device_remove_file(&netdev->dev,
> > + &dev_attr_idletimer);
> > + break;
> > + }
> > +
> > + return NOTIFY_DONE;
> > +}
> > +
> > +static struct notifier_block utimer_notifier_block = {
> > + .notifier_call = utimer_notifier_call,
> > +};
> > +
> > +
> > +static int utimer_init(void)
> > +{
> > + return register_netdevice_notifier(&utimer_notifier_block);
> > +}
> > +
> > +static void utimer_fini(void)
> > +{
> > + struct utimer_t *entry, *next;
> > + struct net_device *dev;
> > + struct net *net;
> > +
> > + list_for_each_entry_safe(entry, next, &active_utimer_head, entry)
> > + utimer_delete(entry);
> > +
> > + rtnl_lock();
>
> deadlock? unregister_netdevice_notifier() already takes the RTNL.
Ugh! How come I didn't notice this before? I'll fix it.
> > + unregister_netdevice_notifier(&utimer_notifier_block);
> > + for_each_net(net) {
> > + for_each_netdev(net, dev) {
> > + utimer_notifier_call(&utimer_notifier_block,
> > + NETDEV_DOWN, dev);
> > + }
> > + }
> > + rtnl_unlock();
> > +}
> > +
> > +/*
> > + * The actual iptables plugin.
> > + */
> > +static unsigned int ipt_idletimer_target(struct sk_buff *skb,
> > + const struct xt_action_param *par)
> > +{
> > + const struct ipt_idletimer_info *target = par->targinfo;
> > + unsigned long expires;
> > +
> > + expires = jiffies + HZ*target->timeout;
> > +
> > + if (par->in != NULL)
> > + utimer_modify(par->in->name,
> > + dev_net(par->in),
> > + expires);
> > +
> > + if (par->out != NULL)
> > + utimer_modify(par->out->name,
> > + dev_net(par->out),
> > + expires);
> > +
> > + return XT_CONTINUE;
> > +}
> > +
> > +static int ipt_idletimer_checkentry(const struct xt_tgchk_param *par)
> > +{
> > + const struct ipt_idletimer_info *info = par->targinfo;
> > +
> > + if (info->timeout == 0) {
> > + DEBUGP("timeout value is zero\n");
> > + return false;
> > + }
> > +
> > + return true;
>
> The return convention in the current net-next tree is 0 for
> no error or an errno code otherwise.
Yes, this seems to have been changing back and forth in the latest
releases. And the description in the x_targets.h header file seems to
be wrong:
/* Registration hooks for targets. */
struct xt_target {
[...]
/* Called when user tries to insert an entry of this type:
hook_mask is a bitmask of hooks from which it can be
called. */
/* Should return true or false, or an error code (-Exxxx). */
int (*checkentry)(const struct xt_tgchk_param *);
[...]
};
Instead of "Should return true or false..." I guess it should read
something like "Should return 0 for success or an error code otherwise".
I'll submit a patch to fix that.
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH resend] bnx2x: avoid TX timeout when stopping device
From: Stanislaw Gruszka @ 2010-05-17 12:34 UTC (permalink / raw)
To: David Miller
Cc: netdev, Eilon Greenstein, Vladislav Zolotarov, Dmitry Kravkov
When stop device call netif_carrier_off() just after disabling TX queue to
avoid possibility of netdev watchdog warning and ->ndo_tx_timeout() invocation.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 2bc35c7..57ff5b3 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -8499,6 +8499,7 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
/* Disable HW interrupts, NAPI and Tx */
bnx2x_netif_stop(bp, 1);
+ netif_carrier_off(bp->dev);
del_timer_sync(&bp->timer);
SHMEM_WR(bp, func_mb[BP_FUNC(bp)].drv_pulse_mb,
@@ -8524,8 +8525,6 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
bp->state = BNX2X_STATE_CLOSED;
- netif_carrier_off(bp->dev);
-
/* The last driver must disable a "close the gate" if there is no
* parity attention or "process kill" pending.
*/
@@ -13431,6 +13430,7 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
bp->rx_mode = BNX2X_RX_MODE_NONE;
bnx2x_netif_stop(bp, 0);
+ netif_carrier_off(bp->dev);
del_timer_sync(&bp->timer);
bp->stats_state = STATS_STATE_DISABLED;
@@ -13457,8 +13457,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
bp->state = BNX2X_STATE_CLOSED;
- netif_carrier_off(bp->dev);
-
return 0;
}
--
1.5.5.6
^ permalink raw reply related
* [PATCH BUGFIX ] ipv6: fix the bug of address check
From: Shan Wei @ 2010-05-17 12:23 UTC (permalink / raw)
To: David Miller, Stephen Hemminger; +Cc: netdev@vger.kernel.org
If there are several IPv6 addresses with same hash value in hashlist,
and they are all not matched with addr argument.
In this case, ipv6_chk_addr() should return 0.
This bug is introduced by commit c2e21293c054817c42eb5fa9c613d2ad51954136
(title: ipv6: convert addrconf list to hlist).
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/addrconf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 3984f52..d8e5907 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1291,7 +1291,7 @@ int ipv6_chk_addr(struct net *net, struct in6_addr *addr,
}
rcu_read_unlock_bh();
- return ifp != NULL;
+ return node != NULL;
}
EXPORT_SYMBOL(ipv6_chk_addr);
--
1.6.3.3
^ permalink raw reply related
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