* Re: [PATCH 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses. Patch from: Laurent Pinchart <laurentp@cse-semaphore.com>
From: Christoph Hellwig @ 2008-02-07 13:30 UTC (permalink / raw)
To: Ben Dooks; +Cc: netdev, jeff, akpm, daniel, laurentp
In-Reply-To: <20080205000814.539308209@fluff.org.uk>
On Tue, Feb 05, 2008 at 12:02:00AM +0000, Ben Dooks wrote:
> This patch splits the receive status in 8bit wide fields and convert the
> packet length from little endian to CPU byte order.
>
> Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
>
> Index: linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> ===================================================================
> --- linux-2.6.24-git5-dm9k.orig/drivers/net/dm9000.c
> +++ linux-2.6.24-git5-dm9k/drivers/net/dm9000.c
> @@ -867,7 +867,8 @@ dm9000_timer(unsigned long data)
> }
>
> struct dm9000_rxhdr {
> - u16 RxStatus;
> + u8 RxPktReady;
> + u8 RxStatus;
> u16 RxLen;
thgis should be __le16. Also please install sparse and do a
make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__"
run over the driver to make sure all hw structures are properly
annotated and you do byteswaps consistantly.
^ permalink raw reply
* [patch 1/3] iucv: wrong irq-disabling locking at module load time
From: Ursula Braun @ 2008-02-07 14:28 UTC (permalink / raw)
To: davem, netdev, linux-s390
In-Reply-To: <20080207142842.852003000@linux.vnet.ibm.com>
[-- Attachment #1: 707-iucv-irq.diff --]
[-- Type: text/plain, Size: 1096 bytes --]
From: Ursula Braun <braunu@de.ibm.com>
Linux may hang when running af_iucv socket programs concurrently
with a load of module netiucv. iucv_register() tries to take the
iucv_table_lock with spin_lock_irq. This conflicts with
iucv_connect() which has a need for an smp_call_function while
holding the iucv_table_lock.
Solution: use bh-disabling locking in iucv_register()
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
net/iucv/iucv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -urpN linux-2.6/net/iucv/iucv.c linux-2.6-patched/net/iucv/iucv.c
--- linux-2.6/net/iucv/iucv.c 2008-02-07 13:24:12.000000000 +0100
+++ linux-2.6-patched/net/iucv/iucv.c 2008-02-07 13:24:34.000000000 +0100
@@ -693,9 +693,9 @@ int iucv_register(struct iucv_handler *h
iucv_setmask_up();
INIT_LIST_HEAD(&handler->paths);
- spin_lock_irq(&iucv_table_lock);
+ spin_lock_bh(&iucv_table_lock);
list_add_tail(&handler->list, &iucv_handler_list);
- spin_unlock_irq(&iucv_table_lock);
+ spin_unlock_bh(&iucv_table_lock);
rc = 0;
out_mutex:
mutex_unlock(&iucv_register_mutex);
--
^ permalink raw reply
* [patch 0/3] [IUCV] fixes for net-2.6.25
From: Ursula Braun @ 2008-02-07 14:28 UTC (permalink / raw)
To: davem, netdev, linux-s390
--
Dave,
the following 3 patches are intended for 2.6.25 and contain:
- locking changes in iucv.c
- locking changes in af_iucv.c
- extra checkings for successful allocations in af_iucv.c
- secure handling of send_skb_q list in af_iucv.c
^ permalink raw reply
* [patch 3/3] af_iucv: defensive programming of iucv_callback_txdone
From: Ursula Braun @ 2008-02-07 14:28 UTC (permalink / raw)
To: davem, netdev, linux-s390
In-Reply-To: <20080207142842.852003000@linux.vnet.ibm.com>
[-- Attachment #1: 714-afiucv-txdone.diff --]
[-- Type: text/plain, Size: 1705 bytes --]
From: Ursula Braun <braunu@de.ibm.com>
The loop in iucv_callback_txdone presumes existence of an entry
with msg->tag in the send_skb_q list. In error cases this
assumption might be wrong and might cause an endless loop.
Loop is rewritten to guarantee loop end in case of missing
msg->tag entry in send_skb_q.
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
net/iucv/af_iucv.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff -urpN linux-2.6/net/iucv/af_iucv.c linux-2.6-patched/net/iucv/af_iucv.c
--- linux-2.6/net/iucv/af_iucv.c 2008-02-07 13:24:39.000000000 +0100
+++ linux-2.6-patched/net/iucv/af_iucv.c 2008-02-07 13:24:39.000000000 +0100
@@ -1112,24 +1112,31 @@ static void iucv_callback_txdone(struct
struct iucv_message *msg)
{
struct sock *sk = path->private;
- struct sk_buff *this;
+ struct sk_buff *this = NULL;
struct sk_buff_head *list = &iucv_sk(sk)->send_skb_q;
struct sk_buff *list_skb = list->next;
unsigned long flags;
- if (list_skb) {
+ if (!skb_queue_empty(list)) {
spin_lock_irqsave(&list->lock, flags);
- do {
- this = list_skb;
+ while (list_skb != (struct sk_buff *)list) {
+ if (!memcmp(&msg->tag, list_skb->cb, 4)) {
+ this = list_skb;
+ break;
+ }
list_skb = list_skb->next;
- } while (memcmp(&msg->tag, this->cb, 4) && list_skb);
- __skb_unlink(this, list);
+ }
+ if (this)
+ __skb_unlink(this, list);
spin_unlock_irqrestore(&list->lock, flags);
- kfree_skb(this);
+ if (this)
+ kfree_skb(this);
}
+ if (!this)
+ printk(KERN_ERR "AF_IUCV msg tag %u not found\n", msg->tag);
if (sk->sk_state == IUCV_CLOSING) {
if (skb_queue_empty(&iucv_sk(sk)->send_skb_q)) {
--
^ permalink raw reply
* [patch 2/3] af_iucv: broken send_skb_q results in endless loop
From: Ursula Braun @ 2008-02-07 14:28 UTC (permalink / raw)
To: davem, netdev, linux-s390
In-Reply-To: <20080207142842.852003000@linux.vnet.ibm.com>
[-- Attachment #1: 713-afiucv.diff --]
[-- Type: text/plain, Size: 1472 bytes --]
From: Ursula Braun <braunu@de.ibm.com>
A race has been detected in iucv_callback_txdone().
skb_unlink has to be done inside the locked area.
In addition checkings for successful allocations are inserted.
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
net/iucv/af_iucv.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff -urpN linux-2.6/net/iucv/af_iucv.c linux-2.6-patched/net/iucv/af_iucv.c
--- linux-2.6/net/iucv/af_iucv.c 2008-02-07 13:24:12.000000000 +0100
+++ linux-2.6-patched/net/iucv/af_iucv.c 2008-02-07 13:24:38.000000000 +0100
@@ -482,6 +482,10 @@ static int iucv_sock_connect(struct sock
/* Create path. */
iucv->path = iucv_path_alloc(IUCV_QUEUELEN_DEFAULT,
IPRMDATA, GFP_KERNEL);
+ if (!iucv->path) {
+ err = -ENOMEM;
+ goto done;
+ }
err = iucv_path_connect(iucv->path, &af_iucv_handler,
sa->siucv_user_id, NULL, user_data, sk);
if (err) {
@@ -1094,6 +1098,8 @@ static void iucv_callback_rx(struct iucv
save_message:
save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA);
+ if (!save_msg)
+ return;
save_msg->path = path;
save_msg->msg = *msg;
@@ -1118,10 +1124,10 @@ static void iucv_callback_txdone(struct
this = list_skb;
list_skb = list_skb->next;
} while (memcmp(&msg->tag, this->cb, 4) && list_skb);
+ __skb_unlink(this, list);
spin_unlock_irqrestore(&list->lock, flags);
- skb_unlink(this, &iucv_sk(sk)->send_skb_q);
kfree_skb(this);
}
--
^ permalink raw reply
* Re: [PATCH 01/24 for-2.6.25] DM9000: Fix endian-ness of data accesses. Patch from: Laurent Pinchart <laurentp@cse-semaphore.com>
From: Jeff Garzik @ 2008-02-07 14:54 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Ben Dooks, netdev, akpm, daniel
In-Reply-To: <200802071428.38849.laurentp@cse-semaphore.com>
Laurent Pinchart wrote:
> On Wednesday 06 February 2008 12:46, Jeff Garzik wrote:
>> two comments:
>>
>> 1) you should be using __le16 type
>>
>> 2) seems like you should do the same for RxStatus, rather than splitting it
>
> The DM9000 datasheet (or rather the application notes) describes two distinct
> fields, even though they both contain some kind of status information.
Sure, there are plenty of distinct fields, just like with every chipset.
That doesn't mean byte instructions are the best choice.
Jeff
^ permalink raw reply
* Problem receiving multicast/promiscuous-mode with kernel.2.6.24
From: Reither Robert @ 2008-02-07 15:39 UTC (permalink / raw)
To: netdev
Visit AVD on prolight+sound in Frankfurt from 12.-15. March 2008 - Hall 8.0, Stand G16
________________________________________________________________________
Hi,
i'm working on a realtime-audio application, which should be capeable to receive RTP packets via multicast addresses.
App did work fine till i switched from 2.6.22 to kernel 2.6.24 (because of hwmon support for VIA EPIA LT15000AG)
With kernel 2.6.22 i had no problems, i'm using almost identical .config
Also tried kernel 2.6.24-rc5, same problem.
Tried it on two different boards (VIA EPIA LT, VIA EPIA 5000, diff. NIC's, cpu's mem, etc ..)
I'm using the same setsockopt with IP_ADD_MEMBERSHIP as before for all interfaces.
But now my app does not receive multicast packets !
Strange thing is, as long as tcpdump is running, the app (and tcpdump) get the multicast packets, but if i stopp tcpdump, my application at the same moment gets no more multicast packets.
I can see with netstat -g the joined MC-address (if app is active)
multicast route is set up properly.
Closer look:
-------------
Right after reboot, receiving of mc-packets worked for just one time.
After one ADD_MEMBERSHIP/DROP_MEMBERSHIP cycle it won't work any longer.
If i deny tcpdump setting promiscous-mode (-p) i get no packets.
Looks like somehow the NIC won't be (re)set to promiscous mode.
My user code:
int join_multicast_group (int fd, const char *mc_address)
{
struct ip_mreqn imr;
log_message(DVA_LOG_INFO,"In join_mc_group: %s\n",mc_address);
if (inet_aton (mc_address, &imr.imr_multiaddr) == 0) {
log_message (DVA_LOG_ERROR, "join_mc:Bad IP address format: %s\n", mc_address);
return -1;
}
imr.imr_address.s_addr = INADDR_ANY;
imr.imr_ifindex = 0;
// Check if already member
if (setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof (imr)) < 0)
{
if (errno == EADDRINUSE) // Address already joined for IP_ADD_MEMBERSHIP
log_message(DVA_LOG_INFO,"Already joined IP_ADD_MEMBERSHIP for %s.\n", mc_address);
else
{
log_perror (DVA_LOG_ERROR, "getsockopt ip_add_membership");
return -1;
}
}
return 0;
}
and quite the same with DROP_MEMBERSHIP before i close the socket.
Robert Reither
Research & Development
AV Digital Audio- Videotechnik GmbH
Pottendorfer Strasse 25-27/4/1/1
A-1120 Wien/Austria
Commercial Register No.: FN 201615v
Commercial Court: Handelsgericht Wien
VAT-No.: ATU 50461904
Tel.: +43/1/3680368 43
email: robert.reither@av-digital.at
Visit: <http://www.av-digital.at>
Robert Reither
Research & Development
AV Digital Audio- Videotechnik GmbH
Pottendorfer Strasse 25-27/4/1/1
A-1120 Wien/Austria
Commercial Register No.: FN 201615v
Commercial Court: Handelsgericht Wien
VAT-No.: ATU 50461904
Tel.: +43/1/3680368 43
email: robert.reither@av-digital.at
Visit: <http://www.av-digital.at>
^ permalink raw reply
* Re: oops with ipcomp
From: Herbert Xu @ 2008-02-07 15:44 UTC (permalink / raw)
To: Beschorner Daniel; +Cc: netdev
In-Reply-To: <3C59DB883F7B0B4D8096010D45ACCD134F20C0@exch.facton.local>
On Wed, Feb 06, 2008 at 09:55:03PM +0100, Beschorner Daniel wrote:
>
> A is the oopsing 2.6.24, B is 2.6.23.
> I didn't change anything in the scenario recently, till 2.6.23 all
> worked fine.
OK, so are you now able to reproduce this crash without waiting
for hours? That would be really helpful in tracking it down.
Could you show me the exact policies/SAs of the tunnel involved
in the crash?
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
* [PATCH] [IPV6] Minor clenup: remove two unused definitions in net/ip6_route.h
From: Rami Rosen @ 2008-02-07 15:58 UTC (permalink / raw)
To: David Miller, netdev; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 193 bytes --]
Hi,
Remove IP6_RT_PRIO_FW and IP6_RT_FLOW_MASK definitions in
include/net/ip6_route.h, as they are not used in the kernel.
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 418 bytes --]
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index faac0ee..f99e4f0 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,11 +1,9 @@
#ifndef _NET_IP6_ROUTE_H
#define _NET_IP6_ROUTE_H
-#define IP6_RT_PRIO_FW 16
#define IP6_RT_PRIO_USER 1024
#define IP6_RT_PRIO_ADDRCONF 256
#define IP6_RT_PRIO_KERN 512
-#define IP6_RT_FLOW_MASK 0x00ff
struct route_info {
__u8 type;
^ permalink raw reply related
* Re: Problem receiving multicast/promiscuous-mode with kernel.2.6.24
From: David Stevens @ 2008-02-07 16:09 UTC (permalink / raw)
To: Reither Robert; +Cc: netdev
In-Reply-To: <BA41E8A07B73A041948C2E3A4EF6239D062F0B@av-digital-exch.avdigital.at>
You need to join the multicast group on the interface you want
to receive it. If you're setting both imr_address and imr_index
to 0, you haven't specified an interface.
Instead of setting imr_ifindex to 0, try setting it like this:
imr.imr_ifindex = if_nametoindex("eth0");
(or whatever interface you need).
You can verify that you've joined the group on the correct
interface with "netstat -g", also. Make sure that the interface
field is correct for the group you want.
And because I can't resist mentioning it, "inet_aton" is deprecated--
suggest inet_pton() with appropriate arguments and return value
checking instead.
There was a bug fix where the sense of promiscuous mode was
backwards for multicasting, which is probably why it was accidently
(and incorrectly) working in earlier kernels.
If that doesn't do it for you, let me know; better if you can post the
full code (or even better, the smallest subset that demonstrates the
problem).
+-DLS
^ permalink raw reply
* [PATCH] New device for DM9601 usb net driver
From: Robert Brockway @ 2008-02-07 16:00 UTC (permalink / raw)
To: jacmet; +Cc: netdev
[-- Attachment #1: Type: TEXT/PLAIN, Size: 330 bytes --]
Hi Peter. I've verified that the Hirose USB-100 (0x0a47, 0x9601) is a
clone of the DAVICOM DM9601. I patched dm9601.c to identify this device
and now have these in production. Unified diff against 2.6.24 attached.
Cheers,
Rob
--
"With sufficient thrust, pigs fly just fine..."
-- RFC 1925 "The Twelve Networking Truths"
[-- Attachment #2: Type: TEXT/X-DIFF, Size: 452 bytes --]
--- drivers/net/usb/dm9601.c.old 2008-01-27 00:51:50.000000000 -0500
+++ drivers/net/usb/dm9601.c 2008-02-07 10:27:40.000000000 -0500
@@ -590,6 +590,10 @@ static const struct usb_device_id produc
USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */
.driver_info = (unsigned long)&dm9601_info,
},
+ {
+ USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
+ .driver_info = (unsigned long)&dm9601_info,
+ },
{}, // END
};
^ permalink raw reply
* [PATCH] [IPV6] Minor cleanup: remove unused definitions in net/ip6_fib.h
From: Rami Rosen @ 2008-02-07 16:23 UTC (permalink / raw)
To: David Miller, netdev; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 225 bytes --]
Hi,
This patch removes some unused definitions and one method typedef
declaration (f_pnode)
in include/net/ip6_fib.h, as they are not used in the kernel.
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 704 bytes --]
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index d8d85b1..953d604 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -150,19 +150,6 @@ struct rt6_statistics {
*
*/
-#define RTPRI_FIREWALL 8 /* Firewall control information */
-#define RTPRI_FLOW 16 /* Flow based forwarding rules */
-#define RTPRI_KERN_CTL 32 /* Kernel control routes */
-
-#define RTPRI_USER_MIN 256 /* Mimimum user priority */
-#define RTPRI_USER_MAX 1024 /* Maximum user priority */
-
-#define RTPRI_KERN_DFLT 4096 /* Kernel default routes */
-
-#define MAX_FLOW_BACKTRACE 32
-
-
-typedef void (*f_pnode)(struct fib6_node *fn, void *);
struct fib6_table {
struct hlist_node tb6_hlist;
^ permalink raw reply related
* Re: Bug? Kernels 2.6.2x drops TCP packets over wireless (independent of card used)
From: Eric Dumazet @ 2008-02-07 16:30 UTC (permalink / raw)
To: Marcin Koziej; +Cc: Oliver Pinter, linux-kernel, netdev
In-Reply-To: <776aaa6c.68622465.47ab2df0.78e4b@o2.pl>
Marcin Koziej a écrit :
>> hmm, i think, the site is broken (193.219.28.140), and not the card or
>> the driver is wrong. when it does, then other sites are auch
>> reproductable ..
>>
>> /* is use auch madwifi-0.9.3.3, but it think, it is not driver problem */
>>
>
> Unfortunately, this is not the case :( This happens to all TCP connections, inside and outside LAN,
> also with the telnet session with the router. I also tried to manipulate MTU, but without any positive effect.
> I also tried to change things like net.ipv4.tcp_congestion_control -- which i figured out might affect TCP traffic, but also didn't get any results.
> I'm afraid this can have something to do with IRQ, because the PCMCIA cards (my Atheros wireless card is such) are visible only with irqpoll kernel option.
>
> Of course, as I mentioned, everything works fine with kernel 2.6.19; with the same servers etc.
>
>
Very strange, as the tcpdump you gave shows that the remote peer only
sent "220-\r\n"
This was ACKed, and then nothing but timeout. We can conclude remote
peer is *very* slow or a firewall is blocking trafic after 6 bytes sent :)
Could you give a tcpdump for the same destination, on 2.6.19 this time ?
^ permalink raw reply
* [PATCH] (02/06/08 Linus git) Smack unlabeled outgoing ambient packets
From: Casey Schaufler @ 2008-02-07 17:07 UTC (permalink / raw)
To: akpm, torvalds, mingo; +Cc: davem, netdev, linux-kernel
From: Casey Schaufler <casey@schaufler-ca.com>
Smack uses CIPSO labeling, but allows for unlabeled packets
by specifying an "ambient" label that is applied to incoming
unlabeled packets. Because the other end of the connection
may dislike IP options, and ssh is one know application that
behaves thus, it is prudent to respond in kind. This patch
changes the network labeling behavior such that an outgoing
packet that would be given a CIPSO label that matches the
ambient label is left unlabeled.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
---
security/smack/smack_lsm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff -uprN -X linux-2.6.25-g0206-base//Documentation/dontdiff linux-2.6.25-g0206-base/security/smack/smack_lsm.c linux-2.6.25-g0206/security/smack/smack_lsm.c
--- linux-2.6.25-g0206-base/security/smack/smack_lsm.c 2008-02-06 16:01:43.000000000 -0800
+++ linux-2.6.25-g0206/security/smack/smack_lsm.c 2008-02-06 18:39:55.000000000 -0800
@@ -1276,6 +1276,12 @@ static void smack_to_secattr(char *smack
* Convert the outbound smack value (smk_out) to a
* secattr and attach it to the socket.
*
+ * If the label is the ambient label do not set the secattr.
+ * Thus, all ambient packets are unlabeled and all unlabeled
+ * packets are ambient. This permits unlabeled responces to
+ * unlabeled requests without knowing on a per-packet basis
+ * if the packet was labeled ambient or was unlabeled.
+ *
* Returns 0 on success or an error code
*/
static int smack_netlabel(struct sock *sk)
@@ -1284,6 +1290,9 @@ static int smack_netlabel(struct sock *s
struct netlbl_lsm_secattr secattr;
int rc = 0;
+ if (strncmp(ssp->smk_out, smack_net_ambient, SMK_MAXLEN) == 0)
+ return 0;
+
netlbl_secattr_init(&secattr);
smack_to_secattr(ssp->smk_out, &secattr);
if (secattr.flags != NETLBL_SECATTR_NONE)
^ permalink raw reply
* [PATCH 1/3][NETLABEL]: Compilation for CONFIG_AUDIT=n case.
From: Pavel Emelyanov @ 2008-02-07 17:20 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List
The audit_log_start() will expand into an empty do { } while (0)
construction and the audit_ctx becomes unused.
The solution: push current->audit_context into audit_log_start()
directly, since it is not required in any other place in the
calling function.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/netlabel/netlabel_user.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c
index 85a96a3..023fc8f 100644
--- a/net/netlabel/netlabel_user.c
+++ b/net/netlabel/netlabel_user.c
@@ -96,7 +96,6 @@ int netlbl_netlink_init(void)
struct audit_buffer *netlbl_audit_start_common(int type,
struct netlbl_audit *audit_info)
{
- struct audit_context *audit_ctx = current->audit_context;
struct audit_buffer *audit_buf;
char *secctx;
u32 secctx_len;
@@ -104,7 +103,7 @@ struct audit_buffer *netlbl_audit_start_common(int type,
if (audit_enabled == 0)
return NULL;
- audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
+ audit_buf = audit_log_start(current->audit_context, GFP_ATOMIC, type);
if (audit_buf == NULL)
return NULL;
--
1.5.3.4
^ permalink raw reply related
* [PATCH 2/3][NETLABEL]: Don't produce unused variables when IPv6 is off.
From: Pavel Emelyanov @ 2008-02-07 17:24 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List
Some code declares variables on the stack, but uses them
under #ifdef CONFIG_IPV6, so thay become unused when ipv6
is off. Fortunately, they are used in a switch's case
branches, so the fix is rather simple.
Is it OK from coding style POV to add braces inside "cases",
or should I better avoid such style and rework the patch?
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/netlabel/netlabel_unlabeled.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 42e81fd..3587874 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -617,8 +617,6 @@ static int netlbl_unlhsh_add(struct net *net,
int ifindex;
struct net_device *dev;
struct netlbl_unlhsh_iface *iface;
- struct in_addr *addr4, *mask4;
- struct in6_addr *addr6, *mask6;
struct audit_buffer *audit_buf = NULL;
char *secctx = NULL;
u32 secctx_len;
@@ -651,7 +649,9 @@ static int netlbl_unlhsh_add(struct net *net,
audit_buf = netlbl_audit_start_common(AUDIT_MAC_UNLBL_STCADD,
audit_info);
switch (addr_len) {
- case sizeof(struct in_addr):
+ case sizeof(struct in_addr): {
+ struct in_addr *addr4, *mask4;
+
addr4 = (struct in_addr *)addr;
mask4 = (struct in_addr *)mask;
ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid);
@@ -661,8 +661,11 @@ static int netlbl_unlhsh_add(struct net *net,
addr4->s_addr,
mask4->s_addr);
break;
+ }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
- case sizeof(struct in6_addr):
+ case sizeof(struct in6_addr): {
+ struct in6_addr *addr6, *mask6;
+
addr6 = (struct in6_addr *)addr;
mask6 = (struct in6_addr *)mask;
ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid);
@@ -671,6 +674,7 @@ static int netlbl_unlhsh_add(struct net *net,
dev_name,
addr6, mask6);
break;
+ }
#endif /* IPv6 */
default:
ret_val = -EINVAL;
@@ -1741,10 +1745,6 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
u16 family,
struct netlbl_lsm_secattr *secattr)
{
- struct iphdr *hdr4;
- struct ipv6hdr *hdr6;
- struct netlbl_unlhsh_addr4 *addr4;
- struct netlbl_unlhsh_addr6 *addr6;
struct netlbl_unlhsh_iface *iface;
rcu_read_lock();
@@ -1752,21 +1752,29 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
if (iface == NULL)
goto unlabel_getattr_nolabel;
switch (family) {
- case PF_INET:
+ case PF_INET: {
+ struct iphdr *hdr4;
+ struct netlbl_unlhsh_addr4 *addr4;
+
hdr4 = ip_hdr(skb);
addr4 = netlbl_unlhsh_search_addr4(hdr4->saddr, iface);
if (addr4 == NULL)
goto unlabel_getattr_nolabel;
secattr->attr.secid = addr4->secid;
break;
+ }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
- case PF_INET6:
+ case PF_INET6: {
+ struct ipv6hdr *hdr6;
+ struct netlbl_unlhsh_addr6 *addr6;
+
hdr6 = ipv6_hdr(skb);
addr6 = netlbl_unlhsh_search_addr6(&hdr6->saddr, iface);
if (addr6 == NULL)
goto unlabel_getattr_nolabel;
secattr->attr.secid = addr6->secid;
break;
+ }
#endif /* IPv6 */
default:
goto unlabel_getattr_nolabel;
--
1.5.3.4
^ permalink raw reply related
* [PATCH 3/3][NETLABLE]: Hide netlbl_unlabel_audit_addr6 under ifdef CONFIG_IPV6.
From: Pavel Emelyanov @ 2008-02-07 17:25 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List
This one is called from under this config only, so move
it in the same place.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/netlabel/netlabel_unlabeled.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 3587874..3e745b7 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -180,6 +180,7 @@ static void netlbl_unlabel_audit_addr4(struct audit_buffer *audit_buf,
}
}
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
/**
* netlbl_unlabel_audit_addr6 - Audit an IPv6 address
* @audit_buf: audit buffer
@@ -213,6 +214,7 @@ static void netlbl_unlabel_audit_addr6(struct audit_buffer *audit_buf,
audit_log_format(audit_buf, " src_prefixlen=%d", mask_len);
}
}
+#endif /* IPv6 */
/*
* Unlabeled Connection Hash Table Functions
--
1.5.3.4
^ permalink raw reply related
* [PATCH] 3c509: convert to isa_driver and pnp_driver v4
From: Ondrej Zary @ 2008-02-07 17:31 UTC (permalink / raw)
To: maz; +Cc: Jeff Garzik, netdev, Linux Kernel, Andrew Morton
In-Reply-To: <wrphcglx9w0.fsf@hina.wild-wind.fr.eu.org>
Hello,
this patch converts 3c509 driver to isa_driver and pnp_driver. The result is
that autoloading using udev and hibernation works with ISA PnP cards. It also
adds hibernation support for non-PnP ISA cards.
xcvr module parameter was removed as its value was not used.
Tested using 3 ISA cards in various combinations of PnP and non-PnP modes.
EISA and MCA only compile-tested.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
--- linux-2.6.24-orig/drivers/net/3c509.c 2008-01-27 19:48:19.000000000 +0100
+++ linux-2.6.24-pentium/drivers/net/3c509.c 2008-02-07 17:58:45.000000000 +0100
@@ -54,25 +54,24 @@
v1.19a 28Oct2002 Davud Ruggiero <jdr@farfalle.com>
- Increase *read_eeprom udelay to workaround oops with 2 cards.
v1.19b 08Nov2002 Marc Zyngier <maz@wild-wind.fr.eu.org>
- - Introduce driver model for EISA cards.
+ - Introduce driver model for EISA cards.
+ v1.20 04Feb2008 Ondrej Zary <linux@rainbow-software.org>
+ - convert to isa_driver and pnp_driver and some cleanups
*/
#define DRV_NAME "3c509"
-#define DRV_VERSION "1.19b"
-#define DRV_RELDATE "08Nov2002"
+#define DRV_VERSION "1.20"
+#define DRV_RELDATE "04Feb2008"
/* A few values that may be tweaked. */
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (400*HZ/1000)
-/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 10;
#include <linux/module.h>
-#ifdef CONFIG_MCA
#include <linux/mca.h>
-#endif
-#include <linux/isapnp.h>
+#include <linux/isa.h>
+#include <linux/pnp.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
@@ -97,10 +96,6 @@
static char version[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
-#if defined(CONFIG_PM) && (defined(CONFIG_MCA) || defined(CONFIG_EISA))
-#define EL3_SUSPEND
-#endif
-
#ifdef EL3_DEBUG
static int el3_debug = EL3_DEBUG;
#else
@@ -111,6 +106,7 @@
* a global variable so that the mca/eisa probe routines can increment
* it */
static int el3_cards = 0;
+#define EL3_MAX_CARDS 8
/* To minimize the size of the driver source I only define operating
constants if they are used several times. You'll need the manual
@@ -119,7 +115,7 @@
#define EL3_DATA 0x00
#define EL3_CMD 0x0e
#define EL3_STATUS 0x0e
-#define EEPROM_READ 0x80
+#define EEPROM_READ 0x80
#define EL3_IO_EXTENT 16
@@ -168,23 +164,31 @@
*/
#define SKB_QUEUE_SIZE 64
+typedef enum { EL3_ISA, EL3_PNP, EL3_MCA, EL3_EISA } el3_cardtype;
+
struct el3_private {
struct net_device_stats stats;
- struct net_device *next_dev;
spinlock_t lock;
/* skb send-queue */
int head, size;
struct sk_buff *queue[SKB_QUEUE_SIZE];
- enum {
- EL3_MCA,
- EL3_PNP,
- EL3_EISA,
- } type; /* type of device */
- struct device *dev;
+ el3_cardtype type;
};
-static int id_port __initdata = 0x110; /* Start with 0x110 to avoid new sound cards.*/
-static struct net_device *el3_root_dev;
+static int id_port;
+static int current_tag;
+static struct net_device *el3_devs[EL3_MAX_CARDS];
+
+/* Parameters that may be passed into the module. */
+static int debug = -1;
+static int irq[] = {-1, -1, -1, -1, -1, -1, -1, -1};
+/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
+static int max_interrupt_work = 10;
+#ifdef CONFIG_PNP
+static int nopnp;
+#endif
+static int __init el3_common_init(struct net_device *dev);
+static void el3_common_remove (struct net_device *dev);
static ushort id_read_eeprom(int index);
static ushort read_eeprom(int ioaddr, int index);
static int el3_open(struct net_device *dev);
@@ -199,23 +203,277 @@
static void el3_down(struct net_device *dev);
static void el3_up(struct net_device *dev);
static const struct ethtool_ops ethtool_ops;
-#ifdef EL3_SUSPEND
+#ifdef CONFIG_PM
static int el3_suspend(struct device *, pm_message_t);
static int el3_resume(struct device *);
-#else
-#define el3_suspend NULL
-#define el3_resume NULL
#endif
/* generic device remove for all device types */
-#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
static int el3_device_remove (struct device *device);
-#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
static void el3_poll_controller(struct net_device *dev);
#endif
+/* Return 0 on success, 1 on error, 2 when found already detected PnP card */
+static int el3_isa_id_sequence(__be16 *phys_addr)
+{
+ short lrs_state = 0xff;
+ int i;
+
+ /* ISA boards are detected by sending the ID sequence to the
+ ID_PORT. We find cards past the first by setting the 'current_tag'
+ on cards as they are found. Cards with their tag set will not
+ respond to subsequent ID sequences. */
+
+ outb(0x00, id_port);
+ outb(0x00, id_port);
+ for (i = 0; i < 255; i++) {
+ outb(lrs_state, id_port);
+ lrs_state <<= 1;
+ lrs_state = lrs_state & 0x100 ? lrs_state ^ 0xcf : lrs_state;
+ }
+ /* For the first probe, clear all board's tag registers. */
+ if (current_tag == 0)
+ outb(0xd0, id_port);
+ else /* Otherwise kill off already-found boards. */
+ outb(0xd8, id_port);
+ if (id_read_eeprom(7) != 0x6d50)
+ return 1;
+ /* Read in EEPROM data, which does contention-select.
+ Only the lowest address board will stay "on-line".
+ 3Com got the byte order backwards. */
+ for (i = 0; i < 3; i++)
+ phys_addr[i] = htons(id_read_eeprom(i));
+#ifdef CONFIG_PNP
+ if (!nopnp) {
+ /* The ISA PnP 3c509 cards respond to the ID sequence too.
+ This check is needed in order not to register them twice. */
+ for (i = 0; i < el3_cards; i++) {
+ struct el3_private *lp = netdev_priv(el3_devs[i]);
+ if (lp->type == EL3_PNP && !memcmp(phys_addr, el3_devs[i]->dev_addr, ETH_ALEN)) {
+ if (el3_debug > 3)
+ printk(KERN_DEBUG "3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
+ phys_addr[0] & 0xff, phys_addr[0] >> 8,
+ phys_addr[1] & 0xff, phys_addr[1] >> 8,
+ phys_addr[2] & 0xff, phys_addr[2] >> 8);
+ /* Set the adaptor tag so that the next card can be found. */
+ outb(0xd0 + ++current_tag, id_port);
+ return 2;
+ }
+ }
+ }
+#endif /* CONFIG_PNP */
+ return 0;
+
+}
+
+static void __devinit el3_dev_fill(struct net_device *dev, __be16 *phys_addr,
+ int ioaddr, int irq, int if_port,
+ el3_cardtype type)
+{
+ struct el3_private *lp = netdev_priv(dev);
+
+ memcpy(dev->dev_addr, phys_addr, ETH_ALEN);
+ dev->base_addr = ioaddr;
+ dev->irq = irq;
+ dev->if_port = if_port;
+ lp->type = type;
+}
+
+static int __devinit el3_isa_match(struct device *pdev,
+ unsigned int ndev)
+{
+ struct net_device *dev;
+ int ioaddr, isa_irq, if_port, err;
+ unsigned int iobase;
+ __be16 phys_addr[3];
+
+ while ((err = el3_isa_id_sequence(phys_addr)) == 2)
+ ; /* Skip to next card when PnP card found */
+ if (err == 1)
+ return 0;
+
+ iobase = id_read_eeprom(8);
+ if_port = iobase >> 14;
+ ioaddr = 0x200 + ((iobase & 0x1f) << 4);
+ if (irq[el3_cards] > 1 && irq[el3_cards] < 16)
+ isa_irq = irq[el3_cards];
+ else
+ isa_irq = id_read_eeprom(9) >> 12;
+
+ dev = alloc_etherdev(sizeof (struct el3_private));
+ if (!dev)
+ return -ENOMEM;
+
+ netdev_boot_setup_check(dev);
+
+ if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) {
+ free_netdev(dev);
+ return 0;
+ }
+
+ /* Set the adaptor tag so that the next card can be found. */
+ outb(0xd0 + ++current_tag, id_port);
+
+ /* Activate the adaptor at the EEPROM location. */
+ outb((ioaddr >> 4) | 0xe0, id_port);
+
+ EL3WINDOW(0);
+ if (inw(ioaddr) != 0x6d50) {
+ free_netdev(dev);
+ return 0;
+ }
+
+ /* Free the interrupt so that some other card can use it. */
+ outw(0x0f00, ioaddr + WN0_IRQ);
+
+ el3_dev_fill(dev, phys_addr, ioaddr, isa_irq, if_port, EL3_ISA);
+ dev_set_drvdata(pdev, dev);
+ if (el3_common_init(dev)) {
+ free_netdev(dev);
+ return 0;
+ }
+
+ el3_devs[el3_cards++] = dev;
+ return 1;
+}
+
+static int __devexit el3_isa_remove(struct device *pdev,
+ unsigned int ndev)
+{
+ el3_device_remove(pdev);
+ dev_set_drvdata(pdev, NULL);
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int el3_isa_suspend(struct device *dev, unsigned int n,
+ pm_message_t state)
+{
+ current_tag = 0;
+ return el3_suspend(dev, state);
+}
+
+static int el3_isa_resume(struct device *dev, unsigned int n)
+{
+ struct net_device *ndev = dev_get_drvdata(dev);
+ int ioaddr = ndev->base_addr, err;
+ __be16 phys_addr[3];
+
+ while ((err = el3_isa_id_sequence(phys_addr)) == 2)
+ ; /* Skip to next card when PnP card found */
+ if (err == 1)
+ return 0;
+ /* Set the adaptor tag so that the next card can be found. */
+ outb(0xd0 + ++current_tag, id_port);
+ /* Enable the card */
+ outb((ioaddr >> 4) | 0xe0, id_port);
+ EL3WINDOW(0);
+ if (inw(ioaddr) != 0x6d50)
+ return 1;
+ /* Free the interrupt so that some other card can use it. */
+ outw(0x0f00, ioaddr + WN0_IRQ);
+ return el3_resume(dev);
+}
+#endif
+
+static struct isa_driver el3_isa_driver = {
+ .match = el3_isa_match,
+ .remove = __devexit_p(el3_isa_remove),
+#ifdef CONFIG_PM
+ .suspend = el3_isa_suspend,
+ .resume = el3_isa_resume,
+#endif
+ .driver = {
+ .name = "3c509"
+ },
+};
+static int isa_registered;
+
+#ifdef CONFIG_PNP
+static struct pnp_device_id el3_pnp_ids[] = {
+ { .id = "TCM5090" }, /* 3Com Etherlink III (TP) */
+ { .id = "TCM5091" }, /* 3Com Etherlink III */
+ { .id = "TCM5094" }, /* 3Com Etherlink III (combo) */
+ { .id = "TCM5095" }, /* 3Com Etherlink III (TPO) */
+ { .id = "TCM5098" }, /* 3Com Etherlink III (TPC) */
+ { .id = "PNP80f7" }, /* 3Com Etherlink III compatible */
+ { .id = "PNP80f8" }, /* 3Com Etherlink III compatible */
+ { .id = "" }
+};
+MODULE_DEVICE_TABLE(pnp, el3_pnp_ids);
+
+static int __devinit el3_pnp_probe(struct pnp_dev *pdev,
+ const struct pnp_device_id *id)
+{
+ short i;
+ int ioaddr, irq, if_port;
+ u16 phys_addr[3];
+ struct net_device *dev = NULL;
+ int err;
+
+ ioaddr = pnp_port_start(pdev, 0);
+ if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-pnp"))
+ return -EBUSY;
+ irq = pnp_irq(pdev, 0);
+ EL3WINDOW(0);
+ for (i = 0; i < 3; i++)
+ phys_addr[i] = htons(read_eeprom(ioaddr, i));
+ if_port = read_eeprom(ioaddr, 8) >> 14;
+ dev = alloc_etherdev(sizeof (struct el3_private));
+ if (!dev) {
+ release_region(ioaddr, EL3_IO_EXTENT);
+ return -ENOMEM;
+ }
+ SET_NETDEV_DEV(dev, &pdev->dev);
+ netdev_boot_setup_check(dev);
+
+ el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_PNP);
+ pnp_set_drvdata (pdev, dev);
+ err = el3_common_init(dev);
+
+ if (err) {
+ pnp_set_drvdata (pdev, NULL);
+ free_netdev(dev);
+ return err;
+ }
+
+ el3_devs[el3_cards++] = dev;
+ return 0;
+}
+
+static void __devexit el3_pnp_remove(struct pnp_dev *pdev)
+{
+ el3_common_remove(pnp_get_drvdata(pdev));
+ pnp_set_drvdata(pdev, NULL);
+}
+
+#ifdef CONFIG_PM
+static int el3_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
+{
+ return el3_suspend(&pdev->dev, state);
+}
+
+static int el3_pnp_resume(struct pnp_dev *pdev)
+{
+ return el3_resume(&pdev->dev);
+}
+#endif
+
+static struct pnp_driver el3_pnp_driver = {
+ .name = "3c509",
+ .id_table = el3_pnp_ids,
+ .probe = el3_pnp_probe,
+ .remove = __devexit_p(el3_pnp_remove),
+#ifdef CONFIG_PM
+ .suspend = el3_pnp_suspend,
+ .resume = el3_pnp_resume,
+#endif
+};
+static int pnp_registered;
+#endif /* CONFIG_PNP */
+
#ifdef CONFIG_EISA
static struct eisa_device_id el3_eisa_ids[] = {
{ "TCM5092" },
@@ -230,13 +488,14 @@
static struct eisa_driver el3_eisa_driver = {
.id_table = el3_eisa_ids,
.driver = {
- .name = "3c509",
+ .name = "3c579",
.probe = el3_eisa_probe,
.remove = __devexit_p (el3_device_remove),
.suspend = el3_suspend,
.resume = el3_resume,
}
};
+static int eisa_registered;
#endif
#ifdef CONFIG_MCA
@@ -271,45 +530,9 @@
.resume = el3_resume,
},
};
+static int mca_registered;
#endif /* CONFIG_MCA */
-#if defined(__ISAPNP__)
-static struct isapnp_device_id el3_isapnp_adapters[] __initdata = {
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5090),
- (long) "3Com Etherlink III (TP)" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5091),
- (long) "3Com Etherlink III" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5094),
- (long) "3Com Etherlink III (combo)" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5095),
- (long) "3Com Etherlink III (TPO)" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5098),
- (long) "3Com Etherlink III (TPC)" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_FUNCTION(0x80f7),
- (long) "3Com Etherlink III compatible" },
- { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
- ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_FUNCTION(0x80f8),
- (long) "3Com Etherlink III compatible" },
- { } /* terminate list */
-};
-
-static __be16 el3_isapnp_phys_addr[8][3];
-static int nopnp;
-#endif /* __ISAPNP__ */
-
-/* With the driver model introduction for EISA devices, both init
- * and cleanup have been split :
- * - EISA devices probe/remove starts in el3_eisa_probe/el3_device_remove
- * - MCA/ISA still use el3_probe
- *
- * Both call el3_common_init/el3_common_remove. */
-
static int __init el3_common_init(struct net_device *dev)
{
struct el3_private *lp = netdev_priv(dev);
@@ -360,231 +583,11 @@
static void el3_common_remove (struct net_device *dev)
{
- struct el3_private *lp = netdev_priv(dev);
-
- (void) lp; /* Keep gcc quiet... */
-#if defined(__ISAPNP__)
- if (lp->type == EL3_PNP)
- pnp_device_detach(to_pnp_dev(lp->dev));
-#endif
-
unregister_netdev (dev);
release_region(dev->base_addr, EL3_IO_EXTENT);
free_netdev (dev);
}
-static int __init el3_probe(int card_idx)
-{
- struct net_device *dev;
- struct el3_private *lp;
- short lrs_state = 0xff, i;
- int ioaddr, irq, if_port;
- __be16 phys_addr[3];
- static int current_tag;
- int err = -ENODEV;
-#if defined(__ISAPNP__)
- static int pnp_cards;
- struct pnp_dev *idev = NULL;
- int pnp_found = 0;
-
- if (nopnp == 1)
- goto no_pnp;
-
- for (i=0; el3_isapnp_adapters[i].vendor != 0; i++) {
- int j;
- while ((idev = pnp_find_dev(NULL,
- el3_isapnp_adapters[i].vendor,
- el3_isapnp_adapters[i].function,
- idev))) {
- if (pnp_device_attach(idev) < 0)
- continue;
- if (pnp_activate_dev(idev) < 0) {
-__again:
- pnp_device_detach(idev);
- continue;
- }
- if (!pnp_port_valid(idev, 0) || !pnp_irq_valid(idev, 0))
- goto __again;
- ioaddr = pnp_port_start(idev, 0);
- if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509 PnP")) {
- pnp_device_detach(idev);
- return -EBUSY;
- }
- irq = pnp_irq(idev, 0);
- if (el3_debug > 3)
- printk ("ISAPnP reports %s at i/o 0x%x, irq %d\n",
- (char*) el3_isapnp_adapters[i].driver_data, ioaddr, irq);
- EL3WINDOW(0);
- for (j = 0; j < 3; j++)
- el3_isapnp_phys_addr[pnp_cards][j] =
- phys_addr[j] =
- htons(read_eeprom(ioaddr, j));
- if_port = read_eeprom(ioaddr, 8) >> 14;
- dev = alloc_etherdev(sizeof (struct el3_private));
- if (!dev) {
- release_region(ioaddr, EL3_IO_EXTENT);
- pnp_device_detach(idev);
- return -ENOMEM;
- }
-
- SET_NETDEV_DEV(dev, &idev->dev);
- pnp_cards++;
-
- netdev_boot_setup_check(dev);
- pnp_found = 1;
- goto found;
- }
- }
-no_pnp:
-#endif /* __ISAPNP__ */
-
- /* Select an open I/O location at 0x1*0 to do contention select. */
- for ( ; id_port < 0x200; id_port += 0x10) {
- if (!request_region(id_port, 1, "3c509"))
- continue;
- outb(0x00, id_port);
- outb(0xff, id_port);
- if (inb(id_port) & 0x01){
- release_region(id_port, 1);
- break;
- } else
- release_region(id_port, 1);
- }
- if (id_port >= 0x200) {
- /* Rare -- do we really need a warning? */
- printk(" WARNING: No I/O port available for 3c509 activation.\n");
- return -ENODEV;
- }
-
- /* Next check for all ISA bus boards by sending the ID sequence to the
- ID_PORT. We find cards past the first by setting the 'current_tag'
- on cards as they are found. Cards with their tag set will not
- respond to subsequent ID sequences. */
-
- outb(0x00, id_port);
- outb(0x00, id_port);
- for(i = 0; i < 255; i++) {
- outb(lrs_state, id_port);
- lrs_state <<= 1;
- lrs_state = lrs_state & 0x100 ? lrs_state ^ 0xcf : lrs_state;
- }
-
- /* For the first probe, clear all board's tag registers. */
- if (current_tag == 0)
- outb(0xd0, id_port);
- else /* Otherwise kill off already-found boards. */
- outb(0xd8, id_port);
-
- if (id_read_eeprom(7) != 0x6d50) {
- return -ENODEV;
- }
-
- /* Read in EEPROM data, which does contention-select.
- Only the lowest address board will stay "on-line".
- 3Com got the byte order backwards. */
- for (i = 0; i < 3; i++) {
- phys_addr[i] = htons(id_read_eeprom(i));
- }
-
-#if defined(__ISAPNP__)
- if (nopnp == 0) {
- /* The ISA PnP 3c509 cards respond to the ID sequence.
- This check is needed in order not to register them twice. */
- for (i = 0; i < pnp_cards; i++) {
- if (phys_addr[0] == el3_isapnp_phys_addr[i][0] &&
- phys_addr[1] == el3_isapnp_phys_addr[i][1] &&
- phys_addr[2] == el3_isapnp_phys_addr[i][2])
- {
- if (el3_debug > 3)
- printk("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
- phys_addr[0] & 0xff, phys_addr[0] >> 8,
- phys_addr[1] & 0xff, phys_addr[1] >> 8,
- phys_addr[2] & 0xff, phys_addr[2] >> 8);
- /* Set the adaptor tag so that the next card can be found. */
- outb(0xd0 + ++current_tag, id_port);
- goto no_pnp;
- }
- }
- }
-#endif /* __ISAPNP__ */
-
- {
- unsigned int iobase = id_read_eeprom(8);
- if_port = iobase >> 14;
- ioaddr = 0x200 + ((iobase & 0x1f) << 4);
- }
- irq = id_read_eeprom(9) >> 12;
-
- dev = alloc_etherdev(sizeof (struct el3_private));
- if (!dev)
- return -ENOMEM;
-
- netdev_boot_setup_check(dev);
-
- /* Set passed-in IRQ or I/O Addr. */
- if (dev->irq > 1 && dev->irq < 16)
- irq = dev->irq;
-
- if (dev->base_addr) {
- if (dev->mem_end == 0x3c509 /* Magic key */
- && dev->base_addr >= 0x200 && dev->base_addr <= 0x3e0)
- ioaddr = dev->base_addr & 0x3f0;
- else if (dev->base_addr != ioaddr)
- goto out;
- }
-
- if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) {
- err = -EBUSY;
- goto out;
- }
-
- /* Set the adaptor tag so that the next card can be found. */
- outb(0xd0 + ++current_tag, id_port);
-
- /* Activate the adaptor at the EEPROM location. */
- outb((ioaddr >> 4) | 0xe0, id_port);
-
- EL3WINDOW(0);
- if (inw(ioaddr) != 0x6d50)
- goto out1;
-
- /* Free the interrupt so that some other card can use it. */
- outw(0x0f00, ioaddr + WN0_IRQ);
-
-#if defined(__ISAPNP__)
- found: /* PNP jumps here... */
-#endif /* __ISAPNP__ */
-
- memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
- dev->base_addr = ioaddr;
- dev->irq = irq;
- dev->if_port = if_port;
- lp = netdev_priv(dev);
-#if defined(__ISAPNP__)
- lp->dev = &idev->dev;
- if (pnp_found)
- lp->type = EL3_PNP;
-#endif
- err = el3_common_init(dev);
-
- if (err)
- goto out1;
-
- el3_cards++;
- lp->next_dev = el3_root_dev;
- el3_root_dev = dev;
- return 0;
-
-out1:
-#if defined(__ISAPNP__)
- if (idev)
- pnp_device_detach(idev);
-#endif
-out:
- free_netdev(dev);
- return err;
-}
-
#ifdef CONFIG_MCA
static int __init el3_mca_probe(struct device *device)
{
@@ -596,7 +599,6 @@
* redone for multi-card detection by ZP Gu (zpg@castle.net)
* now works as a module */
- struct el3_private *lp;
short i;
int ioaddr, irq, if_port;
u16 phys_addr[3];
@@ -613,7 +615,7 @@
irq = pos5 & 0x0f;
- printk("3c529: found %s at slot %d\n",
+ printk(KERN_INFO "3c529: found %s at slot %d\n",
el3_mca_adapter_names[mdev->index], slot + 1);
/* claim the slot */
@@ -626,7 +628,7 @@
irq = mca_device_transform_irq(mdev, irq);
ioaddr = mca_device_transform_ioport(mdev, ioaddr);
if (el3_debug > 2) {
- printk("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port);
+ printk(KERN_DEBUG "3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port);
}
EL3WINDOW(0);
for (i = 0; i < 3; i++) {
@@ -641,13 +643,7 @@
netdev_boot_setup_check(dev);
- memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
- dev->base_addr = ioaddr;
- dev->irq = irq;
- dev->if_port = if_port;
- lp = netdev_priv(dev);
- lp->dev = device;
- lp->type = EL3_MCA;
+ el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_MCA);
device->driver_data = dev;
err = el3_common_init(dev);
@@ -657,7 +653,7 @@
return -ENOMEM;
}
- el3_cards++;
+ el3_devs[el3_cards++] = dev;
return 0;
}
@@ -666,7 +662,6 @@
#ifdef CONFIG_EISA
static int __init el3_eisa_probe (struct device *device)
{
- struct el3_private *lp;
short i;
int ioaddr, irq, if_port;
u16 phys_addr[3];
@@ -678,7 +673,7 @@
edev = to_eisa_device (device);
ioaddr = edev->base_addr;
- if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509"))
+ if (!request_region(ioaddr, EL3_IO_EXTENT, "3c579-eisa"))
return -EBUSY;
/* Change the register set to the configuration window 0. */
@@ -700,13 +695,7 @@
netdev_boot_setup_check(dev);
- memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
- dev->base_addr = ioaddr;
- dev->irq = irq;
- dev->if_port = if_port;
- lp = netdev_priv(dev);
- lp->dev = device;
- lp->type = EL3_EISA;
+ el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_EISA);
eisa_set_drvdata (edev, dev);
err = el3_common_init(dev);
@@ -716,12 +705,11 @@
return err;
}
- el3_cards++;
+ el3_devs[el3_cards++] = dev;
return 0;
}
#endif
-#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
/* This remove works for all device types.
*
* The net dev must be stored in the driver_data field */
@@ -734,7 +722,6 @@
el3_common_remove (dev);
return 0;
}
-#endif
/* Read a word from the EEPROM using the regular EEPROM access register.
Assume that we are in register window zero.
@@ -749,7 +736,7 @@
}
/* Read a word from the EEPROM when in the ISA ID probe state. */
-static ushort __init id_read_eeprom(int index)
+static ushort id_read_eeprom(int index)
{
int bit, word = 0;
@@ -765,7 +752,7 @@
word = (word << 1) + (inb(id_port) & 0x01);
if (el3_debug > 3)
- printk(" 3c509 EEPROM word %d %#4.4x.\n", index, word);
+ printk(KERN_DEBUG " 3c509 EEPROM word %d %#4.4x.\n", index, word);
return word;
}
@@ -787,13 +774,13 @@
EL3WINDOW(0);
if (el3_debug > 3)
- printk("%s: Opening, IRQ %d status@%x %4.4x.\n", dev->name,
+ printk(KERN_DEBUG "%s: Opening, IRQ %d status@%x %4.4x.\n", dev->name,
dev->irq, ioaddr + EL3_STATUS, inw(ioaddr + EL3_STATUS));
el3_up(dev);
if (el3_debug > 3)
- printk("%s: Opened 3c509 IRQ %d status %4.4x.\n",
+ printk(KERN_DEBUG "%s: Opened 3c509 IRQ %d status %4.4x.\n",
dev->name, dev->irq, inw(ioaddr + EL3_STATUS));
return 0;
@@ -806,7 +793,7 @@
int ioaddr = dev->base_addr;
/* Transmitter timeout, serious problems. */
- printk("%s: transmit timed out, Tx_status %2.2x status %4.4x "
+ printk(KERN_WARNING "%s: transmit timed out, Tx_status %2.2x status %4.4x "
"Tx FIFO room %d.\n",
dev->name, inb(ioaddr + TX_STATUS), inw(ioaddr + EL3_STATUS),
inw(ioaddr + TX_FREE));
@@ -831,7 +818,7 @@
lp->stats.tx_bytes += skb->len;
if (el3_debug > 4) {
- printk("%s: el3_start_xmit(length = %u) called, status %4.4x.\n",
+ printk(KERN_DEBUG "%s: el3_start_xmit(length = %u) called, status %4.4x.\n",
dev->name, skb->len, inw(ioaddr + EL3_STATUS));
}
#if 0
@@ -840,7 +827,7 @@
ushort status = inw(ioaddr + EL3_STATUS);
if (status & 0x0001 /* IRQ line active, missed one. */
&& inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */
- printk("%s: Missed interrupt, status then %04x now %04x"
+ printk(KERN_DEBUG "%s: Missed interrupt, status then %04x now %04x"
" Tx %2.2x Rx %4.4x.\n", dev->name, status,
inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS),
inw(ioaddr + RX_STATUS));
@@ -914,7 +901,7 @@
if (el3_debug > 4) {
status = inw(ioaddr + EL3_STATUS);
- printk("%s: interrupt, status %4.4x.\n", dev->name, status);
+ printk(KERN_DEBUG "%s: interrupt, status %4.4x.\n", dev->name, status);
}
while ((status = inw(ioaddr + EL3_STATUS)) &
@@ -925,7 +912,7 @@
if (status & TxAvailable) {
if (el3_debug > 5)
- printk(" TX room bit was handled.\n");
+ printk(KERN_DEBUG " TX room bit was handled.\n");
/* There's room in the FIFO for a full-sized packet. */
outw(AckIntr | TxAvailable, ioaddr + EL3_CMD);
netif_wake_queue (dev);
@@ -964,7 +951,7 @@
}
if (--i < 0) {
- printk("%s: Infinite loop in interrupt, status %4.4x.\n",
+ printk(KERN_ERR "%s: Infinite loop in interrupt, status %4.4x.\n",
dev->name, status);
/* Clear all interrupts. */
outw(AckIntr | 0xFF, ioaddr + EL3_CMD);
@@ -975,7 +962,7 @@
}
if (el3_debug > 4) {
- printk("%s: exiting interrupt, status %4.4x.\n", dev->name,
+ printk(KERN_DEBUG "%s: exiting interrupt, status %4.4x.\n", dev->name,
inw(ioaddr + EL3_STATUS));
}
spin_unlock(&lp->lock);
@@ -1450,7 +1437,7 @@
}
/* Power Management support functions */
-#ifdef EL3_SUSPEND
+#ifdef CONFIG_PM
static int
el3_suspend(struct device *pdev, pm_message_t state)
@@ -1500,79 +1487,102 @@
return 0;
}
-#endif /* EL3_SUSPEND */
-
-/* Parameters that may be passed into the module. */
-static int debug = -1;
-static int irq[] = {-1, -1, -1, -1, -1, -1, -1, -1};
-static int xcvr[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
+#endif /* CONFIG_PM */
module_param(debug,int, 0);
module_param_array(irq, int, NULL, 0);
-module_param_array(xcvr, int, NULL, 0);
module_param(max_interrupt_work, int, 0);
MODULE_PARM_DESC(debug, "debug level (0-6)");
MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
-MODULE_PARM_DESC(xcvr,"transceiver(s) (0=internal, 1=external)");
MODULE_PARM_DESC(max_interrupt_work, "maximum events handled per interrupt");
-#if defined(__ISAPNP__)
+#ifdef CONFIG_PNP
module_param(nopnp, int, 0);
MODULE_PARM_DESC(nopnp, "disable ISA PnP support (0-1)");
-MODULE_DEVICE_TABLE(isapnp, el3_isapnp_adapters);
-#endif /* __ISAPNP__ */
-MODULE_DESCRIPTION("3Com Etherlink III (3c509, 3c509B) ISA/PnP ethernet driver");
+#endif /* CONFIG_PNP */
+MODULE_DESCRIPTION("3Com Etherlink III (3c509, 3c509B, 3c529, 3c579) ethernet driver");
MODULE_LICENSE("GPL");
static int __init el3_init_module(void)
{
int ret = 0;
- el3_cards = 0;
if (debug >= 0)
el3_debug = debug;
- el3_root_dev = NULL;
- while (el3_probe(el3_cards) == 0) {
- if (irq[el3_cards] > 1)
- el3_root_dev->irq = irq[el3_cards];
- if (xcvr[el3_cards] >= 0)
- el3_root_dev->if_port = xcvr[el3_cards];
- el3_cards++;
+#ifdef CONFIG_PNP
+ if (!nopnp) {
+ ret = pnp_register_driver(&el3_pnp_driver);
+ if (!ret)
+ pnp_registered = 1;
+ }
+#endif
+ /* Select an open I/O location at 0x1*0 to do ISA contention select. */
+ /* Start with 0x110 to avoid some sound cards.*/
+ for (id_port = 0x110 ; id_port < 0x200; id_port += 0x10) {
+ if (!request_region(id_port, 1, "3c509-control"))
+ continue;
+ outb(0x00, id_port);
+ outb(0xff, id_port);
+ if (inb(id_port) & 0x01)
+ break;
+ else
+ release_region(id_port, 1);
+ }
+ if (id_port >= 0x200) {
+ id_port = 0;
+ printk(KERN_ERR "No I/O port available for 3c509 activation.\n");
+ } else {
+ ret = isa_register_driver(&el3_isa_driver, EL3_MAX_CARDS);
+ if (!ret)
+ isa_registered = 1;
}
-
#ifdef CONFIG_EISA
ret = eisa_driver_register(&el3_eisa_driver);
+ if (!ret)
+ eisa_registered = 1;
#endif
#ifdef CONFIG_MCA
- {
- int err = mca_register_driver(&el3_mca_driver);
- if (ret == 0)
- ret = err;
- }
+ ret = mca_register_driver(&el3_mca_driver);
+ if (!ret)
+ mca_registered = 1;
+#endif
+
+#ifdef CONFIG_PNP
+ if (pnp_registered)
+ ret = 0;
+#endif
+ if (isa_registered)
+ ret = 0;
+#ifdef CONFIG_EISA
+ if (eisa_registered)
+ ret = 0;
+#endif
+#ifdef CONFIG_MCA
+ if (mca_registered)
+ ret = 0;
#endif
return ret;
}
static void __exit el3_cleanup_module(void)
{
- struct net_device *next_dev;
-
- while (el3_root_dev) {
- struct el3_private *lp = netdev_priv(el3_root_dev);
-
- next_dev = lp->next_dev;
- el3_common_remove (el3_root_dev);
- el3_root_dev = next_dev;
- }
-
+#ifdef CONFIG_PNP
+ if (pnp_registered)
+ pnp_unregister_driver(&el3_pnp_driver);
+#endif
+ if (isa_registered)
+ isa_unregister_driver(&el3_isa_driver);
+ if (id_port)
+ release_region(id_port, 1);
#ifdef CONFIG_EISA
- eisa_driver_unregister (&el3_eisa_driver);
+ if (eisa_registered)
+ eisa_driver_unregister (&el3_eisa_driver);
#endif
#ifdef CONFIG_MCA
- mca_unregister_driver(&el3_mca_driver);
+ if (mca_registered)
+ mca_unregister_driver(&el3_mca_driver);
#endif
}
module_init (el3_init_module);
module_exit (el3_cleanup_module);
-
--
Ondrej Zary
^ permalink raw reply
* Re: oops with ipcomp
From: Beschorner Daniel @ 2008-02-07 18:01 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
In-Reply-To: <20080207154437.GA7237@gondor.apana.org.au>
> OK, so are you now able to reproduce this crash without waiting
> for hours? That would be really helpful in tracking it down.
Yes, I can reproduce it in minutes now.
> Could you show me the exact policies/SAs of the tunnel involved
> in the crash?
esp/cbc(aes128)/hmac(sha1)
--------------------------------------------------------
Mit freundlichen Grüßen
i.A. Daniel Beschorner
Entwicklung
FACTON GmbH
Prager Str. 2
01069 Dresden
Tel.: +49-351-40223-0
Mobil: +49-151-54446012
Fax: +49-351-40223-15
Mail: Daniel.Beschorner@facton.com
Web: www.facton.com
--------------------------------------------------------
Neuer FACTON-Unternehmensauftritt im Internet: www.facton.com
Alle Schulungstermine 2008 in der Übersicht: www.facton.com/akademie2008 --------------------------------------------------------
Vertretungsberechtigte Geschäftsführer: Thoralf Nehls, Martin Nehls
Sitz der Gesellschaft: Prager Straße 2, 01069 Dresden
Handelsregister: Amtsgericht Dresden HRB 17304
--------------------------------------------------------
"This email message is intended only for the person(s) to whom it is addressed
and as such is confidential. If you have received this communication in error,
please notify us immediately and delete the original message.
Thank you for your cooperation."
^ permalink raw reply
* Re: Bug? Kernels 2.6.2x drops TCP packets over wireless (independentof card used)
From: Marcin Koziej @ 2008-02-07 18:33 UTC (permalink / raw)
To: Eric Dumazet; +Cc: linux-kernel, netdev
In-Reply-To: <47AB321E.5080908@cosmosbay.com>
> > I have problem with wireless network connectivity;
> > TCP connections hang and timeout before all data is read.
> >
> > Problem description:
> > I am connected to the network via hotspot wifi router:
> > ath0 IEEE 802.11g ESSID:"hotspot" Nickname:""
> > Mode:Managed Frequency:2.462 GHz Access Point: 00:60:B3:6C:A1:2E
> > Bit Rate:11 Mb/s Tx-Power:17 dBm Sensitivity=1/1
> > Retry:off RTS thr:off Fragment thr:off
> > Power Management:off
> > Link Quality=19/70 Signal level=-77 dBm Noise level=-96 dBm
> > Rx invalid nwid:43882 Rx invalid crypt:0 Rx invalid frag:0
> > Tx excessive retries:0 Invalid misc:0 Missed beacon:0
> >
> > ICMP and UDP protocols seem to work (provided by 0% packet loss
> > ping to router (and internet servers), and a working DNS resolver)
> > However, when I try to connect to a TCP service, for example FTP or HTTP, the
> > connection is made, request
> > sent but truncated answer (or no answer) ever read back.
> >
> > For example:
> > # ftp ftp.icm.edu.pl
> > Connected to ftp.icm.edu.pl (193.219.28.140).
> > 220-
> > (hangs)
> >
> > The packet dump is:
> > 23:56:08.807674 IP 192.168.1.2.51909 > sunsite2.icm.edu.pl.ftp: S
> > 980196671:980196671(0) win 5840 <mss 1460,sackOK,timestamp 1971553
> > 0,nop,wscale 5>
> > 0x0000: 4500 003c 885e 4000 4006 124c c0a8 0102 E..<.^@.@..L....
> > 0x0010: c1db 1c8c cac5 0015 3a6c 9d3f 0000 0000 ........:l.?....
> > 0x0020: a002 16d0 d91a 0000 0204 05b4 0402 080a ................
> > 0x0030: 001e 1561 0000 0000 0103 0305 ...a........
> > 23:56:08.821639 IP sunsite2.icm.edu.pl.ftp > 192.168.1.2.51909: S
> > 2723526584:2723526584(0) ack 980196672 win 5792 <mss 1460,sackOK,timestamp
> > 983901832 1971553,nop,wscale 7>
> > 0x0000: 4500 003c 0000 4000 3c06 9eaa c1db 1c8c E..<..@.<.......
> > 0x0010: c0a8 0102 0015 cac5 a255 b7b8 3a6c 9d40 .........U..:l.@
> > 0x0020: a012 16a0 1dfc 0000 0204 05b4 0402 080a ................
> > 0x0030: 3aa5 2688 001e 1561 0103 0307 :.&....a....
> > 23:56:08.821685 IP 192.168.1.2.51909 > sunsite2.icm.edu.pl.ftp: . ack 1 win 183
> > <nop,nop,timestamp 1971567 983901832>
> > 0x0000: 4500 0034 885f 4000 4006 1253 c0a8 0102 E..4._@.@..S....
> > 0x0010: c1db 1c8c cac5 0015 3a6c 9d40 a255 b7b9 ........:l.@.U..
> > 0x0020: 8010 00b7 62a3 0000 0101 080a 001e 156f ....b..........o
> > 0x0030: 3aa5 2688 :.&.
> > 23:56:08.842801 IP sunsite2.icm.edu.pl.ftp > 192.168.1.2.51909: P 1:7(6) ack 1
> > win 46 <nop,nop,timestamp 983901837 1971567>
> > 0x0000: 4510 003a 9135 4000 3c06 0d67 c1db 1c8c E..:.5@.<..g....
> > 0x0010: c0a8 0102 0015 cac5 a255 b7b9 3a6c 9d40 .........U..:l.@
> > 0x0020: 8018 002e f3af 0000 0101 080a 3aa5 268d ............:.&.
> > 0x0030: 001e 156f 3232 302d 0d0a ...o220-..
> > 23:56:08.843069 IP 192.168.1.2.51909 > sunsite2.icm.edu.pl.ftp: . ack 7 win 183
> > <nop,nop,timestamp 1971588 983901837>
> > 0x0000: 4510 0034 8860 4000 4006 1242 c0a8 0102 E..4.`@.@..B....
> > 0x0010: c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf ........:l.@.U..
> > 0x0020: 8010 00b7 6283 0000 0101 080a 001e 1584 ....b...........
> > 0x0030: 3aa5 268d :.&.
> > 23:56:31.920327 IP 192.168.1.2.51909 > sunsite2.icm.edu.pl.ftp: F 1:1(0) ack 7
> > win 183 <nop,nop,timestamp 1994676 983901837>
> > 0x0000: 4510 0034 8861 4000 4006 1241 c0a8 0102 E..4.a@.@..A....
> > 0x0010: c1db 1c8c cac5 0015 3a6c 9d40 a255 b7bf ........:l.@.U..
> > 0x0020: 8011 00b7 0852 0000 0101 080a 001e 6fb4 .....R........o.
> > 0x0030: 3aa5 268d :.&.
> > 23:56:31.935145 IP sunsite2.icm.edu.pl.ftp > 192.168.1.2.51909: . ack 2 win 46
> > <nop,nop,timestamp 983907613 1994676>
> > 0x0000: 4510 0034 913d 4000 3c06 0d65 c1db 1c8c E..4.=@.<..e....
> > 0x0010: c0a8 0102 0015 cac5 a255 b8e5 3a6c 9d41 .........U..:l.A
> > 0x0020: 8010 002e f124 0000 0101 080a 3aa5 3d1d .....$......:.=.
> > 0x0030: 001e 6fb4 ..o.
> >
> > Other machines work with the router fine.
> >
> > How can I solve this problem?
> > I tried to look for some relevand info with athdebug, but i'm not sure what to
> > look for.
> > Can You help me?
> >
> > System:
> > I am using Atheros Communications, Inc. AR5212 802.11abg NIC PCMCIA card.
> > Computer is Acer Aspire 1520.
> >
> > I use vanilla kernel:
> > Linux 2.6.23 #1 Sat Jan 12 12:07:39 CET 2008 i686 AMD Athlon(tm) 64 Processor
> > 3700+ AuthenticAMD GNU/Linux
> > and madwifi driver ath_pci 0.9.4.5 (0.9.3.3)
> > kernel options: irqpoll (without irqpoll system doesn't detect pcmcia cards).
> >
> > Device detection:
> > ath_hal: module license 'Proprietary' taints kernel.
> > ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
> > ath_pci: 0.9.4.5 (0.9.3.3)
> > ath_rate_sample: 1.2 (0.9.3.3)
> > wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
> > wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps
> > 36Mbps 48Mbps 54Mbps
> > wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
> > wifi0: H/W encryption support: WEP AES AES_CCM TKIP
> > wifi0: mac 5.9 phy 4.3 radio 4.6
> > wifi0: Use hw queue 1 for WME_AC_BE traffic
> > wifi0: Use hw queue 0 for WME_AC_BK traffic
> > wifi0: Use hw queue 2 for WME_AC_VI traffic
> > wifi0: Use hw queue 3 for WME_AC_VO traffic
> > wifi0: Use hw queue 8 for CAB traffic
> > wifi0: Use hw queue 9 for beacons
> > wifi0: Atheros 5212: mem=0x34000000, irq=11
> >
> > On the same irq are:
> > ehci_hcd:usb1
> > eth0
> > uhci_hcd:usb4
> > wifi%d
> > yenta
> >
Eric Dumazet <dada1@cosmosbay.com> -----------------------------------------
> Very strange, as the tcpdump you gave shows that the remote peer only
> sent "220-\r\n"
>
> This was ACKed, and then nothing but timeout. We can conclude remote
> peer is *very* slow or a firewall is blocking trafic after 6 bytes sent :)
>
> Could you give a tcpdump for the same destination, on 2.6.19 this time ?
Here goes, this happens after running:
ftp sunsite.icm.edu.pl
The ftp session is successful
----------------------------------------------------
tcpdump -i ath0 tcp and port 21 -X -s 300 -vv
tcpdump: listening on ath0, link-type EN10MB (Ethernet), capture size 300 bytes
18:09:48.435612 IP (tos 0x0, ttl 64, id 6423, offset 0, flags [DF], proto: TCP (6), length: 60) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: S, cksum 0xe759 (correct), 1749015234:1749015234(0) win 5840 <mss 1460,sackOK,timestamp 1885141 0,nop,wscale 2>
0x0000: 4500 003c 1917 4000 4006 8184 c0a8 0111 E..<..@.@.......
0x0010: c1db 1c8c a2b1 0015 683f dac2 0000 0000 ........h?......
0x0020: a002 16d0 e759 0000 0204 05b4 0402 080a .....Y..........
0x0030: 001c c3d5 0000 0000 0103 0302 ............
18:09:48.449755 IP (tos 0x0, ttl 60, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: S, cksum 0xc97a (correct), 1528170639:1528170639(0) ack 1749015235 win 5792 <mss 1460,sackOK,timestamp 536320604 1885141,nop,wscale 7>
0x0000: 4500 003c 0000 4000 3c06 9e9b c1db 1c8c E..<..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 088f 683f dac3 ........[...h?..
0x0020: a012 16a0 c97a 0000 0204 05b4 0402 080a .....z..........
0x0030: 1ff7 9a5c 001c c3d5 0103 0307 ...\........
18:09:48.449827 IP (tos 0x0, ttl 64, id 6424, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x0925 (correct), 1:1(0) ack 1 win 1460 <nop,nop,timestamp 1885155 536320604>
0x0000: 4500 0034 1918 4000 4006 818b c0a8 0111 E..4..@.@.......
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0890 ........h?..[...
0x0020: 8010 05b4 0925 0000 0101 080a 001c c3e3 .....%..........
0x0030: 1ff7 9a5c ...\
18:09:48.485234 IP (tos 0x10, ttl 60, id 37583, offset 0, flags [DF], proto: TCP (6), length: 58) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x9f2a (correct), 1:7(6) ack 1 win 46 <nop,nop,timestamp 536320613 1885155>
0x0000: 4510 003a 92cf 4000 3c06 0bbe c1db 1c8c E..:..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0890 683f dac3 ........[...h?..
0x0020: 8018 002e 9f2a 0000 0101 080a 1ff7 9a65 .....*.........e
0x0030: 001c c3e3 3232 302d 0d0a ....220-..
18:09:48.485337 IP (tos 0x10, ttl 64, id 6425, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x08f2 (correct), 1:1(0) ack 7 win 1460 <nop,nop,timestamp 1885191 536320613>
0x0000: 4510 0034 1919 4000 4006 817a c0a8 0111 E..4..@.@..z....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0896 ........h?..[...
0x0020: 8010 05b4 08f2 0000 0101 080a 001c c407 ................
0x0030: 1ff7 9a65 ...e
18:09:48.500421 IP (tos 0x10, ttl 60, id 37584, offset 0, flags [DF], proto: TCP (6), length: 191) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0xc74e (correct), 7:146(139) ack 1 win 46 <nop,nop,timestamp 536320616 1885191>
0x0000: 4510 00bf 92d0 4000 3c06 0b38 c1db 1c8c E.....@.<..8....
0x0010: c0a8 0111 0015 a2b1 5b16 0896 683f dac3 ........[...h?..
0x0020: 8018 002e c74e 0000 0101 080a 1ff7 9a68 .....N.........h
0x0030: 001c c407 3232 302d 2020 2020 2020 2020 ....220-........
0x0040: 2020 2020 4654 5020 6e61 2053 756e 5349 ....FTP.na.SunSI
0x0050: 5445 2028 3620 5442 206f 7072 6f67 7261 TE.(6.TB.oprogra
0x0060: 6d6f 7761 6e69 6129 2e0d 0a32 3230 2d20 mowania)...220-.
0x0070: 2020 2020 5577 6167 693a 2073 756e 7369 ....Uwagi:.sunsi
0x0080: 7465 4069 636d 2e65 6475 2e70 6c20 286f te@icm.edu.pl.(o
0x0090: 6470 6f77 6961 6461 6d79 206e 6120 7773 dpowiadamy.na.ws
0x00a0: 7a79 7374 6b69 6520 646f 742e 2053 756e zystkie.dot..Sun
0x00b0: 5349 5445 2761 290d 0a32 3230 2d0d 0a SITE'a)..220-..
18:09:48.500471 IP (tos 0x10, ttl 64, id 6426, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x0855 (correct), 1:1(0) ack 146 win 1460 <nop,nop,timestamp 1885206 536320616>
0x0000: 4510 0034 191a 4000 4006 8179 c0a8 0111 E..4..@.@..y....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0921 ........h?..[..!
0x0020: 8010 05b4 0855 0000 0101 080a 001c c416 .....U..........
0x0030: 1ff7 9a68 ...h
18:09:48.515721 IP (tos 0x10, ttl 60, id 37585, offset 0, flags [DF], proto: TCP (6), length: 292) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P 146:386(240) ack 1 win 46 <nop,nop,timestamp 536320620 1885206>
0x0000: 4510 0124 92d1 4000 3c06 0ad2 c1db 1c8c E..$..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0921 683f dac3 ........[..!h?..
0x0020: 8018 002e 7a99 0000 0101 080a 1ff7 9a6c ....z..........l
0x0030: 001c c416 3232 302d 5769 7461 6d79 205b ....220-Witamy.[
0x0040: 756e 6b6e 6f77 6e5d 4063 7162 3530 2e6e unknown]@cqb50.n
0x0050: 656f 706c 7573 2e61 6473 6c2e 7470 6e65 eoplus.adsl.tpne
0x0060: 742e 706c 2e20 4a65 7374 2054 6875 2046 t.pl..Jest.Thu.F
0x0070: 6562 2020 3720 3139 3a31 323a 3437 2032 eb..7.19:12:47.2
0x0080: 3030 382e 0d0a 3232 302d 5720 7477 6f6a 008...220-W.twoj
0x0090: 656a 206b 6c61 7369 6520 6d6f 7a65 2062 ej.klasie.moze.b
0x00a0: 7963 2064 6f20 3730 3020 757a 7974 6b6f yc.do.700.uzytko
0x00b0: 776e 696b 6f77 2c20 6f62 6563 6e69 6520 wnikow,.obecnie.
0x00c0: 6a65 7374 2069 6368 2032 322e 0d0a 3232 jest.ich.22...22
0x00d0: 302d 0d0a 3232 302d 446f 7374 6570 2074 0-..220-Dostep.t
0x00e0: 657a 2070 727a 657a 3a20 7273 796e 633a ez.przez:.rsync:
0x00f0: 2f2f 6674 702e 6963 6d2e 6564 752e 706c //ftp.icm.edu.pl
0x0100: 2f20 6874 7470 3a2f 2f66 7470 2e69 636d /.http://ftp.icm
0x0110: 2e65 6475 2e70 6c2f 7075 622f 0d0a .edu.pl/pub/..
18:09:48.520175 IP (tos 0x10, ttl 64, id 6427, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x0642 (correct), 1:1(0) ack 386 win 1728 <nop,nop,timestamp 1885225 536320620>
0x0000: 4510 0034 191b 4000 4006 8178 c0a8 0111 E..4..@.@..x....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0a11 ........h?..[...
0x0020: 8010 06c0 0642 0000 0101 080a 001c c429 .....B.........)
0x0030: 1ff7 9a6c ...l
18:09:48.537656 IP (tos 0x10, ttl 60, id 37586, offset 0, flags [DF], proto: TCP (6), length: 415) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P 386:749(363) ack 1 win 46 <nop,nop,timestamp 536320625 1885225>
0x0000: 4510 019f 92d2 4000 3c06 0a56 c1db 1c8c E.....@.<..V....
0x0010: c0a8 0111 0015 a2b1 5b16 0a11 683f dac3 ........[...h?..
0x0020: 8018 002e 3920 0000 0101 080a 1ff7 9a71 ....9..........q
0x0030: 001c c429 3232 302d 5557 4147 413a 2077 ...)220-UWAGA:.w
0x0040: 6965 6b73 7a6f 7363 2075 7a79 746b 6f77 iekszosc.uzytkow
0x0050: 6e69 6b6f 7720 6d61 206c 696d 6974 2035 nikow.ma.limit.5
0x0060: 2070 6f6c 6163 7a65 6e20 6e61 2031 2061 .polaczen.na.1.a
0x0070: 6472 6573 2049 502e 0d0a 3232 302d 506c dres.IP...220-Pl
0x0080: 696b 6920 3e3d 2032 2047 4220 6d6f 7a6e iki.>=.2.GB.mozn
0x0090: 6120 706f 6269 6572 6163 2074 657a 2070 a.pobierac.tez.p
0x00a0: 727a 657a 2068 7474 703a 2f2f 6674 702e rzez.http://ftp.
0x00b0: 6963 6d2e 6564 752e 706c 2f70 7562 2f0d icm.edu.pl/pub/.
0x00c0: 0a32 3230 2d0d 0a32 3230 2d5a 6170 7261 .220-..220-Zapra
0x00d0: 737a 616d 2064 6f20 7375 6273 6b72 7962 szam.do.subskryb
0x00e0: 6f77 616e 6961 206c 6973 7479 2064 7973 owania.listy.dys
0x00f0: 6b75 7379 6a6e 656a 206f 2073 756e 7369 kusyjnej.o.sunsi
0x0100: 6369 653a 0d0a 3232 302d 0968 7474 703a cie:..220-.http:
0x0110: 2f2f 6c69 7374 792e 6963 6d2e 6564 //listy.icm.ed
18:09:48.543973 IP (tos 0x10, ttl 64, id 6428, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x03ae (correct), 1:1(0) ack 749 win 1996 <nop,nop,timestamp 1885249 536320625>
0x0000: 4510 0034 191c 4000 4006 8177 c0a8 0111 E..4..@.@..w....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0b7c ........h?..[..|
0x0020: 8010 07cc 03ae 0000 0101 080a 001c c441 ...............A
0x0030: 1ff7 9a71 ...q
18:09:48.559804 IP (tos 0x10, ttl 60, id 37587, offset 0, flags [DF], proto: TCP (6), length: 198) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x007d (correct), 749:895(146) ack 1 win 46 <nop,nop,timestamp 536320631 1885249>
0x0000: 4510 00c6 92d3 4000 3c06 0b2e c1db 1c8c E.....@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0b7c 683f dac3 ........[..|h?..
0x0020: 8018 002e 007d 0000 0101 080a 1ff7 9a77 .....}.........w
0x0030: 001c c441 3232 302d 2d20 3230 3037 3131 ...A220--.200711
0x0040: 3038 2046 4320 380d 0a32 3230 2d2d 2032 08.FC.8..220--.2
0x0050: 3030 3731 3030 3420 4643 2037 2e39 320d 0071004.FC.7.92.
0x0060: 0a32 3230 2d0d 0a32 3230 2073 756e 7369 .220-..220.sunsi
0x0070: 7465 322e 6963 6d2e 6564 752e 706c 2046 te2.icm.edu.pl.F
0x0080: 5450 2073 6572 7665 7220 2856 6572 7369 TP.server.(Versi
0x0090: 6f6e 2077 752d 322e 362e 3228 3129 2054 on.wu-2.6.2(1).T
0x00a0: 6875 204d 6179 2032 3420 3138 3a31 383a hu.May.24.18:18:
0x00b0: 3130 204d 4553 5420 3230 3037 2920 7265 10.MEST.2007).re
0x00c0: 6164 792e 0d0a ady...
18:09:48.566984 IP (tos 0x10, ttl 64, id 6429, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x02ff (correct), 1:1(0) ack 895 win 1996 <nop,nop,timestamp 1885272 536320631>
0x0000: 4510 0034 191d 4000 4006 8176 c0a8 0111 E..4..@.@..v....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0c0e ........h?..[...
0x0020: 8010 07cc 02ff 0000 0101 080a 001c c458 ...............X
0x0030: 1ff7 9a77 ...w
18:09:51.641584 IP (tos 0x10, ttl 64, id 6430, offset 0, flags [DF], proto: TCP (6), length: 62) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0xe0a2 (correct), 1:11(10) ack 895 win 1996 <nop,nop,timestamp 1888347 536320631>
0x0000: 4510 003e 191e 4000 4006 816b c0a8 0111 E..>..@.@..k....
0x0010: c1db 1c8c a2b1 0015 683f dac3 5b16 0c0e ........h?..[...
0x0020: 8018 07cc e0a2 0000 0101 080a 001c d05b ...............[
0x0030: 1ff7 9a77 4155 5448 2053 534c 0d0a ...wAUTH.SSL..
18:09:51.655226 IP (tos 0x10, ttl 60, id 37588, offset 0, flags [DF], proto: TCP (6), length: 52) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: ., cksum 0xfb89 (correct), 895:895(0) ack 11 win 46 <nop,nop,timestamp 536321405 1888347>
0x0000: 4510 0034 92d4 4000 3c06 0bbf c1db 1c8c E..4..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0c0e 683f dacd ........[...h?..
0x0020: 8010 002e fb89 0000 0101 080a 1ff7 9d7d ...............}
0x0030: 001c d05b ...[
18:09:51.657130 IP (tos 0x10, ttl 60, id 37589, offset 0, flags [DF], proto: TCP (6), length: 90) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x9640 (correct), 895:933(38) ack 11 win 46 <nop,nop,timestamp 536321405 1888347>
0x0000: 4510 005a 92d5 4000 3c06 0b98 c1db 1c8c E..Z..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0c0e 683f dacd ........[...h?..
0x0020: 8018 002e 9640 0000 0101 080a 1ff7 9d7d .....@.........}
0x0030: 001c d05b 3533 3020 506c 6561 7365 206c ...[530.Please.l
0x0040: 6f67 696e 2077 6974 6820 5553 4552 2061 ogin.with.USER.a
0x0050: 6e64 2050 4153 532e 0d0a nd.PASS...
18:09:51.663526 IP (tos 0x10, ttl 64, id 6431, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xf3af (correct), 11:11(0) ack 933 win 1996 <nop,nop,timestamp 1888369 536321405>
0x0000: 4510 0034 191f 4000 4006 8174 c0a8 0111 E..4..@.@..t....
0x0010: c1db 1c8c a2b1 0015 683f dacd 5b16 0c34 ........h?..[..4
0x0020: 8010 07cc f3af 0000 0101 080a 001c d071 ...............q
0x0030: 1ff7 9d7d ...}
18:09:51.663643 IP (tos 0x10, ttl 64, id 6432, offset 0, flags [DF], proto: TCP (6), length: 68) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0x6bbb (correct), 11:27(16) ack 933 win 1996 <nop,nop,timestamp 1888369 536321405>
0x0000: 4510 0044 1920 4000 4006 8163 c0a8 0111 E..D..@.@..c....
0x0010: c1db 1c8c a2b1 0015 683f dacd 5b16 0c34 ........h?..[..4
0x0020: 8018 07cc 6bbb 0000 0101 080a 001c d071 ....k..........q
0x0030: 1ff7 9d7d 5553 4552 2061 6e6f 6e79 6d6f ...}USER.anonymo
0x0040: 7573 0d0a us..
18:09:51.685672 IP (tos 0x10, ttl 60, id 37590, offset 0, flags [DF], proto: TCP (6), length: 120) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x1145 (correct), 933:1001(68) ack 27 win 46 <nop,nop,timestamp 536321413 1888369>
0x0000: 4510 0078 92d6 4000 3c06 0b79 c1db 1c8c E..x..@.<..y....
0x0010: c0a8 0111 0015 a2b1 5b16 0c34 683f dadd ........[..4h?..
0x0020: 8018 002e 1145 0000 0101 080a 1ff7 9d85 .....E..........
0x0030: 001c d071 3333 3120 4775 6573 7420 6c6f ...q331.Guest.lo
0x0040: 6769 6e20 6f6b 2c20 7365 6e64 2079 6f75 gin.ok,.send.you
0x0050: 7220 636f 6d70 6c65 7465 2065 2d6d 6169 r.complete.e-mai
0x0060: 6c20 6164 6472 6573 7320 6173 2070 6173 l.address.as.pas
0x0070: 7377 6f72 642e 0d0a sword...
18:09:51.733455 IP (tos 0x10, ttl 64, id 6433, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xf30d (correct), 27:27(0) ack 1001 win 1996 <nop,nop,timestamp 1888439 536321413>
0x0000: 4510 0034 1921 4000 4006 8172 c0a8 0111 E..4.!@.@..r....
0x0010: c1db 1c8c a2b1 0015 683f dadd 5b16 0c78 ........h?..[..x
0x0020: 8010 07cc f30d 0000 0101 080a 001c d0b7 ................
0x0030: 1ff7 9d85 ....
18:09:56.826492 IP (tos 0x10, ttl 64, id 6434, offset 0, flags [DF], proto: TCP (6), length: 71) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0xe4e0 (correct), 27:46(19) ack 1001 win 1996 <nop,nop,timestamp 1893533 536321413>
0x0000: 4510 0047 1922 4000 4006 815e c0a8 0111 E..G."@.@..^....
0x0010: c1db 1c8c a2b1 0015 683f dadd 5b16 0c78 ........h?..[..x
0x0020: 8018 07cc e4e0 0000 0101 080a 001c e49d ................
0x0030: 1ff7 9d85 5041 5353 2067 7565 7374 406c ....PASS.guest@l
0x0040: 6f6c 2e70 650d 0a ol.pe..
18:09:56.856513 IP (tos 0x10, ttl 60, id 37591, offset 0, flags [DF], proto: TCP (6), length: 100) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x3587 (correct), 1001:1049(48) ack 46 win 46 <nop,nop,timestamp 536322706 1893533>
0x0000: 4510 0064 92d7 4000 3c06 0b8c c1db 1c8c E..d..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0c78 683f daf0 ........[..xh?..
0x0020: 8018 002e 3587 0000 0101 080a 1ff7 a292 ....5...........
0x0030: 001c e49d 3233 3020 4775 6573 7420 6c6f ....230.Guest.lo
0x0040: 6769 6e20 6f6b 2c20 6163 6365 7373 2072 gin.ok,.access.r
0x0050: 6573 7472 6963 7469 6f6e 7320 6170 706c estrictions.appl
0x0060: 792e 0d0a y...
18:09:56.863649 IP (tos 0x10, ttl 64, id 6435, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xd9b2 (correct), 46:46(0) ack 1049 win 1996 <nop,nop,timestamp 1893570 536322706>
0x0000: 4510 0034 1923 4000 4006 8170 c0a8 0111 E..4.#@.@..p....
0x0010: c1db 1c8c a2b1 0015 683f daf0 5b16 0ca8 ........h?..[...
0x0020: 8010 07cc d9b2 0000 0101 080a 001c e4c2 ................
0x0030: 1ff7 a292 ....
18:09:56.863741 IP (tos 0x10, ttl 64, id 6436, offset 0, flags [DF], proto: TCP (6), length: 58) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0x25ed (correct), 46:52(6) ack 1049 win 1996 <nop,nop,timestamp 1893570 536322706>
0x0000: 4510 003a 1924 4000 4006 8169 c0a8 0111 E..:.$@.@..i....
0x0010: c1db 1c8c a2b1 0015 683f daf0 5b16 0ca8 ........h?..[...
0x0020: 8018 07cc 25ed 0000 0101 080a 001c e4c2 ....%...........
0x0030: 1ff7 a292 5359 5354 0d0a ....SYST..
18:09:56.880888 IP (tos 0x10, ttl 60, id 37592, offset 0, flags [DF], proto: TCP (6), length: 71) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x79d9 (correct), 1049:1068(19) ack 52 win 46 <nop,nop,timestamp 536322712 1893570>
0x0000: 4510 0047 92d8 4000 3c06 0ba8 c1db 1c8c E..G..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0ca8 683f daf6 ........[...h?..
0x0020: 8018 002e 79d9 0000 0101 080a 1ff7 a298 ....y...........
0x0030: 001c e4c2 3231 3520 554e 4958 2054 7970 ....215.UNIX.Typ
0x0040: 653a 204c 380d 0a e:.L8..
18:09:56.923607 IP (tos 0x10, ttl 64, id 6437, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xd957 (correct), 52:52(0) ack 1068 win 1996 <nop,nop,timestamp 1893630 536322712>
0x0000: 4510 0034 1925 4000 4006 816e c0a8 0111 E..4.%@.@..n....
0x0010: c1db 1c8c a2b1 0015 683f daf6 5b16 0cbb ........h?..[...
0x0020: 8010 07cc d957 0000 0101 080a 001c e4fe .....W..........
0x0030: 1ff7 a298 ....
18:10:00.672381 IP (tos 0x10, ttl 64, id 6438, offset 0, flags [DF], proto: TCP (6), length: 79) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0x08f2 (correct), 52:79(27) ack 1068 win 1996 <nop,nop,timestamp 1897379 536322712>
0x0000: 4510 004f 1926 4000 4006 8152 c0a8 0111 E..O.&@.@..R....
0x0010: c1db 1c8c a2b1 0015 683f daf6 5b16 0cbb ........h?..[...
0x0020: 8018 07cc 08f2 0000 0101 080a 001c f3a3 ................
0x0030: 1ff7 a298 504f 5254 2031 3932 2c31 3638 ....PORT.192,168
0x0040: 2c31 2c31 372c 3233 352c 3132 310d 0a ,1,17,235,121..
18:10:00.689596 IP (tos 0x10, ttl 60, id 37593, offset 0, flags [DF], proto: TCP (6), length: 82) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x1170 (correct), 1068:1098(30) ack 79 win 46 <nop,nop,timestamp 536323664 1897379>
0x0000: 4510 0052 92d9 4000 3c06 0b9c c1db 1c8c E..R..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0cbb 683f db11 ........[...h?..
0x0020: 8018 002e 1170 0000 0101 080a 1ff7 a650 .....p.........P
0x0030: 001c f3a3 3230 3020 504f 5254 2063 6f6d ....200.PORT.com
0x0040: 6d61 6e64 2073 7563 6365 7373 6675 6c2e mand.successful.
0x0050: 0d0a ..
18:10:00.694216 IP (tos 0x10, ttl 64, id 6439, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xc6ab (correct), 79:79(0) ack 1098 win 1996 <nop,nop,timestamp 1897401 536323664>
0x0000: 4510 0034 1927 4000 4006 816c c0a8 0111 E..4.'@.@..l....
0x0010: c1db 1c8c a2b1 0015 683f db11 5b16 0cd9 ........h?..[...
0x0020: 8010 07cc c6ab 0000 0101 080a 001c f3b9 ................
0x0030: 1ff7 a650 ...P
18:10:00.694311 IP (tos 0x10, ttl 64, id 6440, offset 0, flags [DF], proto: TCP (6), length: 58) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0x19f6 (correct), 79:85(6) ack 1098 win 1996 <nop,nop,timestamp 1897401 536323664>
0x0000: 4510 003a 1928 4000 4006 8165 c0a8 0111 E..:.(@.@..e....
0x0010: c1db 1c8c a2b1 0015 683f db11 5b16 0cd9 ........h?..[...
0x0020: 8018 07cc 19f6 0000 0101 080a 001c f3b9 ................
0x0030: 1ff7 a650 4c49 5354 0d0a ...PLIST..
18:10:00.728627 IP (tos 0x10, ttl 60, id 37594, offset 0, flags [DF], proto: TCP (6), length: 105) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x2475 (correct), 1098:1151(53) ack 85 win 46 <nop,nop,timestamp 536323674 1897401>
0x0000: 4510 0069 92da 4000 3c06 0b84 c1db 1c8c E..i..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0cd9 683f db17 ........[...h?..
0x0020: 8018 002e 2475 0000 0101 080a 1ff7 a65a ....$u.........Z
0x0030: 001c f3b9 3135 3020 4f70 656e 696e 6720 ....150.Opening.
0x0040: 4153 4349 4920 6d6f 6465 2064 6174 6120 ASCII.mode.data.
0x0050: 636f 6e6e 6563 7469 6f6e 2066 6f72 202f connection.for./
0x0060: 6269 6e2f 6c73 2e0d 0a bin/ls...
18:10:00.768972 IP (tos 0x10, ttl 64, id 6441, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xc61b (correct), 85:85(0) ack 1151 win 1996 <nop,nop,timestamp 1897476 536323674>
0x0000: 4510 0034 1929 4000 4006 816a c0a8 0111 E..4.)@.@..j....
0x0010: c1db 1c8c a2b1 0015 683f db17 5b16 0d0e ........h?..[...
0x0020: 8010 07cc c61b 0000 0101 080a 001c f404 ................
0x0030: 1ff7 a65a ...Z
18:10:00.781556 IP (tos 0x10, ttl 60, id 37595, offset 0, flags [DF], proto: TCP (6), length: 76) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0xfe96 (correct), 1151:1175(24) ack 85 win 46 <nop,nop,timestamp 536323687 1897476>
0x0000: 4510 004c 92db 4000 3c06 0ba0 c1db 1c8c E..L..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0d0e 683f db17 ........[...h?..
0x0020: 8018 002e fe96 0000 0101 080a 1ff7 a667 ...............g
0x0030: 001c f404 3232 3620 5472 616e 7366 6572 ....226.Transfer
0x0040: 2063 6f6d 706c 6574 652e 0d0a .complete...
18:10:00.785333 IP (tos 0x10, ttl 64, id 6442, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0xc5e6 (correct), 85:85(0) ack 1175 win 1996 <nop,nop,timestamp 1897492 536323687>
0x0000: 4510 0034 192a 4000 4006 8169 c0a8 0111 E..4.*@.@..i....
0x0010: c1db 1c8c a2b1 0015 683f db17 5b16 0d26 ........h?..[..&
0x0020: 8010 07cc c5e6 0000 0101 080a 001c f414 ................
0x0030: 1ff7 a667 ...g
18:10:14.323280 IP (tos 0x10, ttl 64, id 6443, offset 0, flags [DF], proto: TCP (6), length: 58) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: P, cksum 0xe948 (correct), 85:91(6) ack 1175 win 1996 <nop,nop,timestamp 1911024 536323687>
0x0000: 4510 003a 192b 4000 4006 8162 c0a8 0111 E..:.+@.@..b....
0x0010: c1db 1c8c a2b1 0015 683f db17 5b16 0d26 ........h?..[..&
0x0020: 8018 07cc e948 0000 0101 080a 001d 28f0 .....H........(.
0x0030: 1ff7 a667 5155 4954 0d0a ...gQUIT..
18:10:14.337180 IP (tos 0x10, ttl 60, id 37596, offset 0, flags [DF], proto: TCP (6), length: 98) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: P, cksum 0x09c9 (correct), 1175:1221(46) ack 91 win 46 <nop,nop,timestamp 536327076 1911024>
0x0000: 4510 0062 92dc 4000 3c06 0b89 c1db 1c8c E..b..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0d26 683f db1d ........[..&h?..
0x0020: 8018 002e 09c9 0000 0101 080a 1ff7 b3a4 ................
0x0030: 001d 28f0 3232 312d 596f 7520 6861 7665 ..(.221-You.have
0x0040: 2074 7261 6e73 6665 7272 6564 2030 2062 .transferred.0.b
0x0050: 7974 6573 2069 6e20 3020 6669 6c65 732e ytes.in.0.files.
0x0060: 0d0a ..
18:10:14.337572 IP (tos 0x10, ttl 64, id 6444, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: ., cksum 0x838a (correct), 91:91(0) ack 1221 win 1996 <nop,nop,timestamp 1911039 536327076>
0x0000: 4510 0034 192c 4000 4006 8167 c0a8 0111 E..4.,@.@..g....
0x0010: c1db 1c8c a2b1 0015 683f db1d 5b16 0d54 ........h?..[..T
0x0020: 8010 07cc 838a 0000 0101 080a 001d 28ff ..............(.
0x0030: 1ff7 b3a4 ....
18:10:14.342705 IP (tos 0x10, ttl 60, id 37597, offset 0, flags [DF], proto: TCP (6), length: 198) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: FP, cksum 0x9075 (correct), 1221:1367(146) ack 91 win 46 <nop,nop,timestamp 536327077 1911024>
0x0000: 4510 00c6 92dd 4000 3c06 0b24 c1db 1c8c E.....@.<..$....
0x0010: c0a8 0111 0015 a2b1 5b16 0d54 683f db1d ........[..Th?..
0x0020: 8019 002e 9075 0000 0101 080a 1ff7 b3a5 .....u..........
0x0030: 001d 28f0 3232 312d 546f 7461 6c20 7472 ..(.221-Total.tr
0x0040: 6166 6669 6320 666f 7220 7468 6973 2073 affic.for.this.s
0x0050: 6573 7369 6f6e 2077 6173 2031 3938 3220 ession.was.1982.
0x0060: 6279 7465 7320 696e 2031 2074 7261 6e73 bytes.in.1.trans
0x0070: 6665 7273 2e0d 0a32 3231 2d54 6861 6e6b fers...221-Thank
0x0080: 2079 6f75 2066 6f72 2075 7369 6e67 2074 .you.for.using.t
0x0090: 6865 2046 5450 2073 6572 7669 6365 206f he.FTP.service.o
0x00a0: 6e20 7375 6e73 6974 6532 2e69 636d 2e65 n.sunsite2.icm.e
0x00b0: 6475 2e70 6c2e 0d0a 3232 3120 476f 6f64 du.pl...221.Good
0x00c0: 6279 652e 0d0a bye...
18:10:14.344866 IP (tos 0x10, ttl 64, id 6445, offset 0, flags [DF], proto: TCP (6), length: 52) sabayonx86.local.41649 > sunsite2.icm.edu.pl.ftp: F, cksum 0x82ee (correct), 91:91(0) ack 1368 win 1996 <nop,nop,timestamp 1911046 536327077>
0x0000: 4510 0034 192d 4000 4006 8166 c0a8 0111 E..4.-@.@..f....
0x0010: c1db 1c8c a2b1 0015 683f db1d 5b16 0de7 ........h?..[...
0x0020: 8011 07cc 82ee 0000 0101 080a 001d 2906 ..............).
0x0030: 1ff7 b3a5 ....
18:10:14.358146 IP (tos 0x10, ttl 60, id 37598, offset 0, flags [DF], proto: TCP (6), length: 52) sunsite2.icm.edu.pl.ftp > sabayonx86.local.41649: ., cksum 0x8a87 (correct), 1368:1368(0) ack 92 win 46 <nop,nop,timestamp 536327082 1911046>
0x0000: 4510 0034 92de 4000 3c06 0bb5 c1db 1c8c E..4..@.<.......
0x0010: c0a8 0111 0015 a2b1 5b16 0de7 683f db1e ........[...h?..
0x0020: 8010 002e 8a87 0000 0101 080a 1ff7 b3aa ................
0x0030: 001d 2906 ..).
The console output is:
# ftp sunsite.icm.edu.pl
Connected to ftp.icm.edu.pl (193.219.28.140).
220-
220- FTP na SunSITE (6 TB oprogramowania).
220- Uwagi: sunsite@icm.edu.pl (odpowiadamy na wszystkie dot. SunSITE'a)
220-
220-Witamy [unknown]@cqb50.neoplus.adsl.tpnet.pl. Jest Thu Feb 7 19:12:47 2008.
220-W twojej klasie moze byc do 700 uzytkownikow, obecnie jest ich 22.
220-
220-Dostep tez przez: rsync://ftp.icm.edu.pl/ http://ftp.icm.edu.pl/pub/
220-
220-UWAGA: wiekszosc uzytkownikow ma limit 5 polaczen na 1 adres IP.
220-Pliki >= 2 GB mozna pobierac tez przez http://ftp.icm.edu.pl/pub/
220-
220-Zapraszam do subskrybowania listy dyskusyjnej o sunsicie:
220- http://listy.icm.edu.pl/mailman/listinfo/uzytkownicy
220-
220-Pliki sa dostepne bezposrednio przez ftp://ftp.icm.edu.pl/
220-
220-AKTUALNOSCI:
220-- 20071108 FC 8
220-- 20071004 FC 7.92
220-
220 sunsite2.icm.edu.pl FTP server (Version wu-2.6.2(1) Thu May 24 18:18:10 MEST 2007) ready.
Name (ftp.icm.edu.pl:root): anonymous
530 Please login with USER and PASS.
SSL not available
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 85417
d--x--x--x 2 0 1024 Dec 6 04:23 bin
d--x--x--x 2 0 1024 Jul 16 2007 etc
lrwxrwxrwx 1 500 17 Jun 26 2007 incoming -> packages/incoming
drwxr-xr-x 2 0 1024 Jan 11 2007 lib
drwxr-xr-x 2 0 1024 Jun 29 2007 lib64
drwx------ 2 0 12288 Jun 26 2007 lost+found
-rw-r--r-- 1 500 87066244 Jun 27 2007 ls-lR.gz
drwxr-xr-x 3 500 1024 Jun 28 2007 mirrors
drwxr-xr-x 2 500 11264 Jan 3 12:44 packages
lrwxrwxrwx 1 0 16 Sep 26 12:21 private -> packages/private
drwxr-xr-x 21 500 1024 Jun 26 2007 pub
drwxr-xr-x 248 500 11264 Jun 13 2007 sites
drwxr-xr-x 2 0 1024 May 12 2006 usr
drwxr-xr-x 7 500 1024 Mar 23 2007 vol
226 Transfer complete.
ftp> quit
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 1982 bytes in 1 transfers.
221-Thank you for using the FTP service on sunsite2.icm.edu.pl.
221 Goodbye.
---------------------------
Best regards and thank You for Your time.
Marcin Koziej
^ permalink raw reply
* Re: converting fore200e driver to use request_firmware()
From: chas williams - CONTRACTOR @ 2008-02-07 19:20 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20080206.160542.07994571.davem@davemloft.net>
In message <20080206.160542.07994571.davem@davemloft.net>,David Miller writes:
>> however, i ran into a little problem with the sbus interface. what should
>> i pass for 'struct device *' for an sbus device?
>
>"&sdev->ofdev.dev" should work
thanks! that is what i needed. so what i have works on pci and is
quite a bit cleaner than the current mess for the firmware. the only
iffy part is the conversion of the struct fore_200e to a struct device
which is depends your bus. perhaps it should be a seperate routine.
any comments on the following?
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
index 1c7ae30..a5303ee 100644
--- a/drivers/atm/Kconfig
+++ b/drivers/atm/Kconfig
@@ -325,81 +325,21 @@ config ATM_IA_DEBUG
speed of the driver, and the size of your syslog files! When
inactive, they will have only a modest impact on performance.
-config ATM_FORE200E_MAYBE
+config ATM_FORE200E
tristate "FORE Systems 200E-series"
- depends on PCI || SBUS
+ depends on (PCI || SBUS)
---help---
This is a driver for the FORE Systems 200E-series ATM adapter
cards. It simultaneously supports PCA-200E and SBA-200E models
on PCI and SBUS hosts. Say Y (or M to compile as a module
named fore_200e) here if you have one of these ATM adapters.
- Note that the driver will actually be compiled only if you
- additionally enable the support for PCA-200E and/or SBA-200E
- cards.
-
See the file <file:Documentation/networking/fore200e.txt> for
further details.
-config ATM_FORE200E_PCA
- bool "PCA-200E support"
- depends on ATM_FORE200E_MAYBE && PCI
- help
- Say Y here if you want your PCA-200E cards to be probed.
-
-config ATM_FORE200E_PCA_DEFAULT_FW
- bool "Use default PCA-200E firmware (normally enabled)"
- depends on ATM_FORE200E_PCA
- help
- Use the default PCA-200E firmware data shipped with the driver.
-
- Normal users do not have to deal with the firmware stuff, so
- they should say Y here.
-
-config ATM_FORE200E_PCA_FW
- string "Pathname of user-supplied binary firmware"
- depends on ATM_FORE200E_PCA && !ATM_FORE200E_PCA_DEFAULT_FW
- default ""
- help
- This defines the pathname of an alternative PCA-200E binary
- firmware image supplied by the user. This pathname may be
- absolute or relative to the drivers/atm directory.
-
- The driver comes with an adequate firmware image, so normal users do
- not have to supply an alternative one. They just say Y to "Use
- default PCA-200E firmware" instead.
-
-config ATM_FORE200E_SBA
- bool "SBA-200E support"
- depends on ATM_FORE200E_MAYBE && SBUS
- help
- Say Y here if you want your SBA-200E cards to be probed.
-
-config ATM_FORE200E_SBA_DEFAULT_FW
- bool "Use default SBA-200E firmware (normally enabled)"
- depends on ATM_FORE200E_SBA
- help
- Use the default SBA-200E firmware data shipped with the driver.
-
- Normal users do not have to deal with the firmware stuff, so
- they should say Y here.
-
-config ATM_FORE200E_SBA_FW
- string "Pathname of user-supplied binary firmware"
- depends on ATM_FORE200E_SBA && !ATM_FORE200E_SBA_DEFAULT_FW
- default ""
- help
- This defines the pathname of an alternative SBA-200E binary
- firmware image supplied by the user. This pathname may be
- absolute or relative to the drivers/atm directory.
-
- The driver comes with an adequate firmware image, so normal users do
- not have to supply an alternative one. They just say Y to "Use
- default SBA-200E firmware", above.
-
config ATM_FORE200E_USE_TASKLET
bool "Defer interrupt work to a tasklet"
- depends on (PCI || SBUS) && (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+ depends on ATM_FORE200E
default n
help
This defers work to be done by the interrupt handler to a
@@ -408,7 +348,7 @@ config ATM_FORE200E_USE_TASKLET
config ATM_FORE200E_TX_RETRY
int "Maximum number of tx retries"
- depends on (PCI || SBUS) && (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+ depends on ATM_FORE200E
default "16"
---help---
Specifies the number of times the driver attempts to transmit
@@ -425,7 +365,7 @@ config ATM_FORE200E_TX_RETRY
config ATM_FORE200E_DEBUG
int "Debugging level (0-3)"
- depends on (PCI || SBUS) && (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
+ depends on ATM_FORE200E
default "0"
help
Specifies the level of debugging messages issued by the driver.
@@ -436,12 +376,6 @@ config ATM_FORE200E_DEBUG
the performances of the driver, and the size of your syslog files!
Keep the debugging level to 0 during normal operations.
-config ATM_FORE200E
- tristate
- depends on (PCI || SBUS) && (ATM_FORE200E_PCA || ATM_FORE200E_SBA)
- default m if ATM_FORE200E_MAYBE!=y
- default y if ATM_FORE200E_MAYBE=y
-
config ATM_HE
tristate "ForeRunner HE Series"
depends on PCI
diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile
index e4fa996..4109583 100644
--- a/drivers/atm/Makefile
+++ b/drivers/atm/Makefile
@@ -3,14 +3,11 @@
#
fore_200e-objs := fore200e.o
-hostprogs-y := fore200e_mkfirm
# Files generated that shall be removed upon make clean
clean-files := atmsar11.bin atmsar11.bin1 atmsar11.bin2 pca200e.bin \
pca200e.bin1 pca200e.bin2 pca200e_ecd.bin pca200e_ecd.bin1 \
pca200e_ecd.bin2 sba200e_ecd.bin sba200e_ecd.bin1 sba200e_ecd.bin2
-# Firmware generated that shall be removed upon make clean
-clean-files += fore200e_pca_fw.c fore200e_sba_fw.c
obj-$(CONFIG_ATM_ZATM) += zatm.o uPD98402.o
obj-$(CONFIG_ATM_NICSTAR) += nicstar.o
@@ -36,37 +33,11 @@ obj-$(CONFIG_ATM_TCP) += atmtcp.o
obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
obj-$(CONFIG_ATM_LANAI) += lanai.o
-ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
- fore_200e-objs += fore200e_pca_fw.o
- # guess the target endianess to choose the right PCA-200E firmware image
- ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
- byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h
- CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) $(KBUILD_CPPFLAGS) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2)
- endif
-endif
-
-ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
- fore_200e-objs += fore200e_sba_fw.o
- ifeq ($(CONFIG_ATM_FORE200E_SBA_DEFAULT_FW),y)
- CONFIG_ATM_FORE200E_SBA_FW := $(obj)/sba200e_ecd.bin2
- endif
-endif
obj-$(CONFIG_ATM_HE) += he.o
ifeq ($(CONFIG_ATM_HE_USE_SUNI),y)
obj-$(CONFIG_ATM_HE) += suni.o
endif
-# FORE Systems 200E-series firmware magic
-$(obj)/fore200e_pca_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_PCA_FW)) \
- $(obj)/fore200e_mkfirm
- $(obj)/fore200e_mkfirm -k -b _fore200e_pca_fw \
- -i $(CONFIG_ATM_FORE200E_PCA_FW) -o $@
-
-$(obj)/fore200e_sba_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_SBA_FW)) \
- $(obj)/fore200e_mkfirm
- $(obj)/fore200e_mkfirm -k -b _fore200e_sba_fw \
- -i $(CONFIG_ATM_FORE200E_SBA_FW) -o $@
-
# deal with the various suffixes of the binary firmware images
$(obj)/%.bin $(obj)/%.bin1 $(obj)/%.bin2: $(src)/%.data
objcopy -Iihex $< -Obinary $@.gz
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 6b4512c..f365174 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -36,6 +36,7 @@
#include <linux/atm_suni.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
+#include <linux/firmware.h>
#include <asm/io.h>
#include <asm/string.h>
#include <asm/page.h>
@@ -45,7 +46,7 @@
#include <asm/uaccess.h>
#include <asm/atomic.h>
-#ifdef CONFIG_ATM_FORE200E_SBA
+#ifdef CONFIG_SBUS
#include <asm/idprom.h>
#include <asm/sbus.h>
#include <asm/openprom.h>
@@ -382,9 +383,6 @@ fore200e_shutdown(struct fore200e* fore200e)
case FORE200E_STATE_START_FW:
/* nothing to do for that state */
- case FORE200E_STATE_LOAD_FW:
- /* nothing to do for that state */
-
case FORE200E_STATE_RESET:
/* nothing to do for that state */
@@ -405,7 +403,7 @@ fore200e_shutdown(struct fore200e* fore200e)
}
-#ifdef CONFIG_ATM_FORE200E_PCA
+#ifdef CONFIG_PCI
static u32 fore200e_pca_read(volatile u32 __iomem *addr)
{
@@ -658,10 +656,10 @@ fore200e_pca_proc_read(struct fore200e* fore200e, char *page)
pci_dev->bus->number, PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn));
}
-#endif /* CONFIG_ATM_FORE200E_PCA */
+#endif /* CONFIG_PCI */
-#ifdef CONFIG_ATM_FORE200E_SBA
+#ifdef CONFIG_SBUS
static u32
fore200e_sba_read(volatile u32 __iomem *addr)
@@ -909,7 +907,7 @@ fore200e_sba_proc_read(struct fore200e* fore200e, char *page)
return sprintf(page, " SBUS slot/device:\t\t%d/'%s'\n", sbus_dev->slot, sbus_dev->prom_name);
}
-#endif /* CONFIG_ATM_FORE200E_SBA */
+#endif /* CONFIG_SBUS */
static void
@@ -2556,11 +2554,45 @@ fore200e_monitor_puts(struct fore200e* fore200e, char* str)
static int __devinit
-fore200e_start_fw(struct fore200e* fore200e)
-{
- int ok;
- char cmd[ 48 ];
- struct fw_header* fw_header = (struct fw_header*) fore200e->bus->fw_data;
+fore200e_load_and_start_fw(struct fore200e* fore200e)
+{
+ const struct firmware *firmware;
+ struct device *device;
+ struct fw_header *fw_header;
+ u32 *fw_data, fw_size;
+ u32 __iomem *load_addr;
+ char buf[48];
+ int err = -ENODEV;
+
+ if (strcmp(fore200e->bus->model_name, "PCA-200E") == 0)
+ device = &((struct pci_dev *) fore200e->bus_dev)->dev;
+#ifdef CONFIG_SBUS
+ else if (strcmp(fore200e->bus->model_name, "SBA-200E") == 0)
+ device = &((struct sbus_dev *) fore200e->bus_dev)->ofdev.dev;
+#endif
+ else
+ return err;
+
+ sprintf(buf, "%s.bin", fore200e->bus->proc_name);
+ if (request_firmware(&firmware, buf, device) == 1) {
+ return err;
+ }
+
+ fw_data = (u32 *) firmware->data;
+ fw_size = firmware->size / sizeof(u32);
+ fw_header = (struct fw_header*) fw_data;
+ load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset);
+
+ DPRINTK(2, "device %s firmware being loaded at 0x%p (%d words)\n",
+ fore200e->name, load_addr, fw_size);
+
+ if (le32_to_cpu(fw_header->magic) != FW_HEADER_MAGIC) {
+ printk(FORE200E "corrupted %s firmware image\n", fore200e->bus->model_name);
+ goto release;
+ }
+
+ for (; fw_size--; fw_data++, load_addr++)
+ fore200e->bus->write(le32_to_cpu(*fw_data), load_addr);
DPRINTK(2, "device %s firmware being started\n", fore200e->name);
@@ -2569,46 +2601,22 @@ fore200e_start_fw(struct fore200e* fore200e)
fore200e_spin(100);
#endif
- sprintf(cmd, "\rgo %x\r", le32_to_cpu(fw_header->start_offset));
-
- fore200e_monitor_puts(fore200e, cmd);
+ sprintf(buf, "\rgo %x\r", le32_to_cpu(fw_header->start_offset));
+ fore200e_monitor_puts(fore200e, buf);
- ok = fore200e_io_poll(fore200e, &fore200e->cp_monitor->bstat, BSTAT_CP_RUNNING, 1000);
- if (ok == 0) {
+ if (fore200e_io_poll(fore200e, &fore200e->cp_monitor->bstat, BSTAT_CP_RUNNING, 1000) == 0) {
printk(FORE200E "device %s firmware didn't start\n", fore200e->name);
- return -ENODEV;
+ goto release;
}
printk(FORE200E "device %s firmware started\n", fore200e->name);
fore200e->state = FORE200E_STATE_START_FW;
- return 0;
-}
-
+ err = 0;
-static int __devinit
-fore200e_load_fw(struct fore200e* fore200e)
-{
- u32* fw_data = (u32*) fore200e->bus->fw_data;
- u32 fw_size = (u32) *fore200e->bus->fw_size / sizeof(u32);
-
- struct fw_header* fw_header = (struct fw_header*) fw_data;
-
- u32 __iomem *load_addr = fore200e->virt_base + le32_to_cpu(fw_header->load_offset);
-
- DPRINTK(2, "device %s firmware being loaded at 0x%p (%d words)\n",
- fore200e->name, load_addr, fw_size);
-
- if (le32_to_cpu(fw_header->magic) != FW_HEADER_MAGIC) {
- printk(FORE200E "corrupted %s firmware image\n", fore200e->bus->model_name);
- return -ENODEV;
- }
-
- for (; fw_size--; fw_data++, load_addr++)
- fore200e->bus->write(le32_to_cpu(*fw_data), load_addr);
-
- fore200e->state = FORE200E_STATE_LOAD_FW;
- return 0;
+release:
+ release_firmware(firmware);
+ return err;
}
@@ -2654,10 +2662,7 @@ fore200e_init(struct fore200e* fore200e)
if (fore200e_reset(fore200e, 1) < 0)
return -ENODEV;
- if (fore200e_load_fw(fore200e) < 0)
- return -ENODEV;
-
- if (fore200e_start_fw(fore200e) < 0)
+ if (fore200e_load_and_start_fw(fore200e) < 0)
return -ENODEV;
if (fore200e_initialize(fore200e) < 0)
@@ -2691,7 +2696,7 @@ fore200e_init(struct fore200e* fore200e)
return 0;
}
-#ifdef CONFIG_ATM_FORE200E_PCA
+#ifdef CONFIG_PCI
static int __devinit
fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
{
@@ -2806,7 +2811,7 @@ fore200e_module_init(void)
}
}
-#ifdef CONFIG_ATM_FORE200E_PCA
+#ifdef CONFIG_PCI
if (!pci_register_driver(&fore200e_pca_driver))
return 0;
#endif
@@ -2823,7 +2828,7 @@ fore200e_module_cleanup(void)
{
struct fore200e *fore200e, *next;
-#ifdef CONFIG_ATM_FORE200E_PCA
+#ifdef CONFIG_PCI
pci_unregister_driver(&fore200e_pca_driver);
#endif
@@ -3142,19 +3147,9 @@ static const struct atmdev_ops fore200e_ops =
};
-#ifdef CONFIG_ATM_FORE200E_PCA
-extern const unsigned char _fore200e_pca_fw_data[];
-extern const unsigned int _fore200e_pca_fw_size;
-#endif
-#ifdef CONFIG_ATM_FORE200E_SBA
-extern const unsigned char _fore200e_sba_fw_data[];
-extern const unsigned int _fore200e_sba_fw_size;
-#endif
-
static const struct fore200e_bus fore200e_bus[] = {
-#ifdef CONFIG_ATM_FORE200E_PCA
+#ifdef CONFIG_PCI
{ "PCA-200E", "pca200e", 32, 4, 32,
- _fore200e_pca_fw_data, &_fore200e_pca_fw_size,
fore200e_pca_read,
fore200e_pca_write,
fore200e_pca_dma_map,
@@ -3175,9 +3170,8 @@ static const struct fore200e_bus fore200e_bus[] = {
fore200e_pca_proc_read,
},
#endif
-#ifdef CONFIG_ATM_FORE200E_SBA
+#ifdef CONFIG_SBUS
{ "SBA-200E", "sba200e", 32, 64, 32,
- _fore200e_sba_fw_data, &_fore200e_sba_fw_size,
fore200e_sba_read,
fore200e_sba_write,
fore200e_sba_dma_map,
diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
index b85a546..73a185d 100644
--- a/drivers/atm/fore200e.h
+++ b/drivers/atm/fore200e.h
@@ -755,7 +755,6 @@ typedef enum fore200e_state {
FORE200E_STATE_CONFIGURE, /* bus interface configured */
FORE200E_STATE_MAP, /* board space mapped in host memory */
FORE200E_STATE_RESET, /* board resetted */
- FORE200E_STATE_LOAD_FW, /* firmware loaded */
FORE200E_STATE_START_FW, /* firmware started */
FORE200E_STATE_INITIALIZE, /* initialize command successful */
FORE200E_STATE_INIT_CMDQ, /* command queue initialized */
@@ -804,8 +803,6 @@ typedef struct fore200e_bus {
int descr_alignment; /* tpd/rpd/rbd DMA alignment requirement */
int buffer_alignment; /* rx buffers DMA alignment requirement */
int status_alignment; /* status words DMA alignment requirement */
- const unsigned char* fw_data; /* address of firmware data start */
- const unsigned int* fw_size; /* address of firmware data size */
u32 (*read)(volatile u32 __iomem *);
void (*write)(u32, volatile u32 __iomem *);
u32 (*dma_map)(struct fore200e*, void*, int, int);
^ permalink raw reply related
* Re: [BUG][AX25] Fwd: SMP with AX.25
From: Jarek Poplawski @ 2008-02-07 19:34 UTC (permalink / raw)
To: netdev; +Cc: Ralf Baechle, Jann Traschewski
In-Reply-To: <20080206074529.GC4496@ff.dom.local>
> ---------- Forwarded message ----------
> From: Jann Traschewski <jann@gmx.de>
> Date: Thu, 7 Feb 2008 06:27:38 +0100
> Subject: FW: smp kernel oops ax25 2008-02-07
> To: Jarek Poplawski <jarkao2@gmail.com>
...
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000065
> printing eip: c02266c7 *pde = 00000000
> Oops: 0000 [#1] SMP
> Modules linked in: netconsole ppp_deflate zlib_deflate zlib_inflate bsd_comp
> ppp_async ppp_generic slhc tun bitrev crc32 mkiss ax25 crc16 iptable_nat
> nf_nat nf_conntrack_ipv4 xt_state nf_conntrack ipt_REJECT iptable_filter
> iptable_mangle xt_MARK ipv6 ipip tunnel4 ide_cd cdrom aic7xxx
> scsi_transport_spi parport_serial parport_pc parport i2c_piix4 genrtc
>
> Pid: 19761, comm: frmaster Not tainted (2.6.24-dg8ngn #1)
> EIP: 0060:[<c02266c7>] EFLAGS: 00010297 CPU: 1
> EIP is at skb_clone+0x3/0x4d
> EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000020
> ESI: 00000008 EDI: 00000000 EBP: c0cfc8ac ESP: d3cfddc4
> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> Process frmaster (pid: 19761, ti=d3cfc000 task=f7fbf570 task.ti=d3cfc000)
> Stack: c0cfc800 f8a0a8f9 c0cfc800 d3cfdf6c 00000007 00000015 c0cfc8cc
> e84492e0
> c0cfc800 d3cfdf64 f6e6fbc0 f8a0e9d8 d3cfde60 00000000 c1d8c340
> d3cfdea0
> c0cfc800 f5d12200 d3cfdf24 c014143d 01e7a9be 00000000 d3cfdf24
> 00000022
> Call Trace:
> [<f8a0a8f9>] ax25_kick+0xaf/0x184 [ax25]
> [<f8a0e9d8>] ax25_sendmsg+0x35f/0x49a [ax25]
> [<c014143d>] __generic_file_aio_write_nolock+0x474/0x4d3
> [<c0221214>] sock_aio_write+0xbc/0xc8
> [<c01414f7>] generic_file_aio_write+0x5b/0xb0
> [<c015a1d3>] do_sync_write+0xc7/0x10a
> [<c022b643>] dev_hard_start_xmit+0x20a/0x26a
> [<c012db6d>] autoremove_wake_function+0x0/0x35
> [<c01253d3>] lock_timer_base+0x19/0x35
> [<c015a960>] vfs_write+0x9e/0x10c
> [<c015aeb7>] sys_write+0x41/0x67
> [<c0103e4e>] syscall_call+0x7/0xb
> =======================
> Code: 24 20 89 7c 24 08 89 44 24 04 03 aa 9c 00 00 00 89 2c 24 e8 cc 67 f9
> ff 89 44 24 54 8b 44 24 54 83 c4 3c 5b 5e 5f 5d c3 53 89 c3 <8a> 40 65 24 18
> 3c 08 75 1f 8d 8b a8 00 00 00 f6 41 65 18 75 13
> EIP: [<c02266c7>] skb_clone+0x3/0x4d SS:ESP 0068:d3cfddc4
> ---[ end trace 504af05b5c529aa1 ]---
^ permalink raw reply
* Re: [BUG][AX25] Fwd: SMP with AX.25
From: Jarek Poplawski @ 2008-02-07 19:35 UTC (permalink / raw)
To: netdev; +Cc: Ralf Baechle, Jann Traschewski
In-Reply-To: <20080206074529.GC4496@ff.dom.local>
Here I resend another OOPS I got from Jann:
On Thu, Feb 07, 2008 at 05:42:42PM +0100, Jann Traschewski wrote:
...
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000065
> printing eip: c02266c7 *pde = 00000000
> Oops: 0000 [#1] SMP
> Modules linked in: netconsole ppp_deflate zlib_deflate zlib_inflate bsd_comp
> ppp_async ppp_generic slhc tun bitrev crc32 mkiss ax25 crc16 iptable_nat
> nf_nat nf_conntrack_ipv4 xt_state nf_conntrack ipt_REJECT iptable_filter
> iptable_mangle xt_MARK ipv6 ipip tunnel4 ide_cd cdrom aic7xxx
> scsi_transport_spi parport_serial parport_pc parport i2c_piix4 genrtc
>
> Pid: 3035, comm: linuxnet Not tainted (2.6.24-dg8ngn #1)
> EIP: 0060:[<c02266c7>] EFLAGS: 00010202 CPU: 0
> EIP is at skb_clone+0x3/0x4d
> EAX: 00000000 EBX: 00000000 ECX: 00000001 EDX: 00000020
> ESI: 00000008 EDI: 00000000 EBP: f700a4ac ESP: f720b9ac
> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> Process linuxnet (pid: 3035, ti=f720a000 task=f7c63570 task.ti=f720a000)
> Stack: f700a400 f8a0a8f9 c01254db 00000000 00000000 f700a400 f700a4cc
> f700a400 __wake_up_common+0x32/0x5c
> __wake_up+0x32/0x42
> [<c0224e67>] sock_def_readable+0x39/0x63
> [<c02251e1>] sock_queue_rcv_skb+0xb6/0xd1
> [<c022b060>] netif_receive_skb+0x309/0x372
> [<c0117f35>] dequeue_entity+0xb/0x2a
> [<c022d42f>] process_backlog+0x5c/0xaa
> [<c022cf21>] net_rx_action+0x8d/0x173
> [<c012213a>] __do_softirq+0x5d/0xc1
> [<c01221d0>] do_softirq+0x32/0x36
> [<c01223df>] local_bh_enable_ip+0x35/0x40
> [<c0261ebe>] udp_poll+0xc1/0xd5
> [<c0220f2c>] sock_poll+0xc/0xe
> [<c016495a>] do_select+0x229/0x3c9
> [<c01650b6>] __pollwait+0x0/0xac
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c0118e73>] default_wake_function+0x0/0x8
> [<c011756c>] __wake_up_common+0x32/0x5c
> [<c011911c>] __wake_up+0x32/0x42
> [<c0164da0>] core_sys_select+0x2a6/0x2c7
> [<c011756c>] __wake_up_common+0x32/0x5c
> [<c011911c>] __wake_up+0x32/0x42
> [<c01d13c2>] tty_wakeup+0x4c/0x50
> [<c01d72c6>] pty_unthrottle+0x12/0x1d
> [<f89fc60e>] mkiss_receive_buf+0x381/0x3af [mkiss]
> sys_select+0xa4/0x187
> syscall_call+0x7/0xb
> Kernel panic - not syncing: Fatal exception in interrupt
^ permalink raw reply
* Re: converting fore200e driver to use request_firmware()
From: Stephen Hemminger @ 2008-02-07 19:43 UTC (permalink / raw)
To: chas williams - CONTRACTOR; +Cc: netdev
In-Reply-To: <200802071920.m17JKJMb029314@cmf.nrl.navy.mil>
On Thu, 07 Feb 2008 14:20:19 -0500
"chas williams - CONTRACTOR" <chas@cmf.nrl.navy.mil> wrote:
> In message <20080206.160542.07994571.davem@davemloft.net>,David Miller writes:
> >> however, i ran into a little problem with the sbus interface. what should
> >> i pass for 'struct device *' for an sbus device?
> >
> >"&sdev->ofdev.dev" should work
>
> thanks! that is what i needed. so what i have works on pci and is
> quite a bit cleaner than the current mess for the firmware. the only
> iffy part is the conversion of the struct fore_200e to a struct device
> which is depends your bus. perhaps it should be a seperate routine.
>
> any comments on the following?
>
> diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig
> index 1c7ae30..a5303ee 100644
> --- a/drivers/atm/Kconfig
> +++ b/drivers/atm/Kconfig
> @@ -325,81 +325,21 @@ config ATM_IA_DEBUG
> speed of the driver, and the size of your syslog files! When
> inactive, they will have only a modest impact on performance.
>
> -config ATM_FORE200E_MAYBE
> +config ATM_FORE200E
> tristate "FORE Systems 200E-series"
> - depends on PCI || SBUS
> + depends on (PCI || SBUS)
> ---help---
> This is a driver for the FORE Systems 200E-series ATM adapter
> cards. It simultaneously supports PCA-200E and SBA-200E models
> on PCI and SBUS hosts. Say Y (or M to compile as a module
> named fore_200e) here if you have one of these ATM adapters.
>
> - Note that the driver will actually be compiled only if you
> - additionally enable the support for PCA-200E and/or SBA-200E
> - cards.
> -
> See the file <file:Documentation/networking/fore200e.txt> for
> further details.
>
Think you now need to select FW_LOADER?
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply
* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Ross Vandegrift @ 2008-02-07 19:44 UTC (permalink / raw)
To: Andi Kleen; +Cc: Glenn Griffin, netdev, linux-kernel
In-Reply-To: <20080206085357.GA1402@one.firstfloor.org>
On Wed, Feb 06, 2008 at 09:53:57AM +0100, Andi Kleen wrote:
> That would be useful yes -- for different bandwidths.
My initial test is end-to-end 1000Mbps, but I've got a few different
packet rates.
> If the young/old heuristics do not work well enough anymore most
> likely we should try readding RED to the syn queue again. That used
> to be pretty effective in the early days. I don't quite remember why
> Linux didn't end up using it in fact.
I'm running juno-z with 2, 4, & 8 threads of syn flood to port 80.
wireshark measures 2 threads at 350pps, 4 threads at 750pps, and 8
threads at 1200pps. Under no SYN flood, the server handles 750 HTTP
requests per second, measured via httping in flood mode.
With a default tcp_max_syn_backlog of 1024, I can trivially prevent
any inbound client connections with 2 threads of syn flood.
Enabling tcp_syncookies brings the connection handling back up to 725
fetches per second.
If I raise the backlog to 16384, 4 threads gives me about 650 legit
requests per sec. Going to 8 threads makes connections very unreliable - a
handful will get through every 15 to 20 seconds. Again,
tcp_syncookies returns performance almost totally back to normal.
Cranking juno-z to the max generates me about 16kpps. Any syn backlog
is easily overwhelmed and nothing gets through. tcp_syncookies gets
me back to 650 requests per second.
At these levels the CPU impact of tcp_syncookies is nothing. I can't
measure a difference. In the real world, a 16kpps syn flood is small.
People with a distributed botnet can easily get to the hundreds of
thousands, and I have seen over million packets per second of SYN flood.
BTW, I can trigger a soft lockup BUG when I restart apache to change the
backlog during the 16kpps test-case:
BUG: soft lockup detected on CPU#1!
[<c044d1ec>] softlockup_tick+0x96/0xa4
[<c042ddb0>] update_process_times+0x39/0x5c
[<c04196f7>] smp_apic_timer_interrupt+0x5b/0x6c
[<c04059bf>] apic_timer_interrupt+0x1f/0x24
[<c045007b>] taskstats_exit_send+0x152/0x371
[<c05c007b>] netlink_kernel_create+0x5/0x11c
[<c05a7415>] reqsk_queue_alloc+0x32/0x81
[<c05a5aca>] lock_sock+0x8e/0x96
[<c05ce8c4>] inet_csk_listen_start+0x17/0x106
[<c05e720f>] inet_listen+0x3c/0x5f
[<c05a3e55>] sys_listen+0x4a/0x66
[<c05a4f4d>] sys_socketcall+0x98/0x19e
[<c0407ef7>] do_syscall_trace+0xab/0xb1
[<c0404eff>] syscall_call+0x7/0xb
=======================
BUG: soft lockup detected on CPU#3!
[<c044d1ec>] softlockup_tick+0x96/0xa4
[<c042ddb0>] update_process_times+0x39/0x5c
[<c04196f7>] smp_apic_timer_interrupt+0x5b/0x6c
[<c04059bf>] apic_timer_interrupt+0x1f/0x24
[<c045007b>] taskstats_exit_send+0x152/0x371
[<c05c007b>] netlink_kernel_create+0x5/0x11c
[<c05a7415>] reqsk_queue_alloc+0x32/0x81
[<c05a5aca>] lock_sock+0x8e/0x96
[<c05ce8c4>] inet_csk_listen_start+0x17/0x106
[<c05e720f>] inet_listen+0x3c/0x5f
[<c05a3e55>] sys_listen+0x4a/0x66
[<c05a4f4d>] sys_socketcall+0x98/0x19e
[<c0407ef7>] do_syscall_trace+0xab/0xb1
[<c0404eff>] syscall_call+0x7/0xb
=======================
--
Ross Vandegrift
ross@kallisti.us
"The good Christian should beware of mathematicians, and all those who
make empty prophecies. The danger already exists that the mathematicians
have made a covenant with the devil to darken the spirit and to confine
man in the bonds of Hell."
--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox