Herbert Xu [Tue, 5 Oct 2004 15:01:33 +0000 (08:01 -0700)]
[TCP]: Fix bug that hid sockets in tcp_diag
This patch squashes a bug in tcp_diag which was created when the
sk_* loops replaced the original for loops. It's a pity that these
sk_*/hlist_*/list_* loops don't take an arbitrary expression as an
argument for continue.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
We broke ECN encapsulation in tunnels recently.
Without this patch, even though encapusulated (inner) packet is
'not-ECN', encapusulating (outer) packet is sent with 'ECT(0)' set.
This is wrong and should be 'not-ECN.'
This patch fixes up.
From RFC3168:
The full-functionality option for ECN encapsulation is to copy the
ECN codepoint of the inside header to the outside header on
encapsulation if the inside header is not-ECT or ECT, and to set the
ECN codepoint of the outside header to ECT(0) if the ECN codepoint of
the inside header is CE.
Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Tue, 5 Oct 2004 14:58:06 +0000 (07:58 -0700)]
[TCP]: Show all SYN_RECV sockets in /proc/net/tcp
I was fixing the tcp_diag so that it shows SYN_RECV sockets properly.
I found that /proc/net/tcp didn't do it correctly either. So here is
a small patch to fix /proc/net/tcp.
The logic in there stinks though so I'd love to see a rewrite.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Oct 2004 14:28:15 +0000 (07:28 -0700)]
[SPARC64]: Make kprobe implementation more robust.
Switch over to use the single-step scheme which x86 uses
which is to execute the kprobe instruction in the
kprobe->insn[] area. Also, make sure the kprobe execution
runs fully with interrupts disabled, so we do not deadlock.
This required adding code to fix things up as a result of
the instruction executing at a PC which is different from
where it would normally execute. For example, if the
instruction is a PC-relative branch, we have to adjust the
final PC value.
Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Tue, 5 Oct 2004 11:51:53 +0000 (04:51 -0700)]
i386: mark do_test_wp_bit() noinline
As reported by Zachary Amsden <zach@vmware.com>,
some gcc versions will inline the function even when
it is declared after the call-site. This particular
function must not be inlined, since the exception
recovery doesn't like __init sections (which the caller
is in).
Linus Torvalds [Tue, 5 Oct 2004 11:01:31 +0000 (04:01 -0700)]
pcmcia: add iomem sparse annotations.
It was pretty clean already, adding the proper annotations
to the base pointers and a few functions was all it took
to make sparse happy about the PCI accesses.
Linus Torvalds [Tue, 5 Oct 2004 10:29:04 +0000 (03:29 -0700)]
Fix up CHECKFLAGS definitions
More recent versions of sparse do not define the Linux-specific
default defines, so we make the main Makefile default to the
regular Linux preprocessor defines (__linux__, linux, __STDC__
and unix, __unix__).
Also, sparse has long since fixed the default empty define to
be "1" as in regular C, so remove the unnecessary "=1" from
the architecture-specific sparse CHECKFLAGS.
Ingo Molnar [Tue, 5 Oct 2004 09:44:44 +0000 (02:44 -0700)]
[PATCH] Fix task_hot() balancing
This fixes the integer underflow in task_hot() noticed by Kenneth W Chen
and makes use of p->last_ran to separate load-balancing timestamps (used
by task_hot()) from interactivity timestamps. (which two interfered)
compiled, booted on x86 SMP.
Confirmed by Kenneth Chen <kenneth.w.chen@intel.com> to fix the db
transaction processing workload that showed the balancing problem.
Roger Blofeld [Tue, 5 Oct 2004 11:07:18 +0000 (12:07 +0100)]
[SERIAL] Pick nearest baud rate divider
From: Roger Blofeld
This patch modifies uart_get_divisor to select the nearest baud rate
divider rather than the lowest. It minimizes baud rate errors.
For example, if uartclk is 33000000 and baud is 115200 the ratio is about
17.9 The current code selects 17 (5% error) but should select 18 (0.5%
error)
Signed-off-by: Andrew Morton Signed-off-by: Russell King
Manfred Spraul [Tue, 5 Oct 2004 07:23:17 +0000 (00:23 -0700)]
[NET]: Fix secure tcp sequence number generation
Ted's recent random.c update broke the periodic rekeying:
schedule_work() doesn't provide synchronization. Additionally the first
syn values after boot are generated with secret 0 - not good.
Attached is a big cleanup. Linus asked me to send to to you for merging:
The tcp sequence number generator needs a random seed that is reset every
few minutes. Since the sequence numbers should be constantly increasing,
for each rekey 2^24 is added to the sequence number.
The actual use of the sequence number generator is lockless,
synchronization is achieved by having two copies of the control structure.
The attached patch:
- fixes a race in rekey_seq_generator(): schedule_work doesn't
provide synchronization.
- Uses schedule_delayed_work() for the rekey: simplifies synchronization
and speeds up the hot path.
- Adds a late_initcall for the first initialization after boot.
init_call would be too early, I've checked that the late_initcall runs
before net/ipv4/ipconfig.c, i.e. the BOOTP/DHCP autoconfiguration.
Signed-Off-By: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Oct 2004 06:38:47 +0000 (23:38 -0700)]
[NET]: Generic network statistics/estimator
Work done by Thomas Graf <tgraf@suug.ch> and
Jamal Hadi Salim <hadi@cyberus.ca>
The following patchset introduces generic network statistics for
netlink users. It uses nested TLV which prevents further compatibility
problems when introducing new statistics. Backward compatibility to
existing TLV types TCA_STATS and TCA_XSTATS is ensured but can be
easly removed once it is no longer needed. Therefore prior users of
struct tc_stats can be converted to this API and existing userspace
applications will not notice a difference while converted applications
can use the new extendable statistic interface.
Changes:
- Add generic network statistics API for netlink users.
- Introduces a generic rate estimator based on timers. Patch is based
on Jamals patch and adapted to the new generic network statistics
API.
- Add documentation of generic network statistics and estimator API.
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
There is a problem with "struct fddi_statistics" for 64-bit systems.
The starting members of the struct are expected to correspond to the
respective members of "struct net_device_stats" (drivers for FDDI
devices return "struct fddi_statistics" in the response to the
get_stats() call of "struct net_device"). Unfortunately, due to using
different types (u32 vs ulong) they do not. "struct net_device_stats"
is a public interface and as a result, bogus results are retrieved,
e.g. for /proc/net/dev.
Here is my proposal to address the problem. I think there is no
point in duplicating the layout of "struct net_device_stats" in
"struct fddi_statistics" as the former can simply be included as a
member avoiding this problem and actually any possible discrepancy in
the future. This also preserves the layout of the structure for
32-bit systems.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Banks [Tue, 5 Oct 2004 04:37:55 +0000 (21:37 -0700)]
[NET]: Fix race between neigh-timer_handler and neigh_event_send
Fix a race between neigh_timer_handler() calling down to arp_solicit()
with an sk_buff peeked from the head of the neigh->arp_queue, and
neigh_event_send() unqueuing and freeing the head of the same queue
because it's reached the maximum length of 3, by taking an extra
sk_buff reference while holding neigh->lock.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Hunold [Tue, 5 Oct 2004 00:54:19 +0000 (17:54 -0700)]
[PATCH] Fix error path in Video4Linux dpc7146 driver
The I2C adapter wasn't de-registered correctly in case the video card
wasn't found. When the I2C subsystem tried to speak with the dangling
I2C adapter later on, usually an oops happened.
Added documentation for the GPIO calls, updated
the overview with more information on the supported
core devices, and updated the state of the EB2410ITX
François Romieu [Mon, 4 Oct 2004 13:11:05 +0000 (09:11 -0400)]
[PATCH] via-velocity: removal of incomplete endianness handling
Removed cpu_to_le32 call on OWNED_BY_NIC. This will produce 0x01000000 on
big endian machines while rdesc0.owner still evaluates to 0x00000000 or
0x00000001. BTW, unless we reorder bit fields on big endian machines or
use u32's and cpu_to_le32'd bit mask macros, current code won't work on big
endian machines.
François Romieu [Mon, 4 Oct 2004 13:10:51 +0000 (09:10 -0400)]
[PATCH] via-velocity: early invocation of init_cam_filter()
In velocity_init_registers(), init_cam_filter() clears mCAMmask which
might have been set by set_multi() (not sure if this can ever occur).
Modified to invoke init_cam_filter() first. Also, clear_isr() is called
twice. Removed the first invocation.
In velocity_found1(), there was a unneeded assignment from vptr to
dev->priv. Removed.
François Romieu [Mon, 4 Oct 2004 13:10:39 +0000 (09:10 -0400)]
[PATCH] via-velocity: received ring wrong index and missing barriers
There were several receive ring related bugs.
In velocity_give_many_rx_descs(), index calculation was incorrect.
This and bugs in velocity_rx_srv() described in the following paragraph
caused packet loss, truncation and infinite error interrupt generation.
In velocity_rx_srv(), velocity_rx_refill() could be called without any
dirty slot. With proper timing, This can result in refilling yet
unreceived packets and pushing dirty pointer ahead of the current pointer.
And vptr->rd_curr which is used by velocity_rx_refill() was updated after
calling velocity_rx_refill() thus screwing receive descriptor ring.
Also, between checking owner and reading the packet, rmb() is missing.
In velocity_give_rx_desc(), there should be a wmb() between resetting the
first four bytes of rdesc0 and setting owner. As resetting the first four
bytes isn't necessary, I just removed the function and directly set owner.
Another rationale for removing the function:
The function doesn't handle synchronization. We should do wmb() before
calling the function. So, I think using bare assignment makes the fact
more explicit.
Neil Horman [Mon, 4 Oct 2004 12:48:22 +0000 (08:48 -0400)]
[PATCH] olympic driver: fix kernel oops on lobe fault
It fixes an oops that results when a lobe fault is detected. The oops
occurs because a lobe fault triggers an interrupt which is handled
in the current version of the driver by effectively shutting down the
card, and freeing its requisite irq. The former is fine, the latter
is not, as its illegal to free an irq from within an interrupt context.
I've fixed this bug by removing the call to free_irq from the interrupt
handler (specifically the chunk around line 964 fixes that). While I
was in there I noticed that there were several other conditions in
the interrupt handler that contained the same condition, so I made
the same fix there. I re-added.
I also modified the contents of olympic_freemem (the chunk around line
898 to correct a misuse of a pointer after it requisite memory has
been free in the case the the adapter is re-initalized after a fault
to prevent that oops. And then I clean up the interrupt handler to
simply use olympic_freemem from the close routine since the ring buffer
doesn't need to be freed until the driver is closed.
In addition to these changes I added a call to olympic init in
olympic_open and reset the spinlock so the adapter can be reset and
rejoin the ring without needing to rmmod/insmod the module. Lastly I
cleaned up the wait queue code so that the close routine didn't have
to wait 60 seconds to close the adapter if a fatal fault has closed
the adapter.
Dave Jiang [Sun, 3 Oct 2004 23:28:36 +0000 (00:28 +0100)]
[ARM PATCH] 2117/1: Fix ATU config on IQ80331 to prevent master aborts, replace 2099/1
Patch from Dave Jiang
Latest IQ80331 redboot changed value of ATU registers and is causing master aborts on the plugged in card. Changing value back to previous sane state for Linux.
Signed-off-by: Dave Jiang (dave.jiang@gmail.com)
Patch in replacement of 2099/1 due to formatting problems.
Russell King [Sun, 3 Oct 2004 21:46:58 +0000 (22:46 +0100)]
[ARM] Check access permissions for whole of signal stack frame.
We really need to check that we have access to the whole of the
signal frame when we allocate it, rather than "most of it" when
we have iWMMXt extensions selected.
Russell King [Sun, 3 Oct 2004 21:36:58 +0000 (22:36 +0100)]
[ARM] Fix consistent.c for DMA allocations.
- Use ISA_DMA_THRESHOLD as the mask for GFP_DMA allocations.
- Don't allow DMA allocations which are for a "smaller" mask than
ISA_DMA_THRESHOLD.
- Ensure that "handle" is initialised to our error value when
returning an error.
- Pass tcf_result into tcf_action_exec()
- Update res->classid and res->class on non-zero
skb->tc_classid, then reset skb->tc_classid
- Update tcf_action_exec() callers in cls_u32.c
and cls_fw.c
Based upon a patch by Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Roland Dreier [Sun, 3 Oct 2004 04:04:37 +0000 (21:04 -0700)]
[PATCH] ppc64: fix cross-compilation
After the "ppc64 monster cleanup," I get
powerpc-750-linux-gnu-strip: vmlinux: File format not recognized
from my ppc32 strip command when cross-compiling a ppc64 kernel, since
vmlinux is a 64-bit ELF file. This patch fixes my build (and the
resulting kernel boots fine).
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Davide Libenzi [Sun, 3 Oct 2004 02:51:43 +0000 (19:51 -0700)]
[PATCH] Avoid unnecessary copy for EPOLL_CTL_DEL
Ulrich Drepper points out that EPOLL_CTL_DEL doesn't need to copy any of
the hash events.
Also, we should specify in the man pages that a NULL is allowed in
EPOLL_CTL_DEL. Currently it does not say that.
Also, starting from when epoll uses rbtrees instead of hashes, the
'size' hint passed to epoll_create(2) is no more used. But since an API
change has clearly to be excluded, I guess it'll stay as is.