* Re: ixgbe question
From: Eric Dumazet @ 2009-11-30 13:02 UTC (permalink / raw)
To: David Miller
Cc: john.r.fastabend, peter.p.waskiewicz.jr, robert, hawk, netdev
In-Reply-To: <20091129.001856.236847721.davem@davemloft.net>
David Miller a écrit :
> From: John Fastabend <john.r.fastabend@intel.com>
> Date: Tue, 24 Nov 2009 13:14:12 +0000
>
>> Believe the below patch will break DCB and FCoE though, both features
>> have the potential to set real_num_tx_queues to greater then the
>> number of CPUs. This could result in real_num_tx_queues >
>> num_tx_queues.
>>
>> The current solution isn't that great though, maybe we should set to
>> the minimum of MAX_TX_QUEUES and num_possible_cpus() * 2 + 8.
>>
>> That should cover the maximum possible queues for DCB, FCoE and their
>> combinations.
>>
>> general multiq = num_possible_cpus()
>> DCB = 8 tx queue's
>> FCoE = 2*num_possible_cpus()
>> FCoE + DCB = 8 tx queues + num_possible_cpus
>
> Eric, I'm tossing your patch because of this problem, just FYI.
Sure, I guess we need a more generic way to handle this.
^ permalink raw reply
* Re: [linux-pm] intermittent suspend problem again
From: Ferenc Wagner @ 2009-11-29 10:12 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-pm, Andrew Morton, LKML, linux-netdev
In-Reply-To: <200911290129.25505.rjw@sisk.pl>
"Rafael J. Wysocki" <rjw@sisk.pl> writes:
> On Saturday 28 November 2009, Ferenc Wagner wrote:
>> "Rafael J. Wysocki" <rjw@sisk.pl> writes:
>>
>>> On Wednesday 18 November 2009, Ferenc Wagner wrote:
>>>
>>>> Ferenc Wagner <wferi@niif.hu> writes:
>>>>
>>>>> Since I've instrumented s2disk and the hibernation path, no freeze
>>>>> happened during hibernating the machine.
>>>>
>>>> Not until I removed the delays from hibernation_platform_enter(), which
>>>> were put there previously to get step-by-step feedback. Removing them
>>>> again resulted in a freeze in short course, maybe just two hibernations
>>>> later. The instrumentation shows it stuck in dpm_suspend_start(PMSG_HIBERNATE).
>>>> Does it mean that some device driver is at fault?
>>>
>>> A driver or one of the platform hooks.
>>>
>>>> I'll check if it always fails at the same point (although tracing into
>>>> dpm_suspend_start isn't pure fun because of the multitude of devices it
>>>> loops over). Is there any way to get printk output from that phase?
>>>
>>> Compile with CONFIG_PM_VERBOSE (it does mean exactly that).
>>
>> The last message now was:
>>
>> e100: 0000:02:08.0: hibernate, may wakeup
>>
>> Looks like hibernating the e100 driver is unstable.
>
> Can you verify that by trying to hibernate without the e100 driver?
Not really, as I still can't reliable reproduce the issue. Since I'm
running with suspend loglevel = 8, it's happened only twice (in a row),
with seemingly exact same console output. Some earlier freezes also
happened in dpm_suspend_start, at least. However, I can certainly add
e100 to SUSPEND_MODULES under /etc/pm/config.d, and continue running
with that. Or I can try stress-testing the module, but not sure, how.
Interestingly, git log v2.6.31.. -- e100.c is tiny, but 8fbd962e affects
the suspend/resume routines through e100_up. This could explain the
timing-sensitive nature of the issue. I took the liberty to change the
Cc list, maybe linux-netdev can lend us a hand.
--
Regards,
Feri.
^ permalink raw reply
* Re: dmfe/tulip device id overlap
From: Ben Hutchings @ 2009-11-30 12:46 UTC (permalink / raw)
To: David Miller; +Cc: brandon, grundler, tobias, kyle, netdev, grundler
In-Reply-To: <20091129.230703.206229796.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
On Sun, 2009-11-29 at 23:07 -0800, David Miller wrote:
> From: Brandon Philips <brandon@ifup.org>
> Date: Sun, 29 Nov 2009 22:55:12 -0800
>
> > Thus, the patch only lets tulip handle 0x9100 and 0x9102 if __sparc__.
> >
> > Perhaps someone knows if there is a way to tell the PCI card from the
> > sparc builtin machine?
>
> We should get both cases working in one of the two drivers,
> preferrably Tulip.
>
> That's the outcome I'm trying to say is the only legitimate one.
If the problem is that the drivers are not portable, then this makes
sense. However, as I understand it, the problem is that the same device
ids have been assigned to significantly different controllers/boards.
In this case it may be better for both of the drivers to claim the
device ids and to distinguish them at probe time.
Ben.
--
Ben Hutchings
Quantity is no substitute for quality, but it's the only one we've got.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [tproxy,regression] tproxy broken in 2.6.32
From: KOVACS Krisztian @ 2009-11-30 12:45 UTC (permalink / raw)
To: hadi; +Cc: KOVACS Krisztian, Patrick McHardy, Andreas Schultz, tproxy,
netdev
In-Reply-To: <1259583359.873.17.camel@bigi>
Hi,
On Mon, 2009-11-30 at 07:15 -0500, jamal wrote:
> On Sun, 2009-11-29 at 21:35 +0100, KOVACS Krisztian wrote:
>
> > The story is that we really do want to deliver these packets locally, as
> > if the destination IP address was locally configured on the host. The only
> > way I know of to get the packet to ip_local_deliver() is by using a local
> > route.
>
> Aha, now i understand where both you and Patrick are coming from. So
> you literally have to hit the main(or default) table in the reverse
> source validation. How does the workaround (that you suggested) work
> then? i.e you are going to fail the RTN_UNICAST test no matter what.
No, because by narrowing the rule to specific ingress interfaces the
lookup done in fib_validate_source() won't match the rule(s) (because
the flow used will have iif set to the loopback device), and thus it
will look up the main table and select a unicast route.
> Dave, give me some short time to mull this over. I am not sure i like
> the sysctl approach - we may have to just revert the whole thing
> instead.
I don't think it would be unreasonable to add a sysctl but disable the
feature by default. It's up to you, of course.
Cheers,
Krisztian
^ permalink raw reply
* Re: [PATCH 0/20] Batch network namespace cleanup
From: jamal @ 2009-11-30 12:44 UTC (permalink / raw)
To: Eric W. Biederman
Cc: David Miller, netdev, Daniel Lezcano, Alexey Dobriyan,
Patrick McHardy
In-Reply-To: <m1ljhodbtw.fsf@fess.ebiederm.org>
On Sun, 2009-11-29 at 17:46 -0800, Eric W. Biederman wrote:
>
> Recently Jamal and Daniel perform some experiments and found that
> large numbers of network namespace exiting simultaneously is very
> inefficient. 24+ minutes in some configurations. The cpu overhead
> was negligible but it results in long hold times of net_mutex, and
> memory being consumed a long time after the last user has gone away.
>
> I looked into it and discovered that by batching network namespace
> cleanups I can reduce the time for 4k network namespaces exiting from
> 5-7 minutes in my configuration to 44 seconds.
Excellent work Eric. I have time today so i can test these patches
status quo vs.
This is against net-next?
cheers,
jamal
^ permalink raw reply
* Re: [ethtool PATCH] ethtool: Add Direct Attach to the available connector ports
From: Ben Hutchings @ 2009-11-30 12:35 UTC (permalink / raw)
To: Jeff Garzik
Cc: David Miller, jeffrey.t.kirsher, shemminger, netdev, gospo,
peter.p.waskiewicz.jr, Aníbal Monsalve Salazar
In-Reply-To: <4B125014.9080507@garzik.org>
[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]
On Sun, 2009-11-29 at 05:42 -0500, Jeff Garzik wrote:
[...]
> I've been trying to think of what would be a good versioning scheme for
> ethtool. Even though it is [essentially] a user-friendly kernel
> interface, its releases have never really been closely synchronized with
> the kernel releases. And unlike a lot of other software, ethtool is so
> simple it does not really go through any release-candidate or beta period.
>
> The current scheme just increments a release number: 5->6, 6->7, etc.
> But with so few kernel releases (and thus ethtool releases), I was
> leaning towards either yearly release naming ("ethtool-2009"), kernel
> release naming ("ethtool-2.6.33"), or the release scheme proposed for
> glibc: snapshot directly from the git repository.
>
> If people want one, I could do a release right now. Or, we could move
> to an alternate scheme like git snapshots. I think git snapshots are
> viable because ethtool has historically had next to zero bugs in the
> actual userland utility. Fedora already imports git snapshots, for example.
So does Debian. But this is because we need to include the new
features, not because we like using snapshots.
> Preferences?
I think it should be based on kernel versions, so that it's clear
whether a given ethtool version supports the features introduced in a
given kernel version.
Ben.
--
Ben Hutchings
Quantity is no substitute for quality, but it's the only one we've got.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH] b44.c box lockup fix (netconsole): ratelimit NAPI poll error message
From: Andreas Mohr @ 2009-11-30 12:17 UTC (permalink / raw)
To: David Miller; +Cc: zambrano, dave, mb, netdev, linux-kernel
In-Reply-To: <20091130.001541.134590904.davem@davemloft.net>
Hi,
now managed to see the replies, thanks for the notification Michael!
(I'm afraid our SMTP trap won't get lifted since it's probably
justified given the SPAM situation).
> The patch below is what I'll check in to fix this, thanks.
Seems fine.
> I'll queue this b44 patch up for -stable too.
Dito.
Thank you very much,
Andreas Mohr
^ permalink raw reply
* Re: [tproxy,regression] tproxy broken in 2.6.32
From: jamal @ 2009-11-30 12:15 UTC (permalink / raw)
To: KOVACS Krisztian
Cc: Patrick McHardy, KOVACS Krisztian, Andreas Schultz, tproxy,
netdev
In-Reply-To: <20091129203508.GB18259@sch.bme.hu>
On Sun, 2009-11-29 at 21:35 +0100, KOVACS Krisztian wrote:
> The story is that we really do want to deliver these packets locally, as
> if the destination IP address was locally configured on the host. The only
> way I know of to get the packet to ip_local_deliver() is by using a local
> route.
Aha, now i understand where both you and Patrick are coming from. So
you literally have to hit the main(or default) table in the reverse
source validation. How does the workaround (that you suggested) work
then? i.e you are going to fail the RTN_UNICAST test no matter what.
Dave, give me some short time to mull this over. I am not sure i like
the sysctl approach - we may have to just revert the whole thing
instead.
cheers,
jamal
^ permalink raw reply
* Re: [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH
From: Octavian Purdila @ 2009-11-30 12:08 UTC (permalink / raw)
To: Eric W. Biederman
Cc: David Miller, netdev, jamal, Daniel Lezcano, Alexey Dobriyan,
Patrick McHardy
In-Reply-To: <1259545577-7466-1-git-send-email-ebiederm@xmission.com>
On Monday 30 November 2009 03:45:58 you wrote:
> + /* Process any work delayed until the end of the batch */
> + dev = list_entry(head->next, struct net_device, unreg_list);
> + call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev);
>
> - list_for_each_entry_safe(dev, aux, head, unreg_list) {
> - int new_net = 1;
> - list_for_each_entry(fdev, &pernet_list, unreg_list) {
> - if (net_eq(dev_net(dev), dev_net(fdev))) {
> - new_net = 0;
> - dev_put(dev);
> - break;
> - }
> - }
> - if (new_net)
> - list_move(&dev->unreg_list, &pernet_list);
> - }
>
This implies that the devices we want to batch unregister needs to be part of
the same namespace. It might be worth mentioning that in the
unregister_netdevice_many() function comments.
And, fortunately, it seems that all of the current batch unregister users
comply with this requirement.
^ permalink raw reply
* Re: [Bugme-new] [Bug 14685] New: 2.6.30 -> 2.6.31: very high number of RX dropped in bnx2
From: Michael Chan @ 2009-11-30 11:33 UTC (permalink / raw)
To: 'Andrew Morton', netdev@vger.kernel.org
Cc: bugzilla-daemon@bugzilla.kernel.org,
bugme-daemon@bugzilla.kernel.org, olel@ans.pl
In-Reply-To: <20091125124713.f7ac10e4.akpm@linux-foundation.org>
Andrew Morton wrote:
> > # uptime ; ifconfig eth0|grep "RX p"; ethtool -S eth0|grep disc
> > 01:07:31 up 6 min, 1 user, load average: 0.00, 0.07, 0.04
> > RX packets:2234 errors:0 dropped:527 overruns:0 frame:0
> > rx_discards: 0
> > rx_fw_discards: 527
> >
Please report rx_bcast_packets and rx_mcast_packets together with
rx_fw_discards. Thanks.
^ permalink raw reply
* Re: [PATCH] sch_htb: ix the deficit overflows
From: Jarek Poplawski @ 2009-11-30 11:10 UTC (permalink / raw)
To: Changli Gao; +Cc: Jamal Hadi Salim, David S. Miller, netdev, Martin Devera
In-Reply-To: <412e6f7f0911292026w704a70b8yc3af2c2473e05d34@mail.gmail.com>
On Mon, Nov 30, 2009 at 12:26:33PM +0800, Changli Gao wrote:
> On Sat, Nov 28, 2009 at 8:04 AM, Jarek Poplawski <jarkao2@gmail.com> wrote:
> > Changli Gao wrote, On 11/27/2009 09:14 AM:
> >
> >
> > This case of the quantum smaller than the packet size should be treated
> > as a broken config, so I don't think it's worth to do such a deep change
> > with additional delays and cpu cycles for all to fix it. A warning or
> > lower limit should be enough (if necessary at all).
> >
>
> I don't think this change is deep. HTB has it own lower limit for
> quantum 1000, but the MTU is various, and maybe larger than that.
Users can control this with "r2q" and "quantum", and there is a hint
on quantum size in the user's guide.
> And
> if we use IMQ to shape traffic, the skb will be defragmented by
> conntrack, and its size will be larger than MTU.
IMQ is a very nice thing, but it's considered broken as well, so it
can't be the reason for changing HTB.
>
> The previous patch indeed introduces some additional CPU cycles.
> Review the new patch bellow please:
And this patch is very similar, except ->peek()/dequeue(). Additional
lookups are done instead of dequeuing the first found class, which
might be quite long in some cases.
>
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 2e38d1a..d55382b 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -815,6 +815,17 @@ next:
> goto next;
> }
>
> + if (unlikely(cl->un.leaf.deficit[level] < 0)) {
> + cl->un.leaf.deficit[level] += cl->quantum;
> + htb_next_rb_node((level ? cl->parent->un.inner.ptr :
> + q->ptr[0]) + prio);
> + cl = htb_lookup_leaf(q->row[level] + prio, prio,
> + q->ptr[level] + prio,
> + q->last_ptr_id[level] + prio);
> + start = cl;
> + goto next;
> + }
> +
> skb = cl->un.leaf.q->dequeue(cl->un.leaf.q);
> if (likely(skb != NULL))
> break;
>
> If you think it is acceptable, I'll resubmit it for inclusion.
It's not acceptable to me mainly because the real change done by this
patch is different than you describe: preventing an overflow might be
simple. You change the way DRR is implemented here, and even if it's
right, it should be written explicitly and proved with tests results.
Anyway, I think you should rather care for the author's acceptance,
because the way it's done doesn't look like accidental and has been
heavily tested btw. (I added Martin to CC.)
Regards,
Jarek P.
PS: Btw, this newer version of the patch is broken with spaces.
^ permalink raw reply
* Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
From: Michael Chan @ 2009-11-30 11:02 UTC (permalink / raw)
To: 'Eric Dumazet'; +Cc: leitao@linux.vnet.ibm.com, netdev@vger.kernel.org
In-Reply-To: <4B13A321.8070909@gmail.com>
Eric Dumazet wrote:
> Michael Chan a écrit :
> > Calling bnx2_get_stats() won't refresh the stats counters because
> > they are DMA'ed once a second. There's an I/O to immediately DMA
> > the counters:
> >
> > REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
> > BNX2_HC_COMMAND_STATS_NOW);
> > REG_RD(bp, BNX2_HC_COMMAND);
> >
> > We then need to add some delay to wait for the DMA to complete.
>
> Yes, but if you dont call bnx2_get_stats() netdev->stats will contain
> possibly very old values.
>
> At least, calling it will give one no more than second error.
>
OK I see. We are also not saving the ethtool stats. So perhaps the
more complete solution is to save the entire statistics block before
reset.
^ permalink raw reply
* Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
From: Eric Dumazet @ 2009-11-30 10:49 UTC (permalink / raw)
To: Michael Chan; +Cc: leitao@linux.vnet.ibm.com, netdev@vger.kernel.org
In-Reply-To: <C27F8246C663564A84BB7AB34397724218065B9851@IRVEXCHCCR01.corp.ad.broadcom.com>
Michael Chan a écrit :
> Eric Dumazet wrote:
>
>> leitao@linux.vnet.ibm.com a écrit :
>>> Actually when bnx2 changes the interface's MTU size, it resets
>>> the chip and consequently flushes the interface statistics.
>>> This patch saves the statistics in a temporary space in order to
>>> maintain the statistics correct after the chip reset.
>>>
>>> Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
>>
>>
>>> return net_stats;
>>> }
>>> @@ -6989,6 +7004,11 @@ bnx2_change_ring_size(struct bnx2
>> *bp, u32 rx, u32 tx)
>>> {
>>> if (netif_running(bp->dev)) {
>>> bnx2_netif_stop(bp);
>> I wonder if you need to renew this stats before copying them ?
>> (eg calling bnx2_get_stats())
>
> Calling bnx2_get_stats() won't refresh the stats counters because
> they are DMA'ed once a second. There's an I/O to immediately DMA
> the counters:
>
> REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
> BNX2_HC_COMMAND_STATS_NOW);
> REG_RD(bp, BNX2_HC_COMMAND);
>
> We then need to add some delay to wait for the DMA to complete.
Yes, but if you dont call bnx2_get_stats() netdev->stats will contain
possibly very old values.
At least, calling it will give one no more than second error.
^ permalink raw reply
* Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
From: Michael Chan @ 2009-11-30 10:43 UTC (permalink / raw)
To: 'Eric Dumazet', leitao@linux.vnet.ibm.com; +Cc: netdev@vger.kernel.org
In-Reply-To: <4B139ED2.2060500@gmail.com>
Eric Dumazet wrote:
> leitao@linux.vnet.ibm.com a écrit :
> > Actually when bnx2 changes the interface's MTU size, it resets
> > the chip and consequently flushes the interface statistics.
> > This patch saves the statistics in a temporary space in order to
> > maintain the statistics correct after the chip reset.
> >
> > Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
>
>
>
> > return net_stats;
> > }
> > @@ -6989,6 +7004,11 @@ bnx2_change_ring_size(struct bnx2
> *bp, u32 rx, u32 tx)
> > {
> > if (netif_running(bp->dev)) {
> > bnx2_netif_stop(bp);
>
> I wonder if you need to renew this stats before copying them ?
> (eg calling bnx2_get_stats())
Calling bnx2_get_stats() won't refresh the stats counters because
they are DMA'ed once a second. There's an I/O to immediately DMA
the counters:
REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
BNX2_HC_COMMAND_STATS_NOW);
REG_RD(bp, BNX2_HC_COMMAND);
We then need to add some delay to wait for the DMA to complete.
>
>
> > +
> > + /* Save statistics that is going to be reseted */
> > + memcpy(bp->stats_extra, &bp->dev->stats,
> > + sizeof(struct net_device_stats));
> > +
> > bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
> > bnx2_free_skbs(bp);
> > bnx2_free_mem(bp);
^ permalink raw reply
* warning: massive change to conditional coding style in net?
From: William Allen Simpson @ 2009-11-30 10:36 UTC (permalink / raw)
To: Linux Kernel Developers; +Cc: Linux Kernel Network Developers
Over the past several days, David Miller (with help from Joe Perches)
made sweeping changes to the format of conditional statements in the
net tree -- the equivalent of mass patches that change spaces.
This makes writing patches for multiple versions of the tree very
difficult, and will make future pullups problematic. It's enough to
make a grown man cry.... Patching conflicts everywhere!
CodingStyle is mute on this issue. Does Linus have a preference?
My personal practice (based on decades of open source projects) has
been to use a form already used in the same file or section of code,
matching the existing practice.
If this is to be done everywhere, CodingStyle (and SubmittingPatches)
should be updated.
Currently, roughly 19% (7855 lines) of the -2.6 tree uses leading form:
if (condition
&& condition
&& (condition
|| condition
|| condition)) {
Single spaced is also fairly common:
if (condition
&& condition
&& (condition
|| condition
|| condition)) {
The advantage of the leading form is *readability* due to indentation,
ease of patching and reading patches (changes affect only 1 line,
instead of previous and following lines), and especially conditionals
within #if sections. Also, shorter lines (by 3 characters).
The other 81% uses trailing form, often with odd random line breaks:
if (condition &&
condition && (condition || condition ||
condition)) {
Miller (with Perches) changed hundreds (thousands?) of these to
trailing form. This results in a number of hilarious examples --
lines with both leading and trailing, lines with only &&, etc. A
small sample for illustration:
===
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 322b408..b78e615 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -264,9 +264,11 @@ int ip_mc_output(struct sk_buff *skb)
This check is duplicated in ip_mr_input at the moment.
*/
- && ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))
+ &&
+ ((rt->rt_flags & RTCF_LOCAL) ||
+ !(IPCB(skb)->flags & IPSKB_FORWARDED))
#endif
- ) {
+ ) {
struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
if (newskb)
NF_HOOK(PF_INET, NF_INET_POST_ROUTING, newskb,
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index cccc2e9..b26dee7 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -1403,8 +1403,8 @@ irnet_connect_indication(void * instance,
/* Socket already connecting ? On primary ? */
if(0
#ifdef ALLOW_SIMULT_CONNECT
- || ((irttp_is_primary(server->tsap) == 1) /* primary */
- && (test_and_clear_bit(0, &new->ttp_connect)))
+ || ((irttp_is_primary(server->tsap) == 1) && /* primary */
+ (test_and_clear_bit(0, &new->ttp_connect)))
#endif /* ALLOW_SIMULT_CONNECT */
)
{
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 7034ea4..dd9414e 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -170,21 +170,23 @@ restart:
for (s = sht[h1]; s; s = s->next) {
if (dst[RSVP_DST_LEN-1] == s->dst[RSVP_DST_LEN-1] &&
protocol == s->protocol &&
- !(s->dpi.mask & (*(u32*)(xprt+s->dpi.offset)^s->dpi.key))
+ !(s->dpi.mask &
+ (*(u32*)(xprt+s->dpi.offset)^s->dpi.key)) &&
#if RSVP_DST_LEN == 4
- && dst[0] == s->dst[0]
- && dst[1] == s->dst[1]
- && dst[2] == s->dst[2]
+ dst[0] == s->dst[0] &&
+ dst[1] == s->dst[1] &&
+ dst[2] == s->dst[2] &&
#endif
- && tunnelid == s->tunnelid) {
+ tunnelid == s->tunnelid) {
for (f = s->ht[h2]; f; f = f->next) {
if (src[RSVP_DST_LEN-1] == f->src[RSVP_DST_LEN-1] &&
!(f->spi.mask & (*(u32*)(xprt+f->spi.offset)^f->spi.key))
#if RSVP_DST_LEN == 4
- && src[0] == f->src[0]
- && src[1] == f->src[1]
- && src[2] == f->src[2]
+ &&
+ src[0] == f->src[0] &&
+ src[1] == f->src[1] &&
+ src[2] == f->src[2]
#endif
) {
*res = f->res;
^ permalink raw reply related
* Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
From: Eric Dumazet @ 2009-11-30 10:30 UTC (permalink / raw)
To: leitao; +Cc: netdev, mchan
In-Reply-To: <1259341163-12775-1-git-send-email-leitao@linux.vnet.ibm.com>
leitao@linux.vnet.ibm.com a écrit :
> Actually when bnx2 changes the interface's MTU size, it resets
> the chip and consequently flushes the interface statistics.
> This patch saves the statistics in a temporary space in order to
> maintain the statistics correct after the chip reset.
>
> Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
> return net_stats;
> }
> @@ -6989,6 +7004,11 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
> {
> if (netif_running(bp->dev)) {
> bnx2_netif_stop(bp);
I wonder if you need to renew this stats before copying them ?
(eg calling bnx2_get_stats())
> +
> + /* Save statistics that is going to be reseted */
> + memcpy(bp->stats_extra, &bp->dev->stats,
> + sizeof(struct net_device_stats));
> +
> bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
> bnx2_free_skbs(bp);
> bnx2_free_mem(bp);
> @@ -7649,6 +7669,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
>
> bp->flags = 0;
> bp->phy_flags = 0;
> + bp->stats_extra = kzalloc(sizeof(struct net_device_stats), GFP_KERNEL);
There is no test of failed allocation.
>
> /* enable device (incl. PCI PM wakeup), and bus-mastering */
> rc = pci_enable_device(pdev);
> @@ -8162,6 +8183,7 @@ bnx2_remove_one(struct pci_dev *pdev)
> if (bp->regview)
> iounmap(bp->regview);
>
> + kfree(bp->stats_extra);
> free_netdev(dev);
> pci_release_regions(pdev);
> pci_disable_device(pdev);
Structure is small anyway, why not including it in struct bnx2 ?
^ permalink raw reply
* Re: [RFC PATCH 07/10] bnx2: remove skb_dma_map/unmap calls from driver
From: Michael Chan @ 2009-11-30 10:26 UTC (permalink / raw)
To: 'Alexander Duyck', Matthew Carlson,
sathyap@serverengines.com,
"subbus@serverengines.com" <subb
Cc: netdev@vger.kernel.org
In-Reply-To: <20091125012048.32704.84356.stgit@gitlad.jf.intel.com>
Alexander Duyck wrote:
> Due to the fact that skb_dma_map/unmap do not work correctly when a HW
> IOMMU is enabled it has been recommended to go about removing
> the calls
> from the network device drivers.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Thanks Alexander. Sorry for the late response, I just got back
from vacation. It looks ok except in bnx2_free_tx_skbs():
> @@ -5295,18 +5303,30 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
> for (j = 0; j < TX_DESC_CNT; ) {
> struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
> struct sk_buff *skb = tx_buf->skb;
> + int k, last;
>
> if (skb == NULL) {
> j++;
> continue;
> }
>
> - skb_dma_unmap(&bp->pdev->dev, skb,
> DMA_TO_DEVICE);
> + pci_unmap_single(bp->pdev,
> + pci_unmap_addr(tx_buf,
> mapping),
> + skb_headlen(skb),
> + PCI_DMA_TODEVICE);
>
> tx_buf->skb = NULL;
>
> - j += skb_shinfo(skb)->nr_frags + 1;
> + last = skb_shinfo(skb)->nr_frags;
> + for (k = 0; k < last; k++) {
> + tx_buf = &txr->tx_buf_ring[j + k + 1];
j + k + 1 can go beyond the ring when the ring wraps around.
I'll send an updated patch tomorrow.
> + pci_unmap_page(bp->pdev,
> + pci_unmap_addr(tx_buf, mapping),
> + skb_shinfo(skb)->frags[j].size,
> + PCI_DMA_TODEVICE);
> + }
> dev_kfree_skb(skb);
> + j += k + 1;
> }
> }
> }
^ permalink raw reply
* Re: [PATCH] bnx2: EEH is failing with timeout
From: Michael Chan @ 2009-11-30 9:40 UTC (permalink / raw)
To: 'leitao@linux.vnet.ibm.com'; +Cc: netdev@vger.kernel.org
In-Reply-To: <1259256709-6976-1-git-send-email-leitao@linux.vnet.ibm.com>
leitao@linux.vnet.ibm.com wrote:
> bnx2 is failing when a PCI error is detected. The error is the
> following:
>
> bnx2: Chip not in correct endian mode
> bnx2: fw sync timeout, reset code = 404001d
>
> This error was caused because the way pci_restore_state() is working
> after commit 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff.
>
> Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
Thanks Breno.
Acked by: Michael Chan <mchan@broadcom.com>
> ---
> drivers/net/bnx2.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index 08cddb6..7fa4048 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -8264,6 +8264,7 @@ static pci_ers_result_t
> bnx2_io_slot_reset(struct pci_dev *pdev)
> }
> pci_set_master(pdev);
> pci_restore_state(pdev);
> + pci_save_state(pdev);
>
> if (netif_running(dev)) {
> bnx2_set_power_state(bp, PCI_D0);
> --
> 1.6.0.2
>
>
>
^ permalink raw reply
* Re: [PATCH] bnx2: avoid flushing statistics when doing a MTU change
From: Michael Chan @ 2009-11-30 9:20 UTC (permalink / raw)
To: 'leitao@linux.vnet.ibm.com', netdev@vger.kernel.org
In-Reply-To: <1259341163-12775-1-git-send-email-leitao@linux.vnet.ibm.com>
leitao@linux.vnet.ibm.com wrote:
> Actually when bnx2 changes the interface's MTU size, it resets
> the chip and consequently flushes the interface statistics.
> This patch saves the statistics in a temporary space in order to
> maintain the statistics correct after the chip reset.
Thanks Breno. This looks ok, but I think we need to zero the
stats_extra during bnx2_open().
>
> Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com>
> ---
> drivers/net/bnx2.c | 52
> +++++++++++++++++++++++++++++++++++++---------------
> drivers/net/bnx2.h | 1 +
> 2 files changed, 38 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index 7fa4048..f99e688 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -6469,46 +6469,58 @@ bnx2_get_stats(struct net_device *dev)
> net_stats->rx_packets =
> GET_NET_STATS(stats_blk->stat_IfHCInUcastPkts) +
> GET_NET_STATS(stats_blk->stat_IfHCInMulticastPkts) +
> - GET_NET_STATS(stats_blk->stat_IfHCInBroadcastPkts);
> + GET_NET_STATS(stats_blk->stat_IfHCInBroadcastPkts) +
> + bp->stats_extra->rx_packets;
>
> net_stats->tx_packets =
> GET_NET_STATS(stats_blk->stat_IfHCOutUcastPkts) +
> GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts) +
> - GET_NET_STATS(stats_blk->stat_IfHCOutBroadcastPkts);
> + GET_NET_STATS(stats_blk->stat_IfHCOutBroadcastPkts) +
> + bp->stats_extra->tx_packets;
>
> net_stats->rx_bytes =
> - GET_NET_STATS(stats_blk->stat_IfHCInOctets);
> + GET_NET_STATS(stats_blk->stat_IfHCInOctets) +
> + bp->stats_extra->rx_bytes;
>
> net_stats->tx_bytes =
> - GET_NET_STATS(stats_blk->stat_IfHCOutOctets);
> + GET_NET_STATS(stats_blk->stat_IfHCOutOctets) +
> + bp->stats_extra->tx_bytes;
>
> net_stats->multicast =
> - GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts);
> + GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts) +
> + bp->stats_extra->multicast;
>
> net_stats->collisions =
> - (unsigned long) stats_blk->stat_EtherStatsCollisions;
> + (unsigned long) stats_blk->stat_EtherStatsCollisions +
> + bp->stats_extra->collisions;
>
> net_stats->rx_length_errors =
> (unsigned long)
> (stats_blk->stat_EtherStatsUndersizePkts +
> - stats_blk->stat_EtherStatsOverrsizePkts);
> + stats_blk->stat_EtherStatsOverrsizePkts) +
> + bp->stats_extra->rx_length_errors;
>
> net_stats->rx_over_errors =
> (unsigned long) (stats_blk->stat_IfInFTQDiscards +
> - stats_blk->stat_IfInMBUFDiscards);
> + stats_blk->stat_IfInMBUFDiscards) +
> + bp->stats_extra->rx_over_errors;
>
> net_stats->rx_frame_errors =
> - (unsigned long)
> stats_blk->stat_Dot3StatsAlignmentErrors;
> + (unsigned long)
> stats_blk->stat_Dot3StatsAlignmentErrors +
> + bp->stats_extra->rx_frame_errors;
>
> net_stats->rx_crc_errors =
> - (unsigned long) stats_blk->stat_Dot3StatsFCSErrors;
> + (unsigned long) stats_blk->stat_Dot3StatsFCSErrors +
> + bp->stats_extra->rx_crc_errors;
>
> net_stats->rx_errors = net_stats->rx_length_errors +
> net_stats->rx_over_errors + net_stats->rx_frame_errors +
> - net_stats->rx_crc_errors;
> + net_stats->rx_crc_errors +
> + bp->stats_extra->rx_errors;
>
> net_stats->tx_aborted_errors =
> (unsigned long)
> (stats_blk->stat_Dot3StatsExcessiveCollisions +
> - stats_blk->stat_Dot3StatsLateCollisions);
> + stats_blk->stat_Dot3StatsLateCollisions) +
> + bp->stats_extra->tx_aborted_errors;
>
> if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||
> (CHIP_ID(bp) == CHIP_ID_5708_A0))
> @@ -6516,7 +6528,8 @@ bnx2_get_stats(struct net_device *dev)
> else {
> net_stats->tx_carrier_errors =
> (unsigned long)
> - stats_blk->stat_Dot3StatsCarrierSenseErrors;
> + stats_blk->stat_Dot3StatsCarrierSenseErrors +
> + bp->stats_extra->tx_carrier_errors;
> }
>
> net_stats->tx_errors =
> @@ -6524,11 +6537,13 @@ bnx2_get_stats(struct net_device *dev)
>
> stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors
> +
> net_stats->tx_aborted_errors +
> - net_stats->tx_carrier_errors;
> + net_stats->tx_carrier_errors +
> + bp->stats_extra->tx_errors;
>
> net_stats->rx_missed_errors =
> (unsigned long) (stats_blk->stat_IfInFTQDiscards +
> - stats_blk->stat_IfInMBUFDiscards +
> stats_blk->stat_FwRxDrop);
> + stats_blk->stat_IfInMBUFDiscards +
> stats_blk->stat_FwRxDrop) +
> + bp->stats_extra->rx_missed_errors;
>
> return net_stats;
> }
> @@ -6989,6 +7004,11 @@ bnx2_change_ring_size(struct bnx2 *bp,
> u32 rx, u32 tx)
> {
> if (netif_running(bp->dev)) {
> bnx2_netif_stop(bp);
> +
> + /* Save statistics that is going to be reseted */
> + memcpy(bp->stats_extra, &bp->dev->stats,
> + sizeof(struct net_device_stats));
> +
> bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
> bnx2_free_skbs(bp);
> bnx2_free_mem(bp);
> @@ -7649,6 +7669,7 @@ bnx2_init_board(struct pci_dev *pdev,
> struct net_device *dev)
>
> bp->flags = 0;
> bp->phy_flags = 0;
> + bp->stats_extra = kzalloc(sizeof(struct
> net_device_stats), GFP_KERNEL);
>
> /* enable device (incl. PCI PM wakeup), and bus-mastering */
> rc = pci_enable_device(pdev);
> @@ -8162,6 +8183,7 @@ bnx2_remove_one(struct pci_dev *pdev)
> if (bp->regview)
> iounmap(bp->regview);
>
> + kfree(bp->stats_extra);
> free_netdev(dev);
> pci_release_regions(pdev);
> pci_disable_device(pdev);
> diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
> index a4d8340..b29b0d5 100644
> --- a/drivers/net/bnx2.h
> +++ b/drivers/net/bnx2.h
> @@ -6912,6 +6912,7 @@ struct bnx2 {
>
> const struct firmware *mips_firmware;
> const struct firmware *rv2p_firmware;
> + struct net_device_stats *stats_extra;
> };
>
> #define REG_RD(bp, offset) \
> --
> 1.6.0.2
>
>
>
^ permalink raw reply
* Re: Problem with tcp (2.6.31) as first
From: Eric Dumazet @ 2009-11-30 9:12 UTC (permalink / raw)
To: David Miller; +Cc: ilpo.jarvinen, ole, herbert, Linux Netdev List
In-Reply-To: <20091129.233447.60856273.davem@davemloft.net>
David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thu, 26 Nov 2009 23:42:46 +0100
>
>> Following patch solves this problem, but maybe we need a flag
>> (a la sk->sk_userlocks |= SOCK_WINCLAMP_LOCK;)
>> in case user set window_clamp.
>> Or just document the clearing after a tcp disconnect ?
>>
>> [PATCH] tcp: tcp_disconnect() should clear window_clamp
>>
>> Or reuse of socket possibly selects a small window, wscale = 0 for next connection.
>
> Eric, can you post this with proper signoff to netdev?
>
> Thanks.
Sure, here it is.
Thanks
[PATCH] tcp: tcp_disconnect() should clear window_clamp
NFS can reuse its TCP socket after calling tcp_disconnect().
We noticed window scaling was not negotiated in SYN packet of next connection request.
Fix is to clear tp->window_clamp in tcp_disconnect().
Reported-by: Krzysztof Oledzki <ole@ans.pl>
Tested-by: Krzysztof Oledzki <ole@ans.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f1813bc..d7a884c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2059,6 +2059,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
tp->snd_cwnd_cnt = 0;
tp->bytes_acked = 0;
+ tp->window_clamp = 0;
tcp_set_ca_state(sk, TCP_CA_Open);
tcp_clear_retrans(tp);
inet_csk_delack_init(sk)
^ permalink raw reply related
* [GIT]: Networking
From: David Miller @ 2009-11-30 9:12 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) EMAC driver build fix, macro issues. From chaithrika@ti.com
2) Fix order 5 GFP_ATOMIC allocation on resume in e100, from Roger Oksanen.
This fixes a regression list entry.
3) smc91x IRQ number handling broken since 2.6.26 on some platforms.
Fix from Russell King.
4) Netxen promisc and bonding TLB/ALB mode fix from Narender Kumar.
5) stmmac build fix from Giuseppe CAVALLARO.
6) ETHOC bad kconfig dependencies, fix from Geert Uytterhoeven.
7) ep93xx-eth can register with zero MAC addr, fix from Florian Fainelli.
8) b44 spews log messages on a normal interrupt status condition,
making netconsole over it wedge the machine.
9) IP fragmentation handling can OOPS due to misreferenced network
namespace pointer. Fix from David Ford.
10) Missing semaphore release in cosa driver, from Dan Carpenter.
11) Fix build with debug enabled and fix soft lockup, by Antti Kaijanm^[$(D+#^[(Bki
via Andrew Morton.
12) SCTP retransmit fix from Andrei Pelinescu-Onciul.
13) au1x00 does netdevice register before ->netdev_ops is setup
properly. Fix from Alexander Beregalov.
14) Several netfilter fixes via Patrick McHardy, in particular keep
nf_log from taking a mutex inside of an RCU section thus triggering
might_sleep() warnings.
15) Oops, veth driver accesses statistics in parallal from multiple
cpus completely unlocked. Fix from Eric Dumazet.
16) ieee802154_fake_xmit() claims to handle the SKB but doesn't free
it resulting in a leak. Fix from Eric Dumazet.
17) A few small wireless fixes via John Linville, including hopefully
the final fix for addba timers from Johannes Berg.
Please pull, thanks a lot!
The following changes since commit a8a8a669ea13d792296737505adc43ccacf3a648:
Linus Torvalds (1):
Merge branch 'i2c-pnx-fixes' of git://git.fluff.org/bjdooks/linux
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Alexander Beregalov (1):
Au1x00: fix crash when trying register_netdev()
Amit Kumar Salecha (1):
netxen: fix memory initialization
Andrei Pelinescu-Onciul (1):
sctp: on T3_RTX retransmit all the in-flight chunks
Antti Kaijanm^[$(D+#^[(Bki (2):
hso: fix debug routines
hso: fix soft-lockup
Bruce Allan (7):
e1000e: partial revert of 3ec2a2b8 plus FC workraround for 82577/8
e1000e: read of PHY register may access wrong page on 82578
e1000e: set flow control thresholds properly after enabling/disabling pause
e1000e: add Tx timeout factor for 100Mbps
e1000e: flow control thresholds not correct when changing mtu
e1000e: remove unnecessary 82577 workaround causing link issues
e1000e: do not initiate autonegotiation during OEM configuration
Dan Carpenter (1):
wan: cosa: drop chan->wsem on error path
David Ford (1):
ipv4: additional update of dev_net(dev) to struct *net in ip_fragment.c, NULL ptr OOPS
David J. Choi (1):
drivers/net: ks8851_mll ethernet network driver -resubmit
David S. Miller (3):
Merge branch 'master' of git://git.kernel.org/.../kaber/nf-2.6
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
b44: Fix wedge when using netconsole.
Eric Dumazet (4):
ieee802154: dont leak skbs in ieee802154_fake_xmit()
veth: Fix veth_get_stats()
pktgen: Fix device name compares
pktgen: Fix netdevice unregister
Florian Fainelli (1):
ep93xx-eth: check for zero MAC address on probe, not on device open
Geert Uytterhoeven (1):
net: ETHOC should depend on HAS_DMA
Giuseppe CAVALLARO (2):
stmmac: fixed a compilation error when use the external timer
stmmac: do not fail when the timer cannot be used.
Ivan Vecera (1):
r8169: restore mac addr in rtl8169_remove_one and rtl_shutdown
Jaswinder Singh Rajput (1):
ixgbe: move tc variable to CONFIG_IXGBE_DCB
Johannes Berg (3):
mac80211: fix addba timer (again...)
mac80211: fix resume
rfkill: fix miscdev ops
John W. Linville (1):
ath9k: set ps_default as false
Narender Kumar (2):
netxen: fix promisc for NX2031.
netxen : fix BOND_MODE_TLB/ALB mode.
Patrick McHardy (4):
netfilter: xt_osf: fix xt_osf_remove_callback() return value
netfilter: nf_log: fix sleeping function called from invalid context in seq_show()
netfilter: xt_limit: fix invalid return code in limit_mt_check()
macvlan: fix gso_max_size setting
Roel Kluin (1):
netfilter: xt_osf: fix xt_osf_remove_callback() return value
Roger Oksanen (1):
e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation failure
Russell King - ARM Linux (1):
NET: smc91x: Fix irq flags
Steve Glendinning (1):
smsc9420: prevent BUG() if ethtool is called with interface down
Wu Fengguang (1):
netfilter: nf_log: fix sleeping function called from invalid context in seq_show()
chaithrika@ti.com (1):
TI DaVinci EMAC: Minor macro related updates
drivers/ieee802154/fakehard.c | 5 +-
drivers/net/Kconfig | 2 +-
drivers/net/arm/ep93xx_eth.c | 12 +--
drivers/net/au1000_eth.c | 15 ++--
drivers/net/b44.c | 3 -
drivers/net/davinci_emac.c | 26 +++----
drivers/net/e100.c | 17 +++--
drivers/net/e1000e/e1000.h | 2 +
drivers/net/e1000e/ethtool.c | 12 +++-
drivers/net/e1000e/ich8lan.c | 4 +-
drivers/net/e1000e/netdev.c | 50 ++++++++----
drivers/net/e1000e/phy.c | 56 +++++--------
drivers/net/ixgbe/ixgbe_main.c | 2 +-
drivers/net/ks8851_mll.c | 142 ++++++++++++++++-----------------
drivers/net/macvlan.c | 2 +
drivers/net/netxen/netxen_nic.h | 2 +
drivers/net/netxen/netxen_nic_hdr.h | 2 +
drivers/net/netxen/netxen_nic_hw.c | 55 ++++++++++---
drivers/net/netxen/netxen_nic_init.c | 2 +
drivers/net/netxen/netxen_nic_main.c | 4 +-
drivers/net/r8169.c | 7 ++
drivers/net/smc91x.c | 2 +-
drivers/net/smsc9420.c | 14 +++
drivers/net/stmmac/stmmac_main.c | 50 +++++++-----
drivers/net/stmmac/stmmac_timer.c | 4 +-
drivers/net/stmmac/stmmac_timer.h | 1 +
drivers/net/usb/hso.c | 8 +-
drivers/net/veth.c | 35 ++++-----
drivers/net/wan/cosa.c | 1 +
drivers/net/wireless/ath/ath9k/main.c | 2 +
include/net/sctp/structs.h | 1 -
net/core/pktgen.c | 32 +++++---
net/ipv4/ip_fragment.c | 2 +-
net/mac80211/agg-tx.c | 18 ++---
net/mac80211/ieee80211_i.h | 8 ++
net/mac80211/util.c | 19 ++---
net/netfilter/nf_log.c | 18 +---
net/netfilter/xt_limit.c | 2 +-
net/netfilter/xt_osf.c | 2 +-
net/rfkill/core.c | 1 +
net/sctp/outqueue.c | 10 ---
net/sctp/sm_sideeffect.c | 1 -
net/sctp/transport.c | 5 +-
43 files changed, 359 insertions(+), 299 deletions(-)
^ permalink raw reply
* Re: [PATCH 3/5] slab.c: remove branch hint
From: Pekka Enberg @ 2009-11-30 9:05 UTC (permalink / raw)
To: Tim Blechmann
Cc: Ingo Molnar, linux-kernel, Christoph Lameter, Nick Piggin, davem,
netdev
In-Reply-To: <4B125CC2.7000202@klingt.org>
Tim Blechmann kirjoitti:
> On 11/24/2009 12:28 PM, Pekka Enberg wrote:
>> On Tue, Nov 24, 2009 at 1:20 PM, Ingo Molnar <mingo@elte.hu> wrote:
>>> (Pekka Cc:-ed)
>>>
>>> * Tim Blechmann <tim@klingt.org> wrote:
>>>
>>>> branch profiling on my nehalem machine showed 99% incorrect branch hints:
>>>>
>>>> 28459 7678524 99 __cache_alloc_node slab.c
>>>> 3551
>>>>
>>>> Signed-off-by: Tim Blechmann <tim@klingt.org>
>>>> ---
>>>> mm/slab.c | 2 +-
>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/mm/slab.c b/mm/slab.c
>>>> index f70b326..4125fcd 100644
>>>> --- a/mm/slab.c
>>>> +++ b/mm/slab.c
>>>> @@ -3548,7 +3548,7 @@ __cache_alloc_node(struct kmem_cache *cachep,
>>>> gfp_t flags, int nodeid,
>>>> slab_irq_save(save_flags, this_cpu);
>>>> this_node = cpu_to_node(this_cpu);
>>>> - if (unlikely(nodeid == -1))
>>>> + if (nodeid == -1)
>>>> nodeid = this_node;
>>>> if (unlikely(!cachep->nodelists[nodeid])) {
>> That sounds odd to me. Can you see where the incorrectly predicted
>> calls are coming from? Calling kmem_cache_alloc_node() with node set
>> to -1 most of the time could be a real bug somewhere.
>
> when dumping the stack for the incorrectly hinted branches, i get the
> attached stack traces...
>
> hth, tim
>
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3548,8 +3548,10 @@ __cache_alloc_node(struct kmem_cache *cachep,
> gfp_t flags, int nodeid,
> slab_irq_save(save_flags, this_cpu);
>
> this_node = cpu_to_node(this_cpu);
> - if (nodeid == -1)
> + if (nodeid == -1) {
> + dump_stack();
> nodeid = this_node;
> + }
>
> if (unlikely(!cachep->nodelists[nodeid])) {
> /* Node not bootstrapped yet */
>
>
>
OK, so it's the generic alloc_skb() function that keeps hitting
kmem_cache_alloc_node() with "-1". Christoph, are you okay with removing
the unlikely() annotation from __cache_alloc_node()?
Pekka
^ permalink raw reply
* Re: [PATCH 0/20] Batch network namespace cleanup
From: Eric W. Biederman @ 2009-11-30 8:48 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, netdev, hadi, dlezcano, adobriyan, kaber
In-Reply-To: <m1ljhoa0js.fsf@fess.ebiederm.org>
ebiederm@xmission.com (Eric W. Biederman) writes:
> David Miller <davem@davemloft.net> writes:
>
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Mon, 30 Nov 2009 09:07:39 +0100
>>
>>> It seems list received part of your patches Eric
>>>
>>> 01, 07-20 are OK, 02-06 are missing
>>
>> Not just the list, I didn't get copies of the missing patches through
>> direct email even though I was on the CC: list.
>
> Thanks. Weird. I will take a look and resend.
I have resent the missing patches, I'm not certain what happened
the first time but clearly those didn't get sent.
02 and 06 have made it to netdev and looped back to me. I'm not certain
where 03-05 are, but they should be in transit.
Eric
^ permalink raw reply
* Re: [PATCH 15/20] net: Simplify phonet pernet operations.
From: Rémi Denis-Courmont @ 2009-11-30 8:33 UTC (permalink / raw)
To: Eric W. Biederman
Cc: David Miller, netdev, jamal, Daniel Lezcano, Alexey Dobriyan,
Patrick McHardy
On Sun, 29 Nov 2009 17:46:12 -0800, "Eric W. Biederman"
<ebiederm@xmission.com> wrote:
> From: Eric W. Biederman <ebiederm@xmission.com>
>
> Take advantage of the new pernet automatic storage management,
> and stop using compatibility network namespace functions.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Thanks.
--
Rémi Denis-Courmont
^ permalink raw reply
* [PATCH 04/20] net: Automatically allocate per namespace data.
From: Eric W. Biederman @ 2009-11-30 8:25 UTC (permalink / raw)
To: David Miller
Cc: netdev, jamal, Daniel Lezcano, Alexey Dobriyan, Patrick McHardy,
Eric W. Biederman
In-Reply-To: <m1ljhodbtw.fsf@fess.ebiederm.org>
From: Eric W. Biederman <ebiederm@xmission.com>
To get the full benefit of batched network namespace cleanup netowrk
device deletion needs to be performed by the generic code. When
using register_pernet_gen_device and freeing the data in exit_net
it is impossible to delay allocation until after exit_net has called
as the device uninit methods are no longer safe.
To correct this, and to simplify working with per network namespace data
I have moved allocation and deletion of per network namespace data into
the network namespace core. The core now frees the data only after
all of the network namespace exit routines have run.
Now it is only required to set the new fields .id and .size
in the pernet_operations structure if you want network namespace
data to be managed for you automatically.
This makes the current register_pernet_gen_device and
register_pernet_gen_subsys routines unnecessary. For the moment
I have left them as compatibility wrappers in net_namespace.h
They will be removed once all of the users have been updated.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
include/net/net_namespace.h | 28 ++++++-
net/core/net_namespace.c | 188 +++++++++++++++++++++++--------------------
2 files changed, 126 insertions(+), 90 deletions(-)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index d69b479..080774b 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -236,6 +236,8 @@ struct pernet_operations {
struct list_head list;
int (*init)(struct net *net);
void (*exit)(struct net *net);
+ int *id;
+ size_t size;
};
/*
@@ -259,12 +261,30 @@ struct pernet_operations {
*/
extern int register_pernet_subsys(struct pernet_operations *);
extern void unregister_pernet_subsys(struct pernet_operations *);
-extern int register_pernet_gen_subsys(int *id, struct pernet_operations *);
-extern void unregister_pernet_gen_subsys(int id, struct pernet_operations *);
extern int register_pernet_device(struct pernet_operations *);
extern void unregister_pernet_device(struct pernet_operations *);
-extern int register_pernet_gen_device(int *id, struct pernet_operations *);
-extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
+
+static inline int register_pernet_gen_subsys(int *id, struct pernet_operations *ops)
+{
+ ops->id = id;
+ return register_pernet_subsys(ops);
+}
+
+static inline void unregister_pernet_gen_subsys(int id, struct pernet_operations *ops)
+{
+ return unregister_pernet_subsys(ops);
+}
+
+static inline int register_pernet_gen_device(int *id, struct pernet_operations *ops)
+{
+ ops->id = id;
+ return register_pernet_device(ops);
+}
+
+static inline void unregister_pernet_gen_device(int id, struct pernet_operations *ops)
+{
+ return unregister_pernet_device(ops);
+}
struct ctl_path;
struct ctl_table;
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index a42caa2..9679ad2 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -43,13 +43,40 @@ static void unregister_netdevices(struct net *net, struct list_head *list)
}
}
+static int ops_init(const struct pernet_operations *ops, struct net *net)
+{
+ int err;
+ if (ops->id && ops->size) {
+ void *data = kzalloc(ops->size, GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ err = net_assign_generic(net, *ops->id, data);
+ if (err) {
+ kfree(data);
+ return err;
+ }
+ }
+ if (ops->init)
+ return ops->init(net);
+ return 0;
+}
+
+static void ops_free(const struct pernet_operations *ops, struct net *net)
+{
+ if (ops->id && ops->size) {
+ int id = *ops->id;
+ kfree(net_generic(net, id));
+ }
+}
+
/*
* setup_net runs the initializers for the network namespace object.
*/
static __net_init int setup_net(struct net *net)
{
/* Must be called with net_mutex held */
- struct pernet_operations *ops;
+ const struct pernet_operations *ops, *saved_ops;
int error = 0;
atomic_set(&net->count, 1);
@@ -59,11 +86,9 @@ static __net_init int setup_net(struct net *net)
#endif
list_for_each_entry(ops, &pernet_list, list) {
- if (ops->init) {
- error = ops->init(net);
- if (error < 0)
- goto out_undo;
- }
+ error = ops_init(ops, net);
+ if (error < 0)
+ goto out_undo;
}
out:
return error;
@@ -72,6 +97,7 @@ out_undo:
/* Walk through the list backwards calling the exit functions
* for the pernet modules whose init functions did not fail.
*/
+ saved_ops = ops;
list_for_each_entry_continue_reverse(ops, &pernet_list, list) {
if (ops->exit)
ops->exit(net);
@@ -83,6 +109,9 @@ out_undo:
rtnl_unlock();
}
}
+ ops = saved_ops;
+ list_for_each_entry_continue_reverse(ops, &pernet_list, list)
+ ops_free(ops, net);
rcu_barrier();
goto out;
@@ -175,7 +204,7 @@ static LIST_HEAD(cleanup_list); /* Must hold cleanup_list_lock to touch */
static void cleanup_net(struct work_struct *work)
{
- struct pernet_operations *ops;
+ const struct pernet_operations *ops;
struct net *net, *tmp;
LIST_HEAD(net_kill_list);
@@ -214,6 +243,13 @@ static void cleanup_net(struct work_struct *work)
rtnl_unlock();
}
}
+ /* Free the net generic variables */
+ list_for_each_entry_reverse(ops, &pernet_list, list) {
+ if (ops->size && ops->id) {
+ list_for_each_entry(net, &net_kill_list, cleanup_list)
+ ops_free(ops, net);
+ }
+ }
mutex_unlock(&net_mutex);
@@ -309,16 +345,16 @@ static int __init net_ns_init(void)
pure_initcall(net_ns_init);
#ifdef CONFIG_NET_NS
-static int register_pernet_operations(struct list_head *list,
- struct pernet_operations *ops)
+static int __register_pernet_operations(struct list_head *list,
+ struct pernet_operations *ops)
{
struct net *net, *undo_net;
int error;
list_add_tail(&ops->list, list);
- if (ops->init) {
+ if (ops->init || (ops->id && ops->size)) {
for_each_net(net) {
- error = ops->init(net);
+ error = ops_init(ops, net);
if (error)
goto out_undo;
}
@@ -336,10 +372,18 @@ out_undo:
}
}
undone:
+ if (ops->size && ops->id) {
+ for_each_net(undo_net) {
+ if (net_eq(undo_net, net))
+ goto freed;
+ ops_free(ops, undo_net);
+ }
+ }
+freed:
return error;
}
-static void unregister_pernet_operations(struct pernet_operations *ops)
+static void __unregister_pernet_operations(struct pernet_operations *ops)
{
struct net *net;
@@ -347,27 +391,66 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
if (ops->exit)
for_each_net(net)
ops->exit(net);
+ if (ops->id && ops->size)
+ for_each_net(net)
+ ops_free(ops, net);
}
#else
-static int register_pernet_operations(struct list_head *list,
- struct pernet_operations *ops)
+static int __register_pernet_operations(struct list_head *list,
+ struct pernet_operations *ops)
{
- if (ops->init == NULL)
- return 0;
- return ops->init(&init_net);
+ int err = 0;
+ err = ops_init(ops, &init_net);
+ if (err)
+ ops_free(ops, &init_net);
+ return err;
+
}
-static void unregister_pernet_operations(struct pernet_operations *ops)
+static void __unregister_pernet_operations(struct pernet_operations *ops)
{
if (ops->exit)
ops->exit(&init_net);
+ ops_free(ops, &init_net);
}
-#endif
+
+#endif /* CONFIG_NET_NS */
static DEFINE_IDA(net_generic_ids);
+static int register_pernet_operations(struct list_head *list,
+ struct pernet_operations *ops)
+{
+ int error;
+
+ if (ops->id) {
+again:
+ error = ida_get_new_above(&net_generic_ids, 1, ops->id);
+ if (error < 0) {
+ if (error == -EAGAIN) {
+ ida_pre_get(&net_generic_ids, GFP_KERNEL);
+ goto again;
+ }
+ return error;
+ }
+ }
+ error = __register_pernet_operations(list, ops);
+ if (error && ops->id)
+ ida_remove(&net_generic_ids, *ops->id);
+
+ return error;
+}
+
+static void unregister_pernet_operations(struct pernet_operations *ops)
+{
+
+ __unregister_pernet_operations(ops);
+ if (ops->id)
+ ida_remove(&net_generic_ids, *ops->id);
+}
+
/**
* register_pernet_subsys - register a network namespace subsystem
* @ops: pernet operations structure for the subsystem
@@ -414,38 +497,6 @@ void unregister_pernet_subsys(struct pernet_operations *module)
}
EXPORT_SYMBOL_GPL(unregister_pernet_subsys);
-int register_pernet_gen_subsys(int *id, struct pernet_operations *ops)
-{
- int rv;
-
- mutex_lock(&net_mutex);
-again:
- rv = ida_get_new_above(&net_generic_ids, 1, id);
- if (rv < 0) {
- if (rv == -EAGAIN) {
- ida_pre_get(&net_generic_ids, GFP_KERNEL);
- goto again;
- }
- goto out;
- }
- rv = register_pernet_operations(first_device, ops);
- if (rv < 0)
- ida_remove(&net_generic_ids, *id);
-out:
- mutex_unlock(&net_mutex);
- return rv;
-}
-EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);
-
-void unregister_pernet_gen_subsys(int id, struct pernet_operations *ops)
-{
- mutex_lock(&net_mutex);
- unregister_pernet_operations(ops);
- ida_remove(&net_generic_ids, id);
- mutex_unlock(&net_mutex);
-}
-EXPORT_SYMBOL_GPL(unregister_pernet_gen_subsys);
-
/**
* register_pernet_device - register a network namespace device
* @ops: pernet operations structure for the subsystem
@@ -477,30 +528,6 @@ int register_pernet_device(struct pernet_operations *ops)
}
EXPORT_SYMBOL_GPL(register_pernet_device);
-int register_pernet_gen_device(int *id, struct pernet_operations *ops)
-{
- int error;
- mutex_lock(&net_mutex);
-again:
- error = ida_get_new_above(&net_generic_ids, 1, id);
- if (error) {
- if (error == -EAGAIN) {
- ida_pre_get(&net_generic_ids, GFP_KERNEL);
- goto again;
- }
- goto out;
- }
- error = register_pernet_operations(&pernet_list, ops);
- if (error)
- ida_remove(&net_generic_ids, *id);
- else if (first_device == &pernet_list)
- first_device = &ops->list;
-out:
- mutex_unlock(&net_mutex);
- return error;
-}
-EXPORT_SYMBOL_GPL(register_pernet_gen_device);
-
/**
* unregister_pernet_device - unregister a network namespace netdevice
* @ops: pernet operations structure to manipulate
@@ -520,17 +547,6 @@ void unregister_pernet_device(struct pernet_operations *ops)
}
EXPORT_SYMBOL_GPL(unregister_pernet_device);
-void unregister_pernet_gen_device(int id, struct pernet_operations *ops)
-{
- mutex_lock(&net_mutex);
- if (&ops->list == first_device)
- first_device = first_device->next;
- unregister_pernet_operations(ops);
- ida_remove(&net_generic_ids, id);
- mutex_unlock(&net_mutex);
-}
-EXPORT_SYMBOL_GPL(unregister_pernet_gen_device);
-
static void net_generic_release(struct rcu_head *rcu)
{
struct net_generic *ng;
--
1.6.5.2.143.g8cc62
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox