* Re: [PATCH] phylib: Add autoload support for the LXT973 phy.
From: David Woodhouse @ 2010-06-23 9:00 UTC (permalink / raw)
To: Richard Cochran; +Cc: netdev
In-Reply-To: <20100623053723.GA3404@riccoc20.at.omicron.at>
On Wed, 2010-06-23 at 07:37 +0200, Richard Cochran wrote:
>
> Question about the whole PHY MODULE_DEVICE_TABLE system:
>
> I recently posted a phy driver for the National Semiconductor
> DP83640. During development, I used drivers/net/arm/ixp4xx_eth.c as
> the MAC driver, which was linked into the kernel (not a module). I
> noticed that the phy driver's probe function only gets called if the
> phy driver is also statically linked, but not when it is loaded as a
> module.
>
> Is this the correct behavior?
Hm, that seems like the _expected_ behaviour, certainly. The MAC driver
will probe its device at boot time, and will issue a request_module() to
load the a specific PHY driver if there is one. When no such module
turns up (which it won't if you have no file system mounted yet), it'll
just fall back to the generic PHY support.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
^ permalink raw reply
* Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
From: Herbert Xu @ 2010-06-23 9:52 UTC (permalink / raw)
To: Dong, Eddie
Cc: Xin, Xiaohui, Stephen Hemminger, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com,
mingo@elte.hu, davem@davemloft.net, jdike@linux.intel.com
In-Reply-To: <1A42CE6F5F474C41B63392A5F80372B21F58CD9A@shsmsx501.ccr.corp.intel.com>
On Wed, Jun 23, 2010 at 04:09:40PM +0800, Dong, Eddie wrote:
>
> Xiaohui & Herbert:
> Mixing copy of head & 0-copy of bulk data imposes additional challange to find the guest buffer. The backend driver may be unable to find a spare guest buffer from virtqueue at that time which may block the receiving process then.
> Can't we completely eliminate netdev_alloc_skb here? Assigning guest buffer at this time makes life much easier.
I'm not sure I understand you concern. If you mean that when
the guest doesn't give enough pages to the host and the host
can't receive on behalf of the guest then isn't that already
the case with the original patch-set?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <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
* [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Ian Munsie @ 2010-06-23 10:03 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
Cc: Jason Baron, Frederic Weisbecker, Steven Rostedt, Ingo Molnar,
Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Ian Munsie, Alexander Viro, Andrew Morton, Jeff Moyer,
David Howells, Oleg Nesterov, Arnd Bergmann, David S. Miller,
Greg Kroah-Hartman, Dinakar Guniguntala, Thomas Gleixner,
Ingo Molnar, Eric Biederman, Simon Kagstrom <simon.kags
In-Reply-To: <1277287401-28571-1-git-send-email-imunsie@au1.ibm.com>
From: Ian Munsie <imunsie@au1.ibm.com>
This patch converts numerous trivial compat syscalls through the generic
kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
---
fs/compat.c | 2 +-
fs/compat_ioctl.c | 4 ++--
ipc/compat_mq.c | 24 ++++++++++++------------
kernel/futex_compat.c | 19 ++++++++++---------
kernel/kexec.c | 8 ++++----
kernel/ptrace.c | 4 ++--
kernel/sysctl_binary.c | 2 +-
mm/mempolicy.c | 19 ++++++++++---------
net/compat.c | 28 ++++++++++++++--------------
9 files changed, 56 insertions(+), 54 deletions(-)
diff --git a/fs/compat.c b/fs/compat.c
index df0b502..9897b7b 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1823,7 +1823,7 @@ struct compat_sel_arg_struct {
compat_uptr_t tvp;
};
-asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg)
+COMPAT_SYSCALL_DEFINE1(old_select, struct compat_sel_arg_struct __user *, arg)
{
struct compat_sel_arg_struct a;
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 641640d..60d7e91 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1674,8 +1674,8 @@ static int compat_ioctl_check_table(unsigned int xcmd)
return ioctl_pointer[i] == xcmd;
}
-asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
- unsigned long arg)
+COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd,
+ unsigned long, arg)
{
struct file *filp;
int error = -EBADF;
diff --git a/ipc/compat_mq.c b/ipc/compat_mq.c
index d8d1e9f..53593d3 100644
--- a/ipc/compat_mq.c
+++ b/ipc/compat_mq.c
@@ -46,9 +46,9 @@ static inline int put_compat_mq_attr(const struct mq_attr *attr,
| __put_user(attr->mq_curmsgs, &uattr->mq_curmsgs);
}
-asmlinkage long compat_sys_mq_open(const char __user *u_name,
- int oflag, compat_mode_t mode,
- struct compat_mq_attr __user *u_attr)
+COMPAT_SYSCALL_DEFINE4(mq_open, const char __user *, u_name,
+ int, oflag, compat_mode_t, mode,
+ struct compat_mq_attr __user *, u_attr)
{
void __user *p = NULL;
if (u_attr && oflag & O_CREAT) {
@@ -75,10 +75,10 @@ static int compat_prepare_timeout(struct timespec __user * *p,
return 0;
}
-asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
- const char __user *u_msg_ptr,
- size_t msg_len, unsigned int msg_prio,
- const struct compat_timespec __user *u_abs_timeout)
+COMPAT_SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes,
+ const char __user *, u_msg_ptr,
+ size_t, msg_len, unsigned int, msg_prio,
+ const struct compat_timespec __user *, u_abs_timeout)
{
struct timespec __user *u_ts;
@@ -102,8 +102,8 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
u_msg_prio, u_ts);
}
-asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
- const struct compat_sigevent __user *u_notification)
+COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
+ const struct compat_sigevent __user *, u_notification)
{
struct sigevent __user *p = NULL;
if (u_notification) {
@@ -119,9 +119,9 @@ asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
return sys_mq_notify(mqdes, p);
}
-asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
- const struct compat_mq_attr __user *u_mqstat,
- struct compat_mq_attr __user *u_omqstat)
+COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
+ const struct compat_mq_attr __user *, u_mqstat,
+ struct compat_mq_attr __user *, u_omqstat)
{
struct mq_attr mqstat;
struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p));
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index d49afb2..d798c9f 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -10,6 +10,7 @@
#include <linux/compat.h>
#include <linux/nsproxy.h>
#include <linux/futex.h>
+#include <linux/syscalls.h>
#include <asm/uaccess.h>
@@ -114,9 +115,9 @@ void compat_exit_robust_list(struct task_struct *curr)
}
}
-asmlinkage long
-compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
- compat_size_t len)
+COMPAT_SYSCALL_DEFINE2(set_robust_list,
+ struct compat_robust_list_head __user *, head,
+ compat_size_t, len)
{
if (!futex_cmpxchg_enabled)
return -ENOSYS;
@@ -129,9 +130,9 @@ compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
return 0;
}
-asmlinkage long
-compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
- compat_size_t __user *len_ptr)
+COMPAT_SYSCALL_DEFINE3(get_robust_list, int, pid,
+ compat_uptr_t __user *, head_ptr,
+ compat_size_t __user *, len_ptr)
{
struct compat_robust_list_head __user *head;
unsigned long ret;
@@ -170,9 +171,9 @@ err_unlock:
return ret;
}
-asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
- struct compat_timespec __user *utime, u32 __user *uaddr2,
- u32 val3)
+COMPAT_SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
+ struct compat_timespec __user *, utime, u32 __user *, uaddr2,
+ u32, val3)
{
struct timespec ts;
ktime_t t, *tp = NULL;
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 474a847..0b261ed 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1024,10 +1024,10 @@ out:
}
#ifdef CONFIG_COMPAT
-asmlinkage long compat_sys_kexec_load(unsigned long entry,
- unsigned long nr_segments,
- struct compat_kexec_segment __user *segments,
- unsigned long flags)
+COMPAT_SYSCALL_DEFINE4(kexec_load, unsigned long, entry,
+ unsigned long, nr_segments,
+ struct compat_kexec_segment __user *, segments,
+ unsigned long, flags)
{
struct compat_kexec_segment in;
struct kexec_segment out, __user *ksegments;
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 74a3d69..0d91d7f 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -826,8 +826,8 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
return ret;
}
-asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
- compat_long_t addr, compat_long_t data)
+COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
+ compat_long_t, addr, compat_long_t, data)
{
struct task_struct *child;
long ret;
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index 1357c57..fb061c7 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -1502,7 +1502,7 @@ struct compat_sysctl_args {
compat_ulong_t __unused[4];
};
-asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args)
+COMPAT_SYSCALL_DEFINE1(sysctl, struct compat_sysctl_args __user *, args)
{
struct compat_sysctl_args tmp;
compat_size_t __user *compat_oldlenp;
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 5d6fb33..b9fbceb 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1372,10 +1372,10 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,
#ifdef CONFIG_COMPAT
-asmlinkage long compat_sys_get_mempolicy(int __user *policy,
- compat_ulong_t __user *nmask,
- compat_ulong_t maxnode,
- compat_ulong_t addr, compat_ulong_t flags)
+COMPAT_SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,
+ compat_ulong_t __user *, nmask,
+ compat_ulong_t, maxnode,
+ compat_ulong_t, addr, compat_ulong_t, flags)
{
long err;
unsigned long __user *nm = NULL;
@@ -1400,8 +1400,9 @@ asmlinkage long compat_sys_get_mempolicy(int __user *policy,
return err;
}
-asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
- compat_ulong_t maxnode)
+COMPAT_SYSCALL_DEFINE3(set_mempolicy, int, mode,
+ compat_ulong_t __user *, nmask,
+ compat_ulong_t, maxnode)
{
long err = 0;
unsigned long __user *nm = NULL;
@@ -1423,9 +1424,9 @@ asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
return sys_set_mempolicy(mode, nm, nr_bits+1);
}
-asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
- compat_ulong_t mode, compat_ulong_t __user *nmask,
- compat_ulong_t maxnode, compat_ulong_t flags)
+COMPAT_SYSCALL_DEFINE6(mbind, compat_ulong_t, start, compat_ulong_t, len,
+ compat_ulong_t, mode, compat_ulong_t __user *, nmask,
+ compat_ulong_t, maxnode, compat_ulong_t, flags)
{
long err = 0;
unsigned long __user *nm = NULL;
diff --git a/net/compat.c b/net/compat.c
index ec24d9e..eb861c6 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -385,8 +385,8 @@ static int compat_sock_setsockopt(struct socket *sock, int level, int optname,
return sock_setsockopt(sock, level, optname, optval, optlen);
}
-asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
- char __user *optval, unsigned int optlen)
+COMPAT_SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname,
+ char __user *, optval, unsigned int, optlen)
{
int err;
struct socket *sock;
@@ -498,8 +498,8 @@ int compat_sock_get_timestampns(struct sock *sk, struct timespec __user *usersta
}
EXPORT_SYMBOL(compat_sock_get_timestampns);
-asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
- char __user *optval, int __user *optlen)
+COMPAT_SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname,
+ char __user *, optval, int __user *, optlen)
{
int err;
struct socket *sock;
@@ -731,31 +731,31 @@ static unsigned char nas[20]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
AL(4),AL(5)};
#undef AL
-asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags)
+COMPAT_SYSCALL_DEFINE3(sendmsg, int, fd, struct compat_msghdr __user *, msg, unsigned, flags)
{
return sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
}
-asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags)
+COMPAT_SYSCALL_DEFINE3(recvmsg, int, fd, struct compat_msghdr __user *, msg, unsigned int, flags)
{
return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT);
}
-asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, unsigned flags)
+COMPAT_SYSCALL_DEFINE4(recv, int, fd, void __user *, buf, size_t, len, unsigned, flags)
{
return sys_recv(fd, buf, len, flags | MSG_CMSG_COMPAT);
}
-asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len,
- unsigned flags, struct sockaddr __user *addr,
- int __user *addrlen)
+COMPAT_SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, buf, size_t, len,
+ unsigned, flags, struct sockaddr __user *, addr,
+ int __user *, addrlen)
{
return sys_recvfrom(fd, buf, len, flags | MSG_CMSG_COMPAT, addr, addrlen);
}
-asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
- unsigned vlen, unsigned int flags,
- struct compat_timespec __user *timeout)
+COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg,
+ unsigned, vlen, unsigned int, flags,
+ struct compat_timespec __user *, timeout)
{
int datagrams;
struct timespec ktspec;
@@ -775,7 +775,7 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
return datagrams;
}
-asmlinkage long compat_sys_socketcall(int call, u32 __user *args)
+COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
{
int ret;
u32 a[6];
--
1.7.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* RE: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
From: Dong, Eddie @ 2010-06-23 10:05 UTC (permalink / raw)
To: Herbert Xu
Cc: Xin, Xiaohui, Stephen Hemminger, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com,
mingo@elte.hu, davem@davemloft.net, jdike@linux.intel.com,
Dong, Eddie
In-Reply-To: <20100623095254.GA32491@gondor.apana.org.au>
Herbert Xu wrote:
> On Wed, Jun 23, 2010 at 04:09:40PM +0800, Dong, Eddie wrote:
>>
>> Xiaohui & Herbert:
>> Mixing copy of head & 0-copy of bulk data imposes additional
>> challange to find the guest buffer. The backend driver may be
>> unable to find a spare guest buffer from virtqueue at that time
>> which may block the receiving process then. Can't we completely
>> eliminate netdev_alloc_skb here? Assigning guest buffer at this time
>> makes life much easier.
>
> I'm not sure I understand you concern. If you mean that when
> the guest doesn't give enough pages to the host and the host
> can't receive on behalf of the guest then isn't that already
> the case with the original patch-set?
>
I mean once the frontend side driver post the buffers to the backend driver, the backend driver will "immediately" use that buffers to compose skb or gro_frags and post them to the assigned host NIC driver as receive buffers. In that case, if the backend driver recieves a packet from the NIC that requires to do copy, it may be unable to find additional free guest buffer because all of them are already used by the NIC driver. We have to reserve some guest buffers for the possible copy even if the buffer address is not identified by original skb :(
Thx, Eddie
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Andi Kleen @ 2010-06-23 10:19 UTC (permalink / raw)
To: Ian Munsie
Cc: linux-kernel, linuxppc-dev, Jason Baron, Frederic Weisbecker,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong, Sam Ravnborg
In-Reply-To: <1277287401-28571-32-git-send-email-imunsie@au1.ibm.com>
, Ian Munsie wrote:
> From: Ian Munsie<imunsie@au1.ibm.com>
>
> This patch converts numerous trivial compat syscalls through the generic
> kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
Why? This just makes the code look uglier and the functions harder
to grep for.
-Andi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Frederic Weisbecker @ 2010-06-23 10:29 UTC (permalink / raw)
To: Andi Kleen
Cc: Ian Munsie, linux-kernel, linuxppc-dev, Jason Baron,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong, Sam Ravnborg, Rol
In-Reply-To: <4C21DFBA.2070202@linux.intel.com>
On Wed, Jun 23, 2010 at 12:19:38PM +0200, Andi Kleen wrote:
> , Ian Munsie wrote:
>> From: Ian Munsie<imunsie@au1.ibm.com>
>>
>> This patch converts numerous trivial compat syscalls through the generic
>> kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
>
> Why? This just makes the code look uglier and the functions harder
> to grep for.
Because it makes them usable with syscall tracing.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: KOSAKI Motohiro @ 2010-06-23 10:30 UTC (permalink / raw)
To: Andi Kleen
Cc: kosaki.motohiro, Ian Munsie, linux-kernel, linuxppc-dev,
Jason Baron, Frederic Weisbecker, Steven Rostedt, Ingo Molnar,
Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Alexander Viro, Andrew Morton, Jeff Moyer, David Howells,
Oleg Nesterov, Arnd Bergmann, David S. Miller, Greg Kroah-Hartman,
Dinakar Guniguntala, Thomas Gleixner, Ingo
In-Reply-To: <4C21DFBA.2070202@linux.intel.com>
> , Ian Munsie wrote:
> > From: Ian Munsie<imunsie@au1.ibm.com>
> >
> > This patch converts numerous trivial compat syscalls through the generic
> > kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
>
> Why? This just makes the code look uglier and the functions harder
> to grep for.
I guess trace-syscall feature need to override COMPAT_SYSCALL_DEFINE. but
It's only guess...
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH] snmp: fix SNMP_ADD_STATS()
From: Eric Dumazet @ 2010-06-23 10:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Tom Herbert
commit aa2ea0586d9d (tcp: fix outsegs stat for TSO segments) incorrectly
assumed SNMP_ADD_STATS() was used from BH context.
Fix this using mib[!in_softirq()] instead of mib[0]
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tom Herbert <therbert@google.com>
---
include/net/snmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 92456f1..899003d 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -134,7 +134,7 @@ struct linux_xfrm_mib {
#define SNMP_ADD_STATS_USER(mib, field, addend) \
this_cpu_add(mib[1]->mibs[field], addend)
#define SNMP_ADD_STATS(mib, field, addend) \
- this_cpu_add(mib[0]->mibs[field], addend)
+ this_cpu_add(mib[!in_softirq()]->mibs[field], addend)
/*
* Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
* to make @ptr a non-percpu pointer.
^ permalink raw reply related
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Andi Kleen @ 2010-06-23 10:37 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Ian Munsie, linux-kernel, linuxppc-dev, Jason Baron,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong, Sam Ravnborg
In-Reply-To: <20100623102931.GB5242@nowhere>
, Frederic Weisbecker wrote:
> On Wed, Jun 23, 2010 at 12:19:38PM +0200, Andi Kleen wrote:
>> , Ian Munsie wrote:
>>> From: Ian Munsie<imunsie@au1.ibm.com>
>>>
>>> This patch converts numerous trivial compat syscalls through the generic
>>> kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
>>
>> Why? This just makes the code look uglier and the functions harder
>> to grep for.
>
>
> Because it makes them usable with syscall tracing.
Ok that information is missing in the changelog then.
Also I hope the uglification<->usefullness factor is really worth it.
The patch is certainly no slouch on the uglification side.
It also has maintenance costs, e.g. I doubt ctags and cscope
will be able to deal with these kinds of macros, so it has a
high cost for everyone using these tools. For those
it would be actually better if you used separate annotation
that does not confuse standard C parsers.
-Andi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH] net: add dependency on fw class module
From: Ben Hutchings @ 2010-06-23 11:19 UTC (permalink / raw)
To: Amit Kumar Salecha; +Cc: davem, netdev, ameen.rahman, Anirban Chakraborty
In-Reply-To: <1277276075-29322-1-git-send-email-amit.salecha@qlogic.com>
On Tue, 2010-06-22 at 23:54 -0700, Amit Kumar Salecha wrote:
> From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
>
> netxen_nic and qlcnic driver depends on firmware_class module.
[...]
By the way, I noticed that these drivers are very similar, and it looks
like qlcnic has code for a bunch of NetXen boards even though it doesn't
include their device IDs in its device ID table. Have you considered
merging the two?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Frederic Weisbecker @ 2010-06-23 11:38 UTC (permalink / raw)
To: Andi Kleen
Cc: Ian Munsie, linux-kernel, linuxppc-dev, Jason Baron,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong, Sam Ravnborg, Rol
In-Reply-To: <4C21E3F8.9000405@linux.intel.com>
On Wed, Jun 23, 2010 at 12:37:44PM +0200, Andi Kleen wrote:
> , Frederic Weisbecker wrote:
>> On Wed, Jun 23, 2010 at 12:19:38PM +0200, Andi Kleen wrote:
>>> , Ian Munsie wrote:
>>>> From: Ian Munsie<imunsie@au1.ibm.com>
>>>>
>>>> This patch converts numerous trivial compat syscalls through the generic
>>>> kernel code to use the COMPAT_SYSCALL_DEFINE family of macros.
>>>
>>> Why? This just makes the code look uglier and the functions harder
>>> to grep for.
>>
>>
>> Because it makes them usable with syscall tracing.
>
> Ok that information is missing in the changelog then.
Agreed, the changelog lacks the purpose of what it does.
> Also I hope the uglification<->usefullness factor is really worth it.
> The patch is certainly no slouch on the uglification side.
It's worth because the kernel's syscall tracing is not complete, we lack all
the compat part.
These wrappers let us create TRACE_EVENT() for every syscalls automatically.
If we had to create them manually, the uglification would be way much more worse.
Most syscalls use the syscall wrappers already, so the uglification
is there mostly. We just forgot to uglify a bunch of them :)
> It also has maintenance costs, e.g. I doubt ctags and cscope
> will be able to deal with these kinds of macros, so it has a
> high cost for everyone using these tools. For those
> it would be actually better if you used separate annotation
> that does not confuse standard C parsers.
I haven't heard any complains about existing syscalls wrappers.
What kind of annotations could solve that?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* RE: [PATCH] net: add dependency on fw class module
From: Amit Salecha @ 2010-06-23 11:49 UTC (permalink / raw)
To: Ben Hutchings
Cc: davem@davemloft.net, netdev@vger.kernel.org, Ameen Rahman,
Anirban Chakraborty
In-Reply-To: <1277291941.26161.9.camel@localhost>
Actually that is not actually reflect to board type.
"board_type" is a encoding to find out number of physical port and phy speed.
NX3031 (netxen_nic) and QLOGIC CNA (qlcnic) device have some common board form.
But not all board types are valid for QLOGIC CNA device. We will clean this up.
Thanks for pointing this out.
-Amit
-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com]
Sent: Wednesday, June 23, 2010 4:49 PM
To: Amit Salecha
Cc: davem@davemloft.net; netdev@vger.kernel.org; Ameen Rahman; Anirban Chakraborty
Subject: Re: [PATCH] net: add dependency on fw class module
On Tue, 2010-06-22 at 23:54 -0700, Amit Kumar Salecha wrote:
> From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
>
> netxen_nic and qlcnic driver depends on firmware_class module.
[...]
By the way, I noticed that these drivers are very similar, and it looks
like qlcnic has code for a bunch of NetXen boards even though it doesn't
include their device IDs in its device ID table. Have you considered
merging the two?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Andi Kleen @ 2010-06-23 12:35 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Ian Munsie, linux-kernel, linuxppc-dev, Jason Baron,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong, Sam Ravnborg
In-Reply-To: <20100623113806.GD5242@nowhere>
>
> I haven't heard any complains about existing syscalls wrappers.
At least for me they always interrupt my grepping.
>
> What kind of annotations could solve that?
If you put the annotation in a separate macro and leave the original
prototype alone. Then C parsers could still parse it.
-Andi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: Christoph Hellwig @ 2010-06-23 12:41 UTC (permalink / raw)
To: Andi Kleen
Cc: Frederic Weisbecker, Ian Munsie, linux-kernel, linuxppc-dev,
Jason Baron, Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman, Simon Kagstrom,
WANG Cong
In-Reply-To: <4C21FF9A.2040207@linux.intel.com>
On Wed, Jun 23, 2010 at 02:35:38PM +0200, Andi Kleen wrote:
> >I haven't heard any complains about existing syscalls wrappers.
>
> At least for me they always interrupt my grepping.
>
> >
> >What kind of annotations could solve that?
>
> If you put the annotation in a separate macro and leave the original
> prototype alone. Then C parsers could still parse it.
I personally hate the way SYSCALL_DEFINE works with passion, mostly
for the grep reason, but also because it looks horribly ugly.
But there is no reason not to be consistent here. We already use
the wrappers for all native system calls, so leaving the compat
calls out doesn't make any sense. And I'd cheer for anyone who
comes up with a better scheme for the native and compat wrappers.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH] ipv6: remove ipv6_statistics
From: Eric Dumazet @ 2010-06-23 12:51 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Hideaki YOSHIFUJI, Denis V.Lunev, Alexey Dobriyan
commit 9261e5370112 (ipv6: making ip and icmp statistics per/namespace)
forgot to remove ipv6_statistics variable.
commit bc417d99bf27 (ipv6: remove stale MIB definitions) took care of
icmpv6_statistics & icmpv6msg_statistics
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Denis V. Lunev <den@openvz.org>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
---
net/ipv6/ipv6_sockglue.c | 2 --
1 files changed, 2 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index bd43f01..a7f66bc 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -55,8 +55,6 @@
#include <asm/uaccess.h>
-DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly;
-
struct ip6_ra_chain *ip6_ra_chain;
DEFINE_RWLOCK(ip6_ra_lock);
^ permalink raw reply related
* Re: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
From: Justin P. Mattock @ 2010-06-23 14:41 UTC (permalink / raw)
To: John W. Linville; +Cc: Linux Kernel Mailing List, netdev
In-Reply-To: <20100623141622.GC15205@tuxdriver.com>
On 06/23/2010 07:16 AM, John W. Linville wrote:
> On Tue, Jun 22, 2010 at 04:16:53PM -0700, Justin Mattock wrote:
>> I remember ipsec was able to work cleanly on my machines probably
>> about 4/6 months ago
>> now I get this:
>
> <snip>
>
> Perhaps netdev would be a more appropriate list than linux-wireless
> for this?
>
> John
alright added the cc's..
almost done bisecting..hopefully this points to
the right area..(if not I'll re-bisect until I get this).
as for the troubled machines I've a macbookpro2,2(no proprietary
stuff) and an imac9,1 with broadcom-sta(blah) both
seem to hit this right when the ipsec transaction starts
with ssh, vncviewer..(last good kernel I have is
2.6.33-rc5-01007-ge9449d8).
Justin P. Mattock
^ permalink raw reply
* Re: [PATCH] ipv6: fix NULL reference in proxy neighbor discovery
From: YOSHIFUJI Hideaki @ 2010-06-23 14:44 UTC (permalink / raw)
To: Stephen Hemminger, David Miller
Cc: Andreas Klauer, Hagen Paul Pfeifer, netdev, Octavian Purdila,
YOSHIFUJI Hideaki
In-Reply-To: <20100621140013.508741df@nehalam>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
(2010/06/22 6:00), Stephen Hemminger wrote:
> The addition of TLLAO option created a kernel OOPS regression
> for the case where neighbor advertisement is being sent via
> proxy path. When using proxy, ipv6_get_ifaddr() returns NULL
> causing the NULL dereference.
>
> Change causing the bug was:
> commit f7734fdf61ec6bb848e0bafc1fb8bad2c124bb50
> Author: Octavian Purdila<opurdila@ixiacom.com>
> Date: Fri Oct 2 11:39:15 2009 +0000
>
> make TLLAO option for NA packets configurable
>
> Signed-off-by: Stephen Hemminger<shemminger@vyatta.com>
>
> ---
> Patch for -net and -stable.
> Applies to 2.6.33 and later.
>
> --- a/net/ipv6/ndisc.c 2010-06-11 08:13:13.008657498 -0700
> +++ b/net/ipv6/ndisc.c 2010-06-21 13:52:57.961486303 -0700
> @@ -586,6 +586,7 @@ static void ndisc_send_na(struct net_dev
> src_addr = solicited_addr;
> if (ifp->flags& IFA_F_OPTIMISTIC)
> override = 0;
> + inc_opt |= ifp->idev->cnf.force_tllao;
> in6_ifa_put(ifp);
> } else {
> if (ipv6_dev_get_saddr(dev_net(dev), dev, daddr,
> @@ -599,7 +600,6 @@ static void ndisc_send_na(struct net_dev
> icmp6h.icmp6_solicited = solicited;
> icmp6h.icmp6_override = override;
>
> - inc_opt |= ifp->idev->cnf.force_tllao;
> __ndisc_send(dev, neigh, daddr, src_addr,
> &icmp6h, solicited_addr,
> inc_opt ? ND_OPT_TARGET_LL_ADDR : 0);
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] gainfar.c : skb_over_panic
From: Eran Liberty @ 2010-06-23 15:03 UTC (permalink / raw)
To: David Miller; +Cc: galak, netdev
In-Reply-To: <20100617.122030.112600189.davem@davemloft.net>
David Miller wrote:
> From: Eran Liberty <liberty@extricom.com>
> Date: Thu, 17 Jun 2010 19:32:54 +0300
>
>
>> I have demonstrated skb_over_panic with linux 2.6.32.15 on a mpc8548
>> based product.
>>
>
> A fix for a similar bug was necessary for the ucc_geth driver,
> see below.
>
> The real problem is that skb->data assignment, the rest of the
> SKB state has to be reset, and not doing that is what results in
> the skb_over_panic calls.
>
> >From db176edc89abbf22e6db6853f8581f9475fe8ec1 Mon Sep 17 00:00:00 2001
> From: Sergey Matyukevich <geomatsi@gmail.com>
> Date: Mon, 14 Jun 2010 06:35:20 +0000
> Subject: [PATCH] ucc_geth: fix for RX skb buffers recycling
>
> This patch implements a proper modification of RX skb buffers before
> recycling. Adjusting only skb->data is not enough because after that
> skb->tail and skb->len become incorrect.
>
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/ucc_geth.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 4a34833..807470e 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3215,6 +3215,8 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
> __func__, __LINE__, (u32) skb);
> if (skb) {
> skb->data = skb->head + NET_SKB_PAD;
> + skb->len = 0;
> + skb_reset_tail_pointer(skb);
> __skb_queue_head(&ugeth->rx_recycle, skb);
> }
>
>
When I do go via this code this patch helps. But, I have managed to
reach the skb_over_panic without going first via __skb_queue_head()
which render this patch useless... So I am investigating this before
suggesting any patch.
doing something like this:
if (unlikely(skb->tail + pkt_len > skb->end)) {
pr_err("gfar_clean_rx_ring(): skb_over_panic event avoided\n");
dev_kfree_skb_any(skb);
} else {
skb_put(skb, pkt_len);
dev->stats.rx_bytes += pkt_len;
if (in_irq() || irqs_disabled())
printk("Interrupt problem!\n");
gfar_process_frame(dev, skb, amount_pull);
}
successfully avoids the skb_over_panic(), But I rather find the offending skb creator then continuously defend against its arrival.
-- Liberty
^ permalink raw reply
* Re: [PATCH 31/40] trace syscalls: Convert various generic compat syscalls
From: H. Peter Anvin @ 2010-06-23 15:51 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: Andi Kleen, Ian Munsie, linux-kernel, linuxppc-dev, Jason Baron,
Steven Rostedt, Ingo Molnar, Benjamin Herrenschmidt,
Paul Mackerras, Michael Ellerman, Alexander Viro, Andrew Morton,
Jeff Moyer, David Howells, Oleg Nesterov, Arnd Bergmann,
David S. Miller, Greg Kroah-Hartman, Dinakar Guniguntala,
Thomas Gleixner, Ingo Molnar, Eric Biederman <ebie
In-Reply-To: <20100623113806.GD5242@nowhere>
On 06/23/2010 04:38 AM, Frederic Weisbecker wrote:
>
> I haven't heard any complains about existing syscalls wrappers.
>
Then you truly haven't been listening.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Question about xfrm by MARK feature
From: Gerd v. Egidy @ 2010-06-23 16:03 UTC (permalink / raw)
To: jamal; +Cc: timo.teras, kaber, herbert, netdev
Hi Jamal,
while looking through the 2.6.34 changelog I found the xfrm by MARK feature
you developed in february. I'm currently working on NAT for ipsec connections
and thought your feature might help me.
For example I have 2 different remote networks with the same ip network each
and both of them have a tunnel to the same local network. I map their IPs to
something different so I can distinguish them in the local network. But after
the nat the xfrm code sees two tunnels with exactly the same values. So this
can't work.
But if I understood your feature correctly, I can now mark the packets (e.g.
in iptables with ... -j MARK --set-mark 1) and have xfrm select the correct
ipsec tunnel via the mark. Correct?
But does your feature also set the mark on packets decrypted by xfrm? I need
some way to find out from which tunnel the packet came to correctly treat it.
Do you know if any of the ipsec solutions for linux (e.g. strongswan,
openswan, racoon) already have support for this feature or are developing on
it?
Kind regards,
Gerd
--
Address (better: trap) for people I really don't want to get mail from:
jonas@cactusamerica.com
^ permalink raw reply
* Re: SO_REUSEPORT
From: Brian Bloniarz @ 2010-06-23 16:09 UTC (permalink / raw)
To: Alexander Clouter; +Cc: linux-kernel, netdev
In-Reply-To: <06r8f7-jsn.ln1@chipmunk.wormnet.eu>
On 06/23/2010 03:54 AM, Alexander Clouter wrote:
> Hi,
>
> Tim Prepscius <timprepscius@gmail.com> wrote:
>>
>> Is SO_REUSEPORT available 2.6.ish - (or any version)?
>> I've been searching for a conclusive answer to this question and can't
>> find it.
>>
> That will be a no then:
> ----
> alex@berk:~$ grep SO_REUSEPORT -r /usr/src/linux-2.6-stable/include/
> /usr/src/linux-2.6-stable/include/asm-generic/socket.h:/* To add :#define SO_REUSEPORT 15 */
> ----
>
>> (yes I know of SO_REUSEADDR, and I know the difference between this
>> and *PORT, and yes I know that I *definitely* need SO_REUSEPORT, no,
>> I'm unconcerned this may/may not be part of a "standard," yes I know
>> it is implemented differently on different systems, yes I know there
>> may be security problems, but no, I don't care about this.)
>>
> This really sounds like the sort of thing (for TCP/SCTP) where the
> 'master' process would maintain the listening socket and upon accept()
> you would fork() or pass the file descriptor off to a thread. This
> would make SO_REUSEPORT un-necessary and also your code would be
> portable.
>
> If you are doing things with UDP (or another datagram-esque stream) then
> your master listener could pass off the incoming packets to
> threads/processes trivially.
>
> Of course this depends on what you are doing, but my opinion is that the
> functionality has been unneeded so far by people in the kernel, so *I*
> must be doing something wrong ;)
Tom Herbert gave a pretty great description of why you
might want this functionality in his original patch submission:
http://kerneltrap.org/mailarchive/linux-netdev/2010/4/19/6274993
If you follow that thread though, there wasn't consensus about
the best architecture & API for it, and nothing has made it
yet.
I'm adding netdev to the cc, AFAIK it's the place for discussing
stuff like this.
^ permalink raw reply
* Re: Question about xfrm by MARK feature
From: Patrick McHardy @ 2010-06-23 16:15 UTC (permalink / raw)
To: Gerd v. Egidy; +Cc: jamal, timo.teras, herbert, netdev
In-Reply-To: <201006231803.17261.lists@egidy.de>
Gerd v. Egidy wrote:
> Hi Jamal,
>
> while looking through the 2.6.34 changelog I found the xfrm by MARK feature
> you developed in february. I'm currently working on NAT for ipsec connections
> and thought your feature might help me.
>
> For example I have 2 different remote networks with the same ip network each
> and both of them have a tunnel to the same local network. I map their IPs to
> something different so I can distinguish them in the local network. But after
> the nat the xfrm code sees two tunnels with exactly the same values. So this
> can't work.
>
> But if I understood your feature correctly, I can now mark the packets (e.g.
> in iptables with ... -j MARK --set-mark 1) and have xfrm select the correct
> ipsec tunnel via the mark. Correct?
>
> But does your feature also set the mark on packets decrypted by xfrm? I need
> some way to find out from which tunnel the packet came to correctly treat it.
>
You should be able to use the policy match to distinguish the tunnels,
f.i. by matching on the tunnel endpoints.
^ permalink raw reply
* Re: [PATCH] sky2: enable rx/tx in sky2_phy_reinit()
From: Brandon Philips @ 2010-06-23 17:00 UTC (permalink / raw)
To: Mike McCormack; +Cc: Stephen Hemminger, netdev, davem
In-Reply-To: <AANLkTilzHA_URoZONtMf6A9-IRV4wA2ncr0b8Jff1ge9@mail.gmail.com>
On 23:57 Tue 22 Jun 2010, Mike McCormack wrote:
> Tested, and verified that it fixes the bug reported.
Thanks for testing Mike.
While testing this I found a new unrelated bug. If I turn off speed
autoneg the interface stops sending packets until I turn off pause
autoneg also.
To illustrate start pinging some machine and run this:
$ ethtool --change eth0 speed 100 duplex full autoneg off
# At this point the ping stops
$ ethtool -A eth0 autoneg off
# Ping starts up again
When I tried capturing packets nothing was coming from the device.
0ea065e52eb6a0f029b5fa5ed2f142be1b66a153 implemeneted the behaviour of
having seperate pause and speed ethtool controls for sky2. Reverting
this (see quick ugly revert below) obviously fixes the issue.
Any ideas on how to fix this in a proper way though?
Cheers,
Brandon
>From 8de50faa1911933dc545f663a24f32d0caeea3b4 Mon Sep 17 00:00:00 2001
From: Brandon Philips <brandon@ifup.org>
Date: Wed, 23 Jun 2010 09:56:20 -0700
Subject: [PATCH] sky2: revert "fix pause negotiation"
Revert 0ea065e52eb6a0f029b5fa5ed2f142be1b66a153
---
drivers/net/sky2.c | 31 ++++++++++++-------------------
drivers/net/sky2.h | 2 ++
2 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 7985165..a638171 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -333,7 +333,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
struct sky2_port *sky2 = netdev_priv(hw->dev[port]);
u16 ctrl, ct1000, adv, pg, ledctrl, ledover, reg;
- if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
+ if (sky2->autoneg == AUTONEG_ENABLE &&
!(hw->flags & SKY2_HW_NEWER_PHY)) {
u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL);
@@ -375,7 +375,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO);
/* downshift on PHY 88E1112 and 88E1149 is changed */
- if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
+ if (sky2->autoneg == AUTONEG_ENABLE &&
(hw->flags & SKY2_HW_NEWER_PHY)) {
/* set downshift counter to 3x and enable downshift */
ctrl &= ~PHY_M_PC_DSC_MSK;
@@ -420,7 +420,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
adv = PHY_AN_CSMA;
reg = 0;
- if (sky2->flags & SKY2_FLAG_AUTO_SPEED) {
+ if (sky2->autoneg == AUTONEG_ENABLE) {
if (sky2_is_copper(hw)) {
if (sky2->advertising & ADVERTISED_1000baseT_Full)
ct1000 |= PHY_M_1000C_AFD;
@@ -435,11 +435,14 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
if (sky2->advertising & ADVERTISED_10baseT_Half)
adv |= PHY_M_AN_10_HD;
+ adv |= copper_fc_adv[sky2->flow_mode];
} else { /* special defines for FIBER (88E1040S only) */
if (sky2->advertising & ADVERTISED_1000baseT_Full)
adv |= PHY_M_AN_1000X_AFD;
if (sky2->advertising & ADVERTISED_1000baseT_Half)
adv |= PHY_M_AN_1000X_AHD;
+
+ adv |= fiber_fc_adv[sky2->flow_mode];
}
/* Restart Auto-negotiation */
@@ -448,8 +451,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
/* forced speed/duplex settings */
ct1000 = PHY_M_1000C_MSE;
- /* Disable auto update for duplex flow control and duplex */
- reg |= GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_SPD_DIS;
+ /* Disable auto update for duplex flow control and speed */
+ reg |= GM_GPCR_AU_ALL_DIS;
switch (sky2->speed) {
case SPEED_1000:
@@ -467,15 +470,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
ctrl |= PHY_CT_DUP_MD;
} else if (sky2->speed < SPEED_1000)
sky2->flow_mode = FC_NONE;
- }
- if (sky2->flags & SKY2_FLAG_AUTO_PAUSE) {
- if (sky2_is_copper(hw))
- adv |= copper_fc_adv[sky2->flow_mode];
- else
- adv |= fiber_fc_adv[sky2->flow_mode];
- } else {
- reg |= GM_GPCR_AU_FCT_DIS;
+
reg |= gm_fc_disable[sky2->flow_mode];
/* Forward pause packets to GMAC? */
@@ -620,8 +616,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
/* no effect on Yukon-XL */
gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
- if (!(sky2->flags & SKY2_FLAG_AUTO_SPEED) ||
- sky2->speed == SPEED_100) {
+ if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) {
/* turn on 100 Mbps LED (LED_LINK100) */
ledover |= PHY_M_LED_MO_100(MO_LED_ON);
}
@@ -632,7 +627,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
}
/* Enable phy interrupt on auto-negotiation complete (or link up) */
- if (sky2->flags & SKY2_FLAG_AUTO_SPEED)
+ if (sky2->autoneg == AUTONEG_ENABLE)
gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL);
else
gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK);
@@ -688,9 +683,7 @@ static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
/* setup General Purpose Control Register */
gma_write16(hw, port, GM_GP_CTRL,
- GM_GPCR_FL_PASS | GM_GPCR_SPEED_100 |
- GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS |
- GM_GPCR_AU_SPD_DIS);
+ GM_GPCR_FL_PASS | GM_GPCR_SPEED_100 | GM_GPCR_AU_ALL_DIS);
if (hw->chip_id != CHIP_ID_YUKON_EC) {
if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 084eff2..db0b2ad 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1755,6 +1755,7 @@ enum {
};
#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100)
+#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS)
/* GM_TX_CTRL 16 bit r/w Transmit Control Register */
enum {
@@ -2247,6 +2248,7 @@ struct sky2_port {
u16 speed; /* SPEED_1000, SPEED_100, ... */
u8 wol; /* WAKE_ bits */
u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */
+ u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */
u16 flags;
#define SKY2_FLAG_RX_CHECKSUM 0x0001
#define SKY2_FLAG_AUTO_SPEED 0x0002
--
1.7.1
^ permalink raw reply related
* Re: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
From: Justin P. Mattock @ 2010-06-23 17:00 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev, Linux Kernel Mailing List, davem, timo.teras
In-Reply-To: <20100623141622.GC15205@tuxdriver.com>
o.k. the bisect is pointing to the below results..
(I tried git revert xxx but this commit is too big
so I'll(hopefully)manually revert it on the latest HEAD to
see if this is the actual problem im experiencing)
80c802f3073e84c956846e921e8a0b02dfa3755f is the first bad commit
commit 80c802f3073e84c956846e921e8a0b02dfa3755f
Author: Timo Teräs <timo.teras@iki.fi>
Date: Wed Apr 7 00:30:05 2010 +0000
xfrm: cache bundles instead of policies for outgoing flows
__xfrm_lookup() is called for each packet transmitted out of
system. The xfrm_find_bundle() does a linear search which can
kill system performance depending on how many bundles are
required per policy.
This modifies __xfrm_lookup() to store bundles directly in
the flow cache. If we did not get a hit, we just create a new
bundle instead of doing slow search. This means that we can now
get multiple xfrm_dst's for same flow (on per-cpu basis).
Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
:040000 040000 d8e60f5fa4c1329f450d9c7cdf98b34e6a177f22
9f576e68e5bf4ce357d7f0305aee5f410250dfe2 M include
:040000 040000 f2876df688ee36907af7b4123eea96592faaed3e
a3f6f6f94f0309106856cd99b38ec90b024eb016 M net
Justin P. Mattock
^ permalink raw reply
* Re: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
From: Eric Dumazet @ 2010-06-23 17:29 UTC (permalink / raw)
To: Justin P.Mattock
Cc: John W.Linville, netdev, Linux Kernel Mailing List, davem,
timo.teras
In-Reply-To: <4C223DCA.5090704@gmail.com>
Le mercredi 23 juin 2010 à 10:00 -0700, Justin P. Mattock a écrit :
> o.k. the bisect is pointing to the below results..
> (I tried git revert xxx but this commit is too big
> so I'll(hopefully)manually revert it on the latest HEAD to
> see if this is the actual problem im experiencing)
>
>
>
> 80c802f3073e84c956846e921e8a0b02dfa3755f is the first bad commit
> commit 80c802f3073e84c956846e921e8a0b02dfa3755f
> Author: Timo Teräs <timo.teras@iki.fi>
> Date: Wed Apr 7 00:30:05 2010 +0000
>
> xfrm: cache bundles instead of policies for outgoing flows
>
> __xfrm_lookup() is called for each packet transmitted out of
> system. The xfrm_find_bundle() does a linear search which can
> kill system performance depending on how many bundles are
> required per policy.
>
> This modifies __xfrm_lookup() to store bundles directly in
> the flow cache. If we did not get a hit, we just create a new
> bundle instead of doing slow search. This means that we can now
> get multiple xfrm_dst's for same flow (on per-cpu basis).
>
> Signed-off-by: Timo Teras <timo.teras@iki.fi>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> :040000 040000 d8e60f5fa4c1329f450d9c7cdf98b34e6a177f22
> 9f576e68e5bf4ce357d7f0305aee5f410250dfe2 M include
> :040000 040000 f2876df688ee36907af7b4123eea96592faaed3e
> a3f6f6f94f0309106856cd99b38ec90b024eb016 M net
>
>
Thanks a lot for bisecting Jutin, this is really appreciated.
crash is in xfrm_bundle_ok()
if (xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))
return 0;
xdst->pols[0] contains a NULL pointer
^ 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