* Re: [PATCH 2/2] [PATCH] ucc_geth: fix for RX skb buffers recycling
From: David Miller @ 2010-06-10 1:02 UTC (permalink / raw)
To: geomatsi; +Cc: netdev, leoli, avorontsov
In-Reply-To: <1275935894-30483-2-git-send-email-geomatsi@gmail.com>
From: Sergey Matyukevich <geomatsi@gmail.com>
Date: Mon, 7 Jun 2010 22:38:14 +0400
> This patch implements a proper recycling of skb buffers belonging to RX error
> path. The suggested fix actually follows the recycling scheme implemented for
> TX skb buffers in the same driver (see 'ucc_geth_tx' function): skb buffers
> are checked by 'skb_recycle_check' function and deleted if can't be recycled.
>
> This problem in recycling of skb buffers was discovered by accident in a setup
> when ethernet interface on one link end was full-duplex while another was
> half-duplex. In this case numerous corrupted frames were received by
> full-duplex interface due to late collisions. RX skb buffers with error
> frames were not properly recycled, that is why overflow occured from time to
> time on the next use of those buffers. Here is example of crush dump:
The lack of skb_recycle_check() is not the true cause of this bug.
You should never, ever, need to make skb_recycle_check() tests on
packets in this situation. Once the skb pointers are properly adjusted
it will have sufficient room.
And that points to what the real problem is, the problem is the
skb->data assignment. It's trying to get the SKB data pointers back
into the same state they are in when dev_alloc_skb() returns a packet
buffer.
But this assignment isn't accomplishing that, in fact it's corrupting
the SKB because after adjusting skb->data, skb->tail and skb->len will
become incorrect. And this is what you need to fix.
That's why you get the skb_put() over panics, not because you lack
a skb_recycle_check() call here.
In fact, what your patch makes happen is that the error packets will
never get recycled. The skb_recycle_check() will always fail.
Please fix this bug properly by correctly restoring the SKB pointers
and lengths to their initial state, then you can retain the
unconditional queueing of the error packet onto the recycle list.
Once you do that, all of the checks done by skb_recycle_check() are
superfluous and will always pass, and we know this. The buffer is
not fragmented, there aren't any clones or external references to it,
and once you fix up the data pointers properly it will have enough
room as necessary for the RX buffer size the driver is currently using.
There are numerous helper routines in linux/skbuff.h that can be used
to do this properly, which will adjust a pointer and make the
corresponding adjustment to skb->len as well when necessary.
^ permalink raw reply
* Re: [PATCH net-next-2.6] [PPPOE] cleanup: remove pppoe_xmit() declaration.
From: David Miller @ 2010-06-10 1:07 UTC (permalink / raw)
To: ramirose; +Cc: netdev
In-Reply-To: <AANLkTim_Jg51_xyfeLD3m4i88TGv8B2SRHFZ-H31w1YK@mail.gmail.com>
From: Rami Rosen <ramirose@gmail.com>
Date: Wed, 9 Jun 2010 08:07:56 +0300
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
Applied, thanks Rami.
^ permalink raw reply
* Re: [PATCH net-next-2.6] ipv6: mcast: RCU conversions
From: David Miller @ 2010-06-10 1:07 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, yoshfuji
In-Reply-To: <1275980702.2775.193.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 08 Jun 2010 09:05:02 +0200
> - ipv6_sock_mc_join() : doesnt touch dev refcount
>
> - ipv6_sock_mc_drop() : doesnt touch dev/idev refcounts
>
> - ip6_mc_find_dev() becomes ip6_mc_find_dev_rcu() (called from rcu),
> and doesnt touch dev/idev refcounts
>
> - ipv6_sock_mc_close() : doesnt touch dev/idev refcounts
>
> - ip6_mc_source() uses ip6_mc_find_dev_rcu()
>
> - ip6_mc_msfilter() uses ip6_mc_find_dev_rcu()
>
> - ip6_mc_msfget() uses ip6_mc_find_dev_rcu()
>
> - ipv6_dev_mc_dec(), ipv6_chk_mcast_addr(),
> igmp6_event_query(), igmp6_event_report(),
> mld_sendpack(), igmp6_send() dont touch idev refcount
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6] icmp: RCU conversion in icmp_address_reply()
From: David Miller @ 2010-06-10 1:07 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1275986075.2475.73.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 08 Jun 2010 10:34:35 +0200
> - rcu_read_lock() already held by caller
> - use __in_dev_get_rcu() instead of in_dev_get() / in_dev_put()
> - remove goto out;
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Interesting issue when using IPv6 autoconf sysctl.
From: Ben Greear @ 2010-06-10 1:09 UTC (permalink / raw)
To: NetDev
I just tried using the /proc/sys/net/ipv6/conf/[dev]/autoconf
feature to run off auto-configured link-local addresses
for one of my interfaces.
It worked like a charm, the address is gone,
and now the /proc/sys/net/ipv6/conf/[dev]
directory does not exist so I can't turn it back on!
I can work around this by forcing an ipv6 address back
onto the interface and then removing it, but that
is pretty crufty!
There has got to be a better way to implement this!
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH net-2.6] ipv6: fix ICMP6_MIB_OUTERRORS
From: David Miller @ 2010-06-10 1:39 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1275985484.2475.59.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 08 Jun 2010 10:24:44 +0200
> In commit 1f8438a85366 (icmp: Account for ICMP out errors), I did a typo
> on IPV6 side, using ICMP6_MIB_OUTMSGS instead of ICMP6_MIB_OUTERRORS
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks Eric.
^ permalink raw reply
* [PATCH net-next-2.6] ip: ip_ra_control() rcu fix
From: Eric Dumazet @ 2010-06-10 2:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100607.212612.35795010.davem@davemloft.net>
Le lundi 07 juin 2010 à 21:26 -0700, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 07 Jun 2010 15:12:08 +0200
>
> > Straightforward conversion to RCU.
> >
> > One rwlock becomes a spinlock, and is static.
> >
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Applied.
Hmm, rcu is tricky, I should re-read all my previous patches :(
Here is a followup on this patch, thanks !
[PATCH net-next-2.6] ip: ip_ra_control() rcu fix
commit 66018506e15b (ip: Router Alert RCU conversion) introduced RCU
lookups to ip_call_ra_chain(). It missed proper deinit phase :
When ip_ra_control() deletes an ip_ra_chain, it should make sure
ip_call_ra_chain() users can not start to use socket during the rcu
grace period. It should also delay the sock_put() after the grace
period, or we risk a premature socket freeing and corruptions, as
raw sockets are not rcu protected yet.
This delay avoids using expensive atomic_inc_not_return() in
ip_call_ra_chain().
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/ip.h | 5 ++++-
net/ipv4/ip_sockglue.c | 19 +++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/include/net/ip.h b/include/net/ip.h
index 9982c97..d52f011 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -61,7 +61,10 @@ struct ipcm_cookie {
struct ip_ra_chain {
struct ip_ra_chain *next;
struct sock *sk;
- void (*destructor)(struct sock *);
+ union {
+ void (*destructor)(struct sock *);
+ struct sock *saved_sk;
+ };
struct rcu_head rcu;
};
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 08b9519..47fff52 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -241,9 +241,13 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc)
struct ip_ra_chain *ip_ra_chain;
static DEFINE_SPINLOCK(ip_ra_lock);
-static void ip_ra_free_rcu(struct rcu_head *head)
+
+static void ip_ra_destroy_rcu(struct rcu_head *head)
{
- kfree(container_of(head, struct ip_ra_chain, rcu));
+ struct ip_ra_chain *ra = container_of(head, struct ip_ra_chain, rcu);
+
+ sock_put(ra->saved_sk);
+ kfree(ra);
}
int ip_ra_control(struct sock *sk, unsigned char on,
@@ -264,13 +268,20 @@ int ip_ra_control(struct sock *sk, unsigned char on,
kfree(new_ra);
return -EADDRINUSE;
}
+ /* dont let ip_call_ra_chain() use sk again */
+ ra->sk = NULL;
rcu_assign_pointer(*rap, ra->next);
spin_unlock_bh(&ip_ra_lock);
if (ra->destructor)
ra->destructor(sk);
- sock_put(sk);
- call_rcu(&ra->rcu, ip_ra_free_rcu);
+ /*
+ * Delay sock_put(sk) and kfree(ra) after one rcu grace
+ * period. This guarantee ip_call_ra_chain() dont need
+ * to mess with socket refcounts.
+ */
+ ra->saved_sk = sk;
+ call_rcu(&ra->rcu, ip_ra_destroy_rcu);
return 0;
}
}
^ permalink raw reply related
* Re: [PATCH net-next-2.6] ip: ip_ra_control() rcu fix
From: Eric Dumazet @ 2010-06-10 2:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1276136109.2475.9.camel@edumazet-laptop>
Le jeudi 10 juin 2010 à 04:15 +0200, Eric Dumazet a écrit :
> [PATCH net-next-2.6] ip: ip_ra_control() rcu fix
>
> commit 66018506e15b (ip: Router Alert RCU conversion) introduced RCU
> lookups to ip_call_ra_chain(). It missed proper deinit phase :
> When ip_ra_control() deletes an ip_ra_chain, it should make sure
> ip_call_ra_chain() users can not start to use socket during the rcu
> grace period. It should also delay the sock_put() after the grace
> period, or we risk a premature socket freeing and corruptions, as
> raw sockets are not rcu protected yet.
>
> This delay avoids using expensive atomic_inc_not_return() in
Grrr... should be atomic_inc_not_zero(), sorry for the typo in
ChangeLog :(
[PATCH net-next-2.6 v2] ip: ip_ra_control() rcu fix
commit 66018506e15b (ip: Router Alert RCU conversion) introduced RCU
lookups to ip_call_ra_chain(). It missed proper deinit phase :
When ip_ra_control() deletes an ip_ra_chain, it should make sure
ip_call_ra_chain() users can not start to use socket during the rcu
grace period. It should also delay the sock_put() after the grace
period, or we risk a premature socket freeing and corruptions, as
raw sockets are not rcu protected yet.
This delay avoids using expensive atomic_inc_not_zero() in
ip_call_ra_chain().
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/ip.h | 5 ++++-
net/ipv4/ip_sockglue.c | 19 +++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/include/net/ip.h b/include/net/ip.h
index 9982c97..d52f011 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -61,7 +61,10 @@ struct ipcm_cookie {
struct ip_ra_chain {
struct ip_ra_chain *next;
struct sock *sk;
- void (*destructor)(struct sock *);
+ union {
+ void (*destructor)(struct sock *);
+ struct sock *saved_sk;
+ };
struct rcu_head rcu;
};
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 08b9519..47fff52 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -241,9 +241,13 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc)
struct ip_ra_chain *ip_ra_chain;
static DEFINE_SPINLOCK(ip_ra_lock);
-static void ip_ra_free_rcu(struct rcu_head *head)
+
+static void ip_ra_destroy_rcu(struct rcu_head *head)
{
- kfree(container_of(head, struct ip_ra_chain, rcu));
+ struct ip_ra_chain *ra = container_of(head, struct ip_ra_chain, rcu);
+
+ sock_put(ra->saved_sk);
+ kfree(ra);
}
int ip_ra_control(struct sock *sk, unsigned char on,
@@ -264,13 +268,20 @@ int ip_ra_control(struct sock *sk, unsigned char on,
kfree(new_ra);
return -EADDRINUSE;
}
+ /* dont let ip_call_ra_chain() use sk again */
+ ra->sk = NULL;
rcu_assign_pointer(*rap, ra->next);
spin_unlock_bh(&ip_ra_lock);
if (ra->destructor)
ra->destructor(sk);
- sock_put(sk);
- call_rcu(&ra->rcu, ip_ra_free_rcu);
+ /*
+ * Delay sock_put(sk) and kfree(ra) after one rcu grace
+ * period. This guarantee ip_call_ra_chain() dont need
+ * to mess with socket refcounts.
+ */
+ ra->saved_sk = sk;
+ call_rcu(&ra->rcu, ip_ra_destroy_rcu);
return 0;
}
}
^ permalink raw reply related
* [PATCH net-next-2.6] econet: fix locking
From: Eric Dumazet @ 2010-06-10 2:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev
econet lacks proper locking. It holds econet_lock only when inserting or
deleting an entry in econet_sklist, not during lookups.
- convert econet_lock from rwlock to spinlock
- use econet_lock in ec_listening_socket() lookup
- use appropriate sock_hold() / sock_put() to avoid corruptions.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/econet/af_econet.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 2a5a805..dc54bd0 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -48,7 +48,7 @@
static const struct proto_ops econet_ops;
static struct hlist_head econet_sklist;
-static DEFINE_RWLOCK(econet_lock);
+static DEFINE_SPINLOCK(econet_lock);
static DEFINE_MUTEX(econet_mutex);
/* Since there are only 256 possible network numbers (or fewer, depends
@@ -98,16 +98,16 @@ struct ec_cb
static void econet_remove_socket(struct hlist_head *list, struct sock *sk)
{
- write_lock_bh(&econet_lock);
+ spin_lock_bh(&econet_lock);
sk_del_node_init(sk);
- write_unlock_bh(&econet_lock);
+ spin_unlock_bh(&econet_lock);
}
static void econet_insert_socket(struct hlist_head *list, struct sock *sk)
{
- write_lock_bh(&econet_lock);
+ spin_lock_bh(&econet_lock);
sk_add_node(sk, list);
- write_unlock_bh(&econet_lock);
+ spin_unlock_bh(&econet_lock);
}
/*
@@ -782,15 +782,19 @@ static struct sock *ec_listening_socket(unsigned char port, unsigned char
struct sock *sk;
struct hlist_node *node;
+ spin_lock(&econet_lock);
sk_for_each(sk, node, &econet_sklist) {
struct econet_sock *opt = ec_sk(sk);
if ((opt->port == port || opt->port == 0) &&
(opt->station == station || opt->station == 0) &&
- (opt->net == net || opt->net == 0))
+ (opt->net == net || opt->net == 0)) {
+ sock_hold(sk);
goto found;
+ }
}
sk = NULL;
found:
+ spin_unlock(&econet_lock);
return sk;
}
@@ -852,7 +856,7 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
{
struct iphdr *ip = ip_hdr(skb);
unsigned char stn = ntohl(ip->saddr) & 0xff;
- struct sock *sk;
+ struct sock *sk = NULL;
struct sk_buff *newskb;
struct ec_device *edev = skb->dev->ec_ptr;
@@ -882,10 +886,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len)
}
aun_send_response(ip->saddr, ah->handle, 3, 0);
+ sock_put(sk);
return;
bad:
aun_send_response(ip->saddr, ah->handle, 4, 0);
+ if (sk)
+ sock_put(sk);
}
/*
@@ -1050,7 +1057,7 @@ release:
static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{
struct ec_framehdr *hdr;
- struct sock *sk;
+ struct sock *sk = NULL;
struct ec_device *edev = dev->ec_ptr;
if (!net_eq(dev_net(dev), &init_net))
@@ -1085,10 +1092,12 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb,
hdr->port))
goto drop;
-
+ sock_put(sk);
return NET_RX_SUCCESS;
drop:
+ if (sk)
+ sock_put(sk);
kfree_skb(skb);
return NET_RX_DROP;
}
^ permalink raw reply related
* Re: [PATCH] gianfar: Revive the driver for eTSEC devices (disable timestamping)
From: Richard Cochran @ 2010-06-10 6:29 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: David Miller, Manfred Rudigier, netdev, linuxppc-dev
In-Reply-To: <20100609193219.GA8629@oksana.dev.rtsoft.ru>
On Wed, Jun 09, 2010 at 11:32:19PM +0400, Anton Vorontsov wrote:
> Since commit cc772ab7cdcaa24d1fae332d92a1602788644f7a ("gianfar: Add
> hardware RX timestamping support"), the driver no longer works on
> at least MPC8313ERDB and MPC8568EMDS boards (and possibly much more
> boards as well).
What do you mean by, "no longer works?" The driver works fine for us,
even without TMR_CTRL[TE] set. We tested the driver on two MPC8313ERDB
REV C boards, one P2020DS, and one P2020RDB.
> That's how MPC8313 Reference Manual describes RCTRL_TS_ENABLE bit:
>
> Timestamp incoming packets as padding bytes. PAL field is set
> to 8 if the PAL field is programmed to less than 8. Must be set
> to zero if TMR_CTRL[TE]=0.
>
> I see that the commit above sets this bit, but it doesn't handle
> TMR_CTRL. Manfred probably had this bit set by the firmware for
> his boards. But obviously this isn't true for all boards in the
> wild.
No, we did not set TMR_CTRL[TE].
For the Rx timestamps, we simply enabled them unconditionally. The
effect of not setting TMR_CTRL[TE] was that the timestamps were
invalid, but that should not matter if user space has not configured
the PTP clock. We left the TMR_CTRL[TE] bit for the PTP clock driver
(recently submitted and discussed on netdev). Actually, I copy the PTP
clock driver to the target via 'scp' during development, and I never
had any trouble.
> Also, I recall that Freescale BSPs were explicitly disabling the
> timestamping because of a performance drop.
The BSPs that we have, for the MPC8313ERDB and the P2020RBD both
include a (hacky) PTP timestmaping driver. Can you be more specific
about where and when Freescale is disabling timestamping?
> For now, the best way to deal with this is just disable the
> timestamping, and later we can discuss proper device tree bindings
> and implement enabling this feature via some property.
Okay, but now we want to identify what exactly works and what not. As
mentioned, we tested this driver on four different boards and did not
see any problems.
Thanks,
Richard
^ permalink raw reply
* Re: Bug#584238: linux-image-2.6.32-3-486: When using USB to Ethernet nework adapter later on get error: blocked for more than 120 seconds
From: Petko Manolov @ 2010-06-10 6:49 UTC (permalink / raw)
To: Paul Chany; +Cc: Ben Hutchings, 584238, Petko Manolov, netdev
In-Reply-To: <87aar4e49d.fsf@debian-laptop.localdomain>
The project ain't dead yet, i has moved into the mainline long time ago.
Petko
On Wed, 9 Jun 2010, Paul Chany wrote:
> Ben Hutchings <ben@decadent.org.uk> writes:
>
>> On Wed, 2010-06-02 at 16:45 +0200, Paul Chany wrote:
>>> Package: linux-2.6
>>> Version: 2.6.32-9
>>> Severity: normal
>>> Tags: squeeze
>>>
>>> When using USB to Ethernet adapter later on get error on console:
>>>
>>> [11531.988248] INOF: task khubd:618 blocked for more than 120 seconds.
>>> [11531.988377] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
>>> message.
>>> [11531.990656] INFO: task pegasus:1156 blocked for more than 120 seconds.
>>> [11531.990722] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
>>> message.
>>>
>>> After that I can't reconfigure anymore network, nor reboot the system with the command:
>>> sudo shutdown -t 1 -r now
>>> because the system hangs forever.
>>>
>>> It is not help if I unplug and plug in again the network adapter, it is not recognised by
>>> the kernel anymore.
>>
>> I'm forwarding this to the pegasus driver developers so they can comment
>> on it.
>>
>> Debian kernel version 2.6.32-9 is closely based on stable kernel
>> 2.6.32.9.
>
> It seems that the developers dont' responds for this bugreport at all.
> Is the pegasus kernel driver a dead project now?
> There in their projectpage: http://pegasus2.sourceforge.net/
> one can see that that pegasus is available
> only for kernels 2.4 and 2.5 but not for 2.6, right?
>
> In the meantime I can to reboot every hour or so because of this buggish
> driver.
>
> --
> Regards,
> Paul Chany
> You can freely correct my English.
> http://csanyi-pal.info
>
^ permalink raw reply
* Re: no reassembly for outgoing packets on RAW socket
From: Jiri Olsa @ 2010-06-10 6:56 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, Netfilter Developer Mailing List
In-Reply-To: <4C0FA24A.7060907@trash.net>
On Wed, Jun 09, 2010 at 04:16:42PM +0200, Patrick McHardy wrote:
> Jiri Olsa wrote:
> > On Fri, Jun 04, 2010 at 02:03:17PM +0200, Patrick McHardy wrote:
> >
> >> Jiri Olsa wrote:
> >>
> >>> hi,
> >>>
> >>> I'd like to be able to sendout a single IP packet with MF flag set.
> >>>
> >>> When using RAW sockets the packet will get stuck in the
> >>> netfilter (NF_INET_LOCAL_OUT nf_defrag_ipv4 reassembly unit)
> >>> and wont ever make it out..
> >>>
> >>> I made a change which bypass the outgoing reassembly for
> >>> RAW sockets, but I'm not sure wether it's too invasive..
> >>>
> >> That would break reassembly (and thus connection tracking) for cases
> >> where its really intended.
> >>
> >>
> >>> Is there any standard for RAW sockets behaviour?
> >>> Or another way around? :)
> >>>
> >> You could use the NOTRACK target to bypass connection tracking.
> >>
> >
> > ok,
> >
> > I tried the NOTRACK target, but the packet is still going
> > throught reassembly, because the RAW filter has lower priority
> > then the connection track defragmentation..
> >
>
> Right.
> > I was able to get it bypassed by attached patch and following
> > command:
> >
> > iptables -v -t raw -A OUTPUT -p icmp -j NOTRACK
> >
> > again, not sure if this is too invasive ;)
> >
>
> Well, we can't change it in the mainline kernel.
> > If this is not the way, I'd appreciatte any hint.. my goal is
> > to put malformed packet on the wire (more frags bit set for a
> > non fragmented packet)
>
> I don't have any good suggestions besides adding a flag to the IPCB
> and skipping defragmentation based on that.
ok,
I can see a way when I set this via setsockopt to the socket,
and check the value before the defragmentation.. would such a new
setsock option be acceptable?
I'm not sure I can see a way via IPCB, AFAICS it's for skb bound flags
which arise during the skb processing.
thanks,
jirka
^ permalink raw reply
* Re: no reassembly for outgoing packets on RAW socket
From: Jiri Olsa @ 2010-06-10 6:57 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Patrick McHardy, netdev, Netfilter Developer Mailing List
In-Reply-To: <alpine.LSU.2.01.1006091719010.30265@obet.zrqbmnf.qr>
On Wed, Jun 09, 2010 at 05:20:37PM +0200, Jan Engelhardt wrote:
>
> On Wednesday 2010-06-09 17:16, Patrick McHardy wrote:
> >Jan Engelhardt wrote:
> >> On Wednesday 2010-06-09 16:16, Patrick McHardy wrote:
> >>>>> You could use the NOTRACK target to bypass connection tracking.
> >>>>>
> >>>> I tried the NOTRACK target, but the packet is still going
> >>>> throught reassembly, because the RAW filter has lower priority
> >>>> then the connection track defragmentation..
> >>>
> >>> Right.
> >>
> >> Blech. That reminds me of
> >> http://marc.info/?l=netfilter-devel&m=126581823826735&w=2
> >
> >We already fixed that.
>
> I know, and I posted it for the understanding of the OP
> as to why RAW is after DEFRAG.
thanks, it's helpful
jirka
^ permalink raw reply
* [patch] enic: cleanup vic_provinfo_alloc()
From: Dan Carpenter @ 2010-06-10 7:59 UTC (permalink / raw)
To: Scott Feldman; +Cc: Vasanthy Kolluri, Roopa Prabhu, netdev, kernel-janitors
If oui were a null variable then vic_provinfo_alloc() would leak memory.
But this function is only called from one place and oui is not null so
I removed the check.
I also moved the memory allocation down a line so it was easier to spot.
(No one ever reads variable declarations).
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/enic/vnic_vic.c b/drivers/net/enic/vnic_vic.c
index d769772..0a35085 100644
--- a/drivers/net/enic/vnic_vic.c
+++ b/drivers/net/enic/vnic_vic.c
@@ -25,9 +25,10 @@
struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type)
{
- struct vic_provinfo *vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
+ struct vic_provinfo *vp;
- if (!vp || !oui)
+ vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
+ if (!vp)
return NULL;
memcpy(vp->oui, oui, sizeof(vp->oui));
^ permalink raw reply related
* Re: [PATCH 1/2] pktgen: increasing transmission granularity
From: Daniel Turull @ 2010-06-10 8:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev, robert, jens.laas
In-Reply-To: <20100609.135040.193710199.davem@davemloft.net>
This patch correct a bug in the delay of pktgen.
It makes sure the inter-packet interval is accurate.
Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
---
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2ad68da..1dacd7b 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2170,7 +2170,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
end_time = ktime_now();
pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
- pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay);
+ pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
}
static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)
^ permalink raw reply related
* Re: [PATCH][RFC] Infrastructure for compact call location representation
From: Nick Piggin @ 2010-06-10 8:47 UTC (permalink / raw)
To: David VomLehn; +Cc: Stephen Hemminger, to, netdev
In-Reply-To: <20100609182244.GC19804@dvomlehn-lnx2.corp.sa.net>
On Wed, Jun 09, 2010 at 11:22:44AM -0700, David VomLehn wrote:
> On Wed, Jun 09, 2010 at 03:44:17AM -0500, Nick Piggin wrote:
> > On Tue, Jun 08, 2010 at 08:44:56AM -0700, Stephen Hemminger wrote:
> > > On Mon, 7 Jun 2010 17:30:52 -0700
> > > David VomLehn <dvomlehn@cisco.com> wrote:
> > > > History
> > > > v2 Support small callsite IDs and split out out-of-band parameter
> > > > parsing.
> > > > V1 Initial release
> > > >
> > > > Signed-off-by: David VomLehn <dvomlehn@cisco.com>
> > >
> > > This is really Linux Kernel Mailing List material (not just netdev). And it will
> > > be a hard sell to get it accepted, because it is basically an alternative call
> > > tracing mechanism, and there are already several of these in use or under development
> > > (see perf and ftrace).
> >
> > What about a generic extension or layer on top of stacktrace that
> > does caching and unique IDs for stack traces. This way you can get
> > callsites or _full_ stack traces if required, and it shouldn't require
> > any extra magic in the net functions.
>
> Since the code calls BUG() when it detects an error, you already get the
> full stack trace of the location where the problem is detected. The question
> is the relative cost and benefits of a full stack trace of the previous
> sk_buff state modification. Since I'm working in a MIPS processor
> environment, I am rather prejudiced against doing any stack trace I don't
> have to; for now, at least, they are *very* expensive on MIPS.
Point is that you could select this depending on whether or not you
want it. If not, then you can just record the current IP.
> The two times this code (or its ancestor) has found problems in a deployed
> software stack, the engineers reported they there were able to immediately
> find and fix the problem. This suggests that we don't need to take on the
> complexity of the stack backtrace, at least for now. If this gets added to
> the mainline and people find they need the extra information, I'd be all
> for it.
I don't think it would get added to mainline with the tracing stuff
as a special hack under net/. I'm not saying it's not useful, but it
should just go into core code.
^ permalink raw reply
* Re: [PATCH 1/2] pktgen: increasing transmission granularity
From: Daniel Turull @ 2010-06-10 8:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev, robert, jens.laas
In-Reply-To: <20100609.135040.193710199.davem@davemloft.net>
This patch increases the granularity of the rate generated by pktgen.
The previous version of pktgen uses micro seconds (udelay) resolution when it
was delayed causing gaps in the rates. It is changed to nanosecond (ndelay).
Now any rate is possible.
Also it allows to set, the desired rate in Mb/s or packets per second.
The documentation has been updated.
Signed-off-by: Daniel Turull <daniel.turull@gmail.com>
---
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index 61bb645..75e4fd7 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -151,6 +151,8 @@ Examples:
pgset stop aborts injection. Also, ^C aborts generator.
+ pgset "rate 300M" set rate to 300 Mb/s
+ pgset "ratep 1000000" set rate to 1Mpps
Example scripts
===============
@@ -241,6 +243,9 @@ src6
flows
flowlen
+rate
+ratep
+
References:
ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/
ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 1dacd7b..6428653 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -169,7 +169,7 @@
#include <asm/dma.h>
#include <asm/div64.h> /* do_div */
-#define VERSION "2.73"
+#define VERSION "2.74"
#define IP_NAME_SZ 32
#define MAX_MPLS_LABELS 16 /* This is the max label stack depth */
#define MPLS_STACK_BOTTOM htonl(0x00000100)
@@ -980,6 +980,40 @@ static ssize_t pktgen_if_write(struct file *file,
(unsigned long long) pkt_dev->delay);
return count;
}
+ if (!strcmp(name, "rate")) {
+ len = num_arg(&user_buffer[i], 10, &value);
+ if (len < 0)
+ return len;
+
+ i += len;
+ if (!value)
+ return len;
+ pkt_dev->delay = pkt_dev->min_pkt_size*8*NSEC_PER_USEC/value;
+ if (debug)
+ printk(KERN_INFO
+ "pktgen: Delay set at: %llu ns\n",
+ pkt_dev->delay);
+
+ sprintf(pg_result, "OK: rate=%lu", value);
+ return count;
+ }
+ if (!strcmp(name, "ratep")) {
+ len = num_arg(&user_buffer[i], 10, &value);
+ if (len < 0)
+ return len;
+
+ i += len;
+ if (!value)
+ return len;
+ pkt_dev->delay = NSEC_PER_SEC/value;
+ if (debug)
+ printk(KERN_INFO
+ "pktgen: Delay set at: %llu ns\n",
+ pkt_dev->delay);
+
+ sprintf(pg_result, "OK: rate=%lu", value);
+ return count;
+ }
if (!strcmp(name, "udp_src_min")) {
len = num_arg(&user_buffer[i], 10, &value);
if (len < 0)
@@ -2142,15 +2176,15 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
hrtimer_set_expires(&t.timer, spin_until);
- remaining = ktime_to_us(hrtimer_expires_remaining(&t.timer));
+ remaining = ktime_to_ns(hrtimer_expires_remaining(&t.timer));
if (remaining <= 0) {
pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
return;
}
start_time = ktime_now();
- if (remaining < 100)
- udelay(remaining); /* really small just spin */
+ if (remaining < 100000)
+ ndelay(remaining); /* really small just spin */
else {
/* see do_nanosleep */
hrtimer_init_sleeper(&t, current);
^ permalink raw reply related
* Re: no reassembly for outgoing packets on RAW socket
From: Patrick McHardy @ 2010-06-10 9:14 UTC (permalink / raw)
To: Jiri Olsa; +Cc: netdev, Netfilter Developer Mailing List
In-Reply-To: <20100610065631.GA1915@jolsa.lab.eng.brq.redhat.com>
Jiri Olsa wrote:
> On Wed, Jun 09, 2010 at 04:16:42PM +0200, Patrick McHardy wrote:
>
>>> If this is not the way, I'd appreciatte any hint.. my goal is
>>> to put malformed packet on the wire (more frags bit set for a
>>> non fragmented packet)
>>>
>> I don't have any good suggestions besides adding a flag to the IPCB
>> and skipping defragmentation based on that.
>>
> ok,
>
> I can see a way when I set this via setsockopt to the socket,
> and check the value before the defragmentation.. would such a new
> setsock option be acceptable?
>
> I'm not sure I can see a way via IPCB, AFAICS it's for skb bound flags
> which arise during the skb processing.
>
Yes, a socket option is basically what I was suggesting, using the
IPCB to mark the packet. But just marking the socket is fine of
course.
^ permalink raw reply
* Re: [patch] enic: cleanup vic_provinfo_alloc()
From: walter harms @ 2010-06-10 9:22 UTC (permalink / raw)
To: Dan Carpenter
Cc: Scott Feldman, Vasanthy Kolluri, Roopa Prabhu, netdev,
kernel-janitors
In-Reply-To: <20100610075903.GL5483@bicker>
Dan Carpenter schrieb:
> If oui were a null variable then vic_provinfo_alloc() would leak memory.
> But this function is only called from one place and oui is not null so
> I removed the check.
>
> I also moved the memory allocation down a line so it was easier to spot.
> (No one ever reads variable declarations).
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/net/enic/vnic_vic.c b/drivers/net/enic/vnic_vic.c
> index d769772..0a35085 100644
> --- a/drivers/net/enic/vnic_vic.c
> +++ b/drivers/net/enic/vnic_vic.c
> @@ -25,9 +25,10 @@
>
> struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type)
> {
> - struct vic_provinfo *vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
> + struct vic_provinfo *vp;
>
> - if (!vp || !oui)
> + vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
> + if (!vp)
> return NULL;
>
> memcpy(vp->oui, oui, sizeof(vp->oui));
> --
This looks like memdup() ?
re,
wh
^ permalink raw reply
* Re: [PATCH] gianfar: Revive the driver for eTSEC devices (disable timestamping)
From: Anton Vorontsov @ 2010-06-10 9:31 UTC (permalink / raw)
To: Richard Cochran; +Cc: linuxppc-dev, netdev, David Miller, Manfred Rudigier
In-Reply-To: <20100610062907.GA3390@riccoc20.at.omicron.at>
[-- Attachment #1: Type: text/plain, Size: 3466 bytes --]
On Thu, Jun 10, 2010 at 08:29:08AM +0200, Richard Cochran wrote:
> On Wed, Jun 09, 2010 at 11:32:19PM +0400, Anton Vorontsov wrote:
> > Since commit cc772ab7cdcaa24d1fae332d92a1602788644f7a ("gianfar: Add
> > hardware RX timestamping support"), the driver no longer works on
> > at least MPC8313ERDB and MPC8568EMDS boards (and possibly much more
> > boards as well).
>
> What do you mean by, "no longer works?" The driver works fine for us,
For me it doesn't even able to receive DHCP answer, boot logs
attached. tcpdump on the host side:
12:56:15.266562 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e0:0c:00:7e:21, length 548
12:56:15.266697 IP 10.0.0.2.67 > 10.0.0.32.68: BOOTP/DHCP, Reply, length 324
12:56:22.106691 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e0:0c:00:7e:21, length 548
12:56:22.106843 IP 10.0.0.2.67 > 10.0.0.32.68: BOOTP/DHCP, Reply, length 324
12:56:33.698908 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e0:0c:00:7e:21, length 548
12:56:33.699083 IP 10.0.0.2.67 > 10.0.0.32.68: BOOTP/DHCP, Reply, length 324
12:56:53.607275 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:e0:0c:00:7e:21, length 548
12:56:53.607430 IP 10.0.0.2.67 > 10.0.0.32.68: BOOTP/DHCP, Reply, length 324
> > That's how MPC8313 Reference Manual describes RCTRL_TS_ENABLE bit:
> >
> > Timestamp incoming packets as padding bytes. PAL field is set
> > to 8 if the PAL field is programmed to less than 8. Must be set
> > to zero if TMR_CTRL[TE]=0.
> >
> > I see that the commit above sets this bit, but it doesn't handle
> > TMR_CTRL. Manfred probably had this bit set by the firmware for
> > his boards. But obviously this isn't true for all boards in the
> > wild.
>
> No, we did not set TMR_CTRL[TE].
So, you deliberately violate the spec and expect it to work
everywhere? :-)
> For the Rx timestamps, we simply enabled them unconditionally. The
> effect of not setting TMR_CTRL[TE] was that the timestamps were
> invalid, but that should not matter if user space has not configured
> the PTP clock.
It seems to matter here, but I haven't tested if enabling the
TE bit actually solves the problem. Disabling timestamping
makes the driver work for sure though.
> > Also, I recall that Freescale BSPs were explicitly disabling the
> > timestamping because of a performance drop.
>
> The BSPs that we have, for the MPC8313ERDB and the P2020RBD both
> include a (hacky) PTP timestmaping driver. Can you be more specific
> about where and when Freescale is disabling timestamping?
Well, bitshrine site no longer allows[1] to list patches at
http://www.bitshrine.org/gpp/ , but there was a patch for sure.
I'll try to find it in a bunch of .iso files that I have on disk
tho.
> > For now, the best way to deal with this is just disable the
> > timestamping, and later we can discuss proper device tree bindings
> > and implement enabling this feature via some property.
>
> Okay, but now we want to identify what exactly works and what not. As
> mentioned, we tested this driver on four different boards and did not
> see any problems.
Sure thing, I would happily test any patches. Or if you need
to dump some register from my board, feel free to send a patch
that adds a bunch of printks and I'll send the output to you.
Thanks,
[1] http://lists.nongnu.org/archive/html/ltib/2010-04/msg00192.html
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
[-- Attachment #2: wk.log --]
[-- Type: text/plain, Size: 8094 bytes --]
U-Boot 1.1.6 (Oct 9 2007 - 20:42:39) MPC83XX
Clock configuration:
Coherent System Bus: 166 MHz
Core: 333 MHz
Local Bus Controller: 166 MHz
Local Bus: 41 MHz
DDR: 333 MHz
SEC: 55 MHz
I2C1: 166 MHz
I2C2: 166 MHz
TSEC1: 166 MHz
TSEC2: 166 MHz
USB MPH: 0 MHz
USB DR: 55 MHz
CPU: MPC8313E, Rev: 10 at 333.333 MHz
Board: Freescale MPC8313ERDB
I2C: ready
DRAM: Initializing
DDR RAM: 128 MB
FLASH: 8 MB
NAND: 32 MiB
In: serial
Out: serial
Err: serial
Net: TSEC0, TSEC1
=>
=>
=> setenv ethact TSEC1 ; setenv ipaddr 10.0.0.99 ; setenv serverip 10.0.0.2 ; setenv bootargs console=ttyS0,115200 ip=on debug ; tftp a00000 uImage ; tftp 900000 dtb ; bootm a00000 - 900000
Waiting for PHY auto negotiation to complete. done
Speed: 100, full duplex
Using TSEC1 device
TFTP from server 10.0.0.2; our IP address is 10.0.0.99
Filename 'uImage'.
Load address: 0xa00000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
##############################
done
Bytes transferred = 1482399 (169e9f hex)
Speed: 100, full duplex
Using TSEC1 device
TFTP from server 10.0.0.2; our IP address is 10.0.0.99
Filename 'dtb'.
Load address: 0x900000
Loading: ####
done
Bytes transferred = 20000 (4e20 hex)
## Booting image at 00a00000 ...
Image Name: Linux-2.6.35-rc2-00059-gf7c3a62
Created: 2010-06-10 8:59:46 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1482335 Bytes = 1.4 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Booting using flat device tree at 0x900000
Using MPC831x RDB machine description
Linux version 2.6.35-rc2-00059-gf7c3a62 (cbou@oksana) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.20.0800760 2008-04-05)) #85 Thu Jun 10 12:59:44 MSD 2010
Found legacy serial port 0 for /soc8313@e0000000/serial@4500
mem=e0004500, taddr=e0004500, irq=0, clk=166666660, speed=0
Found legacy serial port 1 for /soc8313@e0000000/serial@4600
mem=e0004600, taddr=e0004600, irq=0, clk=166666660, speed=0
bootconsole [udbg0] enabled
setup_arch: bootmem
mpc831x_rdb_setup_arch()
arch: exit
Top of RAM: 0x8000000, Total RAM: 0x8000000
Memory hole size: 0MB
Zone PFN ranges:
DMA 0x00000000 -> 0x00008000
Normal empty
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c0302840, node_mem_map c0321000
DMA zone: 256 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 32512 pages, LIFO batch:7
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0,115200 ip=on debug
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126708k/131072k available (2980k kernel code, 4364k reserved, 136k data, 83k bss, 164k init)
Kernel virtual memory layout:
* 0xfffdf000..0xfffff000 : fixmap
* 0xfdffc000..0xfe000000 : early ioremap
* 0xc9000000..0xfdffc000 : vmalloc & ioremap
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:512 nr_irqs:512
IPIC (128 IRQ sources) at c9000700
time_init: decrementer frequency = 41.666665 MHz
time_init: processor frequency = 333.333320 MHz
clocksource: timebase mult[6000004] shift[22] registered
clockevent: decrementer mult[aaaaaa3] shift[32] cpu[0]
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
alloc irq_desc for 38 on node 0
alloc kstat_irqs on node 0
irq: irq 38 on host /soc8313@e0000000/pic@700 mapped to virtual irq 38
Registering ipic with sysfs...
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
alloc irq_desc for 16 on node 0
alloc kstat_irqs on node 0
irq: irq 9 on host /soc8313@e0000000/pic@700 mapped to virtual irq 16
alloc irq_desc for 17 on node 0
alloc kstat_irqs on node 0
irq: irq 10 on host /soc8313@e0000000/pic@700 mapped to virtual irq 17
msgmni has been set to 247
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 17) is a 16550A
brd: module loaded
loop: module loaded
Fixed MDIO Bus: probed
alloc irq_desc for 37 on node 0
alloc kstat_irqs on node 0
irq: irq 37 on host /soc8313@e0000000/pic@700 mapped to virtual irq 37
alloc irq_desc for 36 on node 0
alloc kstat_irqs on node 0
irq: irq 36 on host /soc8313@e0000000/pic@700 mapped to virtual irq 36
alloc irq_desc for 35 on node 0
alloc kstat_irqs on node 0
irq: irq 35 on host /soc8313@e0000000/pic@700 mapped to virtual irq 35
eth0: Gianfar Ethernet Controller Version 1.2, 00:04:9f:ef:23:33
eth0: Running with NAPI enabled
eth0: RX BD ring size for Q[0]: 256
eth0: TX BD ring size for Q[0]: 256
alloc irq_desc for 34 on node 0
alloc kstat_irqs on node 0
irq: irq 34 on host /soc8313@e0000000/pic@700 mapped to virtual irq 34
alloc irq_desc for 33 on node 0
alloc kstat_irqs on node 0
irq: irq 33 on host /soc8313@e0000000/pic@700 mapped to virtual irq 33
alloc irq_desc for 32 on node 0
alloc kstat_irqs on node 0
irq: irq 32 on host /soc8313@e0000000/pic@700 mapped to virtual irq 32
eth1: Gianfar Ethernet Controller Version 1.2, 00:e0:0c:00:7e:21
eth1: Running with NAPI enabled
eth1: RX BD ring size for Q[0]: 256
eth1: TX BD ring size for Q[0]: 256
Freescale PowerQUICC MII Bus: probed
alloc irq_desc for 20 on node 0
alloc kstat_irqs on node 0
irq: irq 20 on host /soc8313@e0000000/pic@700 mapped to virtual irq 20
Freescale PowerQUICC MII Bus: probed
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
TCP cubic registered
NET: Registered protocol family 17
Sending DHCP requests .
PHY: 0:01 - Link is Up - 1000/Full
PHY: mdio@e0024520:04 - Link is Up - 100/Full
., OK
IP-Config: Got DHCP answer from 10.0.0.2, my address is 10.0.0.32
IP-Config: Complete:
device=eth1, addr=10.0.0.32, mask=255.255.255.0, gw=10.0.0.2,
host=10.0.0.32, domain=local.net, nis-domain=(none),
bootserver=10.0.0.2, rootserver=10.0.0.2, rootpath=/opt/montavista/cge/devkit/ppc/83xx/target/
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
Looking up port of RPC 100003/2 on 10.0.0.2
Looking up port of RPC 100005/1 on 10.0.0.2
VFS: Mounted root (nfs filesystem) readonly on device 0:10.
Freeing unused kernel memory: 164k init
[-- Attachment #3: nwk.log --]
[-- Type: text/plain, Size: 7537 bytes --]
U-Boot 1.1.6 (Oct 9 2007 - 20:42:39) MPC83XX
Clock configuration:
Coherent System Bus: 166 MHz
Core: 333 MHz
Local Bus Controller: 166 MHz
Local Bus: 41 MHz
DDR: 333 MHz
SEC: 55 MHz
I2C1: 166 MHz
I2C2: 166 MHz
TSEC1: 166 MHz
TSEC2: 166 MHz
USB MPH: 0 MHz
USB DR: 55 MHz
CPU: MPC8313E, Rev: 10 at 333.333 MHz
Board: Freescale MPC8313ERDB
I2C: ready
DRAM: Initializing
DDR RAM: 128 MB
FLASH: 8 MB
NAND: 32 MiB
In: serial
Out: serial
Err: serial
Net: TSEC0, TSEC1
=>
=>
=> setenv ethact TSEC1 ; setenv ipaddr 10.0.0.99 ; setenv serverip 10.0.0.2 ; setenv bootargs console=ttyS0,115200 ip=on debug ; tftp a00000 uImage ; tftp 900000 dtb ; bootm a00000 - 900000
Waiting for PHY auto negotiation to complete. done
Speed: 100, full duplex
Using TSEC1 device
TFTP from server 10.0.0.2; our IP address is 10.0.0.99
Filename 'uImage'.
Load address: 0xa00000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
##############################
done
Bytes transferred = 1482397 (169e9d hex)
Speed: 100, full duplex
Using TSEC1 device
TFTP from server 10.0.0.2; our IP address is 10.0.0.99
Filename 'dtb'.
Load address: 0x900000
Loading: ####
done
Bytes transferred = 20000 (4e20 hex)
## Booting image at 00a00000 ...
Image Name: Linux-2.6.35-rc2-00058-ge411f2d
Created: 2010-06-10 8:52:33 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1482333 Bytes = 1.4 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Booting using flat device tree at 0x900000
Using MPC831x RDB machine description
Linux version 2.6.35-rc2-00058-ge411f2d (cbou@oksana) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.20.0800760 2008-04-05)) #84 Thu Jun 10 12:52:32 MSD 2010
Found legacy serial port 0 for /soc8313@e0000000/serial@4500
mem=e0004500, taddr=e0004500, irq=0, clk=166666660, speed=0
Found legacy serial port 1 for /soc8313@e0000000/serial@4600
mem=e0004600, taddr=e0004600, irq=0, clk=166666660, speed=0
bootconsole [udbg0] enabled
setup_arch: bootmem
mpc831x_rdb_setup_arch()
arch: exit
Top of RAM: 0x8000000, Total RAM: 0x8000000
Memory hole size: 0MB
Zone PFN ranges:
DMA 0x00000000 -> 0x00008000
Normal empty
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c0302840, node_mem_map c0321000
DMA zone: 256 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 32512 pages, LIFO batch:7
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0,115200 ip=on debug
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126708k/131072k available (2980k kernel code, 4364k reserved, 136k data, 83k bss, 164k init)
Kernel virtual memory layout:
* 0xfffdf000..0xfffff000 : fixmap
* 0xfdffc000..0xfe000000 : early ioremap
* 0xc9000000..0xfdffc000 : vmalloc & ioremap
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:512 nr_irqs:512
IPIC (128 IRQ sources) at c9000700
time_init: decrementer frequency = 41.666665 MHz
time_init: processor frequency = 333.333320 MHz
clocksource: timebase mult[6000004] shift[22] registered
clockevent: decrementer mult[aaaaaa3] shift[32] cpu[0]
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
alloc irq_desc for 38 on node 0
alloc kstat_irqs on node 0
irq: irq 38 on host /soc8313@e0000000/pic@700 mapped to virtual irq 38
Registering ipic with sysfs...
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
alloc irq_desc for 16 on node 0
alloc kstat_irqs on node 0
irq: irq 9 on host /soc8313@e0000000/pic@700 mapped to virtual irq 16
alloc irq_desc for 17 on node 0
alloc kstat_irqs on node 0
irq: irq 10 on host /soc8313@e0000000/pic@700 mapped to virtual irq 17
msgmni has been set to 247
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 17) is a 16550A
brd: module loaded
loop: module loaded
Fixed MDIO Bus: probed
alloc irq_desc for 37 on node 0
alloc kstat_irqs on node 0
irq: irq 37 on host /soc8313@e0000000/pic@700 mapped to virtual irq 37
alloc irq_desc for 36 on node 0
alloc kstat_irqs on node 0
irq: irq 36 on host /soc8313@e0000000/pic@700 mapped to virtual irq 36
alloc irq_desc for 35 on node 0
alloc kstat_irqs on node 0
irq: irq 35 on host /soc8313@e0000000/pic@700 mapped to virtual irq 35
eth0: Gianfar Ethernet Controller Version 1.2, 00:04:9f:ef:23:33
eth0: Running with NAPI enabled
eth0: RX BD ring size for Q[0]: 256
eth0: TX BD ring size for Q[0]: 256
alloc irq_desc for 34 on node 0
alloc kstat_irqs on node 0
irq: irq 34 on host /soc8313@e0000000/pic@700 mapped to virtual irq 34
alloc irq_desc for 33 on node 0
alloc kstat_irqs on node 0
irq: irq 33 on host /soc8313@e0000000/pic@700 mapped to virtual irq 33
alloc irq_desc for 32 on node 0
alloc kstat_irqs on node 0
irq: irq 32 on host /soc8313@e0000000/pic@700 mapped to virtual irq 32
eth1: Gianfar Ethernet Controller Version 1.2, 00:e0:0c:00:7e:21
eth1: Running with NAPI enabled
eth1: RX BD ring size for Q[0]: 256
eth1: TX BD ring size for Q[0]: 256
Freescale PowerQUICC MII Bus: probed
alloc irq_desc for 20 on node 0
alloc kstat_irqs on node 0
irq: irq 20 on host /soc8313@e0000000/pic@700 mapped to virtual irq 20
Freescale PowerQUICC MII Bus: probed
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
TCP cubic registered
NET: Registered protocol family 17
Sending DHCP requests .
PHY: 0:01 - Link is Up - 1000/Full
PHY: mdio@e0024520:04 - Link is Up - 100/Full
..... timed out!
IP-Config: Reopening network devices...
Sending DHCP requests .
PHY: 0:01 - Link is Up - 1000/Full
PHY: mdio@e0024520:04 - Link is Up - 100/Full
.
[-- Attachment #4: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [patch] enic: cleanup vic_provinfo_alloc()
From: Dan Carpenter @ 2010-06-10 9:32 UTC (permalink / raw)
To: walter harms
Cc: Scott Feldman, Vasanthy Kolluri, Roopa Prabhu, netdev,
kernel-janitors
In-Reply-To: <4C10AEE9.4090804@bfs.de>
On Thu, Jun 10, 2010 at 11:22:49AM +0200, walter harms wrote:
> > + vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags);
> > + if (!vp)
> > return NULL;
> >
> > memcpy(vp->oui, oui, sizeof(vp->oui));
> > --
>
>
> This looks like memdup() ?
>
No. VIC_PROVINFO_MAX_DATA is larger than sizeof(vp->oui).
regards,
dan carpenter
> re,
> wh
^ permalink raw reply
* Re: [PATCH v3] netdev:bfin_mac: reclaim and free tx skb as soon as possible after transfer
From: Sonic Zhang @ 2010-06-10 9:44 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b
In-Reply-To: <20100607.212238.209978119.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Tue, Jun 8, 2010 at 12:22 PM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: sonic zhang <sonic.adi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Mon, 7 Jun 2010 18:38:24 +0800
>
>>
>> + if (timer_pending(&lp->tx_reclaim_timer))
>> + del_timer(&(lp->tx_reclaim_timer));
>> +
>
> Please remove the excess parenthesis around lp->tx_reclaim_timer being
> passed to del_timer().
>
> Also, you can unconditionally call del_timer(). If the timer isn't running
> the call won't do anything.
OK
>
> But you have to do something to make sure you don't race with the code that
> enables the timer, f.e. what keeps the timer from being scheduled right
> after you make this del_timer() call?
>
Sorry, I don't understand. If the timer is removed from the timer base
list, how can it be scheduled? Timeout callbacks are scheduled only
in __run_timers() in soft irq handler. Timer base list is protected
by a spinlock. After a timer is removed from the list, __run_timers()
won't triggers it any more.
Does I miss something here?
Thanks
Sonic
^ permalink raw reply
* Re: no reassembly for outgoing packets on RAW socket
From: Jiri Olsa @ 2010-06-10 9:53 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netdev, Netfilter Developer Mailing List
In-Reply-To: <4C10ACDC.6010108@trash.net>
On Thu, Jun 10, 2010 at 11:14:04AM +0200, Patrick McHardy wrote:
> Jiri Olsa wrote:
> > On Wed, Jun 09, 2010 at 04:16:42PM +0200, Patrick McHardy wrote:
> >
> >>> If this is not the way, I'd appreciatte any hint.. my goal is
> >>> to put malformed packet on the wire (more frags bit set for a
> >>> non fragmented packet)
> >>>
> >> I don't have any good suggestions besides adding a flag to the IPCB
> >> and skipping defragmentation based on that.
> >>
> > ok,
> >
> > I can see a way when I set this via setsockopt to the socket,
> > and check the value before the defragmentation.. would such a new
> > setsock option be acceptable?
> >
> > I'm not sure I can see a way via IPCB, AFAICS it's for skb bound flags
> > which arise during the skb processing.
> >
>
> Yes, a socket option is basically what I was suggesting, using the
> IPCB to mark the packet. But just marking the socket is fine of
> course.
>
>
one last thought before the socket option.. :)
there's IP_HDRINCL option which is enabled for RAW sockets
(can be disabled later by setsockopt)
The 'man 7 ip' says:
"the user supplies an IP header in front of the user data"
but does not mention the outgoing defragmentation.
It kind of looks to me more appropriate to preserve the user suplied
IP header.. moreover if there's a way to switch this off and have
netfilter defragmentation + connection tracking for RAW socket.
please check the following patch..
(there's no special need for the IPSKB_NODEFRAG, it could check the
socket->hdrincl flag directly..)
thoughts?
thanks,
jirka
---
diff --git a/include/net/ip.h b/include/net/ip.h
index 452f229..201a17e 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -42,6 +42,7 @@ struct inet_skb_parm {
#define IPSKB_XFRM_TRANSFORMED 4
#define IPSKB_FRAG_COMPLETE 8
#define IPSKB_REROUTED 16
+#define IPSKB_NODEFRAG 32
};
static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c
index cb763ae..0355bea 100644
--- a/net/ipv4/netfilter/nf_defrag_ipv4.c
+++ b/net/ipv4/netfilter/nf_defrag_ipv4.c
@@ -74,6 +74,9 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,
return NF_ACCEPT;
#endif
#endif
+ if (IPCB(skb)->flags & IPSKB_NODEFRAG)
+ return NF_ACCEPT;
+
/* Gather fragments. */
if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
enum ip_defrag_users user = nf_ct_defrag_user(hooknum, skb);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2c7a163..978e813 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -354,6 +354,13 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
if (memcpy_fromiovecend((void *)iph, from, 0, length))
goto error_free;
+ /*
+ * The header is created by user, preserve the fragments
+ * settings throught the defragmentation unit.
+ */
+ if (iph->frag_off & htons(IP_MF|IP_OFFSET))
+ IPCB(skb)->flags |= IPSKB_NODEFRAG;
+
iphlen = iph->ihl * 4;
/*
^ permalink raw reply related
* Re: no reassembly for outgoing packets on RAW socket
From: Patrick McHardy @ 2010-06-10 10:04 UTC (permalink / raw)
To: Jiri Olsa; +Cc: netdev, Netfilter Developer Mailing List
In-Reply-To: <20100610095312.GC1915@jolsa.lab.eng.brq.redhat.com>
Jiri Olsa wrote:
> On Thu, Jun 10, 2010 at 11:14:04AM +0200, Patrick McHardy wrote:
>
>> Jiri Olsa wrote:
>>
>>> On Wed, Jun 09, 2010 at 04:16:42PM +0200, Patrick McHardy wrote:
>>>
>>>
>>>>> If this is not the way, I'd appreciatte any hint.. my goal is
>>>>> to put malformed packet on the wire (more frags bit set for a
>>>>> non fragmented packet)
>>>>>
>>>>>
>>>> I don't have any good suggestions besides adding a flag to the IPCB
>>>> and skipping defragmentation based on that.
>>>>
>>>>
>>> ok,
>>>
>>> I can see a way when I set this via setsockopt to the socket,
>>> and check the value before the defragmentation.. would such a new
>>> setsock option be acceptable?
>>>
>>> I'm not sure I can see a way via IPCB, AFAICS it's for skb bound flags
>>> which arise during the skb processing.
>>>
>>>
>> Yes, a socket option is basically what I was suggesting, using the
>> IPCB to mark the packet. But just marking the socket is fine of
>> course.
>>
>>
>>
>
> one last thought before the socket option.. :)
>
> there's IP_HDRINCL option which is enabled for RAW sockets
> (can be disabled later by setsockopt)
>
> The 'man 7 ip' says:
> "the user supplies an IP header in front of the user data"
>
> but does not mention the outgoing defragmentation.
>
> It kind of looks to me more appropriate to preserve the user suplied
> IP header.. moreover if there's a way to switch this off and have
> netfilter defragmentation + connection tracking for RAW socket.
>
> please check the following patch..
> (there's no special need for the IPSKB_NODEFRAG, it could check the
> socket->hdrincl flag directly..)
>
> thoughts?
My main concern is that users might expect netfilter to properly
track fragmented packets created using IP_HDRINCL.
^ permalink raw reply
* Re: [PATCH v3] netfilter: Xtables: idletimer target implementation
From: Patrick McHardy @ 2010-06-10 10:07 UTC (permalink / raw)
To: Luciano Coelho
Cc: ext Jan Engelhardt, netfilter-devel@vger.kernel.org,
netdev@vger.kernel.org, Timo Teras
In-Reply-To: <1276108939.11199.23.camel@powerslave>
Luciano Coelho wrote:
> On Wed, 2010-06-09 at 19:48 +0200, Coelho Luciano (Nokia-D/Helsinki)
> wrote:
>
>> On Wed, 2010-06-09 at 17:18 +0200, ext Jan Engelhardt wrote:
>>
>>>>>> + timer = __idletimer_tg_find_by_label(info->label);
>>>>>> + if (!timer) {
>>>>>> + spin_unlock(&list_lock);
>>>>>> + timer = idletimer_tg_create(info);
>>>>>>
>>>>>>
>>>>> How does this prevent creating the same timer twice?
>>>>>
>>>> The timer will only be created if __idletimer_tg_find_by_label() returns
>>>> NULL, which means that no timer with that label has been found. "info"
>>>> won't be the same if info->label is different, right? Or can it change
>>>> on the fly?
>>>>
>>> One thing to be generally aware about is that things could potentially
>>> be instantiated by another entity between the time a label was looked up
>>> with negative result and the time one tries to add it.
>>> It may thus be required to extend keeping the lock until after
>>> idletimer_tg_create, in other words, lookup and create must be atomic
>>> to the rest of the world.
>>>
>> Ahh, sure! I missed the actual point of Patrick's question. I had the
>> idletimer_tg_create() inside the lock, but when I added the
>> sysfs_create_file() there (which can sleep), I screwed up with the
>> locking.
>>
>> I'll move the sysfs file creation to outside that function so I can keep
>> the lock until after the timer is added to the list. Thanks for
>> clarifying!
>>
>
> Hmmm... after struggling with this for a while, I think it's not really
> possible to simply create the sysfs file outside of the lock, because if
> the sysfs creation fails, we will again risk a race condition.
>
> I think the only way is to delay the sysfs file creation and do it in a
> workqueue.
>
Why don't you simply use a mutex instead of the spinlock? It would be better
to only do the lookup once and store the timer pointer in the target
structure
anyways.
^ 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