* Re: linux-2.6.30.1 with gcc-3.4.6 compile error
From: Eric Dumazet @ 2009-07-13 17:29 UTC (permalink / raw)
To: Teck Choon Giam; +Cc: linux-kernel, Linux Netdev List, David S. Miller
In-Reply-To: <9b5c9bb30907130944l3624870ck507f5a9f0f79452b@mail.gmail.com>
Teck Choon Giam a écrit :
> Hi,
>
> Anyone encounter the below error while compiling linux-2.6.30.1 with gcc-3.4.6?
>
> drivers/net/igb/igb_main.c: In function `igb_up':
> drivers/net/igb/igb_main.c:130: sorry, unimplemented: inlining failed
> in call to 'igb_set_rah_pool': function body not available
> drivers/net/igb/igb_main.c:938: sorry, unimplemented: called from here
> drivers/net/igb/igb_main.c:133: sorry, unimplemented: inlining failed
> in call to 'igb_set_vmolr': function body not available
> drivers/net/igb/igb_main.c:939: sorry, unimplemented: called from here
> make[3]: *** [drivers/net/igb/igb_main.o] Error 1
> make[2]: *** [drivers/net/igb] Error 2
> make[1]: *** [drivers/net] Error 2
> make: *** [drivers] Error 2
>
> This is CentOS 4.x system. While using same configuration to compile
> in CentOS 5.x systems with gcc-4.1.2 do not encounter such error and
> my guess is gcc version issue? Any idea?
>
You are right, this driver cannot compile with gcc-3.4.6 and needs
following patch.
[PATCH] igb: gcc-3.4.6 fix
forward declaration of inline function should be avoided, or
old gcc cannot compile.
Reported-by: Teck Choon Giam <giamteckchoon@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index be48029..adb09d3 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -127,14 +127,48 @@ static void igb_restore_vlan(struct igb_adapter *);
static void igb_ping_all_vfs(struct igb_adapter *);
static void igb_msg_task(struct igb_adapter *);
static int igb_rcv_msg_from_vf(struct igb_adapter *, u32);
-static inline void igb_set_rah_pool(struct e1000_hw *, int , int);
static void igb_set_mc_list_pools(struct igb_adapter *, int, u16);
static void igb_vmm_control(struct igb_adapter *);
-static inline void igb_set_vmolr(struct e1000_hw *, int);
-static inline int igb_set_vf_rlpml(struct igb_adapter *, int, int);
static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *);
static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
+static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
+{
+ u32 reg_data;
+
+ reg_data = rd32(E1000_VMOLR(vfn));
+ reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
+ E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
+ E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
+ E1000_VMOLR_AUPE | /* Accept untagged packets */
+ E1000_VMOLR_STRVLAN; /* Strip vlan tags */
+ wr32(E1000_VMOLR(vfn), reg_data);
+}
+
+static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
+ int vfn)
+{
+ struct e1000_hw *hw = &adapter->hw;
+ u32 vmolr;
+
+ vmolr = rd32(E1000_VMOLR(vfn));
+ vmolr &= ~E1000_VMOLR_RLPML_MASK;
+ vmolr |= size | E1000_VMOLR_LPE;
+ wr32(E1000_VMOLR(vfn), vmolr);
+
+ return 0;
+}
+
+static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
+{
+ u32 reg_data;
+
+ reg_data = rd32(E1000_RAH(entry));
+ reg_data &= ~E1000_RAH_POOL_MASK;
+ reg_data |= E1000_RAH_POOL_1 << pool;;
+ wr32(E1000_RAH(entry), reg_data);
+}
+
#ifdef CONFIG_PM
static int igb_suspend(struct pci_dev *, pm_message_t);
static int igb_resume(struct pci_dev *);
@@ -5418,43 +5452,6 @@ static void igb_io_resume(struct pci_dev *pdev)
igb_get_hw_control(adapter);
}
-static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
-{
- u32 reg_data;
-
- reg_data = rd32(E1000_VMOLR(vfn));
- reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
- E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
- E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
- E1000_VMOLR_AUPE | /* Accept untagged packets */
- E1000_VMOLR_STRVLAN; /* Strip vlan tags */
- wr32(E1000_VMOLR(vfn), reg_data);
-}
-
-static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
- int vfn)
-{
- struct e1000_hw *hw = &adapter->hw;
- u32 vmolr;
-
- vmolr = rd32(E1000_VMOLR(vfn));
- vmolr &= ~E1000_VMOLR_RLPML_MASK;
- vmolr |= size | E1000_VMOLR_LPE;
- wr32(E1000_VMOLR(vfn), vmolr);
-
- return 0;
-}
-
-static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
-{
- u32 reg_data;
-
- reg_data = rd32(E1000_RAH(entry));
- reg_data &= ~E1000_RAH_POOL_MASK;
- reg_data |= E1000_RAH_POOL_1 << pool;;
- wr32(E1000_RAH(entry), reg_data);
-}
-
static void igb_set_mc_list_pools(struct igb_adapter *adapter,
int entry_count, u16 total_rar_filters)
{
^ permalink raw reply related
* [PATCH] iproute2 flush: handle larger tables and deleted entries
From: Gautam Kachroo @ 2009-07-13 16:39 UTC (permalink / raw)
To: netdev
use a new netlink socket when sending flush messages to avoid reading
any pending data on the existing netlink socket.
read all of the response from the netlink request -- this response can
be split over multiple recv calls, pretty much one per netlink request
message. ENOENT errors, which correspond to attempts to delete an
already deleted entry, are ignored. Other errors are not ignored.
Signed-off-by: Gautam Kachroo <gk@aristanetworks.com>
---
resending in plain text format
rtnl_send_check calls recv after sending the delete messages. It does
this to catch errors, e.g. user doesn't have permissions to send
netlink messages. It treats *any* response as an error, even if the
message is not an NLMSG_ERROR. However, this doesn't work if the dump
is in the middle of being processed. recv will return the next chunk
of the dump. This was causing the flush operation to bail early, e.g.
when there is a large arp cache.
Ignoring ENOENT lets flush succeed even if entries have been deleted
from underneath the flush.
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -111,7 +111,10 @@ int rtnl_send(struct rtnl_handle *rth, const char
*buf, int len)
return send(rth->fd, buf, len, 0);
}
-int rtnl_send_check(struct rtnl_handle *rth, const char *buf, int len)
+/* send the message in buf using the socket in rth and check for errors
+ (ignoring ENOENT errors)
+*/
+int rtnl_send_check_impl(struct rtnl_handle *rth, const char *buf, int len)
{
struct nlmsghdr *h;
int status;
@@ -122,28 +125,51 @@ int rtnl_send_check(struct rtnl_handle *rth,
const char *buf, int len)
return status;
/* Check for errors */
- status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT);
- if (status < 0) {
- if (errno == EAGAIN)
- return 0;
- return -1;
- }
+ for (;;) {
+ status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT);
+ if (status < 0) {
+ if (errno == EAGAIN)
+ return 0;
+ return -1;
+ }
- for (h = (struct nlmsghdr *)resp; NLMSG_OK(h, status);
- h = NLMSG_NEXT(h, status)) {
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct
nlmsgerr)))
- fprintf(stderr, "ERROR truncated\n");
- else
- errno = -err->error;
+ for (h = (struct nlmsghdr *)resp; NLMSG_OK(h, status);
+ h = NLMSG_NEXT(h, status)) {
+ if (h->nlmsg_type == NLMSG_ERROR) {
+ struct nlmsgerr *err = (struct
nlmsgerr*)NLMSG_DATA(h);
+ if (h->nlmsg_len <
NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
+ fprintf(stderr, "ERROR truncated\n");
+ return -1;
+ }
+ else {
+ if (err->error != -ENOENT) {
+ errno = -err->error;
+ return -1;
+ }
+ }
+ }
}
- return -1;
}
return 0;
}
+/* creates a netlink socket and passes it to rtnl_send_check_impl to send the
+ message in buf
+*/
+int rtnl_send_check(struct rtnl_handle *unused, const char *buf, int len)
+{
+ struct rtnl_handle rth = { .fd = -1 };
+ int ret;
+ if (rtnl_open(&rth, 0) < 0) {
+ fprintf(stderr, "Cannot open rtnetlink\n");
+ return -1;
+ }
+ ret = rtnl_send_check_impl(&rth, buf, len);
+ rtnl_close(&rth);
+ return ret;
+}
+
int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
{
struct nlmsghdr nlh;
^ permalink raw reply
* Re: [PATCH] gre: copy ToS/DiffServ bits to outer IP header
From: David Miller @ 2009-07-13 16:27 UTC (permalink / raw)
To: shemminger; +Cc: aj, netdev, kuznet, kaber
In-Reply-To: <20090713090743.27e1b8ea@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 13 Jul 2009 09:07:43 -0700
> On Mon, 13 Jul 2009 18:01:42 +0200
> Andreas Jaggi <aj@open.ch> wrote:
>
>> On Mon, Jul 13, 2009 at 08:33:03AM -0700, Stephen Hemminger wrote:
>> > Why make it an option? Sounds like it should always be on.
>>
>> In some scenarios people might want to set the ToS value for all
>> GRE tunnel packets to a fixed value (cf. ip tunnel tos option).
>
> Having more options, does not help users. Why not just do that
> with iptables or classifiers?
I think we should behave however our other IP tunnels behave by
default in this situation.
But regardless, always there is the argument that changing default
behavior is surprising and will bite someone.
^ permalink raw reply
* Re: [PATCH] gre: copy ToS/DiffServ bits to outer IP header
From: Stephen Hemminger @ 2009-07-13 16:07 UTC (permalink / raw)
To: Andreas Jaggi; +Cc: netdev, davem, kuznet, kaber
In-Reply-To: <20090713160142.GA9252@urbino.open.ch>
On Mon, 13 Jul 2009 18:01:42 +0200
Andreas Jaggi <aj@open.ch> wrote:
> On Mon, Jul 13, 2009 at 08:33:03AM -0700, Stephen Hemminger wrote:
> > Why make it an option? Sounds like it should always be on.
>
> In some scenarios people might want to set the ToS value for all
> GRE tunnel packets to a fixed value (cf. ip tunnel tos option).
Having more options, does not help users. Why not just do that
with iptables or classifiers?
^ permalink raw reply
* Re: [PATCH] gre: copy ToS/DiffServ bits to outer IP header
From: Andreas Jaggi @ 2009-07-13 16:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, davem, kuznet, kaber
In-Reply-To: <20090713083303.61a59b63@nehalam>
On Mon, Jul 13, 2009 at 08:33:03AM -0700, Stephen Hemminger wrote:
> Why make it an option? Sounds like it should always be on.
In some scenarios people might want to set the ToS value for all
GRE tunnel packets to a fixed value (cf. ip tunnel tos option).
Signed-off-by: Andreas Jaggi <aj@open.ch>
diff -urN vanilla-linux-2.6.29.4/include/linux/if_tunnel.h dev-gre/include/linux/if_tunnel.h
--- vanilla-linux-2.6.29.4/include/linux/if_tunnel.h 2009-05-19 01:52:34.000000000 +0200
+++ dev-gre/include/linux/if_tunnel.h 2009-07-13 15:15:26.000000000 +0200
@@ -24,6 +24,7 @@
#define GRE_REC __constant_htons(0x0700)
#define GRE_FLAGS __constant_htons(0x00F8)
#define GRE_VERSION __constant_htons(0x0007)
+#define GRE_COPY_TOS __constant_htons(0x0008)
struct ip_tunnel_parm
{
diff -urN vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c dev-gre/net/ipv4/ip_gre.c
--- vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c 2009-05-19 01:52:34.000000000 +0200
+++ dev-gre/net/ipv4/ip_gre.c 2009-07-13 17:56:21.000000000 +0200
@@ -677,7 +677,7 @@
}
tos = tiph->tos;
- if (tos&1) {
+ if ((tunnel->parms.o_flags & GRE_COPY_TOS) || (tos & 1)) {
if (skb->protocol == htons(ETH_P_IP))
tos = old_iph->tos;
tos &= ~1;
@@ -804,7 +804,7 @@
iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
}
- ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags;
+ ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags & ~GRE_FLAGS;
((__be16 *)(iph + 1))[1] = (dev->type == ARPHRD_ETHER) ?
htons(ETH_P_TEB) : skb->protocol;
@@ -1080,7 +1080,7 @@
__be16 *p = (__be16*)(iph+1);
memcpy(iph, &t->parms.iph, sizeof(struct iphdr));
- p[0] = t->parms.o_flags;
+ p[0] = t->parms.o_flags & ~GRE_FLAGS;
p[1] = htons(type);
/*
@@ -1503,6 +1503,7 @@
t->parms.iph.ttl = p.iph.ttl;
t->parms.iph.tos = p.iph.tos;
t->parms.iph.frag_off = p.iph.frag_off;
+ t->parms.o_flags |= p.o_flags & GRE_COPY_TOS;
if (t->parms.link != p.link) {
t->parms.link = p.link;
^ permalink raw reply
* Re: use after free bug in socket code
From: Lothar Waßmann @ 2009-07-13 16:00 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, netdev, urs.thuermann, oliver.hartkopp
In-Reply-To: <20090709154533.GA27413@gondor.apana.org.au>
Hi,
Herbert Xu writes:
> Lothar Waßmann <LW@karo-electronics.de> wrote:
> >
> > So, could you point me to the place where the reference count of the
> > socket object is being incremented when a struct sock is associated
> > with it?
>
> It's implicit. Anyway, you should remodel your release function
> on a working protocol.
>
OK. I checked the release functions of the can raw and bcm protocols
and found that they obviously are the culprits since they lack the
call to sock_orphan that other network protocol drivers have:
diff -ur linux-2.6.30/net/can/bcm.c linux-2.6.30-karo/net/can/bcm.c
--- linux-2.6.30/net/can/bcm.c 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30-karo/net/can/bcm.c 2009-07-12 20:12:38.000000000 +0200
@@ -1469,6 +1469,9 @@
bo->ifindex = 0;
}
+ sock_orphan(sk);
+ sock->sk = NULL;
+
release_sock(sk);
sock_put(sk);
diff -ur linux-2.6.30/net/can/raw.c linux-2.6.30-karo/net/can/raw.c
--- linux-2.6.30/net/can/raw.c 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30-karo/net/can/raw.c 2009-07-12 20:12:29.000000000 +0200
@@ -306,6 +306,9 @@
ro->bound = 0;
ro->count = 0;
+ sock_orphan(sk);
+ sock->sk = NULL;
+
release_sock(sk);
sock_put(sk);
Could someone of the CAN-Folks comment on this?
Best regards,
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
^ permalink raw reply
* Re: [PATCH] gre: copy ToS/DiffServ bits to outer IP header
From: Stephen Hemminger @ 2009-07-13 15:33 UTC (permalink / raw)
To: Andreas Jaggi; +Cc: netdev, davem, kuznet, kaber
In-Reply-To: <20090713133225.GA20946@urbino.open.ch>
On Mon, 13 Jul 2009 15:32:25 +0200
Andreas Jaggi <aj@open.ch> wrote:
> When tunneling IP traffic with GRE this patch makes it possible to export the
> ToS/DiffServ information to the outer IP header. This is particularly useful in
> a scenario with ESP/AH where the inner IP header is encrypted but the packet
> priority/DiffServ information should still be respected by the transporting
> routers (for example in an MPLS backbone network).
>
> The feature is disabled by default and can be enabled on per-interface basis.
> The flag is stored in an unused bit of ip_tunnel_parm.o_flags, and can be
> modified through the rntl_link interface.
Why make it an option? Sounds like it should always be on.
> Also does this bring Linux back in the game, as JunOS/IOS provide this for
> quite some time:
> http://www.cisco.com/en/US/docs/ios/11_3/feature/guide/greqos.html
> http://www.juniper.net/techpubs/software/junos/junos94/swconfig-services/configuring-a-gre-tunnel-to-copy-tos-bits-to-the-outer-ip-header.html
>
> Signed-off-by: Andreas Jaggi <aj@open.ch>
>
> diff -urN vanilla-linux-2.6.29.4/include/linux/if_tunnel.h dev-gre/include/linux/if_tunnel.h
> --- vanilla-linux-2.6.29.4/include/linux/if_tunnel.h 2009-05-19 01:52:34.000000000 +0200
> +++ dev-gre/include/linux/if_tunnel.h 2009-07-13 15:15:26.000000000 +0200
> @@ -24,6 +24,7 @@
> #define GRE_REC __constant_htons(0x0700)
> #define GRE_FLAGS __constant_htons(0x00F8)
> #define GRE_VERSION __constant_htons(0x0007)
> +#define GRE_COPY_TOS __constant_htons(0x0008)
>
> struct ip_tunnel_parm
> {
> diff -urN vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c dev-gre/net/ipv4/ip_gre.c
> --- vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c 2009-05-19 01:52:34.000000000 +0200
> +++ dev-gre/net/ipv4/ip_gre.c 2009-07-01 15:30:44.000000000 +0200
> @@ -677,7 +677,7 @@
> }
>
> tos = tiph->tos;
> - if (tos&1) {
> + if (tunnel->parms.o_flags&GRE_COPY_TOS || tos&1) {
This needs whitespace and parenthesis, to be safe and conform to
kernel coding style.
> if (skb->protocol == htons(ETH_P_IP))
> tos = old_iph->tos;
> tos &= ~1;
> @@ -804,7 +804,7 @@
> iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
> }
>
> - ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags;
> + ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags&~GRE_FLAGS;
more white space
> ((__be16 *)(iph + 1))[1] = (dev->type == ARPHRD_ETHER) ?
> htons(ETH_P_TEB) : skb->protocol;
>
> @@ -1080,7 +1080,7 @@
> __be16 *p = (__be16*)(iph+1);
>
> memcpy(iph, &t->parms.iph, sizeof(struct iphdr));
> - p[0] = t->parms.o_flags;
> + p[0] = t->parms.o_flags&~GRE_FLAGS;
> p[1] = htons(type);
>
> /*
> @@ -1503,6 +1503,7 @@
> t->parms.iph.ttl = p.iph.ttl;
> t->parms.iph.tos = p.iph.tos;
> t->parms.iph.frag_off = p.iph.frag_off;
> + t->parms.o_flags |= p.o_flags&GRE_COPY_TOS;
>
> if (t->parms.link != p.link) {
> t->parms.link = p.link;
> --
> 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
* [ofa-general][PATCH] mlx4_core: Synch catastrophic flow with module unload
From: Yevgeny Petrilin @ 2009-07-13 15:27 UTC (permalink / raw)
To: Roland Dreier; +Cc: netdev, general
There is a race condition when the mlx4_core module is being unloaded
during the execution of restart task due to catastrophic error.
Added a global mutex that synchs those operations. If the catastrophic task
tries to catch the mutex, and it is already taken, it means that somebody is unloading the
module, and there is no point in executing the restart operation.
If the unload function tries to catch the mutex and it is taken,
it would wait for the catas task to finish and then unload the module.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
drivers/net/mlx4/catas.c | 4 ++++
drivers/net/mlx4/main.c | 6 ++++++
drivers/net/mlx4/mlx4.h | 2 ++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/mlx4/catas.c b/drivers/net/mlx4/catas.c
index aa9674b..e3aa7e9 100644
--- a/drivers/net/mlx4/catas.c
+++ b/drivers/net/mlx4/catas.c
@@ -91,6 +91,9 @@ static void catas_reset(struct work_struct *work)
LIST_HEAD(tlist);
int ret;
+ if (!mutex_trylock(&drv_mutex))
+ return;
+
spin_lock_irq(&catas_lock);
list_splice_init(&catas_list, &tlist);
spin_unlock_irq(&catas_lock);
@@ -103,6 +106,7 @@ static void catas_reset(struct work_struct *work)
else
mlx4_dbg(dev, "Reset succeeded\n");
}
+ mutex_unlock(&drv_mutex);
}
void mlx4_start_catas_poll(struct mlx4_dev *dev)
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index dac621b..9cd5123 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -77,6 +77,8 @@ static char mlx4_version[] __devinitdata =
DRV_NAME ": Mellanox ConnectX core driver v"
DRV_VERSION " (" DRV_RELDATE ")\n";
+struct mutex drv_mutex;
+
static struct mlx4_profile default_profile = {
.num_qp = 1 << 17,
.num_srq = 1 << 16,
@@ -1325,6 +1327,8 @@ static int __init mlx4_init(void)
{
int ret;
+ mutex_init(&drv_mutex);
+
if (mlx4_verify_params())
return -EINVAL;
@@ -1340,7 +1344,9 @@ static int __init mlx4_init(void)
static void __exit mlx4_cleanup(void)
{
+ mutex_lock(&drv_mutex);
pci_unregister_driver(&mlx4_driver);
+ mutex_unlock(&drv_mutex);
destroy_workqueue(mlx4_wq);
}
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 5bd79c2..bd8fb43 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -284,6 +284,8 @@ struct mlx4_sense {
struct delayed_work sense_poll;
};
+extern struct mutex drv_mutex;
+
struct mlx4_priv {
struct mlx4_dev dev;
--
1.6.0
^ permalink raw reply related
* [PATCH] [net/9p]: default 9p transport module fix
From: Abhishek Kulkarni @ 2009-07-13 13:49 UTC (permalink / raw)
To: linux-kernel; +Cc: ericvh, Abhishek Kulkarni, v9fs-developer, netdev
In-Reply-To: <1247492991-26009-1-git-send-email-adkulkar@umail.iu.edu>
The default 9p transport module is not chosen unless an option parameter (any)
is passed to mount, which thus returns a ENOPROTOSUPPORT. This fix moves the
check out of parse_opts into p9_client_create.
Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
---
:100644 100644 cc25e63... 787ccdd... M net/9p/client.c
net/9p/client.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/9p/client.c b/net/9p/client.c
index cc25e63..787ccdd 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -117,9 +117,6 @@ static int parse_opts(char *opts, struct p9_client *clnt)
}
}
- if (!clnt->trans_mod)
- clnt->trans_mod = v9fs_get_default_trans();
-
kfree(options);
return ret;
}
@@ -689,6 +686,9 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
if (err < 0)
goto error;
+ if (!clnt->trans_mod)
+ clnt->trans_mod = v9fs_get_default_trans();
+
if (clnt->trans_mod == NULL) {
err = -EPROTONOSUPPORT;
P9_DPRINTK(P9_DEBUG_ERROR,
--
1.6.0.4
^ permalink raw reply related
* [PATCH] [net/9p] Possible regression in p9_client_stat
From: Abhishek Kulkarni @ 2009-07-13 13:49 UTC (permalink / raw)
To: linux-kernel; +Cc: ericvh, Abhishek Kulkarni, v9fs-developer, netdev
Fix a possible regression with p9_client_stat where it can try to kfree an ERR_PTR
after an erroneous p9pdu_readf. Also remove an unnecessary data buffer increment
in p9_client_read.
Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
---
:100644 100644 dd43a82... cc25e63... M net/9p/client.c
net/9p/client.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/9p/client.c b/net/9p/client.c
index dd43a82..cc25e63 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1098,7 +1098,6 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
if (data) {
memmove(data, dataptr, count);
- data += count;
}
if (udata) {
@@ -1192,9 +1191,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret);
if (err) {
- ret = ERR_PTR(err);
p9pdu_dump(1, req->rc);
- goto free_and_error;
+ p9_free_req(clnt, req);
+ goto error;
}
P9_DPRINTK(P9_DEBUG_9P,
@@ -1211,8 +1210,6 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
p9_free_req(clnt, req);
return ret;
-free_and_error:
- p9_free_req(clnt, req);
error:
kfree(ret);
return ERR_PTR(err);
--
1.6.0.4
^ permalink raw reply related
* [PATCH] gre: copy ToS/DiffServ bits to outer IP header
From: Andreas Jaggi @ 2009-07-13 13:32 UTC (permalink / raw)
To: netdev; +Cc: davem, kuznet, kaber
When tunneling IP traffic with GRE this patch makes it possible to export the
ToS/DiffServ information to the outer IP header. This is particularly useful in
a scenario with ESP/AH where the inner IP header is encrypted but the packet
priority/DiffServ information should still be respected by the transporting
routers (for example in an MPLS backbone network).
The feature is disabled by default and can be enabled on per-interface basis.
The flag is stored in an unused bit of ip_tunnel_parm.o_flags, and can be
modified through the rntl_link interface.
Also does this bring Linux back in the game, as JunOS/IOS provide this for
quite some time:
http://www.cisco.com/en/US/docs/ios/11_3/feature/guide/greqos.html
http://www.juniper.net/techpubs/software/junos/junos94/swconfig-services/configuring-a-gre-tunnel-to-copy-tos-bits-to-the-outer-ip-header.html
Signed-off-by: Andreas Jaggi <aj@open.ch>
diff -urN vanilla-linux-2.6.29.4/include/linux/if_tunnel.h dev-gre/include/linux/if_tunnel.h
--- vanilla-linux-2.6.29.4/include/linux/if_tunnel.h 2009-05-19 01:52:34.000000000 +0200
+++ dev-gre/include/linux/if_tunnel.h 2009-07-13 15:15:26.000000000 +0200
@@ -24,6 +24,7 @@
#define GRE_REC __constant_htons(0x0700)
#define GRE_FLAGS __constant_htons(0x00F8)
#define GRE_VERSION __constant_htons(0x0007)
+#define GRE_COPY_TOS __constant_htons(0x0008)
struct ip_tunnel_parm
{
diff -urN vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c dev-gre/net/ipv4/ip_gre.c
--- vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c 2009-05-19 01:52:34.000000000 +0200
+++ dev-gre/net/ipv4/ip_gre.c 2009-07-01 15:30:44.000000000 +0200
@@ -677,7 +677,7 @@
}
tos = tiph->tos;
- if (tos&1) {
+ if (tunnel->parms.o_flags&GRE_COPY_TOS || tos&1) {
if (skb->protocol == htons(ETH_P_IP))
tos = old_iph->tos;
tos &= ~1;
@@ -804,7 +804,7 @@
iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
}
- ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags;
+ ((__be16 *)(iph + 1))[0] = tunnel->parms.o_flags&~GRE_FLAGS;
((__be16 *)(iph + 1))[1] = (dev->type == ARPHRD_ETHER) ?
htons(ETH_P_TEB) : skb->protocol;
@@ -1080,7 +1080,7 @@
__be16 *p = (__be16*)(iph+1);
memcpy(iph, &t->parms.iph, sizeof(struct iphdr));
- p[0] = t->parms.o_flags;
+ p[0] = t->parms.o_flags&~GRE_FLAGS;
p[1] = htons(type);
/*
@@ -1503,6 +1503,7 @@
t->parms.iph.ttl = p.iph.ttl;
t->parms.iph.tos = p.iph.tos;
t->parms.iph.frag_off = p.iph.frag_off;
+ t->parms.o_flags |= p.o_flags&GRE_COPY_TOS;
if (t->parms.link != p.link) {
t->parms.link = p.link;
^ permalink raw reply
* [PATCH] net: Rename lookup_neigh_params function
From: Tobias Klauser @ 2009-07-13 8:53 UTC (permalink / raw)
To: davem; +Cc: netdev, Tobias Klauser
Rename lookup_neigh_params to lookup_neigh_parms as the struct is named
neigh_parms and all other functions dealing with the struct carry
neigh_parms in their names.
Signed-off-by: Tobias Klauser <klto@zhaw.ch>
---
net/core/neighbour.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 163b4f5..c6f9ad8 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1316,7 +1316,7 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
}
EXPORT_SYMBOL(pneigh_enqueue);
-static inline struct neigh_parms *lookup_neigh_params(struct neigh_table *tbl,
+static inline struct neigh_parms *lookup_neigh_parms(struct neigh_table *tbl,
struct net *net, int ifindex)
{
struct neigh_parms *p;
@@ -1337,7 +1337,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
struct net *net = dev_net(dev);
const struct net_device_ops *ops = dev->netdev_ops;
- ref = lookup_neigh_params(tbl, net, 0);
+ ref = lookup_neigh_parms(tbl, net, 0);
if (!ref)
return NULL;
@@ -1906,7 +1906,7 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
if (tbp[NDTPA_IFINDEX])
ifindex = nla_get_u32(tbp[NDTPA_IFINDEX]);
- p = lookup_neigh_params(tbl, net, ifindex);
+ p = lookup_neigh_parms(tbl, net, ifindex);
if (p == NULL) {
err = -ENOENT;
goto errout_tbl_lock;
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
From: Alan Cox @ 2009-07-13 8:19 UTC (permalink / raw)
To: David Miller; +Cc: ralf, netdev, guido, paulus, linux-hams, hans
In-Reply-To: <20090712.210730.170014470.davem@davemloft.net>
On Sun, 12 Jul 2009 21:07:30 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Date: Sun, 12 Jul 2009 23:48:54 +0100
>
> >> The issue was, that the locking code in mkiss was assuming it was only
> >> ever being called in process or bh context. Fixed by converting the
> >> involved locking code to use irq-safe locks.
> >
> > Which historically of course was correct until the networking layer
> > changed behaviour some years ago.
>
> Networking layer? Surely you mean the TTY layer or USB because I
> don't see anything networking in his traces :-)
No I mean the network layer.
Historically it went
network bh
transmit packet
ldisc layer
tty write method
and lots of code assumed that. Today the network bits get kicked off at
IRQ level.
Most tty stuff now handles it, some of it has been broken with ppp for
ages but its been so long its hardly a regression any more and its dumb
stuff like jtag consoles and i2c serial ports that break.
^ permalink raw reply
* Re: Using Wireless Extensions in a Kernel Module
From: Tim Schneider @ 2009-07-13 6:24 UTC (permalink / raw)
To: netdev
In-Reply-To: <4A5850E7.5020708@gdt.id.au>
Hi Glen, hi Marcel
thank you for your answers.
I am trying to develop the algorithm for a wireless multihop network,
so no, I'm not making the classical error ;) Still you're right that I
should consider the possibility, that the Algorithm is used on a wired
network. In that case it definitely should not crash the whole system.
Thank you for your hint with the other mailing list. I'm going to try
my luck there.
Regards
Tim
Am 11.07.2009 um 10:44 schrieb Glen Turner:
>
> Hi Tim,
>
> I'm not sure you aren't making a classic error of optimising the
> unusual
> case.
>
> The usual situation is that the TCP sender is on the wired network,
> the
> TCP receiver is on the wireless network. Since the sender determines
> the
> packet scheduling, determining the received signal strength at the TCP
> receiver isn't much help.
>
> What would be really, really useful is a channel to get this sort of
> information back to the sender in a form in which the feedback is
> useful
> even after a RTT/2 delay. There are a few explicit congestion
> notification
> protocols around, and adapting one of those to add the wireless
> condition
> of intermediate and end hops could be the sort of useful
> augmentation that
> gives these protocols enough of an advantage of TCP to be worth
> deploying.
>
> Best wishes, Glen
>
> --
> Glen Turner <http://www.gdt.id.au/~gdt/>
^ permalink raw reply
* [PATCH] drivers/net: using spin_lock_irqsave() in net_send_packet()
From: Dongdong Deng @ 2009-07-13 6:27 UTC (permalink / raw)
To: davem; +Cc: netdev
spin_unlock_irq() will enable interrupt in net_send_packet(),
this patch changes it to spin_lock_irqsave/spin_lock_irqrestore,
so that it doesn't enable interrupts when already disabled,
and netconsole would work properly over cs89x0/isa-skeleton.
Call trace:
netconsole write_msg()
{
...
-> spin_lock_irqsave();
-> netpoll_send_udp()
-> netpoll_send_skb()
-> net_send_packet()
->...
-> spin_unlock_irqrestore();
...
}
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
drivers/net/cs89x0.c | 7 ++++---
drivers/net/isa-skeleton.c | 5 +++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 3eee666..5d619ae 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -1523,6 +1523,7 @@ static void net_timeout(struct net_device *dev)
static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
{
+ unsigned long flags;
struct net_local *lp = netdev_priv(dev);
if (net_debug > 3) {
@@ -1535,7 +1536,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
ask the chip to start transmitting before the
whole packet has been completely uploaded. */
- spin_lock_irq(&lp->lock);
+ spin_lock_irqsave(&lp->lock, flags);
netif_stop_queue(dev);
/* initiate a transmit sequence */
@@ -1549,13 +1550,13 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
* we're waiting for TxOk, so return 1 and requeue this packet.
*/
- spin_unlock_irq(&lp->lock);
+ spin_unlock_irqrestore(&lp->lock, flags);
if (net_debug) printk("cs89x0: Tx buffer not free!\n");
return NETDEV_TX_BUSY;
}
/* Write the contents of the packet */
writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1);
- spin_unlock_irq(&lp->lock);
+ spin_unlock_irqrestore(&lp->lock, flags);
lp->stats.tx_bytes += skb->len;
dev->trans_start = jiffies;
dev_kfree_skb (skb);
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index 73585fd..d12377b 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -430,7 +430,8 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
* hardware interrupt handler. Queue flow control is
* thus managed under this lock as well.
*/
- spin_lock_irq(&np->lock);
+ unsigned long flags;
+ spin_lock_irqsave(&np->lock, flags);
add_to_tx_ring(np, skb, length);
dev->trans_start = jiffies;
@@ -446,7 +447,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
* is when the transmit statistics are updated.
*/
- spin_unlock_irq(&np->lock);
+ spin_unlock_irqrestore(&np->lock, flags);
#else
/* This is the case for older hardware which takes
* a single transmit buffer at a time, and it is
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
From: David Miller @ 2009-07-13 4:07 UTC (permalink / raw)
To: alan; +Cc: ralf, netdev, guido, paulus, linux-hams, hans
In-Reply-To: <20090712234854.10cfcef2@lxorguk.ukuu.org.uk>
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Sun, 12 Jul 2009 23:48:54 +0100
>> The issue was, that the locking code in mkiss was assuming it was only
>> ever being called in process or bh context. Fixed by converting the
>> involved locking code to use irq-safe locks.
>
> Which historically of course was correct until the networking layer
> changed behaviour some years ago.
Networking layer? Surely you mean the TTY layer or USB because I
don't see anything networking in his traces :-)
> These look good to me.
Thanks for reviewing, I'll apply his patch.
^ permalink raw reply
* Re: [PATCH] drivers/net/bonding: Adjust constant name
From: David Miller @ 2009-07-13 3:26 UTC (permalink / raw)
To: fubar; +Cc: julia, bonding-devel, linux-kernel, kernel-janitors, netdev
In-Reply-To: <9220.1247342635@death.nxdomain.ibm.com>
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Sat, 11 Jul 2009 13:03:55 -0700
>
> From: Julia Lawall <julia@diku.dk>
>
> AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
> AD_STATE_LACP_ACTIVITY better reflects the intended semantics.
>
> [ J adds: AD_STATE_LACP_ACTIVITY is a value defined by the standard, and
> should be set here in accordance with 802.3ad 43.4.12; AD_SHORT_TIMEOUT
> is a constant specific to the Linux 802.3ad implementation that happens
> to have the same value ]
>
> The semantic match that finds this problem is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> struct port_params p;
> @@
> * p.port_state |= AD_SHORT_TIMEOUT
> // </smpl>
>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Applied.
^ permalink raw reply
* Re: [PATCH 15/15] dropmon: remove duplicated #include
From: David Miller @ 2009-07-13 3:25 UTC (permalink / raw)
To: weiyi.huang; +Cc: netdev
In-Reply-To: <1247276029-1096-1-git-send-email-weiyi.huang@gmail.com>
From: Huang Weiyi <weiyi.huang@gmail.com>
Date: Sat, 11 Jul 2009 09:33:49 +0800
> Remove duplicated #include('s) in
> include/linux/net_dropmon.h
>
> Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] atl1c: add missing parentheses
From: J. K. Cliburn @ 2009-07-13 0:08 UTC (permalink / raw)
To: Roel Kluin; +Cc: atl1-devel, Andrew Morton, netdev, Jie Yang
In-Reply-To: <4A5A5852.4010901@gmail.com>
Adding Jie (Atheros maintainer) to cc list.
On Sun, Jul 12, 2009 at 4:40 PM, Roel Kluin<roel.kluin@gmail.com> wrote:
> Parentheses are required or the comparison occurs before the bitand.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> #include <stdio.h>
> int main()
> {
> printf("0 & 1 == 0: %u\n", 0 & 1 == 0);
> printf("1 & 1 == 0: %u\n", 1 & 1 == 0);
> printf("(0 & 1) == 0: %u\n", (0 & 1) == 0);
> printf("(1 & 1) == 0: %u\n", (1 & 1) == 0);
> return 0;
> }
>
> output:
> 0 & 1 == 0: 0
> 1 & 1 == 0: 0
> (0 & 1) == 0: 1
> (1 & 1) == 0: 0
>
> diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
> index e1658ef..2a1120a 100644
> --- a/drivers/net/atl1c/atl1c.h
> +++ b/drivers/net/atl1c/atl1c.h
> @@ -188,14 +188,14 @@ struct atl1c_tpd_ext_desc {
> #define RRS_HDS_TYPE_DATA 2
>
> #define RRS_IS_NO_HDS_TYPE(flag) \
> - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == 0)
> + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == 0)
>
> #define RRS_IS_HDS_HEAD(flag) \
> - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \
> + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
> RRS_HDS_TYPE_HEAD)
>
> #define RRS_IS_HDS_DATA(flag) \
> - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \
> + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
> RRS_HDS_TYPE_DATA)
>
> /* rrs word 3 bit 0:31 */
> @@ -245,7 +245,7 @@ struct atl1c_tpd_ext_desc {
> #define RRS_PACKET_TYPE_802_3 1
> #define RRS_PACKET_TYPE_ETH 0
> #define RRS_PACKET_IS_ETH(word) \
> - (((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK == \
> + ((((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK) == \
> RRS_PACKET_TYPE_ETH)
> #define RRS_RXD_IS_VALID(word) \
> ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1)
>
^ permalink raw reply
* Re: [PATCH] sky2: Avoid transmitting during sky2_restart()
From: Mike McCormack @ 2009-07-13 0:06 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20090712101817.5399f06d@nehalam>
2009/7/13 Stephen Hemminger <shemminger@linux-foundation.org>:
> On Sun, 12 Jul 2009 14:39:29 +0900
> Mike McCormack <mikem@ring3k.org> wrote:
>
>> Hi Stephen,
>>
>> "ifconfig eth1 up; pktget eth1" will crashed my machine within 10
>> seconds. (eth1 is sky2)
>> It appears that sky2_tx_timeout causes a restart, and packets in the
>> tx queue are free'd twice (once in sky2_status_intr and once in
>> sky2_down).
>> Furthermore, if sky2_xmit_frame is called during sky2_restart, bad
>> things will happen.
>>
>> This patch fixes both problems and was tested on top of my previous
>> sky2_down fix.
>>
>> thanks,
>>
>> Mike
>
> This should be fixed by managing the queue properly, not
> by using a state flag. I will correct the problem.
I think some kind of state needs to be used, as sky2_tx_complete()
will wake the tx queue if you use netif_tx_stop_queue() and
netif_tx_lock() is used elsewhere, and is not recursive. I am happy
to change the patch if you have a suggestion on which function to use.
thanks,
Mike
^ permalink raw reply
* Re: [PATCH] atlx: duplicate testing of MCAST flag
From: J. K. Cliburn @ 2009-07-13 0:04 UTC (permalink / raw)
To: Roel Kluin; +Cc: atl1-devel, Andrew Morton, netdev, David Miller
In-Reply-To: <4A5A6DE5.4090801@gmail.com>
On Sun, Jul 12, 2009 at 6:12 PM, Roel Kluin<roel.kluin@gmail.com> wrote:
> Fix duplicate testing of MCAST flag
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> I think the first should be UCAST, correct?
>
> diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
> index c734b19..204db96 100644
> --- a/drivers/net/atlx/atl2.c
> +++ b/drivers/net/atlx/atl2.c
> @@ -2071,7 +2071,7 @@ static int atl2_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
> if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
> return -EOPNOTSUPP;
>
> - if (wol->wolopts & (WAKE_MCAST|WAKE_BCAST|WAKE_MCAST))
> + if (wol->wolopts & (WAKE_UCAST | WAKE_BCAST | WAKE_MCAST))
> return -EOPNOTSUPP;
>
> /* these settings will always override what we currently have */
>
Acked-by: Jay Cliburn <jcliburn@gmail.com>
^ permalink raw reply
* [PATCH] atlx: duplicate testing of MCAST flag
From: Roel Kluin @ 2009-07-12 23:12 UTC (permalink / raw)
To: jcliburn, atl1-devel, Andrew Morton, netdev, David Miller
Fix duplicate testing of MCAST flag
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I think the first should be UCAST, correct?
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index c734b19..204db96 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -2071,7 +2071,7 @@ static int atl2_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
return -EOPNOTSUPP;
- if (wol->wolopts & (WAKE_MCAST|WAKE_BCAST|WAKE_MCAST))
+ if (wol->wolopts & (WAKE_UCAST | WAKE_BCAST | WAKE_MCAST))
return -EOPNOTSUPP;
/* these settings will always override what we currently have */
^ permalink raw reply related
* [PATCH] atl1c: misplaced parenthesis
From: Roel Kluin @ 2009-07-12 22:57 UTC (permalink / raw)
To: jcliburn, atl1-devel, Andrew Morton, David Miller, netdev
Fix misplaced parenthesis
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index cd547a2..a383122 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -1689,7 +1689,7 @@ static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
if (likely(RRS_RXD_IS_VALID(rrs->word3))) {
rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) &
RRS_RX_RFD_CNT_MASK;
- if (unlikely(rfd_num) != 1)
+ if (unlikely(rfd_num != 1))
/* TODO support mul rfd*/
if (netif_msg_rx_err(adapter))
dev_warn(&pdev->dev,
^ permalink raw reply related
* Re: [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
From: Alan Cox @ 2009-07-12 22:48 UTC (permalink / raw)
To: Ralf Baechle DL5RB
Cc: David S. Miller, netdev, Guido Trentalancia, Paul Mackerras,
linux-hams, Hans Albas PE1AYX
In-Reply-To: <20090712222658.GC26798@linux-mips.org>
> The issue was, that the locking code in mkiss was assuming it was only
> ever being called in process or bh context. Fixed by converting the
> involved locking code to use irq-safe locks.
Which historically of course was correct until the networking layer
changed behaviour some years ago.
These look good to me.
^ permalink raw reply
* [PATCH] NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
From: Ralf Baechle DL5RB @ 2009-07-12 22:26 UTC (permalink / raw)
To: David S. Miller, netdev
Cc: Guido Trentalancia, Paul Mackerras, Alan Cox, linux-hams,
Hans Albas PE1AYX
In-Reply-To: <20090712172720.GA7313@linux-mips.org>
Guido Trentalancia reports:
I am trying to use the kiss driver in the Linux kernel that is being
shipped with Fedora 10 but unfortunately I get the following oops:
mkiss: AX.25 Multikiss, Hans Albas PE1AYX
mkiss: ax0: crc mode is auto.
ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
------------[ cut here ]------------
WARNING: at kernel/softirq.c:77 __local_bh_disable+0x2f/0x83() (Not
tainted)
[...]
unloaded: microcode]
Pid: 0, comm: swapper Not tainted 2.6.27.25-170.2.72.fc10.i686 #1
[<c042ddfb>] warn_on_slowpath+0x65/0x8b
[<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
[<c04228b4>] ? __enqueue_entity+0xe3/0xeb
[<c042431e>] ? enqueue_entity+0x203/0x20b
[<c0424361>] ? enqueue_task_fair+0x3b/0x3f
[<c041f88c>] ? resched_task+0x3a/0x6e
[<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
[<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
[<c043255b>] __local_bh_disable+0x2f/0x83
[<c04325ba>] local_bh_disable+0xb/0xd
[<c06ab4e2>] _spin_lock_bh+0xb/0x16
[<f8b6f600>] mkiss_receive_buf+0x2fb/0x3a6 [mkiss]
[<c0572a30>] flush_to_ldisc+0xf7/0x198
[<c0572b12>] tty_flip_buffer_push+0x41/0x51
[<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
[<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
[<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
[<c05ea290>] uhci_giveback_urb+0xe5/0x15f
[<c05eaabf>] uhci_scan_schedule+0x52e/0x767
[<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
[<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
[<c05ec5b0>] uhci_irq+0x110/0x125
[<c05d4834>] usb_hcd_irq+0x40/0xa3
[<c0465313>] handle_IRQ_event+0x2f/0x64
[<c046642b>] handle_level_irq+0x74/0xbe
[<c04663b7>] ? handle_level_irq+0x0/0xbe
[<c0406e6e>] do_IRQ+0xc7/0xfe
[<c0405668>] common_interrupt+0x28/0x30
[<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
[<c0617f52>] cpuidle_idle_call+0x60/0x92
[<c0403c61>] cpu_idle+0x101/0x134
[<c069b1ba>] rest_init+0x4e/0x50
=======================
---[ end trace b7cc8076093467ad ]---
------------[ cut here ]------------
WARNING: at kernel/softirq.c:136 _local_bh_enable_ip+0x3d/0xc4()
[...]
Pid: 0, comm: swapper Tainted: G W 2.6.27.25-170.2.72.fc10.i686
[<c042ddfb>] warn_on_slowpath+0x65/0x8b
[<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
[<c04228b4>] ? __enqueue_entity+0xe3/0xeb
[<c042431e>] ? enqueue_entity+0x203/0x20b
[<c0424361>] ? enqueue_task_fair+0x3b/0x3f
[<c041f88c>] ? resched_task+0x3a/0x6e
[<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
[<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
[<f8b6f642>] ? mkiss_receive_buf+0x33d/0x3a6 [mkiss]
[<c04325f9>] _local_bh_enable_ip+0x3d/0xc4
[<c0432688>] local_bh_enable_ip+0x8/0xa
[<c06ab54d>] _spin_unlock_bh+0x11/0x13
[<f8b6f642>] mkiss_receive_buf+0x33d/0x3a6 [mkiss]
[<c0572a30>] flush_to_ldisc+0xf7/0x198
[<c0572b12>] tty_flip_buffer_push+0x41/0x51
[<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
[<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
[<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
[<c05ea290>] uhci_giveback_urb+0xe5/0x15f
[<c05eaabf>] uhci_scan_schedule+0x52e/0x767
[<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
[<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
[<c05ec5b0>] uhci_irq+0x110/0x125
[<c05d4834>] usb_hcd_irq+0x40/0xa3
[<c0465313>] handle_IRQ_event+0x2f/0x64
[<c046642b>] handle_level_irq+0x74/0xbe
[<c04663b7>] ? handle_level_irq+0x0/0xbe
[<c0406e6e>] do_IRQ+0xc7/0xfe
[<c0405668>] common_interrupt+0x28/0x30
[<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
[<c0617f52>] cpuidle_idle_call+0x60/0x92
[<c0403c61>] cpu_idle+0x101/0x134
[<c069b1ba>] rest_init+0x4e/0x50
=======================
---[ end trace b7cc8076093467ad ]---
mkiss: ax0: Trying crc-smack
mkiss: ax0: Trying crc-flexnet
The issue was, that the locking code in mkiss was assuming it was only
ever being called in process or bh context. Fixed by converting the
involved locking code to use irq-safe locks.
Review of other networking line disciplines shows that 6pack, both sync
and async PPP and STRIP have similar issues. The ppp_async one is the
most interesting one as it sorts out half of the issue as far back as
2004 in commit http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2996d8deaeddd01820691a872550dc0cfba0c37d
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reported-by: Guido Trentalancia <guido@trentalancia.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: linux-hams@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Hans Albas PE1AYX <hans@esrac.ele.tue.nl>
---
v2 - convert some more mkiss.c _bh locks to irq-save locks.
drivers/net/hamradio/6pack.c | 10 ++++++----
drivers/net/hamradio/mkiss.c | 41 ++++++++++++++++++++++++-----------------
drivers/net/ppp_async.c | 11 +++++++----
drivers/net/ppp_synctty.c | 11 +++++++----
drivers/net/wireless/strip.c | 39 ++++++++++++++++++++++++---------------
5 files changed, 68 insertions(+), 44 deletions(-)
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 1551600..913a564 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -398,13 +398,14 @@ static DEFINE_RWLOCK(disc_data_lock);
static struct sixpack *sp_get(struct tty_struct *tty)
{
+ unsigned long flags;
struct sixpack *sp;
- read_lock(&disc_data_lock);
+ read_lock_irqsave(&disc_data_lock, flags);
sp = tty->disc_data;
if (sp)
atomic_inc(&sp->refcnt);
- read_unlock(&disc_data_lock);
+ read_unlock_irqrestore(&disc_data_lock, flags);
return sp;
}
@@ -688,12 +689,13 @@ out:
*/
static void sixpack_close(struct tty_struct *tty)
{
+ unsigned long flags;
struct sixpack *sp;
- write_lock(&disc_data_lock);
+ write_lock_irqsave(&disc_data_lock, flags);
sp = tty->disc_data;
tty->disc_data = NULL;
- write_unlock(&disc_data_lock);
+ write_unlock_irqrestore(&disc_data_lock, flags);
if (!sp)
return;
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index fda2fc8..a728650 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -244,15 +244,16 @@ static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc,
/* Send one completely decapsulated AX.25 packet to the AX.25 layer. */
static void ax_bump(struct mkiss *ax)
{
+ unsigned long flags;
struct sk_buff *skb;
int count;
- spin_lock_bh(&ax->buflock);
+ spin_lock_irqsave(&ax->buflock, flags);
if (ax->rbuff[0] > 0x0f) {
if (ax->rbuff[0] & 0x80) {
if (check_crc_16(ax->rbuff, ax->rcount) < 0) {
ax->dev->stats.rx_errors++;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
return;
}
@@ -267,7 +268,7 @@ static void ax_bump(struct mkiss *ax)
} else if (ax->rbuff[0] & 0x20) {
if (check_crc_flex(ax->rbuff, ax->rcount) < 0) {
ax->dev->stats.rx_errors++;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
return;
}
if (ax->crcmode != CRC_MODE_FLEX && ax->crcauto) {
@@ -294,7 +295,7 @@ static void ax_bump(struct mkiss *ax)
printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n",
ax->dev->name);
ax->dev->stats.rx_dropped++;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
return;
}
@@ -303,11 +304,13 @@ static void ax_bump(struct mkiss *ax)
netif_rx(skb);
ax->dev->stats.rx_packets++;
ax->dev->stats.rx_bytes += count;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
}
static void kiss_unesc(struct mkiss *ax, unsigned char s)
{
+ unsigned long flags;
+
switch (s) {
case END:
/* drop keeptest bit = VSV */
@@ -334,18 +337,18 @@ static void kiss_unesc(struct mkiss *ax, unsigned char s)
break;
}
- spin_lock_bh(&ax->buflock);
+ spin_lock_irqsave(&ax->buflock, flags);
if (!test_bit(AXF_ERROR, &ax->flags)) {
if (ax->rcount < ax->buffsize) {
ax->rbuff[ax->rcount++] = s;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
return;
}
ax->dev->stats.rx_over_errors++;
set_bit(AXF_ERROR, &ax->flags);
}
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
}
static int ax_set_mac_address(struct net_device *dev, void *addr)
@@ -367,6 +370,7 @@ static void ax_changedmtu(struct mkiss *ax)
{
struct net_device *dev = ax->dev;
unsigned char *xbuff, *rbuff, *oxbuff, *orbuff;
+ unsigned long flags;
int len;
len = dev->mtu * 2;
@@ -392,7 +396,7 @@ static void ax_changedmtu(struct mkiss *ax)
return;
}
- spin_lock_bh(&ax->buflock);
+ spin_lock_irqsave(&ax->buflock, flags);
oxbuff = ax->xbuff;
ax->xbuff = xbuff;
@@ -423,7 +427,7 @@ static void ax_changedmtu(struct mkiss *ax)
ax->mtu = dev->mtu + 73;
ax->buffsize = len;
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
kfree(oxbuff);
kfree(orbuff);
@@ -433,6 +437,7 @@ static void ax_changedmtu(struct mkiss *ax)
static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
{
struct mkiss *ax = netdev_priv(dev);
+ unsigned long flags;
unsigned char *p;
int actual, count;
@@ -449,7 +454,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
p = icp;
- spin_lock_bh(&ax->buflock);
+ spin_lock_irqsave(&ax->buflock, flags);
if ((*p & 0x0f) != 0) {
/* Configuration Command (kissparms(1).
* Protocol spec says: never append CRC.
@@ -479,7 +484,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
ax->crcauto = (cmd ? 0 : 1);
printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd);
}
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
netif_start_queue(dev);
return;
@@ -512,7 +517,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
count = kiss_esc(p, (unsigned char *)ax->xbuff, len);
}
}
- spin_unlock_bh(&ax->buflock);
+ spin_unlock_irqrestore(&ax->buflock, flags);
set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);
actual = ax->tty->ops->write(ax->tty, ax->xbuff, count);
@@ -704,13 +709,14 @@ static DEFINE_RWLOCK(disc_data_lock);
static struct mkiss *mkiss_get(struct tty_struct *tty)
{
+ unsigned long flags;
struct mkiss *ax;
- read_lock(&disc_data_lock);
+ read_lock_irqsave(&disc_data_lock, flags);
ax = tty->disc_data;
if (ax)
atomic_inc(&ax->refcnt);
- read_unlock(&disc_data_lock);
+ read_unlock_irqrestore(&disc_data_lock, flags);
return ax;
}
@@ -809,12 +815,13 @@ out:
static void mkiss_close(struct tty_struct *tty)
{
+ unsigned long flags;
struct mkiss *ax;
- write_lock(&disc_data_lock);
+ write_lock_irqsave(&disc_data_lock, flags);
ax = tty->disc_data;
tty->disc_data = NULL;
- write_unlock(&disc_data_lock);
+ write_unlock_irqrestore(&disc_data_lock, flags);
if (!ax)
return;
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 17c116b..1fd319b 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -132,13 +132,15 @@ static DEFINE_RWLOCK(disc_data_lock);
static struct asyncppp *ap_get(struct tty_struct *tty)
{
+ unsigned long flags;
struct asyncppp *ap;
- read_lock(&disc_data_lock);
+ read_lock_irqsave(&disc_data_lock, flags);
ap = tty->disc_data;
if (ap != NULL)
atomic_inc(&ap->refcnt);
- read_unlock(&disc_data_lock);
+ read_unlock_irqrestore(&disc_data_lock, flags);
+
return ap;
}
@@ -215,12 +217,13 @@ ppp_asynctty_open(struct tty_struct *tty)
static void
ppp_asynctty_close(struct tty_struct *tty)
{
+ unsigned long flags;
struct asyncppp *ap;
- write_lock_irq(&disc_data_lock);
+ write_lock_irqsave(&disc_data_lock, flags);
ap = tty->disc_data;
tty->disc_data = NULL;
- write_unlock_irq(&disc_data_lock);
+ write_unlock_irqrestore(&disc_data_lock, flags);
if (!ap)
return;
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index aa3d39f..1b3f75f 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -182,13 +182,15 @@ static DEFINE_RWLOCK(disc_data_lock);
static struct syncppp *sp_get(struct tty_struct *tty)
{
+ unsigned long flags;
struct syncppp *ap;
- read_lock(&disc_data_lock);
+ read_lock_irqsave(&disc_data_lock, flags);
ap = tty->disc_data;
if (ap != NULL)
atomic_inc(&ap->refcnt);
- read_unlock(&disc_data_lock);
+ read_unlock_irqrestore(&disc_data_lock, flags);
+
return ap;
}
@@ -262,12 +264,13 @@ ppp_sync_open(struct tty_struct *tty)
static void
ppp_sync_close(struct tty_struct *tty)
{
+ unsigned long flags;
struct syncppp *ap;
- write_lock_irq(&disc_data_lock);
+ write_lock_irqsave(&disc_data_lock, flags);
ap = tty->disc_data;
tty->disc_data = NULL;
- write_unlock_irq(&disc_data_lock);
+ write_unlock_irqrestore(&disc_data_lock, flags);
if (!ap)
return;
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 38366a5..3d39f65 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -856,6 +856,7 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
unsigned char *orbuff = strip_info->rx_buff;
unsigned char *osbuff = strip_info->sx_buff;
unsigned char *otbuff = strip_info->tx_buff;
+ unsigned long flags;
if (new_mtu > MAX_SEND_MTU) {
printk(KERN_ERR
@@ -864,11 +865,11 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
return -EINVAL;
}
- spin_lock_bh(&strip_lock);
+ spin_lock_irqsave(&strip_lock, flags);
if (!allocate_buffers(strip_info, new_mtu)) {
printk(KERN_ERR "%s: unable to grow strip buffers, MTU change cancelled.\n",
strip_info->dev->name);
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
return -ENOMEM;
}
@@ -892,7 +893,7 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
}
}
strip_info->tx_head = strip_info->tx_buff;
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n",
strip_info->dev->name, old_mtu, strip_info->mtu);
@@ -983,10 +984,13 @@ static void strip_seq_neighbours(struct seq_file *seq,
const MetricomNodeTable * table,
const char *title)
{
- /* We wrap this in a do/while loop, so if the table changes */
- /* while we're reading it, we just go around and try again. */
+ unsigned long flags;
struct timeval t;
+ /*
+ * We wrap this in a do/while loop, so if the table changes
+ * while we're reading it, we just go around and try again.
+ */
do {
int i;
t = table->timestamp;
@@ -995,9 +999,9 @@ static void strip_seq_neighbours(struct seq_file *seq,
for (i = 0; i < table->num_nodes; i++) {
MetricomNode node;
- spin_lock_bh(&strip_lock);
+ spin_lock_irqsave(&strip_lock, flags);
node = table->node[i];
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
seq_printf(seq, " %s\n", node.c);
}
} while (table->timestamp.tv_sec != t.tv_sec
@@ -1536,6 +1540,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb)
static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct strip *strip_info = netdev_priv(dev);
+ unsigned long flags;
if (!netif_running(dev)) {
printk(KERN_ERR "%s: xmit call when iface is down\n",
@@ -1574,11 +1579,11 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
strip_info->dev->name, sx_pps_count / 8);
}
- spin_lock_bh(&strip_lock);
+ spin_lock_irqsave(&strip_lock, flags);
strip_send(strip_info, skb);
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
if (skb)
dev_kfree_skb(skb);
@@ -2263,12 +2268,13 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
{
struct strip *strip_info = tty->disc_data;
const unsigned char *end = cp + count;
+ unsigned long flags;
if (!strip_info || strip_info->magic != STRIP_MAGIC
|| !netif_running(strip_info->dev))
return;
- spin_lock_bh(&strip_lock);
+ spin_lock_irqsave(&strip_lock, flags);
#if 0
{
struct timeval tv;
@@ -2335,7 +2341,7 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
}
cp++;
}
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
}
@@ -2523,9 +2529,11 @@ static void strip_dev_setup(struct net_device *dev)
static void strip_free(struct strip *strip_info)
{
- spin_lock_bh(&strip_lock);
+ unsigned long flags;
+
+ spin_lock_irqsave(&strip_lock, flags);
list_del_rcu(&strip_info->list);
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
strip_info->magic = 0;
@@ -2539,6 +2547,7 @@ static void strip_free(struct strip *strip_info)
static struct strip *strip_alloc(void)
{
struct list_head *n;
+ unsigned long flags;
struct net_device *dev;
struct strip *strip_info;
@@ -2562,7 +2571,7 @@ static struct strip *strip_alloc(void)
strip_info->idle_timer.function = strip_IdleTask;
- spin_lock_bh(&strip_lock);
+ spin_lock_irqsave(&strip_lock, flags);
rescan:
/*
* Search the list to find where to put our new entry
@@ -2581,7 +2590,7 @@ static struct strip *strip_alloc(void)
sprintf(dev->name, "st%ld", dev->base_addr);
list_add_tail_rcu(&strip_info->list, &strip_list);
- spin_unlock_bh(&strip_lock);
+ spin_unlock_irqrestore(&strip_lock, flags);
return strip_info;
}
^ 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