* RE: About the Davicom PHY in drivers/net/phy in Linux kernel
From: Joseph Chang @ 2010-11-01 2:27 UTC (permalink / raw)
To: macpaul, netdev; +Cc: afleming, jeff, f.rodo
In-Reply-To: <50FD90C65C53FB45BADEEBCD84FF07F202A62479@ATCPCS06.andestech.com>
Dear MacPaul,
1.Yes. I have downloaded it. And below is the know items.
DM9161A
cpu: Faraday A320 (arm920t) + Andes AG101 (NDS32) ;SoC
OS: Linux: 2.6.32
Actions:
- davicom.c // Download from LXR
- include-linux-mii.h // Download from LXR
2.Your quote is right. Please tell us the test result.
3.I have a question for you,
Where is your company? I browse for andestech, And found that andestech located at
SiSoft SIPP Center! (Address: 2F, No.1, Li-Hsin First Road, Science-Based Industrial Park)
Is it right?
Best Regards,
Joseph CHANG
System Application Engineering Division
Davicom Semiconductor, Inc.
No. 6 Li-Hsin Rd. VI, Science-Based Park,
Hsin-Chu, Taiwan.
Tel: 886-3-5798797 Ex 8534
Fax: 886-3-5646929
Web: http://www.davicom.com.tw
-----Original Message-----
From: macpaul@andestech.com [mailto:macpaul@andestech.com]
Sent: Friday, October 29, 2010 3:47 PM
To: joseph_chang@mail.davicom.com.tw; netdev@vger.kernel.org
Cc: afleming@freescale.com; jeff@garzik.org; f.rodo@til-technologies.fr
Subject: RE: About the Davicom PHY in drivers/net/phy in Linux kernel
Hi Joseph,
I just followed up your suggestion in previous mail, let me quote them here:
# quote
The recommend is changed to be as below:
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
//err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE);
err = phy_write(phydev, MII_DM9161_SCR, MII_DM9161_SCR_INIT);
err = phy_write(phydev, MII_DM9161_10BTCSR, MII_DM9161_10BTCSR_INIT);
// err = phy_write(phydev, MII_NWAYTEST, 0x10);
err = phy_write(phydev, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART);
*Note: Added a PHY reset command.
# end quote
>
> * == > Would you tell us your:
> CPU = ?
SoC: Faraday A320 (arm920t) / Andes AG101 (NDS32)
> Linux Kernel version= ?
Linux: 2.6.32
> I will like to download the same source code from LXR.
> And can check more detail for you.
I've believed that you have download the source already. :-)
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
^ permalink raw reply
* Re: [patch] netlink: use TID instead of PID for automatic id assignment
From: Herbert Xu @ 2010-11-01 2:25 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: David S. Miller, netdev
In-Reply-To: <alpine.LNX.2.01.1010312013100.20872@obet.zrqbmnf.qr>
On Sun, Oct 31, 2010 at 08:14:00PM +0100, Jan Engelhardt wrote:
> parent 3985c7ce85039adacdf882904ca096f091d39346 (v2.6.36-9871-g3985c7c)
> commit 183ded547d51508f23f6c18a999f6c165e66c99e
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date: Sun Oct 31 20:09:36 2010 +0100
>
> netlink: use TID instead of PID for automatic id assignment
>
> This makes it easier to identify processes in the output of `ss -af
> netlink` - as I see no reason to force negative space numbers upon
> all but the first socket in a thread group.
>
> Turns out this reverts v2.6.15-rc4~65.
>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Nack. Sockets are typically shared amongst threads so using the
ID of the thread that created it doesn't make much sense when
all the threads in that group use it to send/receive messages.
In any case, this field should not be relied on (please google
the thread "netlink nlmsg_pid supposed to be pid or tid?") as
anybody can claim your PID in the netlink name space.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Attention
From: EXXON MOBIL OIL&GAS COMPANY @ 2010-10-31 23:56 UTC (permalink / raw)
You have been awarded the sum of 850.000.00 USD. in the EXXON-MOBIL OIL AND GAS COMPANY AWARD 2010.Cont Mr. Fred Peterson with your Names, Address, Phone No to Email: noticeofclaims01@gala.net or call:+2348073988052 for more info on this award
^ permalink raw reply
* Re: [ANNOUNCE] Host Fabric Interface (HFI) device driver available on sourceforge
From: Jim Dykman @ 2010-10-31 19:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20101030.210806.232732630.davem@davemloft.net>
On 10/31/2010 12:08 AM, David Miller wrote:
> From: Jim Dykman<dykmanj@linux.vnet.ibm.com>
> Date: Sat, 30 Oct 2010 23:10:27 -0400
>
>> The HFI network interface is the internal cluster fabric of IBM's
>> PERCS supercomputer. The device driver patch for 2.6.36, hfi-utils,
>> and an introduction to the hardware are available on the sourceforge
>> page (http://sourceforge.net/projects/hfidevicedriver). The hardware
>> design is under US export control, so we cannot release hardware
>> specs.
>
> Nobody is going to look at your code, let alone help review it
> for inclusion, if you just say "go look at this stuff on this
> sourceforge web site."
>
> You have to post the kernel patches here, one by one.
Sorry, thought I was following the instructions for large patches in
Documentation/SubmittingPatches. It is currently one patch of about
22000 lines, around 630k.
Most of the patch is new files, I'm figuring one file per email.
There are 2 files just under 3000 lines, 4 in the 1000-1700 line range,
and some smaller ones. Do I need to break any of those up further?
Jim Dykman
^ permalink raw reply
* [patch] netlink: use TID instead of PID for automatic id assignment
From: Jan Engelhardt @ 2010-10-31 19:14 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Herbert Xu
parent 3985c7ce85039adacdf882904ca096f091d39346 (v2.6.36-9871-g3985c7c)
commit 183ded547d51508f23f6c18a999f6c165e66c99e
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Sun Oct 31 20:09:36 2010 +0100
netlink: use TID instead of PID for automatic id assignment
This makes it easier to identify processes in the output of `ss -af
netlink` - as I see no reason to force negative space numbers upon
all but the first socket in a thread group.
Turns out this reverts v2.6.15-rc4~65.
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
net/netlink/af_netlink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 478181d..568d07c 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -545,7 +545,7 @@ static int netlink_autobind(struct socket *sock)
struct hlist_head *head;
struct sock *osk;
struct hlist_node *node;
- s32 pid = task_tgid_vnr(current);
+ s32 pid = task_pid_vnr(current);
int err;
static s32 rover = -4097;
--
# Created with git-export-patch
^ permalink raw reply related
* Re: [PATCH 1/2] af_unix: fix unix_dgram_poll() behavior for EPOLLOUT event
From: Davide Libenzi @ 2010-10-31 19:07 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Alban Crequy, David Miller, netdev
In-Reply-To: <1288539383.2660.38.camel@edumazet-laptop>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 3498 bytes --]
On Sun, 31 Oct 2010, Eric Dumazet wrote:
> Le samedi 30 octobre 2010 à 22:47 +0100, Alban Crequy a écrit :
> > Le Sat, 30 Oct 2010 15:17:58 +0200,
> > Eric Dumazet <eric.dumazet@gmail.com> a écrit :
> >
> > > > Problem is the peer_wait, that epoll doesnt seem to be plugged into.
> > > >
> > > > Bug is in unix_dgram_poll()
> > > >
> > > > It calls sock_poll_wait( ... &unix_sk(other)->peer_wait,) only if
> > > > socket is 'writable'. Its a clear bug
> >
> > Yes, it looks weird...
> >
> > > > Try this patch please ?
> >
> > I will be away from computer and I will continue to work on this from
> > the 20th of November.
>
> OK, no problem. I tried it and it solves the problem. Here is an
> official patch submission.
>
> David, for your convenience, I cooked a patch serie for the 2 patches
> against af_unix unix_dgram_poll().
Looks good to me...
Acked-by: Davide Libenzi <davidel@xmailserver.org>
> The third patch (af_unix: unix_write_space() use keyed wakeups)) can be
> applied as is.
>
> Thanks !
>
> [PATCH 1/2] af_unix: fix unix_dgram_poll() behavior for EPOLLOUT event
>
> Alban Crequy reported a problem with connected dgram af_unix sockets and
> provided a test program. epoll() would miss to send an EPOLLOUT event
> when a thread unqueues a packet from the other peer, making its receive
> queue not full.
>
> This is because unix_dgram_poll() fails to call sock_poll_wait(file,
> &unix_sk(other)->peer_wait, wait);
> if the socket is not writeable at the time epoll_ctl(ADD) is called.
>
> We must call sock_poll_wait(), regardless of 'writable' status, so that
> epoll can be notified later of states changes.
>
> Misc: avoids testing twice (sk->sk_shutdown & RCV_SHUTDOWN)
>
> Reported-by: Alban Crequy <alban.crequy@collabora.co.uk>
> Cc: Davide Libenzi <davidel@xmailserver.org>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> net/unix/af_unix.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 0ebc777..7375131 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -2072,13 +2072,12 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
> if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
> mask |= POLLERR;
> if (sk->sk_shutdown & RCV_SHUTDOWN)
> - mask |= POLLRDHUP;
> + mask |= POLLRDHUP | POLLIN | POLLRDNORM;
> if (sk->sk_shutdown == SHUTDOWN_MASK)
> mask |= POLLHUP;
>
> /* readable? */
> - if (!skb_queue_empty(&sk->sk_receive_queue) ||
> - (sk->sk_shutdown & RCV_SHUTDOWN))
> + if (!skb_queue_empty(&sk->sk_receive_queue))
> mask |= POLLIN | POLLRDNORM;
>
> /* Connection-based need to check for termination and startup */
> @@ -2090,20 +2089,15 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
> return mask;
> }
>
> - /* writable? */
> writable = unix_writable(sk);
> - if (writable) {
> - other = unix_peer_get(sk);
> - if (other) {
> - if (unix_peer(other) != sk) {
> - sock_poll_wait(file, &unix_sk(other)->peer_wait,
> - wait);
> - if (unix_recvq_full(other))
> - writable = 0;
> - }
> -
> - sock_put(other);
> + other = unix_peer_get(sk);
> + if (other) {
> + if (unix_peer(other) != sk) {
> + sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
> + if (unix_recvq_full(other))
> + writable = 0;
> }
> + sock_put(other);
> }
>
> if (writable)
>
- Davide
^ permalink raw reply
* [SECURITY] L2TP send buffer allocation size overflows
From: Dan Rosenberg @ 2010-10-31 18:14 UTC (permalink / raw)
To: jchapman; +Cc: netdev, security
Both PPPoL2TP (in net/l2tp/l2tp_ppp.c, pppol2tp_sendmsg()) and IPoL2TP
(in net/l2tp/l2tp_ip.c, l2tp_ip_sendmsg()) make calls to sock_wmalloc()
that perform arithmetic on the size argument without any maximum bound.
As a result, by issuing sendto() calls with very large sizes, this
allocation size will wrap and result in a small buffer being allocated,
leading to ugliness immediately after (probably kernel panics due to bad
sk_buff tail position, but possibly kernel heap corruption).
This issue was just fixed in the core code with:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=253eacc070b114c2ec1f81b067d2fed7305467b0
Even though this won't be an issue for much longer, it should still be
fixed here just in case any paths to calling these functions with large
sizes are left open.
-Dan
^ permalink raw reply
* Re: [PATCH 1/3] net: ax25: fix information leak to userland
From: Eric Dumazet @ 2010-10-31 18:08 UTC (permalink / raw)
To: Vasiliy Kulikov
Cc: kernel-janitors, Joerg Reuter, Ralf Baechle, David S. Miller,
linux-hams, netdev, linux-kernel
In-Reply-To: <1288545022-16393-1-git-send-email-segooon@gmail.com>
Le dimanche 31 octobre 2010 à 20:10 +0300, Vasiliy Kulikov a écrit :
> Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
> field of fsa struct. This structure is then copied to userland. It leads to
> leaking of contents of kernel stack memory. We have to initialize them to zero.
>
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
> net/ax25/af_ax25.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
> index 26eaebf..a324d83 100644
> --- a/net/ax25/af_ax25.c
> +++ b/net/ax25/af_ax25.c
> @@ -1392,6 +1392,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
> ax25_cb *ax25;
> int err = 0;
>
> + memset(&fsa->fsa_digipeater, 0, sizeof(fsa->fsa_digipeater));
> lock_sock(sk);
> ax25 = ax25_sk(sk);
>
If you really want to fix this for good, please do it completely ?
sa_family_t is a short
ax25_address is 7 bytes.
Therefore, there is a hole before sax25_ndigis.
struct sockaddr_ax25 {
sa_family_t sax25_family;
ax25_address sax25_call;
<hole>
int sax25_ndigis;
/* Digipeater ax25_address sets follow */
};
struct full_sockaddr_ax25 {
struct sockaddr_ax25 fsa_ax25;
ax25_address fsa_digipeater[AX25_MAX_DIGIS];
};
So a correct patch is the following one. Note AX25 is probably used by
nobody at all, so a full memset() is not performance critical in this
path.
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 26eaebf..6da5dae 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1392,6 +1392,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
ax25_cb *ax25;
int err = 0;
+ memset(fsa, 0, sizeof(*fsa));
lock_sock(sk);
ax25 = ax25_sk(sk);
@@ -1403,7 +1404,6 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
fsa->fsa_ax25.sax25_family = AF_AX25;
fsa->fsa_ax25.sax25_call = ax25->dest_addr;
- fsa->fsa_ax25.sax25_ndigis = 0;
if (ax25->digipeat != NULL) {
ndigi = ax25->digipeat->ndigi;
^ permalink raw reply related
* Re: [PATCH 1/3] net: ax25: fix information leak to userland
From: Ralf Baechle @ 2010-10-31 18:00 UTC (permalink / raw)
To: Vasiliy Kulikov
Cc: kernel-janitors, Joerg Reuter, David S. Miller, linux-hams,
netdev, linux-kernel
In-Reply-To: <1288545022-16393-1-git-send-email-segooon@gmail.com>
On Sun, Oct 31, 2010 at 08:10:22PM +0300, Vasiliy Kulikov wrote:
> Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
> field of fsa struct. This structure is then copied to userland. It leads to
> leaking of contents of kernel stack memory. We have to initialize them to zero.
>
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
^ permalink raw reply
* [PATCH] kzalloc with swapped params in l2tp_dfs_seq_open
From: Dr. David Alan Gilbert @ 2010-10-31 17:26 UTC (permalink / raw)
To: linux-kernel; +Cc: jchapman, netdev
Hi,
'sparse' spotted that the parameters to kzalloc in l2tp_dfs_seq_open
were swapped.
Tested on current git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
at 1792f17b7210280a3d7ff29da9614ba779cfcedb build, boots and I can see that directory,
but there again I could see /sys/kernel/debug/l2tp with it swapped; I don't have
any l2tp in use.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
--
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index 104ec3b..b8dbae8 100644
--- a/net/l2tp/l2tp_debugfs.c
+++ b/net/l2tp/l2tp_debugfs.c
@@ -249,7 +249,7 @@ static int l2tp_dfs_seq_open(struct inode *inode, struct file *file)
struct seq_file *seq;
int rc = -ENOMEM;
- pd = kzalloc(GFP_KERNEL, sizeof(*pd));
+ pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (pd == NULL)
goto out;
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ gro.gilbert @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply related
* [PATCH 3/3] net: tipc: fix information leak to userland
From: Vasiliy Kulikov @ 2010-10-31 17:10 UTC (permalink / raw)
To: kernel-janitors
Cc: Jon Maloy, Allan Stephens, David S. Miller, tipc-discussion,
netdev, linux-kernel
Structure sockaddr_tipc is copied to userland with padding bytes after
"id" field in union field "name" unitialized. It leads to leaking of
contents of kernel stack memory. We have to initialize them to zero.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
net/tipc/socket.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 33217fc..e9f0d50 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -396,6 +396,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
struct tipc_sock *tsock = tipc_sk(sock->sk);
+ memset(addr, 0, sizeof(*addr));
if (peer) {
if ((sock->state != SS_CONNECTED) &&
((peer != 2) || (sock->state != SS_DISCONNECTING)))
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/3] net: packet: fix information leak to userland
From: Vasiliy Kulikov @ 2010-10-31 17:10 UTC (permalink / raw)
To: kernel-janitors
Cc: David S. Miller, Jiri Pirko, Eric Dumazet, netdev, linux-kernel
packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13. This structure is then copied
to userland. It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of strlcpy().
The same with packet_getname(): it doesn't initialize sll_pkttype field of
sockaddr_ll. Set it to zero.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
net/packet/af_packet.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 3616f27..0856a13 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1719,7 +1719,7 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
rcu_read_lock();
dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex);
if (dev)
- strlcpy(uaddr->sa_data, dev->name, 15);
+ strncpy(uaddr->sa_data, dev->name, 14);
else
memset(uaddr->sa_data, 0, 14);
rcu_read_unlock();
@@ -1742,6 +1742,7 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
sll->sll_family = AF_PACKET;
sll->sll_ifindex = po->ifindex;
sll->sll_protocol = po->num;
+ sll->sll_pkttype = 0;
rcu_read_lock();
dev = dev_get_by_index_rcu(sock_net(sk), po->ifindex);
if (dev) {
--
1.7.0.4
^ permalink raw reply related
* [PATCH 1/3] net: ax25: fix information leak to userland
From: Vasiliy Kulikov @ 2010-10-31 17:10 UTC (permalink / raw)
To: kernel-janitors
Cc: Joerg Reuter, Ralf Baechle, David S. Miller, linux-hams, netdev,
linux-kernel
Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
field of fsa struct. This structure is then copied to userland. It leads to
leaking of contents of kernel stack memory. We have to initialize them to zero.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
net/ax25/af_ax25.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 26eaebf..a324d83 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1392,6 +1392,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,
ax25_cb *ax25;
int err = 0;
+ memset(&fsa->fsa_digipeater, 0, sizeof(fsa->fsa_digipeater));
lock_sock(sk);
ax25 = ax25_sk(sk);
--
1.7.0.4
^ permalink raw reply related
* AFFORDABLE LOAN OFFER!!!
From: ASIAWORLD LOAN COMPANY @ 2010-10-31 16:05 UTC (permalink / raw)
We offer Loan to serious individuals or Organization with low
interest rate of
3%. Contact us via e-mail: asiaworldloan@yahoo.com.hk or Tel: +233543956345
^ permalink raw reply
* Re: [PATCH] text ematch: check for NULL pointer before destroying textsearch config
From: David Miller @ 2010-10-31 16:38 UTC (permalink / raw)
To: tgraf; +Cc: netdev
In-Reply-To: <20101031080635.GA22639@canuck.infradead.org>
From: Thomas Graf <tgraf@infradead.org>
Date: Sun, 31 Oct 2010 04:06:35 -0400
> While validating the configuration em_ops is already set, thus the
> individual destroy functions are called, but the ematch data has
> not been allocated and associated with the ematch yet.
>
> Signed-off-by: Thomas Graf <tgraf@infradead.org>
Applied, thanks Thomas.
^ permalink raw reply
* Re: [PATCH] qlcnic: fix panic on load
From: David Miller @ 2010-10-31 16:34 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, amit.salecha
In-Reply-To: <1288540238.2660.50.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 31 Oct 2010 16:50:38 +0100
> Its now illegal to call netif_stop_queue() before register_netdev()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] jme: fix panic on load
From: David Miller @ 2010-10-31 16:34 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, cooldavid
In-Reply-To: <1288539978.2660.47.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 31 Oct 2010 16:46:18 +0100
> Its now illegal to call netif_stop_queue() before register_netdev()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] jme: fix panic on load
From: Eric Dumazet @ 2010-10-31 16:32 UTC (permalink / raw)
To: Guo-Fu Tseng; +Cc: David Miller, netdev
In-Reply-To: <20101031163428.M61655@cooldavid.org>
Le lundi 01 novembre 2010 à 00:39 +0800, Guo-Fu Tseng a écrit :
> Can this patch be modified to move the netif_stop_queue()
> after register_netdev() ?
> It seems the __QUEUE_STATE_XOFF is not set after the register_netdev.
> The tx_queue was kcalloc() ed without touching state flags.
>
Real question is : why this netif_stop_queue() was needed at the first
place ?
We believe (David and others), that using before ndo_open() is useless
or a sign of design error.
http://www.spinics.net/lists/netdev/msg145481.html
Refs: commit c117e4a2bb4911
If your driver doesnt work after my change, then another patch is
needed, but not using netif_stop_queue() right after register_netdev()
^ permalink raw reply
* Re: [PATCH] jme: fix panic on load
From: David Miller @ 2010-10-31 16:26 UTC (permalink / raw)
To: cooldavid; +Cc: eric.dumazet, netdev
In-Reply-To: <20101031163428.M61655@cooldavid.org>
From: "Guo-Fu Tseng" <cooldavid@cooldavid.org>
Date: Mon, 1 Nov 2010 00:39:14 +0800
> On Sun, 31 Oct 2010 16:46:18 +0100, Eric Dumazet wrote
> Can this patch be modified to move the netif_stop_queue()
> after register_netdev() ?
> It seems the __QUEUE_STATE_XOFF is not set after the register_netdev.
> The tx_queue was kcalloc() ed without touching state flags.
At the veyr moment that register_netdev() is called, the
->open() method of your driver can be invoked and the
queue state changed.
So no, you can't put it after the register call.
There is zero reason to touch the queue state in your
probe routine, the state of the queue before ->open()
is "don't care".
Eric's patch is going to be applied, it is correct.
^ permalink raw reply
* Re: [PATCH] jme: fix panic on load
From: Guo-Fu Tseng @ 2010-10-31 16:39 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev
In-Reply-To: <1288539978.2660.47.camel@edumazet-laptop>
On Sun, 31 Oct 2010 16:46:18 +0100, Eric Dumazet wrote
> Its now illegal to call netif_stop_queue() before register_netdev()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
> ---
> drivers/net/jme.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/jme.c b/drivers/net/jme.c
> index d85edf3..c57d9a4 100644
> --- a/drivers/net/jme.c
> +++ b/drivers/net/jme.c
> @@ -2955,11 +2955,7 @@ jme_init_one(struct pci_dev *pdev,
> * Tell stack that we are not ready to work until open()
> */
> netif_carrier_off(netdev);
> - netif_stop_queue(netdev);
>
> - /*
> - * Register netdev
> - */
> rc = register_netdev(netdev);
> if (rc) {
> pr_err("Cannot register net device\n");
>
> --
> 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
Can this patch be modified to move the netif_stop_queue()
after register_netdev() ?
It seems the __QUEUE_STATE_XOFF is not set after the register_netdev.
The tx_queue was kcalloc() ed without touching state flags.
Guo-Fu Tseng
^ permalink raw reply
* [PATCH] qlcnic: fix panic on load
From: Eric Dumazet @ 2010-10-31 15:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Amit Kumar Salecha
Its now illegal to call netif_stop_queue() before register_netdev()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 7a298cd..a3dcd04 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1450,7 +1450,6 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
netdev->irq = adapter->msix_entries[0].vector;
netif_carrier_off(netdev);
- netif_stop_queue(netdev);
err = register_netdev(netdev);
if (err) {
^ permalink raw reply related
* [PATCH] jme: fix panic on load
From: Eric Dumazet @ 2010-10-31 15:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Guo-Fu Tseng
Its now illegal to call netif_stop_queue() before register_netdev()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
drivers/net/jme.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index d85edf3..c57d9a4 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -2955,11 +2955,7 @@ jme_init_one(struct pci_dev *pdev,
* Tell stack that we are not ready to work until open()
*/
netif_carrier_off(netdev);
- netif_stop_queue(netdev);
- /*
- * Register netdev
- */
rc = register_netdev(netdev);
if (rc) {
pr_err("Cannot register net device\n");
^ permalink raw reply related
* [PATCH 2/2] af_unix: optimize unix_dgram_poll()
From: Eric Dumazet @ 2010-10-31 15:38 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Davide Libenzi, Alban Crequy
unix_dgram_poll() is pretty expensive to check POLLOUT status, because
it has to lock the socket to get its peer, take a reference on the peer
to check its receive queue status, and queue another poll_wait on
peer_wait. This all can be avoided if the process calling
unix_dgram_poll() is not interested in POLLOUT status. It makes
unix_dgram_recvmsg() faster by not queueing irrelevant pollers in
peer_wait.
On a test program provided by Alan Crequy :
Before:
real 0m0.211s
user 0m0.000s
sys 0m0.208s
After:
real 0m0.044s
user 0m0.000s
sys 0m0.040s
Suggested-by: Davide Libenzi <davidel@xmailserver.org>
Reported-by: Alban Crequy <alban.crequy@collabora.co.uk>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/unix/af_unix.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 7375131..7067c5d 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2089,6 +2089,10 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
return mask;
}
+ /* No write status requested, avoid expensive OUT tests. */
+ if (wait && !(wait->key & (POLLWRBAND | POLLWRNORM | POLLOUT)))
+ return mask;
+
writable = unix_writable(sk);
other = unix_peer_get(sk);
if (other) {
^ permalink raw reply related
* [PATCH 1/2] af_unix: fix unix_dgram_poll() behavior for EPOLLOUT event
From: Eric Dumazet @ 2010-10-31 15:36 UTC (permalink / raw)
To: Alban Crequy, David Miller; +Cc: netdev, Davide Libenzi
In-Reply-To: <20101030224703.065e70f6@chocolatine.cbg.collabora.co.uk>
Le samedi 30 octobre 2010 à 22:47 +0100, Alban Crequy a écrit :
> Le Sat, 30 Oct 2010 15:17:58 +0200,
> Eric Dumazet <eric.dumazet@gmail.com> a écrit :
>
> > > Problem is the peer_wait, that epoll doesnt seem to be plugged into.
> > >
> > > Bug is in unix_dgram_poll()
> > >
> > > It calls sock_poll_wait( ... &unix_sk(other)->peer_wait,) only if
> > > socket is 'writable'. Its a clear bug
>
> Yes, it looks weird...
>
> > > Try this patch please ?
>
> I will be away from computer and I will continue to work on this from
> the 20th of November.
OK, no problem. I tried it and it solves the problem. Here is an
official patch submission.
David, for your convenience, I cooked a patch serie for the 2 patches
against af_unix unix_dgram_poll().
The third patch (af_unix: unix_write_space() use keyed wakeups)) can be
applied as is.
Thanks !
[PATCH 1/2] af_unix: fix unix_dgram_poll() behavior for EPOLLOUT event
Alban Crequy reported a problem with connected dgram af_unix sockets and
provided a test program. epoll() would miss to send an EPOLLOUT event
when a thread unqueues a packet from the other peer, making its receive
queue not full.
This is because unix_dgram_poll() fails to call sock_poll_wait(file,
&unix_sk(other)->peer_wait, wait);
if the socket is not writeable at the time epoll_ctl(ADD) is called.
We must call sock_poll_wait(), regardless of 'writable' status, so that
epoll can be notified later of states changes.
Misc: avoids testing twice (sk->sk_shutdown & RCV_SHUTDOWN)
Reported-by: Alban Crequy <alban.crequy@collabora.co.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/unix/af_unix.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0ebc777..7375131 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2072,13 +2072,12 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
mask |= POLLERR;
if (sk->sk_shutdown & RCV_SHUTDOWN)
- mask |= POLLRDHUP;
+ mask |= POLLRDHUP | POLLIN | POLLRDNORM;
if (sk->sk_shutdown == SHUTDOWN_MASK)
mask |= POLLHUP;
/* readable? */
- if (!skb_queue_empty(&sk->sk_receive_queue) ||
- (sk->sk_shutdown & RCV_SHUTDOWN))
+ if (!skb_queue_empty(&sk->sk_receive_queue))
mask |= POLLIN | POLLRDNORM;
/* Connection-based need to check for termination and startup */
@@ -2090,20 +2089,15 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
return mask;
}
- /* writable? */
writable = unix_writable(sk);
- if (writable) {
- other = unix_peer_get(sk);
- if (other) {
- if (unix_peer(other) != sk) {
- sock_poll_wait(file, &unix_sk(other)->peer_wait,
- wait);
- if (unix_recvq_full(other))
- writable = 0;
- }
-
- sock_put(other);
+ other = unix_peer_get(sk);
+ if (other) {
+ if (unix_peer(other) != sk) {
+ sock_poll_wait(file, &unix_sk(other)->peer_wait, wait);
+ if (unix_recvq_full(other))
+ writable = 0;
}
+ sock_put(other);
}
if (writable)
^ permalink raw reply related
* Re: [PATCH v2 02/22] bitops: rename generic little-endian bitops functions
From: Hans-Christian Egtvedt @ 2010-10-31 14:02 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, Arnd Bergmann, Christoph Hellwig,
Andrew Morton, Hans-Christian Egtvedt, Geert Uytterhoeven,
Roman Zippel, Andreas Schwab, linux-m68k, Greg Ungerer,
Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, Andy Grover,
rds-devel, David S. Miller, netdev, Avi Kivity, Marcelo Tosatti,
kvm
In-Reply-To: <1287672077-5797-3-git-send-email-akinobu.mita@gmail.com>
Around Thu 21 Oct 2010 23:40:57 +0900 or thereabout, Akinobu Mita wrote:
> As a preparation for providing little-endian bitops for all architectures,
> This removes generic_ prefix from little-endian bitops function names
> in asm-generic/bitops/le.h.
>
> s/generic_find_next_le_bit/find_next_le_bit/
> s/generic_find_next_zero_le_bit/find_next_zero_le_bit/
> s/generic_find_first_zero_le_bit/find_first_zero_le_bit/
> s/generic___test_and_set_le_bit/__test_and_set_le_bit/
> s/generic___test_and_clear_le_bit/__test_and_clear_le_bit/
> s/generic_test_le_bit/test_le_bit/
> s/generic___set_le_bit/__set_le_bit/
> s/generic___clear_le_bit/__clear_le_bit/
> s/generic_test_and_set_le_bit/test_and_set_le_bit/
> s/generic_test_and_clear_le_bit/test_and_clear_le_bit/
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Roman Zippel <zippel@linux-m68k.org>
> Cc: Andreas Schwab <schwab@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: Greg Ungerer <gerg@uclinux.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Andy Grover <andy.grover@oracle.com>
> Cc: rds-devel@oss.oracle.com
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> Cc: kvm@vger.kernel.org
> ---
> No change from previous submission
>
> arch/avr32/kernel/avr32_ksyms.c | 4 ++--
> arch/avr32/lib/findbit.S | 4 ++--
For the AVR32 changes.
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
<snipp patch>
--
Best regards, Hans-Christian Egtvedt
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox