* Re: [patch net-next-2.6 1/4] rtnetlink: implement setting of master device
From: Patrick McHardy @ 2011-02-16 15:25 UTC (permalink / raw)
To: Jiri Pirko
Cc: Stephen Hemminger, netdev, davem, shemminger, fubar, eric.dumazet,
nicolas.2p.debian
In-Reply-To: <20110216143923.GB5727@psychotron.brq.redhat.com>
On 16.02.2011 15:39, Jiri Pirko wrote:
> Wed, Feb 16, 2011 at 02:18:44PM CET, shemminger@vyatta.com wrote:
>> On Sun, 13 Feb 2011 20:31:06 +0100
>> Jiri Pirko <jpirko@redhat.com> wrote:
>>
>>> This patch allows userspace to enslave/release slave devices via netlink
>>> interface using IFLA_MASTER. This introduces generic way to add/remove
>>> underling devices.
>>>
>>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>
>> But, setting master means something different for each type of device?
>
> Why isn't correct to use master also for bridge? It had no meaning there.
In fact the bridge netlink family uses IFLA_MASTER for exactly
the same purpose.
^ permalink raw reply
* Re: [patch net-next-2.6 1/4] rtnetlink: implement setting of master device
From: Jiri Pirko @ 2011-02-16 14:39 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian
In-Reply-To: <20110216051844.53f577d5@s6510>
Wed, Feb 16, 2011 at 02:18:44PM CET, shemminger@vyatta.com wrote:
>On Sun, 13 Feb 2011 20:31:06 +0100
>Jiri Pirko <jpirko@redhat.com> wrote:
>
>> This patch allows userspace to enslave/release slave devices via netlink
>> interface using IFLA_MASTER. This introduces generic way to add/remove
>> underling devices.
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>But, setting master means something different for each type of device?
Why isn't correct to use master also for bridge? It had no meaning there.
>What happens if you move eth0 from br0 to bond0?
you mean by:
ip link set eth0 master br0
ip link set eth0 master bond0
It's first removed from bridge, then added into bond. No problem here.
>
>The name "master" is only used in the bonding spec. It is not used in
>description of bridges in the 802.1 spec. There are also some companies
>that have very "politically correct" HR departments that think that any
>reference to master or slave is racist.
>
>
^ permalink raw reply
* Re: NFS on little-endian platform - Microblaze
From: Michal Simek @ 2011-02-16 14:16 UTC (permalink / raw)
To: Trond Myklebust
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller,
linux-nfs-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1297865074.6596.10.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
Trond Myklebust wrote:
> On Wed, 2011-02-16 at 14:53 +0100, Michal Simek wrote:
>> Trond Myklebust wrote:
>>> On Wed, 2011-02-16 at 14:16 +0100, Michal Simek wrote:
>>>> Hi again,
>>>>
>>>> I forget to cc linux-nfs mailing list.
>>>>
>>>> Michal
>>>>
>>>> P.S.: Tested on kernels 2.6.38-rc4, 2.6.37 and 2.6.36
>>>>
>>>> Michal Simek wrote:
>>>>> Hi All,
>>>>>
>>>>> I am trying to understand one problem which we have found.
>>>>> The problem is that I can't on Microblaze little-endian platform
>>>>> mount nfs without -o nolock options. (Log below)
>>>>> Selecting tcp or udp has no effect.
>>>>> I am using emaclite driver and there is no problem on big endian
>>>>> microblaze.
>>>>>
>>>>> ping, telnet, http, ftp, iperf, netperf work well.
>>>>>
>>>>> That's why I have a question if there is any endian specific option for
>>>>> NFS?
>>>>>
>>>>> Thanks,
>>>>> Michal
>>>>>
>>>>> ~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
>>>>> svc: failed to register lockdv1 RPC service (errno 13).
>>>>> lockd_up: makesock failed, error=-13
>>>>> svc: failed to register lockdv1 RPC service (errno 13).
>>>>> ~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
>>>>> ~ # mount
>>>>> rootfs on / type rootfs (rw)
>>>>> proc on /proc type proc (rw,relatime)
>>>>> none on /var type ramfs (rw,relatime)
>>>>> none on /sys type sysfs (rw,relatime)
>>>>> none on /etc/config type ramfs (rw,relatime)
>>>>> none on /dev/pts type devpts (rw,relatime,mode=600)
>>>>> 192.168.0.101:/tftpboot/nfs on /mnt type nfs
>>>>> (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
>>>>>
>>>>> ~ #
>>>>> ~ # ps
>>>>> PID USER TIME COMMAND
>>>>> 1 root 0:02 init
>>>>> 2 root 0:00 [kthreadd]
>>>>> 3 root 0:00 [ksoftirqd/0]
>>>>> 4 root 0:00 [kworker/0:0]
>>>>> 5 root 0:00 [kworker/u:0]
>>>>> 6 root 0:00 [khelper]
>>>>> 7 root 0:00 [sync_supers]
>>>>> 8 root 0:00 [bdi-default]
>>>>> 9 root 0:00 [kblockd]
>>>>> 10 root 0:00 [rpciod]
>>>>> 11 root 0:00 [kworker/0:1]
>>>>> 12 root 0:00 [kswapd0]
>>>>> 13 root 0:00 [fsnotify_mark]
>>>>> 14 root 0:00 [aio]
>>>>> 15 root 0:00 [nfsiod]
>>>>> 16 root 0:00 [kworker/u:1]
>>>>> 58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>>>> 62 1 0:00 /bin/portmap
>>>>> 64 root 0:00 /bin/inetd /etc/inetd.conf
>>>>> 65 root 0:01 -sh
>>>>> 66 root 0:00 /bin/syslogd -n
>>>>> 67 root 0:00 /bin/flatfsd
>>>>> 68 root 0:00 [kworker/0:2]
>>>>> 91 root 0:00 ps
>>> Where is rpc.statd? Without it, the above behaviour is 100% expected.
>> I see on BE that lockd is used but it is enabled on little endian too but hasn't started.
>>
>> Enabled options:
>> CONFIG_NETWORK_FILESYSTEMS=y
>> CONFIG_NFS_FS=y
>> CONFIG_NFS_V3=y
>> CONFIG_LOCKD=y
>> CONFIG_LOCKD_V4=y
>> CONFIG_NFS_COMMON=y
>> CONFIG_SUNRPC=y
>>
>> On Be lockd is up.
>> 69 root 0:00 /bin/flatfsd
>> 71 root 0:00 [lockd]
>> 73 root 0:00 ps
>>
>> I have to look why.
>> How is it started?
>
> Either rpc.bind or rpc.portmap and then rpc.statd need to be started
> manually (in that order) before you may mount the NFS partition without
> '-onolock'. The lockd daemon itself will be started by the kernel
> whenever there is a need for it.
On big-endian system is not any rpc* binary either that's why I think this is not a problem.
Only portmap is started on both systems. Nothing more. If you want I can send you cpio archive.
>
> Please check your 'init' boot scripts to find out why they are not being
> started as expected.
ok.
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: NFS on little-endian platform - Microblaze
From: Trond Myklebust @ 2011-02-16 14:04 UTC (permalink / raw)
To: monstr; +Cc: netdev, David Miller, linux-nfs
In-Reply-To: <4D5BD6E5.8010903@monstr.eu>
On Wed, 2011-02-16 at 14:53 +0100, Michal Simek wrote:
> Trond Myklebust wrote:
> > On Wed, 2011-02-16 at 14:16 +0100, Michal Simek wrote:
> >> Hi again,
> >>
> >> I forget to cc linux-nfs mailing list.
> >>
> >> Michal
> >>
> >> P.S.: Tested on kernels 2.6.38-rc4, 2.6.37 and 2.6.36
> >>
> >> Michal Simek wrote:
> >>> Hi All,
> >>>
> >>> I am trying to understand one problem which we have found.
> >>> The problem is that I can't on Microblaze little-endian platform
> >>> mount nfs without -o nolock options. (Log below)
> >>> Selecting tcp or udp has no effect.
> >>> I am using emaclite driver and there is no problem on big endian
> >>> microblaze.
> >>>
> >>> ping, telnet, http, ftp, iperf, netperf work well.
> >>>
> >>> That's why I have a question if there is any endian specific option for
> >>> NFS?
> >>>
> >>> Thanks,
> >>> Michal
> >>>
> >>> ~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
> >>> svc: failed to register lockdv1 RPC service (errno 13).
> >>> lockd_up: makesock failed, error=-13
> >>> svc: failed to register lockdv1 RPC service (errno 13).
> >>> ~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
> >>> ~ # mount
> >>> rootfs on / type rootfs (rw)
> >>> proc on /proc type proc (rw,relatime)
> >>> none on /var type ramfs (rw,relatime)
> >>> none on /sys type sysfs (rw,relatime)
> >>> none on /etc/config type ramfs (rw,relatime)
> >>> none on /dev/pts type devpts (rw,relatime,mode=600)
> >>> 192.168.0.101:/tftpboot/nfs on /mnt type nfs
> >>> (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
> >>>
> >>> ~ #
> >>> ~ # ps
> >>> PID USER TIME COMMAND
> >>> 1 root 0:02 init
> >>> 2 root 0:00 [kthreadd]
> >>> 3 root 0:00 [ksoftirqd/0]
> >>> 4 root 0:00 [kworker/0:0]
> >>> 5 root 0:00 [kworker/u:0]
> >>> 6 root 0:00 [khelper]
> >>> 7 root 0:00 [sync_supers]
> >>> 8 root 0:00 [bdi-default]
> >>> 9 root 0:00 [kblockd]
> >>> 10 root 0:00 [rpciod]
> >>> 11 root 0:00 [kworker/0:1]
> >>> 12 root 0:00 [kswapd0]
> >>> 13 root 0:00 [fsnotify_mark]
> >>> 14 root 0:00 [aio]
> >>> 15 root 0:00 [nfsiod]
> >>> 16 root 0:00 [kworker/u:1]
> >>> 58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
> >>> 62 1 0:00 /bin/portmap
> >>> 64 root 0:00 /bin/inetd /etc/inetd.conf
> >>> 65 root 0:01 -sh
> >>> 66 root 0:00 /bin/syslogd -n
> >>> 67 root 0:00 /bin/flatfsd
> >>> 68 root 0:00 [kworker/0:2]
> >>> 91 root 0:00 ps
> >
> > Where is rpc.statd? Without it, the above behaviour is 100% expected.
>
> I see on BE that lockd is used but it is enabled on little endian too but hasn't started.
>
> Enabled options:
> CONFIG_NETWORK_FILESYSTEMS=y
> CONFIG_NFS_FS=y
> CONFIG_NFS_V3=y
> CONFIG_LOCKD=y
> CONFIG_LOCKD_V4=y
> CONFIG_NFS_COMMON=y
> CONFIG_SUNRPC=y
>
> On Be lockd is up.
> 69 root 0:00 /bin/flatfsd
> 71 root 0:00 [lockd]
> 73 root 0:00 ps
>
> I have to look why.
> How is it started?
Either rpc.bind or rpc.portmap and then rpc.statd need to be started
manually (in that order) before you may mount the NFS partition without
'-onolock'. The lockd daemon itself will be started by the kernel
whenever there is a need for it.
Please check your 'init' boot scripts to find out why they are not being
started as expected.
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply
* Re: NFS on little-endian platform - Microblaze
From: Michal Simek @ 2011-02-16 13:53 UTC (permalink / raw)
To: Trond Myklebust
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller,
linux-nfs-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1297862575.6596.0.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
Trond Myklebust wrote:
> On Wed, 2011-02-16 at 14:16 +0100, Michal Simek wrote:
>> Hi again,
>>
>> I forget to cc linux-nfs mailing list.
>>
>> Michal
>>
>> P.S.: Tested on kernels 2.6.38-rc4, 2.6.37 and 2.6.36
>>
>> Michal Simek wrote:
>>> Hi All,
>>>
>>> I am trying to understand one problem which we have found.
>>> The problem is that I can't on Microblaze little-endian platform
>>> mount nfs without -o nolock options. (Log below)
>>> Selecting tcp or udp has no effect.
>>> I am using emaclite driver and there is no problem on big endian
>>> microblaze.
>>>
>>> ping, telnet, http, ftp, iperf, netperf work well.
>>>
>>> That's why I have a question if there is any endian specific option for
>>> NFS?
>>>
>>> Thanks,
>>> Michal
>>>
>>> ~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
>>> svc: failed to register lockdv1 RPC service (errno 13).
>>> lockd_up: makesock failed, error=-13
>>> svc: failed to register lockdv1 RPC service (errno 13).
>>> ~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
>>> ~ # mount
>>> rootfs on / type rootfs (rw)
>>> proc on /proc type proc (rw,relatime)
>>> none on /var type ramfs (rw,relatime)
>>> none on /sys type sysfs (rw,relatime)
>>> none on /etc/config type ramfs (rw,relatime)
>>> none on /dev/pts type devpts (rw,relatime,mode=600)
>>> 192.168.0.101:/tftpboot/nfs on /mnt type nfs
>>> (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
>>>
>>> ~ #
>>> ~ # ps
>>> PID USER TIME COMMAND
>>> 1 root 0:02 init
>>> 2 root 0:00 [kthreadd]
>>> 3 root 0:00 [ksoftirqd/0]
>>> 4 root 0:00 [kworker/0:0]
>>> 5 root 0:00 [kworker/u:0]
>>> 6 root 0:00 [khelper]
>>> 7 root 0:00 [sync_supers]
>>> 8 root 0:00 [bdi-default]
>>> 9 root 0:00 [kblockd]
>>> 10 root 0:00 [rpciod]
>>> 11 root 0:00 [kworker/0:1]
>>> 12 root 0:00 [kswapd0]
>>> 13 root 0:00 [fsnotify_mark]
>>> 14 root 0:00 [aio]
>>> 15 root 0:00 [nfsiod]
>>> 16 root 0:00 [kworker/u:1]
>>> 58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
>>> 62 1 0:00 /bin/portmap
>>> 64 root 0:00 /bin/inetd /etc/inetd.conf
>>> 65 root 0:01 -sh
>>> 66 root 0:00 /bin/syslogd -n
>>> 67 root 0:00 /bin/flatfsd
>>> 68 root 0:00 [kworker/0:2]
>>> 91 root 0:00 ps
>
> Where is rpc.statd? Without it, the above behaviour is 100% expected.
I see on BE that lockd is used but it is enabled on little endian too but hasn't started.
Enabled options:
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
On Be lockd is up.
69 root 0:00 /bin/flatfsd
71 root 0:00 [lockd]
73 root 0:00 ps
I have to look why.
How is it started?
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] sfc: lower stack usage in efx_ethtool_self_test
From: Eric Dumazet @ 2011-02-16 13:48 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev
In-Reply-To: <1297800733.2584.15.camel@bwh-desktop>
drivers/net/sfc/ethtool.c: In function ‘efx_ethtool_self_test’:
drivers/net/sfc/ethtool.c:613: warning: the frame size of 1200 bytes
is larger than 1024 bytes
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/sfc/ethtool.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 272cfe7..0836b37 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -569,9 +569,14 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
struct ethtool_test *test, u64 *data)
{
struct efx_nic *efx = netdev_priv(net_dev);
- struct efx_self_tests efx_tests;
+ struct efx_self_tests *efx_tests;
int already_up;
- int rc;
+ int rc = -ENOMEM;
+
+ efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
+ if (!efx_tests)
+ goto fail;
+
ASSERT_RTNL();
if (efx->state != STATE_RUNNING) {
@@ -589,13 +594,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
if (rc) {
netif_err(efx, drv, efx->net_dev,
"failed opening device.\n");
- goto fail2;
+ goto fail1;
}
}
- memset(&efx_tests, 0, sizeof(efx_tests));
-
- rc = efx_selftest(efx, &efx_tests, test->flags);
+ rc = efx_selftest(efx, efx_tests, test->flags);
if (!already_up)
dev_close(efx->net_dev);
@@ -604,10 +607,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev,
rc == 0 ? "passed" : "failed",
(test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
- fail2:
- fail1:
+fail1:
/* Fill ethtool results structures */
- efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data);
+ efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
+ kfree(efx_tests);
+fail:
if (rc)
test->flags |= ETH_TEST_FL_FAILED;
}
^ permalink raw reply related
* Re: NFS on little-endian platform - Microblaze
From: Trond Myklebust @ 2011-02-16 13:22 UTC (permalink / raw)
To: monstr; +Cc: netdev, David Miller, linux-nfs
In-Reply-To: <4D5BCE43.1090401@monstr.eu>
On Wed, 2011-02-16 at 14:16 +0100, Michal Simek wrote:
> Hi again,
>
> I forget to cc linux-nfs mailing list.
>
> Michal
>
> P.S.: Tested on kernels 2.6.38-rc4, 2.6.37 and 2.6.36
>
> Michal Simek wrote:
> > Hi All,
> >
> > I am trying to understand one problem which we have found.
> > The problem is that I can't on Microblaze little-endian platform
> > mount nfs without -o nolock options. (Log below)
> > Selecting tcp or udp has no effect.
> > I am using emaclite driver and there is no problem on big endian
> > microblaze.
> >
> > ping, telnet, http, ftp, iperf, netperf work well.
> >
> > That's why I have a question if there is any endian specific option for
> > NFS?
> >
> > Thanks,
> > Michal
> >
> > ~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
> > svc: failed to register lockdv1 RPC service (errno 13).
> > lockd_up: makesock failed, error=-13
> > svc: failed to register lockdv1 RPC service (errno 13).
> > ~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
> > ~ # mount
> > rootfs on / type rootfs (rw)
> > proc on /proc type proc (rw,relatime)
> > none on /var type ramfs (rw,relatime)
> > none on /sys type sysfs (rw,relatime)
> > none on /etc/config type ramfs (rw,relatime)
> > none on /dev/pts type devpts (rw,relatime,mode=600)
> > 192.168.0.101:/tftpboot/nfs on /mnt type nfs
> > (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
> >
> > ~ #
> > ~ # ps
> > PID USER TIME COMMAND
> > 1 root 0:02 init
> > 2 root 0:00 [kthreadd]
> > 3 root 0:00 [ksoftirqd/0]
> > 4 root 0:00 [kworker/0:0]
> > 5 root 0:00 [kworker/u:0]
> > 6 root 0:00 [khelper]
> > 7 root 0:00 [sync_supers]
> > 8 root 0:00 [bdi-default]
> > 9 root 0:00 [kblockd]
> > 10 root 0:00 [rpciod]
> > 11 root 0:00 [kworker/0:1]
> > 12 root 0:00 [kswapd0]
> > 13 root 0:00 [fsnotify_mark]
> > 14 root 0:00 [aio]
> > 15 root 0:00 [nfsiod]
> > 16 root 0:00 [kworker/u:1]
> > 58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
> > 62 1 0:00 /bin/portmap
> > 64 root 0:00 /bin/inetd /etc/inetd.conf
> > 65 root 0:01 -sh
> > 66 root 0:00 /bin/syslogd -n
> > 67 root 0:00 /bin/flatfsd
> > 68 root 0:00 [kworker/0:2]
> > 91 root 0:00 ps
Where is rpc.statd? Without it, the above behaviour is 100% expected.
Trond
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply
* Re: Off-by-one error in net/8021q/vlan.c
From: Patrick McHardy @ 2011-02-16 13:22 UTC (permalink / raw)
To: richard -rw- weinberger; +Cc: Phil Karn, netdev
In-Reply-To: <AANLkTinBOk8ZNQvRpMqZQE_vOu63QVzDZ4ceRRUDvJD_@mail.gmail.com>
On 16.02.2011 13:51, richard -rw- weinberger wrote:
> On Wed, Feb 16, 2011 at 11:58 AM, Phil Karn <karn@ka9q.net> wrote:
>> The range check on vlan_id in register_vlan_device is off by one, and it
>> prevents the creation of a vlan interface for vlan ID 4095. (OSX allows
>> this, I checked.)
>
> Then OSX should fix their code. 4095 is reserved.
I agree.
^ permalink raw reply
* Re: [patch net-next-2.6 4/4] bridge: implement [add/del]_slave ops
From: Stephen Hemminger @ 2011-02-16 13:21 UTC (permalink / raw)
To: David Miller
Cc: jpirko, netdev, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian
In-Reply-To: <20110213.165903.184824754.davem@davemloft.net>
On Sun, 13 Feb 2011 16:59:03 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Jiri Pirko <jpirko@redhat.com>
> Date: Sun, 13 Feb 2011 20:33:42 +0100
>
> > add possibility to addif/delif via rtnetlink
> >
> > Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
> Applied.
You should follow established protocol and wait until I have
had time to review code that impacts areas which I maintain.
The linux-foundation email address is not listed in MAINTAINERS
file and is mainly a spam catcher that I never read.
Maybe I should just start sending networking patches to Linus.
^ permalink raw reply
* Re: [GIT PULL nf-next-2.6] IPVS
From: Patrick McHardy @ 2011-02-16 13:19 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, netfilter, Julian Anastasov,
Patrick Schaaf
In-Reply-To: <1297836293-5942-1-git-send-email-horms@verge.net.au>
On 16.02.2011 07:04, Simon Horman wrote:
> Hi Patrick,
>
> please consider pulling
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git master
> go get:
>
> * Removal of unused ICMP code by Julian
> * More informative "no destination available" messages
> by Patrick Schaaf
> * Fix to buffering of synchronisation messages
> by Tinggong Wang and Julian
>
Pulled, thanks Simon.
^ permalink raw reply
* Re: [patch net-next-2.6 1/4] rtnetlink: implement setting of master device
From: Stephen Hemminger @ 2011-02-16 13:18 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian
In-Reply-To: <20110213193105.GD2740@psychotron.redhat.com>
On Sun, 13 Feb 2011 20:31:06 +0100
Jiri Pirko <jpirko@redhat.com> wrote:
> This patch allows userspace to enslave/release slave devices via netlink
> interface using IFLA_MASTER. This introduces generic way to add/remove
> underling devices.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
But, setting master means something different for each type of device?
What happens if you move eth0 from br0 to bond0?
The name "master" is only used in the bonding spec. It is not used in
description of bridges in the 802.1 spec. There are also some companies
that have very "politically correct" HR departments that think that any
reference to master or slave is racist.
^ permalink raw reply
* Re: NFS on little-endian platform - Microblaze
From: Michal Simek @ 2011-02-16 13:16 UTC (permalink / raw)
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller,
linux-nfs-u79uwXL29TY76Z2rM5mHXA,
Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA
In-Reply-To: <4D5BCC74.9010301-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
Hi again,
I forget to cc linux-nfs mailing list.
Michal
P.S.: Tested on kernels 2.6.38-rc4, 2.6.37 and 2.6.36
Michal Simek wrote:
> Hi All,
>
> I am trying to understand one problem which we have found.
> The problem is that I can't on Microblaze little-endian platform
> mount nfs without -o nolock options. (Log below)
> Selecting tcp or udp has no effect.
> I am using emaclite driver and there is no problem on big endian
> microblaze.
>
> ping, telnet, http, ftp, iperf, netperf work well.
>
> That's why I have a question if there is any endian specific option for
> NFS?
>
> Thanks,
> Michal
>
> ~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
> svc: failed to register lockdv1 RPC service (errno 13).
> lockd_up: makesock failed, error=-13
> svc: failed to register lockdv1 RPC service (errno 13).
> ~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
> ~ # mount
> rootfs on / type rootfs (rw)
> proc on /proc type proc (rw,relatime)
> none on /var type ramfs (rw,relatime)
> none on /sys type sysfs (rw,relatime)
> none on /etc/config type ramfs (rw,relatime)
> none on /dev/pts type devpts (rw,relatime,mode=600)
> 192.168.0.101:/tftpboot/nfs on /mnt type nfs
> (rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
>
> ~ #
> ~ # ps
> PID USER TIME COMMAND
> 1 root 0:02 init
> 2 root 0:00 [kthreadd]
> 3 root 0:00 [ksoftirqd/0]
> 4 root 0:00 [kworker/0:0]
> 5 root 0:00 [kworker/u:0]
> 6 root 0:00 [khelper]
> 7 root 0:00 [sync_supers]
> 8 root 0:00 [bdi-default]
> 9 root 0:00 [kblockd]
> 10 root 0:00 [rpciod]
> 11 root 0:00 [kworker/0:1]
> 12 root 0:00 [kswapd0]
> 13 root 0:00 [fsnotify_mark]
> 14 root 0:00 [aio]
> 15 root 0:00 [nfsiod]
> 16 root 0:00 [kworker/u:1]
> 58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
> 62 1 0:00 /bin/portmap
> 64 root 0:00 /bin/inetd /etc/inetd.conf
> 65 root 0:01 -sh
> 66 root 0:00 /bin/syslogd -n
> 67 root 0:00 /bin/flatfsd
> 68 root 0:00 [kworker/0:2]
> 91 root 0:00 ps
> ~ # cat /proc/cpuinfo
> CPU-Family: MicroBlaze
> FPGA-Arch: spartan6
> CPU-Ver: 8.00.a, little endian
> CPU-MHz: 50.00
> BogoMips: 24.06
> HW:
> Shift: yes
> MSR: yes
> PCMP: yes
> DIV: yes
> MMU: 3
> MUL: v2
> FPU: no
> Exc: op0x0 unal ill iopb dopb zero
> Icache: 16kB line length: 32B
> Dcache: 16kB line length: 16B
> write-through
> HW-Debug: yes
> PVR-USR1: 00
> PVR-USR2: 00000000
> Page size: 4096
> ~ #
>
>
>
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* NFS on little-endian platform - Microblaze
From: Michal Simek @ 2011-02-16 13:09 UTC (permalink / raw)
To: netdev; +Cc: David Miller
Hi All,
I am trying to understand one problem which we have found.
The problem is that I can't on Microblaze little-endian platform
mount nfs without -o nolock options. (Log below)
Selecting tcp or udp has no effect.
I am using emaclite driver and there is no problem on big endian microblaze.
ping, telnet, http, ftp, iperf, netperf work well.
That's why I have a question if there is any endian specific option for NFS?
Thanks,
Michal
~ # mount -t nfs 192.168.0.101:/tftpboot/nfs /mnt
svc: failed to register lockdv1 RPC service (errno 13).
lockd_up: makesock failed, error=-13
svc: failed to register lockdv1 RPC service (errno 13).
~ # mount -t nfs -o nolock 192.168.0.101:/tftpboot/nfs /mnt
~ # mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,relatime)
none on /var type ramfs (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /etc/config type ramfs (rw,relatime)
none on /dev/pts type devpts (rw,relatime,mode=600)
192.168.0.101:/tftpboot/nfs on /mnt type nfs
(rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nolock,proto=udp,port=65535,timeo=7,retrans=3,sec=sys,local_lock=all,addr=192.168.0.101)
~ #
~ # ps
PID USER TIME COMMAND
1 root 0:02 init
2 root 0:00 [kthreadd]
3 root 0:00 [ksoftirqd/0]
4 root 0:00 [kworker/0:0]
5 root 0:00 [kworker/u:0]
6 root 0:00 [khelper]
7 root 0:00 [sync_supers]
8 root 0:00 [bdi-default]
9 root 0:00 [kblockd]
10 root 0:00 [rpciod]
11 root 0:00 [kworker/0:1]
12 root 0:00 [kswapd0]
13 root 0:00 [fsnotify_mark]
14 root 0:00 [aio]
15 root 0:00 [nfsiod]
16 root 0:00 [kworker/u:1]
58 root 0:00 udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
62 1 0:00 /bin/portmap
64 root 0:00 /bin/inetd /etc/inetd.conf
65 root 0:01 -sh
66 root 0:00 /bin/syslogd -n
67 root 0:00 /bin/flatfsd
68 root 0:00 [kworker/0:2]
91 root 0:00 ps
~ # cat /proc/cpuinfo
CPU-Family: MicroBlaze
FPGA-Arch: spartan6
CPU-Ver: 8.00.a, little endian
CPU-MHz: 50.00
BogoMips: 24.06
HW:
Shift: yes
MSR: yes
PCMP: yes
DIV: yes
MMU: 3
MUL: v2
FPU: no
Exc: op0x0 unal ill iopb dopb zero
Icache: 16kB line length: 32B
Dcache: 16kB line length: 16B
write-through
HW-Debug: yes
PVR-USR1: 00
PVR-USR2: 00000000
Page size: 4096
~ #
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
^ permalink raw reply
* Re: Off-by-one error in net/8021q/vlan.c
From: richard -rw- weinberger @ 2011-02-16 12:51 UTC (permalink / raw)
To: Phil Karn; +Cc: kaber, netdev
In-Reply-To: <4D5BADCF.5000804@ka9q.net>
On Wed, Feb 16, 2011 at 11:58 AM, Phil Karn <karn@ka9q.net> wrote:
> The range check on vlan_id in register_vlan_device is off by one, and it
> prevents the creation of a vlan interface for vlan ID 4095. (OSX allows
> this, I checked.)
Then OSX should fix their code. 4095 is reserved.
//richard
> Here's the trivial patch:
>
> --- linux-2.6.37/net/8021q/vlan.c~ 2011-01-04 16:50:19.000000000 -0800
> +++ linux-2.6.37/net/8021q/vlan.c 2011-02-16 02:43:13.988812958 -0800
> @@ -239,7 +239,7 @@
> char name[IFNAMSIZ];
> int err;
>
> - if (vlan_id >= VLAN_VID_MASK)
> + if (vlan_id > VLAN_VID_MASK)
> return -ERANGE;
>
> err = vlan_check_real_dev(real_dev, vlan_id);
> --
> 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
>
--
Thanks,
//richard
^ permalink raw reply
* Re: [PATCH 1/1] tproxy: do not assign timewait sockets to skb->sk
From: Florian Westphal @ 2011-02-16 11:30 UTC (permalink / raw)
To: KOVACS Krisztian
Cc: Patrick McHardy, netfilter-devel, netdev, Balazs Scheidler
In-Reply-To: <4D5B90C7.5040603@balabit.hu>
KOVACS Krisztian <hidden@balabit.hu> wrote:
> On 02/14/2011 04:51 PM, Patrick McHardy wrote:
> >Am 14.02.2011 12:44, schrieb Florian Westphal:
> >>Assigning a socket in timewait state to skb->sk can trigger
> >>kernel oops, e.g. in nfnetlink_log, which does:
> >>
> >>if (skb->sk) {
> >> read_lock_bh(&skb->sk->sk_callback_lock);
> >> if (skb->sk->sk_socket&& skb->sk->sk_socket->file) ...
> >>
> >>in the timewait case, accessing sk->sk_callback_lock and sk->sk_socket
> >>is invalid.
> >>
> >>Either all of these spots will need to add a test for sk->sk_state != TCP_TIME_WAIT,
> >>or xt_TPROXY must not assign a timewait socket to skb->sk.
> >>
> >>This does the latter.
> >>
> >>If a TW socket is found, assign the tproxy nfmark, but skip the skb->sk assignment,
> >>thus mimicking behaviour of a '-m socket .. -j MARK/ACCEPT' re-routing rule.
> >>
> >>The 'SYN to TW socket' case is left unchanged -- we try to redirect to the
> >>listener socket.
> >>
> >>Cc: Balazs Scheidler<bazsi@balabit.hu>
> >>Cc: KOVACS Krisztian<hidden@balabit.hu>
> >>Signed-off-by: Florian Westphal<fwestphal@astaro.com>
> >
> >Looks fine to me. Balazs. Krisztian, any objections?
>
> Seems to be OK, as far as I can see.
>
> Florian, did you make sure the tests still run after applying this patch?
>
> http://git.balabit.hu/?p=bazsi/tproxy-test.git;a=summary
Thanks for the hint, I cloned this and ran it on my test setup:
./tproxy-test.py
[..]
PASS: ('192.168.10.8', 50080), we got a connection as we deserved
PASS: everything is fine
^ permalink raw reply
* Off-by-one error in net/8021q/vlan.c
From: Phil Karn @ 2011-02-16 10:58 UTC (permalink / raw)
To: kaber; +Cc: netdev
The range check on vlan_id in register_vlan_device is off by one, and it
prevents the creation of a vlan interface for vlan ID 4095. (OSX allows
this, I checked.)
Here's the trivial patch:
--- linux-2.6.37/net/8021q/vlan.c~ 2011-01-04 16:50:19.000000000 -0800
+++ linux-2.6.37/net/8021q/vlan.c 2011-02-16 02:43:13.988812958 -0800
@@ -239,7 +239,7 @@
char name[IFNAMSIZ];
int err;
- if (vlan_id >= VLAN_VID_MASK)
+ if (vlan_id > VLAN_VID_MASK)
return -ERANGE;
err = vlan_check_real_dev(real_dev, vlan_id);
^ permalink raw reply
* Re: [PATCH] ip: reuse ip_summed of first fragment for all subsequent fragments
From: Timo Juhani Lindfors @ 2011-02-16 9:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110112.184220.250810179.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
> You're now not handling the code block above this one, guarded
> by the "if (len <= 0)" check.
Yes that's true. Should we use skb_copy_bits() when sk->sk_no_check ==
UDP_CSUM_NOXMIT?
> You seem to just be peppering checks all over the place rather
> than coming up with a coherent, complete, fix for this problem.
I can understand that but I'm afraid that I lack the expertise to do
that. I might be able to fix the above problem but I can't be sure that
it is the only one. The bug report will remain at
https://bugzilla.kernel.org/show_bug.cgi?id=24832
in case somebody wants to continue from here.
^ permalink raw reply
* Re: [PATCH 1/1] tproxy: do not assign timewait sockets to skb->sk
From: KOVACS Krisztian @ 2011-02-16 8:54 UTC (permalink / raw)
To: Patrick McHardy
Cc: Florian Westphal, netfilter-devel, netdev, Balazs Scheidler
In-Reply-To: <4D594F9E.2090100@trash.net>
Hi,
On 02/14/2011 04:51 PM, Patrick McHardy wrote:
> Am 14.02.2011 12:44, schrieb Florian Westphal:
>> Assigning a socket in timewait state to skb->sk can trigger
>> kernel oops, e.g. in nfnetlink_log, which does:
>>
>> if (skb->sk) {
>> read_lock_bh(&skb->sk->sk_callback_lock);
>> if (skb->sk->sk_socket&& skb->sk->sk_socket->file) ...
>>
>> in the timewait case, accessing sk->sk_callback_lock and sk->sk_socket
>> is invalid.
>>
>> Either all of these spots will need to add a test for sk->sk_state != TCP_TIME_WAIT,
>> or xt_TPROXY must not assign a timewait socket to skb->sk.
>>
>> This does the latter.
>>
>> If a TW socket is found, assign the tproxy nfmark, but skip the skb->sk assignment,
>> thus mimicking behaviour of a '-m socket .. -j MARK/ACCEPT' re-routing rule.
>>
>> The 'SYN to TW socket' case is left unchanged -- we try to redirect to the
>> listener socket.
>>
>> Cc: Balazs Scheidler<bazsi@balabit.hu>
>> Cc: KOVACS Krisztian<hidden@balabit.hu>
>> Signed-off-by: Florian Westphal<fwestphal@astaro.com>
>
> Looks fine to me. Balazs. Krisztian, any objections?
Seems to be OK, as far as I can see.
Florian, did you make sure the tests still run after applying this patch?
http://git.balabit.hu/?p=bazsi/tproxy-test.git;a=summary
--
KOVACS Krisztian
^ permalink raw reply
* Re: [RFC !!BONUS!! PATCH 6/5] ipv4: Delete routing cache.
From: Eric Dumazet @ 2011-02-16 7:56 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110215.185534.71133854.davem@davemloft.net>
Le mardi 15 février 2011 à 18:55 -0800, David Miller a écrit :
> From: David Miller <davem@davemloft.net>
> Date: Wed, 09 Feb 2011 22:39:39 -0800 (PST)
>
> >
> > Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Ok, this patch had one nasty bug:
>
> > + if (!err == 0)
>
> Yeah... right.
>
> I'm actively testing this version at the moment, against net-next-2.6,
> works fine thus far.
>
> --------------------
> ipv4: Delete routing cache.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
I suspect we can zap DST_NOCACHE later ?
^ permalink raw reply
* [PATCH v3] sh: sh_eth: Add support ethtool
From: Nobuhiro Iwamatsu @ 2011-02-16 7:17 UTC (permalink / raw)
To: netdev
Cc: linux-sh, bhutchings, eric.dumazet, Nobuhiro Iwamatsu,
Yoshihiro Shimoda
This commit supports following functions.
- get_settings
- set_settings
- nway_reset
- get_msglevel
- set_msglevel
- get_link
- get_strings
- get_ethtool_stats
- get_sset_count
About other function, the device does not support.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
>From v2:
- Remove get function of standard device stats.
- Remove get_drvinfo function.
- Change mdelay 100ms to 1ms in reset fucntion
- Change function name from sh_eth_link* to sh_eth_rcv_snd_*.
Because sh_eth_link* function does not linkup/down.
- Add netif_msg_* function.
drivers/net/sh_eth.c | 208 +++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 189 insertions(+), 19 deletions(-)
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 819c175..095e525 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -32,10 +32,17 @@
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
+#include <linux/ethtool.h>
#include <asm/cacheflush.h>
#include "sh_eth.h"
+#define SH_ETH_DEF_MSG_ENABLE \
+ (NETIF_MSG_LINK | \
+ NETIF_MSG_TIMER | \
+ NETIF_MSG_RX_ERR| \
+ NETIF_MSG_TX_ERR)
+
/* There is CPU dependent code */
#if defined(CONFIG_CPU_SUBTYPE_SH7724)
#define SH_ETH_RESET_DEFAULT 1
@@ -817,6 +824,20 @@ static int sh_eth_rx(struct net_device *ndev)
return 0;
}
+static void sh_eth_rcv_snd_disable(u32 ioaddr)
+{
+ /* disable tx and rx */
+ writel(readl(ioaddr + ECMR) &
+ ~(ECMR_RE | ECMR_TE), ioaddr + ECMR);
+}
+
+static void sh_eth_rcv_snd_enable(u32 ioaddr)
+{
+ /* enable tx and rx */
+ writel(readl(ioaddr + ECMR) |
+ (ECMR_RE | ECMR_TE), ioaddr + ECMR);
+}
+
/* error control function */
static void sh_eth_error(struct net_device *ndev, int intr_status)
{
@@ -843,11 +864,9 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
if (mdp->ether_link_active_low)
link_stat = ~link_stat;
}
- if (!(link_stat & PHY_ST_LINK)) {
- /* Link Down : disable tx and rx */
- writel(readl(ioaddr + ECMR) &
- ~(ECMR_RE | ECMR_TE), ioaddr + ECMR);
- } else {
+ if (!(link_stat & PHY_ST_LINK))
+ sh_eth_rcv_snd_disable(ioaddr);
+ else {
/* Link Up */
writel(readl(ioaddr + EESIPR) &
~DMAC_M_ECI, ioaddr + EESIPR);
@@ -857,8 +876,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
writel(readl(ioaddr + EESIPR) |
DMAC_M_ECI, ioaddr + EESIPR);
/* enable tx and rx */
- writel(readl(ioaddr + ECMR) |
- (ECMR_RE | ECMR_TE), ioaddr + ECMR);
+ sh_eth_rcv_snd_enable(ioaddr);
}
}
}
@@ -867,6 +885,8 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
/* Write buck end. unused write back interrupt */
if (intr_status & EESR_TABT) /* Transmit Abort int */
mdp->stats.tx_aborted_errors++;
+ if (netif_msg_tx_err(mdp))
+ dev_err(&ndev->dev, "Transmit Abort\n");
}
if (intr_status & EESR_RABT) {
@@ -874,14 +894,23 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
if (intr_status & EESR_RFRMER) {
/* Receive Frame Overflow int */
mdp->stats.rx_frame_errors++;
- dev_err(&ndev->dev, "Receive Frame Overflow\n");
+ if (netif_msg_rx_err(mdp))
+ dev_err(&ndev->dev, "Receive Abort\n");
}
}
- if (!mdp->cd->no_ade) {
- if (intr_status & EESR_ADE && intr_status & EESR_TDE &&
- intr_status & EESR_TFE)
- mdp->stats.tx_fifo_errors++;
+ if (intr_status & EESR_TDE) {
+ /* Transmit Descriptor Empty int */
+ mdp->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+ dev_err(&ndev->dev, "Transmit Descriptor Empty\n");
+ }
+
+ if (intr_status & EESR_TFE) {
+ /* FIFO under flow */
+ mdp->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+ dev_err(&ndev->dev, "Transmit FIFO Under flow\n");
}
if (intr_status & EESR_RDE) {
@@ -890,12 +919,22 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
if (readl(ioaddr + EDRRR) ^ EDRRR_R)
writel(EDRRR_R, ioaddr + EDRRR);
- dev_err(&ndev->dev, "Receive Descriptor Empty\n");
+ if (netif_msg_rx_err(mdp))
+ dev_err(&ndev->dev, "Receive Descriptor Empty\n");
}
+
if (intr_status & EESR_RFE) {
/* Receive FIFO Overflow int */
mdp->stats.rx_fifo_errors++;
- dev_err(&ndev->dev, "Receive FIFO Overflow\n");
+ if (netif_msg_rx_err(mdp))
+ dev_err(&ndev->dev, "Receive FIFO Overflow\n");
+ }
+
+ if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) {
+ /* Address Error */
+ mdp->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+ dev_err(&ndev->dev, "Address Error\n");
}
mask = EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE;
@@ -1012,7 +1051,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
mdp->duplex = -1;
}
- if (new_state)
+ if (new_state && netif_msg_link(mdp))
phy_print_status(phydev);
}
@@ -1063,6 +1102,132 @@ static int sh_eth_phy_start(struct net_device *ndev)
return 0;
}
+static int sh_eth_get_settings(struct net_device *ndev,
+ struct ethtool_cmd *ecmd)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ unsigned long flags;
+ int ret;
+
+ spin_lock_irqsave(&mdp->lock, flags);
+ ret = phy_ethtool_gset(mdp->phydev, ecmd);
+ spin_unlock_irqrestore(&mdp->lock, flags);
+
+ return ret;
+}
+
+static int sh_eth_set_settings(struct net_device *ndev,
+ struct ethtool_cmd *ecmd)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ unsigned long flags;
+ int ret;
+ u32 ioaddr = ndev->base_addr;
+
+ spin_lock_irqsave(&mdp->lock, flags);
+
+ /* disable tx and rx */
+ sh_eth_rcv_snd_disable(ioaddr);
+
+ ret = phy_ethtool_sset(mdp->phydev, ecmd);
+ if (ret)
+ goto error_exit;
+
+ if (ecmd->duplex == DUPLEX_FULL)
+ mdp->duplex = 1;
+ else
+ mdp->duplex = 0;
+
+ if (mdp->cd->set_duplex)
+ mdp->cd->set_duplex(ndev);
+
+error_exit:
+ mdelay(1);
+
+ /* enable tx and rx */
+ sh_eth_rcv_snd_enable(ioaddr);
+
+ spin_unlock_irqrestore(&mdp->lock, flags);
+
+ return ret;
+}
+
+static int sh_eth_nway_reset(struct net_device *ndev)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ unsigned long flags;
+ int ret;
+
+ spin_lock_irqsave(&mdp->lock, flags);
+ ret = phy_start_aneg(mdp->phydev);
+ spin_unlock_irqrestore(&mdp->lock, flags);
+
+ return ret;
+}
+
+static u32 sh_eth_get_msglevel(struct net_device *ndev)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ return mdp->msg_enable;
+}
+
+static void sh_eth_set_msglevel(struct net_device *ndev, u32 value)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ mdp->msg_enable = value;
+}
+
+static const char sh_eth_gstrings_stats[][ETH_GSTRING_LEN] = {
+ "rx_current", "tx_current",
+ "rx_dirty", "tx_dirty",
+};
+#define SH_ETH_STATS_LEN ARRAY_SIZE(sh_eth_gstrings_stats)
+
+static int sh_eth_get_sset_count(struct net_device *netdev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return SH_ETH_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void sh_eth_get_ethtool_stats(struct net_device *ndev,
+ struct ethtool_stats *stats, u64 *data)
+{
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+ int i = 0;
+
+ /* device-specific stats */
+ data[i++] = mdp->cur_rx;
+ data[i++] = mdp->cur_tx;
+ data[i++] = mdp->dirty_rx;
+ data[i++] = mdp->dirty_tx;
+}
+
+static void sh_eth_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
+{
+ switch (stringset) {
+ case ETH_SS_STATS:
+ memcpy(data, *sh_eth_gstrings_stats,
+ sizeof(sh_eth_gstrings_stats));
+ break;
+ }
+}
+
+static struct ethtool_ops sh_eth_ethtool_ops = {
+ .get_settings = sh_eth_get_settings,
+ .set_settings = sh_eth_set_settings,
+ .nway_reset = sh_eth_nway_reset,
+ .get_msglevel = sh_eth_get_msglevel,
+ .set_msglevel = sh_eth_set_msglevel,
+ .get_link = ethtool_op_get_link,
+ .get_strings = sh_eth_get_strings,
+ .get_ethtool_stats = sh_eth_get_ethtool_stats,
+ .get_sset_count = sh_eth_get_sset_count,
+};
+
/* network device open function */
static int sh_eth_open(struct net_device *ndev)
{
@@ -1073,8 +1238,8 @@ static int sh_eth_open(struct net_device *ndev)
ret = request_irq(ndev->irq, sh_eth_interrupt,
#if defined(CONFIG_CPU_SUBTYPE_SH7763) || \
- defined(CONFIG_CPU_SUBTYPE_SH7764) || \
- defined(CONFIG_CPU_SUBTYPE_SH7757)
+ defined(CONFIG_CPU_SUBTYPE_SH7764) || \
+ defined(CONFIG_CPU_SUBTYPE_SH7757)
IRQF_SHARED,
#else
0,
@@ -1123,8 +1288,8 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
netif_stop_queue(ndev);
- /* worning message out. */
- printk(KERN_WARNING "%s: transmit timed out, status %8.8x,"
+ if (netif_msg_timer(mdp))
+ dev_err(&ndev->dev, "%s: transmit timed out, status %8.8x,"
" resetting...\n", ndev->name, (int)readl(ioaddr + EESR));
/* tx_errors count up */
@@ -1167,6 +1332,8 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
spin_lock_irqsave(&mdp->lock, flags);
if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) {
if (!sh_eth_txfree(ndev)) {
+ if (netif_msg_tx_queued(mdp))
+ dev_warn(&ndev->dev, "TxFD exhausted.\n");
netif_stop_queue(ndev);
spin_unlock_irqrestore(&mdp->lock, flags);
return NETDEV_TX_BUSY;
@@ -1497,8 +1664,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
/* set function */
ndev->netdev_ops = &sh_eth_netdev_ops;
+ SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops);
ndev->watchdog_timeo = TX_TIMEOUT;
+ /* debug message level */
+ mdp->msg_enable = SH_ETH_DEF_MSG_ENABLE;
mdp->post_rx = POST_RX >> (devno << 1);
mdp->post_fw = POST_FW >> (devno << 1);
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH v2] sh: sh_eth: Add support ethtool
From: Nobuhiro Iwamatsu @ 2011-02-16 7:04 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, linux-sh, yoshihiro.shimoda.uh
In-Reply-To: <1294761426.3637.8.camel@bwh-desktop>
2011/1/12 Ben Hutchings <bhutchings@solarflare.com>:
> On Tue, 2011-01-11 at 20:58 +0900, nobuhiro.iwamatsu.yj@renesas.com
> wrote:
>> From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>>
>> This commit supports following functions.
>> - get_drvinfo
>> - get_settings
>> - set_settings
>> - nway_reset
>> - get_msglevel
>> - set_msglevel
>> - get_link
>> - get_strings
>> - get_ethtool_stats
>> - get_sset_count
>>
>> About other function, the device does not support.
>>
>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> ---
>> v2: reverted one part of the checks of checkpatch.pl.
>> foo *bar -> foo * bar.
>> changed function copying of net_device_stats from *for* to memcopy.
>>
>> drivers/net/sh_eth.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++---
>> 1 files changed, 174 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
>> index 819c175..0b2cb7d 100644
>> --- a/drivers/net/sh_eth.c
>> +++ b/drivers/net/sh_eth.c
> [...]
>> @@ -1063,6 +1074,154 @@ static int sh_eth_phy_start(struct net_device *ndev)
>> return 0;
>> }
>>
>> +static void sh_eth_get_drvinfo(struct net_device *ndev,
>> + struct ethtool_drvinfo *info)
>> +{
>> + strncpy(info->driver, "sh_eth", sizeof(info->driver) - 1);
>> + strcpy(info->version, "N/A");
>> + strcpy(info->fw_version, "N/A");
>> + strlcpy(info->bus_info, dev_name(ndev->dev.parent),
>> + sizeof(info->bus_info));
>> +}
>
> This is redundant; the default implementation already does this.
I see. I removed this.
>
> [...]
>> +static int sh_eth_set_settings(struct net_device *ndev,
>> + struct ethtool_cmd *ecmd)
>> +{
>> + struct sh_eth_private *mdp = netdev_priv(ndev);
>> + unsigned long flags;
>> + int ret;
>> + u32 ioaddr = ndev->base_addr;
>> +
>> + spin_lock_irqsave(&mdp->lock, flags);
>> +
>> + /* disable tx and rx */
>> + sh_eth_linkdown(ioaddr);
>> +
>> + ret = phy_ethtool_sset(mdp->phydev, ecmd);
>> + if (ret)
>> + goto error_exit;
>> +
>> + if (ecmd->duplex == DUPLEX_FULL)
>> + mdp->duplex = 1;
>> + else
>> + mdp->duplex = 0;
>> +
>> + if (mdp->cd->set_duplex)
>> + mdp->cd->set_duplex(ndev);
>> +
>> +error_exit:
>> + mdelay(100);
>
> Ugh, 100 ms holding a spinlock?!
Oh, This was not need 100ms.
I changed to 1 ms.
>
>> + /* enable tx and rx */
>> + sh_eth_linkup(ioaddr);
>
> How do you know the link is up? Shouldn't this be left to the link
> polling function?
>
Hmm. this has bad function name.
This function does not linkup. This enable recv / send function of the
hardware.
I changed a function name from sh_eth_linkup to sh_eth_rcv_send_enable.
> [...]
>> +static u32 sh_eth_get_msglevel(struct net_device *ndev)
>> +{
>> + struct sh_eth_private *mdp = netdev_priv(ndev);
>> + return mdp->msg_enable;
>> +}
>> +
>> +static void sh_eth_set_msglevel(struct net_device *ndev, u32 value)
>> +{
>> + struct sh_eth_private *mdp = netdev_priv(ndev);
>> + mdp->msg_enable = value;
>> +}
>
> This would be more useful if msg_enable was actually used anywhere in
> the driver.
I forgot this.
I am going to include msglevel stuff.
>
> [...]
>> @@ -1073,8 +1232,8 @@ static int sh_eth_open(struct net_device *ndev)
>>
>> ret = request_irq(ndev->irq, sh_eth_interrupt,
>> #if defined(CONFIG_CPU_SUBTYPE_SH7763) || \
>> - defined(CONFIG_CPU_SUBTYPE_SH7764) || \
>> - defined(CONFIG_CPU_SUBTYPE_SH7757)
>> + defined(CONFIG_CPU_SUBTYPE_SH7764) || \
>> + defined(CONFIG_CPU_SUBTYPE_SH7757)
>> IRQF_SHARED,
>> #else
>> 0,
>> @@ -1232,11 +1391,11 @@ static int sh_eth_close(struct net_device *ndev)
>> sh_eth_ring_free(ndev);
>>
>> /* free DMA buffer */
>> - ringsize = sizeof(struct sh_eth_rxdesc) * RX_RING_SIZE;
>> + ringsize = sizeof(struct sh_eth_rxdesc) *RX_RING_SIZE;
>> dma_free_coherent(NULL, ringsize, mdp->rx_ring, mdp->rx_desc_dma);
>>
>> /* free DMA buffer */
>> - ringsize = sizeof(struct sh_eth_txdesc) * TX_RING_SIZE;
>> + ringsize = sizeof(struct sh_eth_txdesc) *TX_RING_SIZE;
>> dma_free_coherent(NULL, ringsize, mdp->tx_ring, mdp->tx_desc_dma);
>>
>> pm_runtime_put_sync(&mdp->pdev->dev);
>
> Please do not include these space changes.
I revised this.
>
>> @@ -1497,8 +1656,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
>>
>> /* set function */
>> ndev->netdev_ops = &sh_eth_netdev_ops;
>> + SET_ETHTOOL_OPS(ndev, &sh_eth_ethtool_ops);
>> ndev->watchdog_timeo = TX_TIMEOUT;
>>
>> + /* debug message level */
>> + mdp->msg_enable = (1 << 3) - 1;
>
> If you're actually going to *use* msg_enable, its value should be
> initialised in terms of the NETIF_MSG_* flags defined in
> <linux/netdevice.h>.
Thanks, I replaced to NETIF_MSG_*.
>
>> mdp->post_rx = POST_RX >> (devno << 1);
>> mdp->post_fw = POST_FW >> (devno << 1);
>>
>> @@ -1572,7 +1734,7 @@ static int sh_eth_runtime_nop(struct device *dev)
>> return 0;
>> }
>>
>> -static struct dev_pm_ops sh_eth_dev_pm_ops = {
>> +static const struct dev_pm_ops sh_eth_dev_pm_ops = {
>> .runtime_suspend = sh_eth_runtime_nop,
>> .runtime_resume = sh_eth_runtime_nop,
>> };
>
> This is worthwhile but unrelated to ethtool!
Oh, I split to other patch.
>
> Ben.
>
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
^ permalink raw reply
* Re: [PATCH v2] sh: sh_eth: Add support ethtool
From: Nobuhiro Iwamatsu @ 2011-02-16 7:04 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linux-sh, yoshihiro.shimoda.uh, bhutchings
In-Reply-To: <1294748343.2927.57.camel@edumazet-laptop>
2011/1/11 Eric Dumazet <eric.dumazet@gmail.com>:
> Le mardi 11 janvier 2011 à 20:58 +0900, nobuhiro.iwamatsu.yj@renesas.com
> a écrit :
>> From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>>
>> This commit supports following functions.
>> - get_drvinfo
>> - get_settings
>> - set_settings
>> - nway_reset
>> - get_msglevel
>> - set_msglevel
>> - get_link
>> - get_strings
>> - get_ethtool_stats
>> - get_sset_count
>>
>> About other function, the device does not support.
>>
>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> ---
>
>> +static const char sh_eth_gstrings_stats[][ETH_GSTRING_LEN] = {
>> + "rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
>> + "tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
>> + "rx_length_errors", "rx_over_errors", "rx_crc_errors",
>> + "rx_frame_errors", "rx_fifo_errors", "rx_missed_errors",
>> + "tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors",
>> + "tx_heartbeat_errors", "tx_window_errors",
>> + /* device-specific stats */
>> + "rx_current", "tx_current",
>> + "rx_dirty", "tx_dirty",
>> +};
>> +#define SH_ETH_NET_STATS_LEN 21
>> +#define SH_ETH_STATS_LEN ARRAY_SIZE(sh_eth_gstrings_stats)
>
> Why is it needed to report standard device stats ?
>
I dont know that we could get standart device status from basic interface.
I removed this.
>
>> +
>> +static int sh_eth_get_sset_count(struct net_device *netdev, int sset)
>> +{
>> + switch (sset) {
>> + case ETH_SS_STATS:
>> + return SH_ETH_STATS_LEN;
>> + default:
>> + return -EOPNOTSUPP;
>> + }
>> +}
>> +
>> +static void sh_eth_get_ethtool_stats(struct net_device *ndev,
>> + struct ethtool_stats *stats, u64 *data)
>> +{
>> + struct sh_eth_private *mdp = netdev_priv(ndev);
>> + int i = SH_ETH_NET_STATS_LEN;
>> +
>> + memcpy(data, (unsigned long *)&ndev->stats,
>> + SH_ETH_NET_STATS_LEN * sizeof(unsigned long));
>
> This is wrong on 32bit arches.
> ndev->stats is an array of "long" values, not u64 ones.
I removed this too.
>> +
>> + /* device-specific stats */
>> + data[i++] = mdp->cur_rx;
>> + data[i++] = mdp->cur_tx;
>> + data[i++] = mdp->dirty_rx;
>> + data[i++] = mdp->dirty_tx;
>> +}
>> +
>
--
Nobuhiro Iwamatsu
^ permalink raw reply
* [PATCH 2/3]drivers:net:rrunner.c Fix typo occationally to occasionally
From: Justin P. Mattock @ 2011-02-16 6:55 UTC (permalink / raw)
To: trivial; +Cc: davem, eric.dumazet, netdev, linux-kernel, Justin P. Mattock
The below patch fixes a typo occationally to occasionally.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/net/rrunner.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index e68c941..6dceeb5 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -1072,7 +1072,7 @@ static irqreturn_t rr_interrupt(int irq, void *dev_id)
txcon = rrpriv->dirty_tx;
if (txcsmr != txcon) {
do {
- /* Due to occational firmware TX producer/consumer out
+ /* Due to occasional firmware TX producer/consumer out
* of sync. error need to check entry in ring -kbf
*/
if(rrpriv->tx_skbuff[txcon]){
--
1.6.5.2.180.gc5b3e
^ permalink raw reply related
* [PATCH 3/3] ipvs: make "no destination available" message more informative
From: Simon Horman @ 2011-02-16 6:04 UTC (permalink / raw)
To: lvs-devel, netdev, netfilter-devel, netfilter
Cc: Julian Anastasov, Patrick Schaaf, Patrick McHardy, Simon Horman
In-Reply-To: <1297836293-5942-1-git-send-email-horms@verge.net.au>
From: Patrick Schaaf <netdev@bof.de>
When IP_VS schedulers do not find a destination, they output a terse
"WLC: no destination available" message through kernel syslog, which I
can not only make sense of because syslog puts them in a logfile
together with keepalived checker results.
This patch makes the output a bit more informative, by telling you which
virtual service failed to find a destination.
Example output:
kernel: [1539214.552233] IPVS: wlc: TCP 192.168.8.30:22 - no destination available
kernel: [1539299.674418] IPVS: wlc: FWM 22 0x00000016 - no destination available
I have tested the code for IPv4 and FWM services, as you can see from
the example; I do not have an IPv6 setup to test the third code path
with.
To avoid code duplication, I put a new function ip_vs_scheduler_err()
into ip_vs_sched.c, and use that from the schedulers instead of calling
IP_VS_ERR_RL directly.
Signed-off-by: Patrick Schaaf <netdev@bof.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 2 ++
net/netfilter/ipvs/ip_vs_lblc.c | 2 +-
net/netfilter/ipvs/ip_vs_lblcr.c | 2 +-
net/netfilter/ipvs/ip_vs_lc.c | 2 +-
net/netfilter/ipvs/ip_vs_nq.c | 2 +-
net/netfilter/ipvs/ip_vs_rr.c | 2 +-
net/netfilter/ipvs/ip_vs_sched.c | 25 +++++++++++++++++++++++++
net/netfilter/ipvs/ip_vs_sed.c | 2 +-
net/netfilter/ipvs/ip_vs_sh.c | 2 +-
net/netfilter/ipvs/ip_vs_wlc.c | 2 +-
net/netfilter/ipvs/ip_vs_wrr.c | 14 ++++++++------
11 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 5d75fea..9399549 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1019,6 +1019,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
struct ip_vs_proto_data *pd);
+extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
+
/*
* IPVS control data and functions (from ip_vs_ctl.c)
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 00b5ffa..4a9c8cd 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -510,7 +510,7 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
/* No cache entry or it is invalid, time to schedule */
dest = __ip_vs_lblc_schedule(svc);
if (!dest) {
- IP_VS_ERR_RL("LBLC: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index bfa25f1..bd329b1 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -692,7 +692,7 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
/* The cache entry is invalid, time to schedule */
dest = __ip_vs_lblcr_schedule(svc);
if (!dest) {
- IP_VS_ERR_RL("LBLCR: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
read_unlock(&svc->sched_lock);
return NULL;
}
diff --git a/net/netfilter/ipvs/ip_vs_lc.c b/net/netfilter/ipvs/ip_vs_lc.c
index 4f69db1..6063800 100644
--- a/net/netfilter/ipvs/ip_vs_lc.c
+++ b/net/netfilter/ipvs/ip_vs_lc.c
@@ -70,7 +70,7 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
}
if (!least)
- IP_VS_ERR_RL("LC: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
else
IP_VS_DBG_BUF(6, "LC: server %s:%u activeconns %d "
"inactconns %d\n",
diff --git a/net/netfilter/ipvs/ip_vs_nq.c b/net/netfilter/ipvs/ip_vs_nq.c
index c413e18..984d9c1 100644
--- a/net/netfilter/ipvs/ip_vs_nq.c
+++ b/net/netfilter/ipvs/ip_vs_nq.c
@@ -99,7 +99,7 @@ ip_vs_nq_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
}
if (!least) {
- IP_VS_ERR_RL("NQ: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}
diff --git a/net/netfilter/ipvs/ip_vs_rr.c b/net/netfilter/ipvs/ip_vs_rr.c
index e210f37..c49b388 100644
--- a/net/netfilter/ipvs/ip_vs_rr.c
+++ b/net/netfilter/ipvs/ip_vs_rr.c
@@ -72,7 +72,7 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
q = q->next;
} while (q != p);
write_unlock(&svc->sched_lock);
- IP_VS_ERR_RL("RR: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
out:
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c
index 076ebe0..08dbdd5 100644
--- a/net/netfilter/ipvs/ip_vs_sched.c
+++ b/net/netfilter/ipvs/ip_vs_sched.c
@@ -29,6 +29,7 @@
#include <net/ip_vs.h>
+EXPORT_SYMBOL(ip_vs_scheduler_err);
/*
* IPVS scheduler list
*/
@@ -146,6 +147,30 @@ void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler)
module_put(scheduler->module);
}
+/*
+ * Common error output helper for schedulers
+ */
+
+void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg)
+{
+ if (svc->fwmark) {
+ IP_VS_ERR_RL("%s: FWM %u 0x%08X - %s\n",
+ svc->scheduler->name, svc->fwmark,
+ svc->fwmark, msg);
+#ifdef CONFIG_IP_VS_IPV6
+ } else if (svc->af == AF_INET6) {
+ IP_VS_ERR_RL("%s: %s [%pI6]:%d - %s\n",
+ svc->scheduler->name,
+ ip_vs_proto_name(svc->protocol),
+ &svc->addr.in6, ntohs(svc->port), msg);
+#endif
+ } else {
+ IP_VS_ERR_RL("%s: %s %pI4:%d - %s\n",
+ svc->scheduler->name,
+ ip_vs_proto_name(svc->protocol),
+ &svc->addr.ip, ntohs(svc->port), msg);
+ }
+}
/*
* Register a scheduler in the scheduler list
diff --git a/net/netfilter/ipvs/ip_vs_sed.c b/net/netfilter/ipvs/ip_vs_sed.c
index 1ab75a9..89ead24 100644
--- a/net/netfilter/ipvs/ip_vs_sed.c
+++ b/net/netfilter/ipvs/ip_vs_sed.c
@@ -87,7 +87,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
goto nextstage;
}
}
- IP_VS_ERR_RL("SED: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
/*
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index e6cc174..b5e2556 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -223,7 +223,7 @@ ip_vs_sh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
|| !(dest->flags & IP_VS_DEST_F_AVAILABLE)
|| atomic_read(&dest->weight) <= 0
|| is_overloaded(dest)) {
- IP_VS_ERR_RL("SH: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
}
diff --git a/net/netfilter/ipvs/ip_vs_wlc.c b/net/netfilter/ipvs/ip_vs_wlc.c
index bbddfdb..fdf0f58 100644
--- a/net/netfilter/ipvs/ip_vs_wlc.c
+++ b/net/netfilter/ipvs/ip_vs_wlc.c
@@ -75,7 +75,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
goto nextstage;
}
}
- IP_VS_ERR_RL("WLC: no destination available\n");
+ ip_vs_scheduler_err(svc, "no destination available");
return NULL;
/*
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index 30db633..1ef41f5 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -147,8 +147,9 @@ ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
if (mark->cl == mark->cl->next) {
/* no dest entry */
- IP_VS_ERR_RL("WRR: no destination available: "
- "no destinations present\n");
+ ip_vs_scheduler_err(svc,
+ "no destination available: "
+ "no destinations present");
dest = NULL;
goto out;
}
@@ -162,8 +163,8 @@ ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
*/
if (mark->cw == 0) {
mark->cl = &svc->destinations;
- IP_VS_ERR_RL("WRR: no destination "
- "available\n");
+ ip_vs_scheduler_err(svc,
+ "no destination available");
dest = NULL;
goto out;
}
@@ -185,8 +186,9 @@ ip_vs_wrr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
/* back to the start, and no dest is found.
It is only possible when all dests are OVERLOADED */
dest = NULL;
- IP_VS_ERR_RL("WRR: no destination available: "
- "all destinations are overloaded\n");
+ ip_vs_scheduler_err(svc,
+ "no destination available: "
+ "all destinations are overloaded");
goto out;
}
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/3] ipvs: remove extra lookups for ICMP packets
From: Simon Horman @ 2011-02-16 6:04 UTC (permalink / raw)
To: lvs-devel, netdev, netfilter-devel, netfilter
Cc: Julian Anastasov, Patrick Schaaf, Patrick McHardy, Simon Horman
In-Reply-To: <1297836293-5942-1-git-send-email-horms@verge.net.au>
From: Julian Anastasov <ja@ssi.bg>
Remove code that should not be called anymore.
Now when ip_vs_out handles replies for local clients at
LOCAL_IN hook we do not need to call conn_out_get and
handle_response_icmp from ip_vs_in_icmp* because such
lookups were already performed for the ICMP packet and no
connection was found.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_core.c | 28 +++-------------------------
1 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 4d06617..2d1f932 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -729,7 +729,7 @@ void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp,
#endif
/* Handle relevant response ICMP messages - forward to the right
- * destination host. Used for NAT and local client.
+ * destination host.
*/
static int handle_response_icmp(int af, struct sk_buff *skb,
union nf_inet_addr *snet,
@@ -979,7 +979,6 @@ static inline int is_tcp_reset(const struct sk_buff *skb, int nh_len)
}
/* Handle response packets: rewrite addresses and send away...
- * Used for NAT and local client.
*/
static unsigned int
handle_response(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
@@ -1280,7 +1279,6 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
struct ip_vs_protocol *pp;
struct ip_vs_proto_data *pd;
unsigned int offset, ihl, verdict;
- union nf_inet_addr snet;
*related = 1;
@@ -1339,17 +1337,8 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
ip_vs_fill_iphdr(AF_INET, cih, &ciph);
/* The embedded headers contain source and dest in reverse order */
cp = pp->conn_in_get(AF_INET, skb, &ciph, offset, 1);
- if (!cp) {
- /* The packet could also belong to a local client */
- cp = pp->conn_out_get(AF_INET, skb, &ciph, offset, 1);
- if (cp) {
- snet.ip = iph->saddr;
- return handle_response_icmp(AF_INET, skb, &snet,
- cih->protocol, cp, pp,
- offset, ihl);
- }
+ if (!cp)
return NF_ACCEPT;
- }
verdict = NF_DROP;
@@ -1395,7 +1384,6 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, int *related, unsigned int hooknum)
struct ip_vs_protocol *pp;
struct ip_vs_proto_data *pd;
unsigned int offset, verdict;
- union nf_inet_addr snet;
struct rt6_info *rt;
*related = 1;
@@ -1455,18 +1443,8 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, int *related, unsigned int hooknum)
ip_vs_fill_iphdr(AF_INET6, cih, &ciph);
/* The embedded headers contain source and dest in reverse order */
cp = pp->conn_in_get(AF_INET6, skb, &ciph, offset, 1);
- if (!cp) {
- /* The packet could also belong to a local client */
- cp = pp->conn_out_get(AF_INET6, skb, &ciph, offset, 1);
- if (cp) {
- ipv6_addr_copy(&snet.in6, &iph->saddr);
- return handle_response_icmp(AF_INET6, skb, &snet,
- cih->nexthdr,
- cp, pp, offset,
- sizeof(struct ipv6hdr));
- }
+ if (!cp)
return NF_ACCEPT;
- }
verdict = NF_DROP;
--
1.7.2.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox