* Re: kernel panic on 2.6.24 with esfq patch applied
From: Corey Hickey @ 2008-02-02 10:23 UTC (permalink / raw)
To: Denys Fedoryshchenko; +Cc: netdev
In-Reply-To: <20080201131509.M52958@visp.net.lb>
Denys Fedoryshchenko wrote:
> Hi
>
> Probably bug related to ESFQ, now i will unload module and will test more.
> But probably not related, so if not difficult, please take a look.
>
> Feb 1 09:08:50 SERVER [12380.067104] BUG: unable to handle kernel NULL
> pointer dereference
> Feb 1 09:08:50 SERVER at virtual address 00000008
> Feb 1 09:08:50 SERVER [12380.067140] printing eip: c01f10ed
> Feb 1 09:08:50 SERVER *pde = 00000000
> Feb 1 09:08:50 SERVER
> Feb 1 09:08:50 SERVER [12380.067162] Oops: 0000 [#1]
> Feb 1 09:08:50 SERVER SMP
> Feb 1 09:08:50 SERVER
> Feb 1 09:08:50 SERVER [12380.067181] Modules linked in:
> Feb 1 09:08:50 SERVER netconsole
> Feb 1 09:08:50 SERVER configfs
> Feb 1 09:08:50 SERVER iTCO_wdt
> Feb 1 09:08:50 SERVER nf_nat_pptp
> Feb 1 09:08:50 SERVER nf_conntrack_pptp
> Feb 1 09:08:50 SERVER nf_conntrack_proto_gre
> Feb 1 09:08:50 SERVER nf_nat_proto_gre
> Feb 1 09:08:50 SERVER sch_esfq
I'd rather you were using my recent patches to SFQ instead of ESFQ. I
was able to crash a 2.6.24 user-mode Linux with ESFQ as well; I don't
know if that's what you encountered, but the SFQ patches should be
better anyway.
http://fatooh.org/esfq-2.6/sfq-2.6.24.tar.bz2
http://fatooh.org/esfq-2.6/
-Corey
^ permalink raw reply
* Re: Still oopsing in nf_nat_move_storage()
From: Patrick McHardy @ 2008-02-02 10:26 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: Netdev, Netfilter Development Mailinglist
In-Reply-To: <47A3AE41.6070104@redhat.com>
Chuck Ebbert wrote:
> On 01/31/2008 01:03 PM, Chuck Ebbert wrote:
>> On 01/29/2008 12:18 PM, Patrick McHardy wrote:
>>> Chuck Ebbert wrote:
>>>> nf_nat_move_storage():
>>>> /usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
>>>>
>>>> 87: f7 47 64 80 01 00 00 testl $0x180,0x64(%edi)
>>>> 8e: 74 39 je c9
>>>> <nf_nat_move_storage+0x65>
>>>>
>>>> line 612:
>>>> if (!(ct->status & IPS_NAT_DONE_MASK))
>>>> return;
>>>>
>>>> ct is NULL
>>> The current kernel (and 2.6.23-stable) have:
>>>
>>> if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
>>> return;
>>>
>>> so it seems you're using an old version.
>
> So, it is now oopsing after the test for NULL and only x86_64 is
> catching the invalid address because it is non-canonical. Checking
> for NULL is obviously not enough...
The addresses passed to ->move seems to be bogus, we're doing:
t->move(ct, ct->ext + ct->ext->offset[i]);
without assigning the new ct->ext first, which is wrong for
two reasons:
- the new ext hasn't been assigned to the conntrack yet,
so its moving within the same extension
- ct->ext + ct->ext->offset[i] should be (void *)ct->ext + ...
I'll fix it and send a patch after some testing. Still wondering
why this wasn't noticed before.
^ permalink raw reply
* Re: [PATCH] IPROUTE2: Add addrlabel subsystem.
From: Jarek Poplawski @ 2008-02-02 9:43 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: shemminger, netdev
In-Reply-To: <20080201.065754.116071721.yoshfuji@linux-ipv6.org>
YOSHIFUJI Hideaki / 吉藤英明 wrote, On 01/31/2008 08:57 PM:
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
> include/linux/if_addrlabel.h | 32 +++++
> ip/Makefile | 2 +-
> ip/ip.c | 5 +-
> ip/ip_common.h | 4 +
> ip/ipaddrlabel.c | 260 ++++++++++++++++++++++++++++++++++++++++++
> ip/ipmonitor.c | 4 +
> 6 files changed, 304 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
> new file mode 100644
> index 0000000..9fe79c9
> --- /dev/null
> +++ b/include/linux/if_addrlabel.h
> @@ -0,0 +1,32 @@
> +/*
> + * if_addrlabel.h - netlink interface for address labels
> + *
> + * Copyright (C)2007 USAGI/WIDE Project, All Rights Reserved.
> + *
Hi,
Is this statement GPL compatible? And, maybe you could add a few words
about this to man ip too?
Regards,
Jarek P.
^ permalink raw reply
* Re: kernel panic on 2.6.24 with esfq patch applied
From: Jarek Poplawski @ 2008-02-02 9:28 UTC (permalink / raw)
To: Denys Fedoryshchenko; +Cc: netdev
In-Reply-To: <20080201131509.M52958@visp.net.lb>
Denys Fedoryshchenko wrote, On 02/01/2008 02:25 PM:
> Hi
>
> Probably bug related to ESFQ, now i will unload module and will test more.
> But probably not related, so if not difficult, please take a look.
Hi,
The main break seems to take place in HTB. Do you use HTB on IFB, BTW?
If not, maybe some exemplary rules from your script? (There are quite
a few modules loaded...)
Thanks,
Jarek P.
^ permalink raw reply
* Re: [git patches] net driver updates #2
From: David Miller @ 2008-02-02 5:52 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel
In-Reply-To: <20080201210338.GA11084@havoc.gtf.org>
From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 1 Feb 2008 16:03:38 -0500
> Please pull from 'upstream2-davem' branch of
This is now pulled and pushed back out to net-2.6
Thanks!
^ permalink raw reply
* Re: [git patches] net driver updates #2
From: David Miller @ 2008-02-02 5:49 UTC (permalink / raw)
To: jeff; +Cc: netdev, linux-kernel
In-Reply-To: <20080201210338.GA11084@havoc.gtf.org>
From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 1 Feb 2008 16:03:38 -0500
> This submit is based on top of Linus's tree, since I'm not sure what's
> going on with net-2.6.git and my previous (lost?) submission.
>
> These changes do /not/ include anything from the previous submission,
> which was on top of net-2.6 -- but then you rebased, which probably made
> everything more difficult. :)
Can you respin the tree with that previus submission init?
The best I'll be able to do is clone that entire tree in
order to pick the patches out, and from here in Australia
with a dodgy link I might not even finish before I have
to get on a plane back home on Monday :-)
I'll pull in this second set later tonight.
^ permalink raw reply
* [PATCH] sis190: fix compile error section type conflict
From: Li Zefan @ 2008-02-02 5:27 UTC (permalink / raw)
To: romieu; +Cc: netdev, LKML, jgarzik
Fix the following compile error:
drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
make[2]: *** [drivers/net/sis190.o] Error 1
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
drivers/net/sis190.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..e48e4ad 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
{ "SiS 191 PCI Gigabit Ethernet adapter" },
};
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
{ 0, },
--
1.5.4.rc3
^ permalink raw reply related
* Re: linux-2.6.24 compile error in drivers/net/b44.c
From: Li Zefan @ 2008-02-02 4:51 UTC (permalink / raw)
To: LKML; +Cc: netdev, David Miller, mboton, zambrano, linville
In-Reply-To: <47A3CC70.8090900@cn.fujitsu.com>
Add CCs:
CC: mboton@gmail.com
CC: zambrano@broadcom.com
CC: linville@tuxdriver.com
Li Zefan wrote:
> drivers/net/b44.c: In function 'b44_remove_one':
> drivers/net/b44.c:2231: error: implicit declaration of function 'ssb_pcihost_set_power_state'
> make[2]: *** [drivers/net/b44.o] Error 1
> make[1]: *** [drivers/net] Error 2
>
> I think it is caused by:
>
> CONFIG_SSB_PCIHOST=n
> CONFIG_B44=y
>
^ permalink raw reply
* Re: [PATCH] Disable TSO for non standard qdiscs
From: Andi Kleen @ 2008-02-02 5:20 UTC (permalink / raw)
To: jamal
Cc: Patrick McHardy, Waskiewicz Jr, Peter P, Andi Kleen, Glen Turner,
Stephen Hemminger, netdev
In-Reply-To: <1201867609.4465.50.camel@localhost>
> Turning TSO off at netdev registration time with a warning will be a
> cleaner IMO. Or alternatively introducing a kernel-config "I know what
You mean the qdisc should force TSO off on the underlying device?
> TSO is" option which is then used at netdev registration. From a
> usability perspective it would make more sense to just keep ethtool as
> the only way to configure TSO.
Ok, reasonable point.
-Andi
^ permalink raw reply
* Re: oops with ipcomp
From: Herbert Xu @ 2008-02-02 4:42 UTC (permalink / raw)
To: Beschorner Daniel; +Cc: netdev
In-Reply-To: <3C59DB883F7B0B4D8096010D45ACCD134F209E@exch.facton.local>
On Fri, Feb 01, 2008 at 11:09:22AM +0100, Beschorner Daniel wrote:
> One more issue with 2.6.24, some hours after I reactivated ipcomp with
> Herb's 2 patches.
> The httpd log shows a http request per esp tunnel at oops time.
> Don't know whether it is for network or compression guys, so I started
> posting here.
>
> Unable to handle kernel paging request at ffffc200000fb000 RIP:
> [<ffffffff8031b8f0>] deflate_slow+0x40/0x400
I'm not able to get much information out of this crash dump. Nor
can I reproduce this bug on my 32-bit machines and I'm currently
away from my 64-bit machines.
How long have you been using IPComp in the past and what was the
last kernel version which was stable with IPComp?
Thanks,
--
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
* Re: [PATCH 4/5] ehea: fix phyp checkpatch complaints
From: Doug Maxey @ 2008-02-02 4:39 UTC (permalink / raw)
To: Scott Wood
Cc: Doug Maxey, Linux PowerPC List, Jan-Bernd Themann, Jeff Garzik,
Paul Mackerras, netdev
In-Reply-To: <20080201192344.GA4541@loki.buserror.net>
On Fri, 01 Feb 2008 13:23:45 CST, Scott Wood wrote:
> On Thu, Jan 31, 2008 at 08:20:50PM -0600, Doug Maxey wrote:
> > /* input param R5 */
> > -#define H_ALL_RES_QP_EQPO EHEA_BMASK_IBM(9, 11)
...
> > +#define H_ALL_RES_QP_EQPO EHEA_BMASK_IBM(9, 11)
...
>
> This was better the way it was (before, it was readable at any tab setting);
> checkpatch is overeager to complain on tab/space issues (it's a bit hard to
> distinguish indentation from alignment with a regex).
In emacs, with no special offsets, the lines appear to still line up.
What did happen was spaces were turned to tabs where applicable.
What editor shows a bad alignment?
++doug
^ permalink raw reply
* Re: [Bugme-new] [Bug 9873] New: BUG at net/ipv4/icmp.c:874
From: Andrew Morton @ 2008-02-02 3:37 UTC (permalink / raw)
To: netdev; +Cc: bugme-daemon, snakebyte
In-Reply-To: <bug-9873-10286@http.bugzilla.kernel.org/>
On Fri, 1 Feb 2008 17:21:34 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=9873
>
> Summary: BUG at net/ipv4/icmp.c:874
> Product: Networking
> Version: 2.5
> KernelVersion: 2.6.24-06481-gaa62999
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: IPV4
> AssignedTo: shemminger@linux-foundation.org
> ReportedBy: snakebyte@gmx.de
>
>
> Latest working kernel version: -
> Earliest failing kernel version: 2.6.24-06481-gaa62999
> Distribution: Ubuntu
> Problem Description:
>
> using icmpsic on a box triggers the ooops
>
> Steps to reproduce:
>
> start
> icmpsic -s 192.168.0.201 -d 192.168.0.201 -p 35000 -r 22361 -k 33000
> on the machine containing those interfaces will completely lock it up
>
>
> [ 360.552115] ------------[ cut here ]------------
> [ 360.552235] kernel BUG at net/ipv4/icmp.c:874!
> [ 360.552235] invalid opcode: 0000 [#1] PREEMPT DEBUG_PAGEALLOC
> [ 360.552235] Modules linked in:
> [ 360.552235]
> [ 360.552235] Pid: 3899, comm: icmpsic Not tainted (2.6.24-06481-gaa62999 #20)
> [ 360.552235] EIP: 0060:[<c05eb1b3>] EFLAGS: 00010282 CPU: 0
> [ 360.552235] EIP is at icmp_timestamp+0x83/0xd0
> [ 360.552235] EAX: fffffff2 EBX: cae7d700 ECX: 00000000 EDX: fffffffc
> [ 360.552235] ESI: 003f04d0 EDI: caded000 EBP: c08efeb4 ESP: c08efe48
> [ 360.552235] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
> [ 360.552235] Process icmpsic (pid: 3899, ti=c08ef000 task=cacf0000
> task.ti=cacbf000)
> [ 360.552235] Stack: 00000004 00000001 cf449060 c0bfb720 cf0df4f0 cf0df4f0
> cf081850 d8053f00
> [ 360.552235] d8053f00 00000004 cae7d700 c08efed4 c0899628 c08efe90
> c0603442 00000000
> [ 360.552235] cf097090 c0603420 c08efeb4 c05b73dd 00000000 c05c5c10
> 00000001 47a3c2a2
> [ 360.552235] Call Trace:
> [ 360.552235] [<c0603442>] ? ipt_hook+0x22/0x30
> [ 360.552235] [<c0603420>] ? ipt_hook+0x0/0x30
> [ 360.552235] [<c05b73dd>] ? nf_iterate+0x5d/0x90
> [ 360.552235] [<c05c5c10>] ? ip_local_deliver_finish+0x0/0x170
> [ 360.552235] [<c05eadf6>] ? icmp_rcv+0xe6/0x200
> [ 360.552235] [<c05c5c77>] ? ip_local_deliver_finish+0x67/0x170
> [ 360.552235] [<c05c60ed>] ? ip_local_deliver+0x2d/0xa0
> [ 360.552235] [<c05c5c10>] ? ip_local_deliver_finish+0x0/0x170
> [ 360.552235] [<c05c59cf>] ? ip_rcv_finish+0xdf/0x320
> [ 360.552235] [<c05b74ca>] ? nf_hook_slow+0xba/0xe0
> [ 360.552235] [<c05c58f0>] ? ip_rcv_finish+0x0/0x320
> [ 360.552235] [<c05c5feb>] ? ip_rcv+0x16b/0x240
> [ 360.552235] [<c05c58f0>] ? ip_rcv_finish+0x0/0x320
> [ 360.552235] [<c05c5e80>] ? do_softirq+0x8a/0xd0
> [ 360.552235] [<c0128eb4>] ? local_bh_enable+0xa4/0x110
> [ 360.552235] [<c05a43d0>] ? dev_queue_xmit+0xa0/0x340
> [ 360.552235] [<c01547ad>] ? __rcu_read_unlock+0x7d/0x90
> [ 360.552235] [<c05c9d4d>] ? ip_finish_output+0x12d/0x2d0
> [ 360.552235] [<c05ca9a9>] ? ip_output+0x79/0xd0
> [ 360.552235] [<c05e4b40>] ? dst_output+0x0/0x10
> [ 360.552235] [<c05e4f71>] ? raw_send_hdrinc+0x121/0x310
> [ 360.552235] [<c05e4b40>] ? dst_output+0x0/0x10
> [ 360.552235] [<c05e60cd>] ? raw_sendmsg+0x36d/0x3a0
> [ 360.552235] [<c05ee914>] ? inet_sendmsg+0x34/0x60
> [ 360.552235] [<c0595c54>] ? sock_sendmsg+0xc4/0xf0
> [ 360.552235] [<c01373b0>] ? autoremove_wake_function+0x0/0x50
> [ 360.552235] [<c01050d3>] ? restore_nocheck+0x12/0x15
> [ 360.552235] [<c0144bf4>] ? trace_hardirqs_on+0xc4/0x150
> [ 360.552235] [<c01050d3>] ? restore_nocheck+0x12/0x15
> [ 360.552235] [<c043ff06>] ? copy_from_user+0x46/0x80
> [ 360.552235] [<c0595f45>] ? __lock_release+0x46/0x70
> [ 360.552235] [<c01070e5>] ? do_softirq+0x55/0xd0
> [ 360.552235] [<c0596e37>] ? sys_socketcall+0x187/0x260
> [ 360.552235] [<c0104fea>] ? sysenter_past_esp+0x5f/0xa5
> [ 360.552235] =======================
> [ 360.552235] Code: f7 ea 69 f6 e8 03 00 00 c1 f9 1f c1 fa 06 29 ca 8d 04 16
> 31 d2 0f c8 8d 4d ac 89 45 b0 89 45 b4 89 d8 e8 c1 02 89 5d 98 c7 45 9c 00 00
> 00
> [ 360.552235] EIP: [<c05eb1b3>] icmp_timestamp+0x83/0xd0 SS:ESP 0068:c08efe48
> [ 360.552276] Kernel panic - not syncing: Fatal exception in interrupt
>
>
> Using the icmpsic command from another box doesnt do a thing, using 127.0.0.1
> will also work.
>
^ permalink raw reply
* Re: [PATCH] Disable TSO for non standard qdiscs
From: Andi Kleen @ 2008-02-02 4:10 UTC (permalink / raw)
To: Rick Jones; +Cc: Andi Kleen, netdev, davem
In-Reply-To: <47A39606.4090401@hp.com>
On Fri, Feb 01, 2008 at 01:58:30PM -0800, Rick Jones wrote:
> >>Does this also imply that JumboFrames interacts badly with these qdiscs?
> >>Or IPoIB with its 65000ish byte MTU?
> >
> >
> >Correct. Of course it is always relative to the link speed. So if your
> >link is 10x faster and your packets 10x bigger you can get similarly
> >smooth shaping.
>
> If the later-in-thread mentioned person shaping for their DSL line
> happens to have enabled JumboFrames on their GbE network, will/should
> the qdisc negate that?
I don't think so, mostly because jumbo frames are not enabled by
default. I'm only concerned about usable defaults there -- if you
set non default options you should certainly know what you're doing.
There are other reasons to not use jumbo frames anyways; e.g. a lot
of cards still do not support SG for them but only process
them as a single continuous buffer in memory so you often run
into memory fragmentation problems.
> Or is the qdisc currently assuming that the
> remote end of the DSL will have asked for a smaller MSS?
First there are lots of different qdiscs that all do different things.
Take a look at net/sched/*. Then they usually don't strictly require particular
MTUs (or know anything about MSS), but tend to work better with smaller
MTUs because that allows more choices in packet scheduling. Generally
the larger your packets the less they can be scheduled.
-Andi
^ permalink raw reply
* Re: why does DCCP SO_REUSEADDR have to be SOL_DCCP?
From: Arnaldo Carvalho de Melo @ 2008-02-02 3:02 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Rick Jones,
Linux Network Development list
In-Reply-To: <20080202025259.GH17164@ghostprotocols.net>
Em Sat, Feb 02, 2008 at 12:52:59AM -0200, Arnaldo Carvalho de Melo escreveu:
> If instead you pass SOL_DCCP we'll go down the rabbit hole till
> do_dccp_setsockopt() and SO_REUSEADDR, that is equal to 2, will be
> interpreted as DCCP_SOCKOPT_SERVICE, that is also equal to 2, so you'll
> be setting the service, not changing the SO_REUSEADDR setting.
>
> The problem here is that you need to use:
>
> setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_PACKET_SIZE, service,
> sizeof(service));
Further info on DCCP service codes:
http://www.rfc.net/rfc4340.txt -> "8.1.2. Service Codes"
> Again, take a look at the ttcp patch, the other patches for iperf,
> netcat, etc handles this.
- Arnaldo
^ permalink raw reply
* Re: why does DCCP SO_REUSEADDR have to be SOL_DCCP?
From: Arnaldo Carvalho de Melo @ 2008-02-02 2:52 UTC (permalink / raw)
To: Rick Jones; +Cc: Linux Network Development list
In-Reply-To: <47A3CA7F.8040300@hp.com>
Em Fri, Feb 01, 2008 at 05:42:23PM -0800, Rick Jones escreveu:
> Hi -
>
> I'm tweaking the netperf omni tests to be able to run over DCCP. I've run
> across a not-unorecedented problem with getaddrinfo() not groking either
> SOCK_DCCP or IPPROTO_DCCP in the hints, and that I can more or less live
> with - I had to do a kludge for getaddrinfo() for IPPROTO_SCTP under Linux
> at one point and I can see how the two are not necessarily going to be in
> sync.
See the ttcp patch where we do a xgetaddrinfo crude hack to handle dccp:
http://vger.kernel.org/~acme/dccp/ttcp.c
> And I've worked-around no user-level include files (ie without setting
> __KERNEL__) define the DCCP stuff, and that is OK too, albeit somewhat
> inconvenient.
Humm, for what? Again, see the ttcp code above:
> My question though is why on earth does an SO_REUSEADDR setsockopt()
> against a DCCP socket have to be SOL_DCCP? SCTP and TCP are quite happy
> with SOL_SOCKET, and it might be foolish consistency, but since the option
> _does_ begin with SO_ I'd have expected it to work for SOL_SOCKET, but
> (again RHEL5.1, yes, I do plan on getting upstream but have to satisfy
> several masters) it doesn't seem to be the case - a subsequent listen() or
> connect() call after an SOL_SOCKET SO_REUSEADDR against a DCCP socket
> leaves one SOL as it were...
Strange, lemme check...
1. sys_socketcall ->
2. sys_setsockopt ->
3. if (level == SOL_SOCKET) {
4. sock_setsockopt:
5. case SO_REUSEADDR:
6. sk->sk_reuse = valbool;
7. } else
8. sock->ops->setsockopt = inet_dccp_ops->setsockopt =
9. inet_dccp_ops->setsockopt = sock_common_setsockopt ->
10. sk->sk_prot->setsockopt = dccp_v4_prot->setsockopt =
11. dccp_setsockopt
12. if (level != SOL_DCCP)
13. return inet_csk(sk)->icsk_af_ops->setsockopt() =
14. ip_setsockopt
15. return do_dccp_setsockopt()
SO_REUSEADDR is handled in 4, if you pass SOL_SOCKET.
If instead you pass SOL_DCCP we'll go down the rabbit hole till
do_dccp_setsockopt() and SO_REUSEADDR, that is equal to 2, will be
interpreted as DCCP_SOCKOPT_SERVICE, that is also equal to 2, so you'll
be setting the service, not changing the SO_REUSEADDR setting.
The problem here is that you need to use:
setsockopt(fd, SOL_DCCP, DCCP_SOCKOPT_PACKET_SIZE, service,
sizeof(service));
Again, take a look at the ttcp patch, the other patches for iperf,
netcat, etc handles this.
> Of course the setsockopt(SO_REUSEADDR) against the DCCP socket using
> SOL_SOCKET itself doesn't fail, only the later listen() or connect()
> call...
>
> happy benchmarking,
Look forward for a happy DCCP netperf bencharking session!
Thanks a lot,
- Arnaldo
^ permalink raw reply
* RE: [PATCH] Disable TSO for non standard qdiscs
From: Waskiewicz Jr, Peter P @ 2008-02-02 1:51 UTC (permalink / raw)
To: Jarek Poplawski, hadi
Cc: Patrick McHardy, Andi Kleen, Glen Turner, Stephen Hemminger,
netdev
In-Reply-To: <20080201225627.GB3071@ami.dom.local>
> I totally disagree with these POVs:
>
> - 10G cards should be treated by default as 10G cards - not
> DSL modems,
> and common users shouldn't have to read any warnings or configs to
> see this.
> - tc with TBF or HTB are professional tools; there should be
> added some
> warnings to manuals. But trying to change the way they work because
> we think we know better what users want, and changing BTW some other
> things (making debugging this later a hell), is simply disrespectful
> for target users of these tools. There are some wrappers or
> "creators"
> invented for this. And, BTW, I think I've seen somewhere a system
> which does this this other way - with creators for
> professionals. So,
> you could be right with this too...
Ok, maybe I'm not done quite yet. Jarek is echo'ing my original point,
changing the behavior of the tool automatically (these qdiscs in
question) is not good for a normal end user. It might be fine for
kernel developers, but not users of these tools, IMO. A less disruptive
approach, such as a warning message printed when loading the qdisc if
TSO is enabled, and documenting recommended usage, I think is more
prudent here.
Cheers,
-PJ Waskiewicz
^ permalink raw reply
* linux-2.6.24 compile error in drivers/net/b44.c
From: Li Zefan @ 2008-02-02 1:50 UTC (permalink / raw)
To: LKML; +Cc: netdev, David Miller
drivers/net/b44.c: In function 'b44_remove_one':
drivers/net/b44.c:2231: error: implicit declaration of function 'ssb_pcihost_set_power_state'
make[2]: *** [drivers/net/b44.o] Error 1
make[1]: *** [drivers/net] Error 2
I think it is caused by:
CONFIG_SSB_PCIHOST=n
CONFIG_B44=y
^ permalink raw reply
* why does DCCP SO_REUSEADDR have to be SOL_DCCP?
From: Rick Jones @ 2008-02-02 1:42 UTC (permalink / raw)
To: Linux Network Development list
Hi -
I'm tweaking the netperf omni tests to be able to run over DCCP. I've
run across a not-unorecedented problem with getaddrinfo() not groking
either SOCK_DCCP or IPPROTO_DCCP in the hints, and that I can more or
less live with - I had to do a kludge for getaddrinfo() for IPPROTO_SCTP
under Linux at one point and I can see how the two are not necessarily
going to be in sync.
And I've worked-around no user-level include files (ie without setting
__KERNEL__) define the DCCP stuff, and that is OK too, albeit somewhat
inconvenient.
My question though is why on earth does an SO_REUSEADDR setsockopt()
against a DCCP socket have to be SOL_DCCP? SCTP and TCP are quite happy
with SOL_SOCKET, and it might be foolish consistency, but since the
option _does_ begin with SO_ I'd have expected it to work for
SOL_SOCKET, but (again RHEL5.1, yes, I do plan on getting upstream but
have to satisfy several masters) it doesn't seem to be the case - a
subsequent listen() or connect() call after an SOL_SOCKET SO_REUSEADDR
against a DCCP socket leaves one SOL as it were...
Of course the setsockopt(SO_REUSEADDR) against the DCCP socket using
SOL_SOCKET itself doesn't fail, only the later listen() or connect() call...
happy benchmarking,
rick jones
^ permalink raw reply
* [PATCH 3/8] ixbge: Make ethtool code account for media types
From: Auke Kok @ 2008-02-01 23:58 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
The i82598 can support various media types but this ethtool
code only was coded for fiber just yet.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_ethtool.c | 52 ++++++++++++++++++++++++++-----------
1 files changed, 36 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 9f3cdb8..b447dd7 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -103,21 +103,41 @@ static int ixgbe_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
+ u32 link_speed = 0;
+ bool link_up;
- ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
- ecmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
- ecmd->port = PORT_FIBRE;
+ ecmd->supported = SUPPORTED_10000baseT_Full;
+ ecmd->autoneg = AUTONEG_ENABLE;
ecmd->transceiver = XCVR_EXTERNAL;
+ if (hw->phy.media_type == ixgbe_media_type_copper) {
+ ecmd->supported |= (SUPPORTED_1000baseT_Full |
+ SUPPORTED_TP | SUPPORTED_Autoneg);
+
+ ecmd->advertising = (ADVERTISED_TP | ADVERTISED_Autoneg);
+ if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
+ ecmd->advertising |= ADVERTISED_10000baseT_Full;
+ if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
+ ecmd->advertising |= ADVERTISED_1000baseT_Full;
+
+ ecmd->port = PORT_TP;
+ } else {
+ ecmd->supported |= SUPPORTED_FIBRE;
+ ecmd->advertising = (ADVERTISED_10000baseT_Full |
+ ADVERTISED_FIBRE);
+ ecmd->port = PORT_FIBRE;
+ }
- if (netif_carrier_ok(adapter->netdev)) {
- ecmd->speed = SPEED_10000;
+ adapter->hw.mac.ops.check_link(hw, &(link_speed), &link_up);
+ if (link_up) {
+ ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ?
+ SPEED_10000 : SPEED_1000;
ecmd->duplex = DUPLEX_FULL;
} else {
ecmd->speed = -1;
ecmd->duplex = -1;
}
- ecmd->autoneg = AUTONEG_DISABLE;
return 0;
}
@@ -125,17 +145,17 @@ static int ixgbe_set_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
- if (ecmd->autoneg == AUTONEG_ENABLE ||
- ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)
- return -EINVAL;
-
- if (netif_running(adapter->netdev)) {
- ixgbe_down(adapter);
- ixgbe_reset(adapter);
- ixgbe_up(adapter);
- } else {
- ixgbe_reset(adapter);
+ switch (hw->phy.media_type) {
+ case ixgbe_media_type_fiber:
+ if ((ecmd->autoneg == AUTONEG_ENABLE) ||
+ (ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL))
+ return -EINVAL;
+ /* in this case we currently only support 10Gb/FULL */
+ break;
+ default:
+ break;
}
return 0;
^ permalink raw reply related
* [PATCH 6/8] ixgbe: properly return CHECKSUM_NONE, cleanup csum code
From: Auke Kok @ 2008-02-01 23:59 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
We were not returning CHECKSUM_NONE in a lot of cases which is
wrong. Move common exit points in this function and error code
up before the actual work in this function.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index c814d9b..ee5ee10 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -304,25 +304,40 @@ static void ixgbe_receive_skb(struct ixgbe_adapter *adapter,
}
}
+/**
+ * ixgbe_rx_checksum - indicate in skb if hw indicated a good cksum
+ * @adapter: address of board private structure
+ * @status_err: hardware indication of status of receive
+ * @skb: skb currently being received and modified
+ **/
static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
u32 status_err,
struct sk_buff *skb)
{
skb->ip_summed = CHECKSUM_NONE;
- /* Ignore Checksum bit is set */
+ /* Ignore Checksum bit is set, or rx csum disabled */
if ((status_err & IXGBE_RXD_STAT_IXSM) ||
- !(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED))
+ !(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED))
return;
- /* TCP/UDP checksum error bit is set */
- if (status_err & (IXGBE_RXDADV_ERR_TCPE | IXGBE_RXDADV_ERR_IPE)) {
- /* let the stack verify checksum errors */
+
+ /* if IP and error */
+ if ((status_err & IXGBE_RXD_STAT_IPCS) &&
+ (status_err & IXGBE_RXDADV_ERR_IPE)) {
adapter->hw_csum_rx_error++;
return;
}
+
+ if (!(status_err & IXGBE_RXD_STAT_L4CS))
+ return;
+
+ if (status_err & IXGBE_RXDADV_ERR_TCPE) {
+ adapter->hw_csum_rx_error++;
+ return;
+ }
+
/* It must be a TCP or UDP packet with a valid checksum */
- if (status_err & (IXGBE_RXD_STAT_L4CS | IXGBE_RXD_STAT_UDPCS))
- skb->ip_summed = CHECKSUM_UNNECESSARY;
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
adapter->hw_csum_rx_good++;
}
^ permalink raw reply related
* [PATCH 5/8] ixgbe: Fix FW init/release, make this code a function
From: Auke Kok @ 2008-02-01 23:59 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
A gap was left in the FW release/grab code in up/down path. Fix
it by making the release/grab code a function and calling it in
appropriate locations.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index b4c9c77..c814d9b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -87,6 +87,25 @@ MODULE_VERSION(DRV_VERSION);
#define DEFAULT_DEBUG_LEVEL_SHIFT 3
+static void ixgbe_release_hw_control(struct ixgbe_adapter *adapter)
+{
+ u32 ctrl_ext;
+
+ /* Let firmware take over control of h/w */
+ ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT,
+ ctrl_ext & ~IXGBE_CTRL_EXT_DRV_LOAD);
+}
+
+static void ixgbe_get_hw_control(struct ixgbe_adapter *adapter)
+{
+ u32 ctrl_ext;
+
+ /* Let firmware know the driver has taken over */
+ ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT,
+ ctrl_ext | IXGBE_CTRL_EXT_DRV_LOAD);
+}
#ifdef DEBUG
/**
@@ -1204,6 +1223,8 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
u32 txdctl, rxdctl, mhadd;
int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+ ixgbe_get_hw_control(adapter);
+
if (adapter->flags & (IXGBE_FLAG_MSIX_ENABLED |
IXGBE_FLAG_MSI_ENABLED)) {
if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
@@ -1490,6 +1511,8 @@ static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);
+ ixgbe_release_hw_control(adapter);
+
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
@@ -1891,14 +1914,8 @@ static int ixgbe_open(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
int err;
- u32 ctrl_ext;
u32 num_rx_queues = adapter->num_rx_queues;
- /* Let firmware know the driver has taken over */
- ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT,
- ctrl_ext | IXGBE_CTRL_EXT_DRV_LOAD);
-
try_intr_reinit:
/* allocate transmit descriptors */
err = ixgbe_setup_all_tx_resources(adapter);
@@ -1949,6 +1966,7 @@ try_intr_reinit:
return 0;
err_up:
+ ixgbe_release_hw_control(adapter);
ixgbe_free_irq(adapter);
err_req_irq:
ixgbe_free_all_rx_resources(adapter);
@@ -1974,7 +1992,6 @@ err_setup_tx:
static int ixgbe_close(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
- u32 ctrl_ext;
ixgbe_down(adapter);
ixgbe_free_irq(adapter);
@@ -1982,9 +1999,7 @@ static int ixgbe_close(struct net_device *netdev)
ixgbe_free_all_tx_resources(adapter);
ixgbe_free_all_rx_resources(adapter);
- ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT,
- ctrl_ext & ~IXGBE_CTRL_EXT_DRV_LOAD);
+ ixgbe_release_hw_control(adapter);
return 0;
}
@@ -2749,6 +2764,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
return 0;
err_register:
+ ixgbe_release_hw_control(adapter);
err_hw_init:
err_sw_init:
err_eeprom:
@@ -2784,6 +2800,8 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
+ ixgbe_release_hw_control(adapter);
+
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
^ permalink raw reply related
* [PATCH 4/8] ixgbe: Fix pause code for ethtool
From: Auke Kok @ 2008-02-01 23:58 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_ethtool.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index b447dd7..a119cbd 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -167,7 +167,7 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
- pause->autoneg = AUTONEG_DISABLE;
+ pause->autoneg = (hw->fc.type == ixgbe_fc_full ? 1 : 0);
if (hw->fc.type == ixgbe_fc_rx_pause) {
pause->rx_pause = 1;
@@ -185,10 +185,8 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
- if (pause->autoneg == AUTONEG_ENABLE)
- return -EINVAL;
-
- if (pause->rx_pause && pause->tx_pause)
+ if ((pause->autoneg == AUTONEG_ENABLE) ||
+ (pause->rx_pause && pause->tx_pause))
hw->fc.type = ixgbe_fc_full;
else if (pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgbe_fc_rx_pause;
@@ -196,6 +194,8 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
hw->fc.type = ixgbe_fc_tx_pause;
else if (!pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgbe_fc_none;
+ else
+ return -EINVAL;
hw->fc.original_type = hw->fc.type;
^ permalink raw reply related
* [PATCH 2/8] ixbge: remove TX lock and redo TX accounting.
From: Auke Kok @ 2008-02-01 23:58 UTC (permalink / raw)
To: jeff; +Cc: netdev, e1000-devel
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
This ports Herbert Xu's "maybe_stop_tx" code and removes the tx_lock
which is not needed.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 2 -
drivers/net/ixgbe/ixgbe_main.c | 110 ++++++++++++++++++++++++++++------------
2 files changed, 76 insertions(+), 36 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 7dd9a03..d0bf206 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -136,8 +136,6 @@ struct ixgbe_ring {
u16 head;
u16 tail;
- /* To protect race between sender and clean_tx_irq */
- spinlock_t tx_lock;
struct ixgbe_queue_stats stats;
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 28bb203..b4c9c77 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -165,6 +165,15 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter,
return false;
}
+#define IXGBE_MAX_TXD_PWR 14
+#define IXGBE_MAX_DATA_PER_TXD (1 << IXGBE_MAX_TXD_PWR)
+
+/* Tx Descriptors needed, worst case */
+#define TXD_USE_COUNT(S) (((S) >> IXGBE_MAX_TXD_PWR) + \
+ (((S) & (IXGBE_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
+#define DESC_NEEDED (TXD_USE_COUNT(IXGBE_MAX_DATA_PER_TXD) /* skb->data */ + \
+ MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1) /* for context */
+
/**
* ixgbe_clean_tx_irq - Reclaim resources after transmit completes
* @adapter: board private structure
@@ -177,18 +186,34 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_adapter *adapter,
struct ixgbe_tx_buffer *tx_buffer_info;
unsigned int i, eop;
bool cleaned = false;
- int count = 0;
+ unsigned int total_tx_bytes = 0, total_tx_packets = 0;
i = tx_ring->next_to_clean;
eop = tx_ring->tx_buffer_info[i].next_to_watch;
eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
while (eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)) {
- for (cleaned = false; !cleaned;) {
+ cleaned = false;
+ while (!cleaned) {
tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
tx_buffer_info = &tx_ring->tx_buffer_info[i];
cleaned = (i == eop);
tx_ring->stats.bytes += tx_buffer_info->length;
+ if (cleaned) {
+ struct sk_buff *skb = tx_buffer_info->skb;
+#ifdef NETIF_F_TSO
+ unsigned int segs, bytecount;
+ segs = skb_shinfo(skb)->gso_segs ?: 1;
+ /* multiply data chunks by size of headers */
+ bytecount = ((segs - 1) * skb_headlen(skb)) +
+ skb->len;
+ total_tx_packets += segs;
+ total_tx_bytes += bytecount;
+#else
+ total_tx_packets++;
+ total_tx_bytes += skb->len;
+#endif
+ }
ixgbe_unmap_and_free_tx_resource(adapter,
tx_buffer_info);
tx_desc->wb.status = 0;
@@ -204,29 +229,34 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_adapter *adapter,
eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
/* weight of a sort for tx, avoid endless transmit cleanup */
- if (count++ >= tx_ring->work_limit)
+ if (total_tx_packets >= tx_ring->work_limit)
break;
}
tx_ring->next_to_clean = i;
-#define TX_WAKE_THRESHOLD 32
- spin_lock(&tx_ring->tx_lock);
-
- if (cleaned && netif_carrier_ok(netdev) &&
- (IXGBE_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD) &&
- !test_bit(__IXGBE_DOWN, &adapter->state))
- netif_wake_queue(netdev);
-
- spin_unlock(&tx_ring->tx_lock);
+#define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
+ if (total_tx_packets && netif_carrier_ok(netdev) &&
+ (IXGBE_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) {
+ /* Make sure that anybody stopping the queue after this
+ * sees the new next_to_clean.
+ */
+ smp_mb();
+ if (netif_queue_stopped(netdev) &&
+ !test_bit(__IXGBE_DOWN, &adapter->state)) {
+ netif_wake_queue(netdev);
+ adapter->restart_queue++;
+ }
+ }
if (adapter->detect_tx_hung)
if (ixgbe_check_tx_hang(adapter, tx_ring, eop, eop_desc))
netif_stop_queue(netdev);
- if (count >= tx_ring->work_limit)
+ if (total_tx_packets >= tx_ring->work_limit)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS, tx_ring->eims_value);
+ cleaned = total_tx_packets ? true : false;
return cleaned;
}
@@ -1646,7 +1676,6 @@ int ixgbe_setup_tx_resources(struct ixgbe_adapter *adapter,
txdr->next_to_use = 0;
txdr->next_to_clean = 0;
txdr->work_limit = txdr->count;
- spin_lock_init(&txdr->tx_lock);
return 0;
}
@@ -2086,15 +2115,6 @@ static void ixgbe_watchdog(unsigned long data)
round_jiffies(jiffies + 2 * HZ));
}
-#define IXGBE_MAX_TXD_PWR 14
-#define IXGBE_MAX_DATA_PER_TXD (1 << IXGBE_MAX_TXD_PWR)
-
-/* Tx Descriptors needed, worst case */
-#define TXD_USE_COUNT(S) (((S) >> IXGBE_MAX_TXD_PWR) + \
- (((S) & (IXGBE_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
-#define DESC_NEEDED (TXD_USE_COUNT(IXGBE_MAX_DATA_PER_TXD) /* skb->data */ + \
- MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1) /* for context */
-
static int ixgbe_tso(struct ixgbe_adapter *adapter,
struct ixgbe_ring *tx_ring, struct sk_buff *skb,
u32 tx_flags, u8 *hdr_len)
@@ -2366,6 +2386,37 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter,
writel(i, adapter->hw.hw_addr + tx_ring->tail);
}
+static int __ixgbe_maybe_stop_tx(struct net_device *netdev,
+ struct ixgbe_ring *tx_ring, int size)
+{
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+ netif_stop_queue(netdev);
+ /* Herbert's original patch had:
+ * smp_mb__after_netif_stop_queue();
+ * but since that doesn't exist yet, just open code it. */
+ smp_mb();
+
+ /* We need to check again in a case another CPU has just
+ * made room available. */
+ if (likely(IXGBE_DESC_UNUSED(tx_ring) < size))
+ return -EBUSY;
+
+ /* A reprieve! - use start_queue because it doesn't call schedule */
+ netif_wake_queue(netdev);
+ ++adapter->restart_queue;
+ return 0;
+}
+
+static int ixgbe_maybe_stop_tx(struct net_device *netdev,
+ struct ixgbe_ring *tx_ring, int size)
+{
+ if (likely(IXGBE_DESC_UNUSED(tx_ring) >= size))
+ return 0;
+ return __ixgbe_maybe_stop_tx(netdev, tx_ring, size);
+}
+
+
static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -2373,7 +2424,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
unsigned int len = skb->len;
unsigned int first;
unsigned int tx_flags = 0;
- unsigned long flags = 0;
u8 hdr_len;
int tso;
unsigned int mss = 0;
@@ -2399,14 +2449,10 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
for (f = 0; f < nr_frags; f++)
count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
- spin_lock_irqsave(&tx_ring->tx_lock, flags);
- if (IXGBE_DESC_UNUSED(tx_ring) < (count + 2)) {
+ if (ixgbe_maybe_stop_tx(netdev, tx_ring, count)) {
adapter->tx_busy++;
- netif_stop_queue(netdev);
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
return NETDEV_TX_BUSY;
}
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= IXGBE_TX_FLAGS_VLAN;
tx_flags |= (vlan_tx_tag_get(skb) << IXGBE_TX_FLAGS_VLAN_SHIFT);
@@ -2433,11 +2479,7 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
netdev->trans_start = jiffies;
- spin_lock_irqsave(&tx_ring->tx_lock, flags);
- /* Make sure there is space in the ring for the next send. */
- if (IXGBE_DESC_UNUSED(tx_ring) < DESC_NEEDED)
- netif_stop_queue(netdev);
- spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+ ixgbe_maybe_stop_tx(netdev, tx_ring, DESC_NEEDED);
return NETDEV_TX_OK;
}
^ permalink raw reply related
* [PATCH 8/8] ixgbe: add real-time traffic counters
From: Auke Kok @ 2008-02-01 23:59 UTC (permalink / raw)
To: jeff; +Cc: e1000-devel, netdev
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Just like our other drivers before we can switch ixgbe to
provide real-time packet/byte counters to the stack easily.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 6e7d90e..ead49e5 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -275,6 +275,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_adapter *adapter,
if (total_tx_packets >= tx_ring->work_limit)
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS, tx_ring->eims_value);
+ adapter->net_stats.tx_bytes += total_tx_bytes;
+ adapter->net_stats.tx_packets += total_tx_packets;
cleaned = total_tx_packets ? true : false;
return cleaned;
}
@@ -443,6 +445,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_adapter *adapter,
u16 hdr_info, vlan_tag;
bool is_vlan, cleaned = false;
int cleaned_count = 0;
+ unsigned int total_rx_bytes = 0, total_rx_packets = 0;
i = rx_ring->next_to_clean;
upper_len = 0;
@@ -522,6 +525,11 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_adapter *adapter,
}
ixgbe_rx_checksum(adapter, staterr, skb);
+
+ /* probably a little skewed due to removing CRC */
+ total_rx_bytes += skb->len;
+ total_rx_packets++;
+
skb->protocol = eth_type_trans(skb, netdev);
ixgbe_receive_skb(adapter, skb, is_vlan, vlan_tag);
netdev->last_rx = jiffies;
@@ -550,6 +558,9 @@ next_desc:
if (cleaned_count)
ixgbe_alloc_rx_buffers(adapter, rx_ring, cleaned_count);
+ adapter->net_stats.rx_bytes += total_rx_bytes;
+ adapter->net_stats.rx_packets += total_rx_packets;
+
return cleaned;
}
@@ -2088,10 +2099,6 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
/* Fill out the OS statistics structure */
- adapter->net_stats.rx_packets = adapter->stats.gprc;
- adapter->net_stats.tx_packets = adapter->stats.gptc;
- adapter->net_stats.rx_bytes = adapter->stats.gorc;
- adapter->net_stats.tx_bytes = adapter->stats.gotc;
adapter->net_stats.multicast = adapter->stats.mprc;
/* Rx Errors */
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related
* [PATCH 7/8] ixgbe: fix several counter register errata
From: Auke Kok @ 2008-02-01 23:59 UTC (permalink / raw)
To: jeff; +Cc: e1000-devel, netdev
In-Reply-To: <20080201235841.31474.49421.stgit@localhost.localdomain>
From: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Several counters behave differently on 82598 causing them to display
incorrect values. Adjust the accounting so the reported numbers
make sense and do not double count or represent the wrong item.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 53 +++++++++++++++++++++++-----------------
1 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index ee5ee10..6e7d90e 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2026,22 +2026,26 @@ static int ixgbe_close(struct net_device *netdev)
void ixgbe_update_stats(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
- u64 good_rx, missed_rx, bprc;
+ u64 total_mpc = 0;
+ u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
- good_rx = IXGBE_READ_REG(hw, IXGBE_GPRC);
- missed_rx = IXGBE_READ_REG(hw, IXGBE_MPC(0));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(1));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(2));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(3));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(4));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(5));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(6));
- missed_rx += IXGBE_READ_REG(hw, IXGBE_MPC(7));
- adapter->stats.gprc += (good_rx - missed_rx);
-
- adapter->stats.mpc[0] += missed_rx;
+ for (i = 0; i < 8; i++) {
+ /* for packet buffers not used, the register should read 0 */
+ mpc = IXGBE_READ_REG(hw, IXGBE_MPC(i));
+ missed_rx += mpc;
+ adapter->stats.mpc[i] += mpc;
+ total_mpc += adapter->stats.mpc[i];
+ adapter->stats.rnbc[i] += IXGBE_READ_REG(hw, IXGBE_RNBC(i));
+ }
+ adapter->stats.gprc += IXGBE_READ_REG(hw, IXGBE_GPRC);
+ /* work around hardware counting issue */
+ adapter->stats.gprc -= missed_rx;
+
+ /* 82598 hardware only has a 32 bit counter in the high register */
adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCH);
+ adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
+ adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORH);
bprc = IXGBE_READ_REG(hw, IXGBE_BPRC);
adapter->stats.bprc += bprc;
adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC);
@@ -2053,28 +2057,34 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
adapter->stats.prc511 += IXGBE_READ_REG(hw, IXGBE_PRC511);
adapter->stats.prc1023 += IXGBE_READ_REG(hw, IXGBE_PRC1023);
adapter->stats.prc1522 += IXGBE_READ_REG(hw, IXGBE_PRC1522);
-
adapter->stats.rlec += IXGBE_READ_REG(hw, IXGBE_RLEC);
adapter->stats.lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXC);
- adapter->stats.lxontxc += IXGBE_READ_REG(hw, IXGBE_LXONTXC);
adapter->stats.lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
- adapter->stats.lxofftxc += IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
+ lxon = IXGBE_READ_REG(hw, IXGBE_LXONTXC);
+ adapter->stats.lxontxc += lxon;
+ lxoff = IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
+ adapter->stats.lxofftxc += lxoff;
adapter->stats.ruc += IXGBE_READ_REG(hw, IXGBE_RUC);
adapter->stats.gptc += IXGBE_READ_REG(hw, IXGBE_GPTC);
- adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
- adapter->stats.rnbc[0] += IXGBE_READ_REG(hw, IXGBE_RNBC(0));
+ adapter->stats.mptc += IXGBE_READ_REG(hw, IXGBE_MPTC);
+ /*
+ * 82598 errata - tx of flow control packets is included in tx counters
+ */
+ xon_off_tot = lxon + lxoff;
+ adapter->stats.gptc -= xon_off_tot;
+ adapter->stats.mptc -= xon_off_tot;
+ adapter->stats.gotc -= (xon_off_tot * (ETH_ZLEN + ETH_FCS_LEN));
adapter->stats.ruc += IXGBE_READ_REG(hw, IXGBE_RUC);
adapter->stats.rfc += IXGBE_READ_REG(hw, IXGBE_RFC);
adapter->stats.rjc += IXGBE_READ_REG(hw, IXGBE_RJC);
- adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORH);
adapter->stats.tpr += IXGBE_READ_REG(hw, IXGBE_TPR);
adapter->stats.ptc64 += IXGBE_READ_REG(hw, IXGBE_PTC64);
+ adapter->stats.ptc64 -= xon_off_tot;
adapter->stats.ptc127 += IXGBE_READ_REG(hw, IXGBE_PTC127);
adapter->stats.ptc255 += IXGBE_READ_REG(hw, IXGBE_PTC255);
adapter->stats.ptc511 += IXGBE_READ_REG(hw, IXGBE_PTC511);
adapter->stats.ptc1023 += IXGBE_READ_REG(hw, IXGBE_PTC1023);
adapter->stats.ptc1522 += IXGBE_READ_REG(hw, IXGBE_PTC1522);
- adapter->stats.mptc += IXGBE_READ_REG(hw, IXGBE_MPTC);
adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
/* Fill out the OS statistics structure */
@@ -2090,8 +2100,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
adapter->net_stats.rx_dropped = 0;
adapter->net_stats.rx_length_errors = adapter->stats.rlec;
adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
- adapter->net_stats.rx_missed_errors = adapter->stats.mpc[0];
-
+ adapter->net_stats.rx_missed_errors = total_mpc;
}
/**
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ 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