* Re: [PATCH 2/4] macvlan: cleanup rx statistics
From: Arnd Bergmann @ 2009-11-24 9:28 UTC (permalink / raw)
To: virtualization
Cc: Eric Dumazet, Herbert Xu, Anna Fischer, netdev, bridge,
linux-kernel, Mark Smith, Gerhard Stenzel, Eric W. Biederman,
Jens Osterkamp, Patrick Mullaney, Stephen Hemminger,
Edge Virtual Bridging, David Miller
In-Reply-To: <200911240845.14454.arnd@arndb.de>
On Tuesday 24 November 2009 08:45:14 Arnd Bergmann wrote:
> On Tuesday 24 November 2009 08:15:53 Eric Dumazet wrote:
> > Arnd Bergmann a écrit :
> > I find following more readable, it probably generates more branches,
> > but avoid dirtying rx_errors if it is in another cache line.
> >
> > if (likely(success)) {
> > rx_stats->rx_packets++;
> > rx_stats->rx_bytes += length;
> > if (multicast)
> > rx_stats->multicast++;
> > } else {
> > rx_stats->rx_errors++;
> > }
>
> Given that the structure only has four members and alloc_percpu requests
> cache aligned data, it is rather likely to be in the same cache line.
>
> I'll have a look at what gcc generates on x86-64 for both versions
> and use the version you suggested unless it looks significantly more
> expensive.
Ok, that's what I got for trying to be clever. My version did not avoid
any branches, just created more code. I'll fold this update into my
patches then:
---
macvlan: cleanups
Use bool instead of int for flags, don't misoptimize rx counters,
avoid accessing a NULL skb.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 3db96b9..ff5f0b0 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -119,19 +119,23 @@ static int macvlan_addr_busy(const struct macvlan_port *port,
}
static inline void macvlan_count_rx(const struct macvlan_dev *vlan, int length,
- int success, int multicast)
+ bool success, bool multicast)
{
struct macvlan_rx_stats *rx_stats;
rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
- rx_stats->rx_packets += success != 0;
- rx_stats->rx_bytes += success ? length : 0;
- rx_stats->multicast += success && multicast;
- rx_stats->rx_errors += !success;
+ if (likely(success)) {
+ rx_stats->rx_packets++;;
+ rx_stats->rx_bytes += length;
+ if (multicast)
+ rx_stats->multicast++;
+ } else {
+ rx_stats->rx_errors++;
+ }
}
static int macvlan_broadcast_one(struct sk_buff *skb, struct net_device *dev,
- const struct ethhdr *eth, int local)
+ const struct ethhdr *eth, bool local)
{
if (!skb)
return NET_RX_DROP;
@@ -173,7 +177,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
err = macvlan_broadcast_one(nskb, vlan->dev, eth,
mode == MACVLAN_MODE_BRIDGE);
macvlan_count_rx(vlan, skb->len + ETH_HLEN,
- likely(err == NET_RX_SUCCESS), 1);
+ err == NET_RX_SUCCESS, 1);
}
}
}
@@ -186,6 +190,7 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
const struct macvlan_dev *vlan;
const struct macvlan_dev *src;
struct net_device *dev;
+ int len;
port = rcu_dereference(skb->dev->macvlan_port);
if (port == NULL)
@@ -218,8 +223,11 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
kfree_skb(skb);
return NULL;
}
+ len = skb->len + ETH_HLEN;
skb = skb_share_check(skb, GFP_ATOMIC);
- macvlan_count_rx(vlan, skb->len + ETH_HLEN, likely(skb != NULL), 0);
+ macvlan_count_rx(vlan, len, skb != NULL, 0);
+ if (!skb)
+ return NULL;
skb->dev = dev;
skb->pkt_type = PACKET_HOST;
@@ -248,7 +256,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
int length = skb->len + ETH_HLEN;
int ret = dev_forward_skb(dest->dev, skb);
macvlan_count_rx(dest, length,
- likely(ret == NET_RX_SUCCESS), 0);
+ ret == NET_RX_SUCCESS, 0);
return NET_XMIT_SUCCESS;
}
^ permalink raw reply related
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter Zijlstra @ 2009-11-24 9:15 UTC (permalink / raw)
To: Peter P Waskiewicz Jr
Cc: Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org, Thomas Gleixner
In-Reply-To: <1259053156.2631.21.camel@ppwaskie-mobl2>
On Tue, 2009-11-24 at 00:59 -0800, Peter P Waskiewicz Jr wrote:
>
> > All the while not CC'ing the IRQ folks,.. brilliant approach.
>
> If I knew who I should CC, I'd be happy to add them. Can you provide
> email addresses please?
Since most people can't seen to read a simple MAINTAINERS file, some
other people wrote a script to read it for you:
# scripts/get_maintainer.pl -f kernel/irq/manage.c
Ingo Molnar <mingo@elte.hu>
Thomas Gleixner <tglx@linutronix.de>
linux-kernel@vger.kernel.org
Another option is to do something like:
# git log kernel/irq/manage.c | grep Author | head -30 | awk
'{ t[$0]++; } END { for (i in t) { print t[i] " " i; }}' | sort -rn
10 Author: Thomas Gleixner <tglx@linutronix.de>
9 Author: Ingo Molnar <mingo@elte.hu>
3 Author: Magnus Damm <damm@igel.co.jp>
2 Author: Linus Torvalds <torvalds@linux-foundation.org>
...
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter P Waskiewicz Jr @ 2009-11-24 9:15 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org, Thomas Gleixner
In-Reply-To: <1259053736.4531.1097.camel@laptop>
On Tue, 2009-11-24 at 02:08 -0700, Peter Zijlstra wrote:
> On Tue, 2009-11-24 at 00:59 -0800, Peter P Waskiewicz Jr wrote:
> > > This all sounds backwards.. we've got a perfectly functional interface
> > > for affinity -- which people object to being used for some reason. So
> > > you add another interface on top, and that is ok?
> > >
> >
> > But it's not functional. If I set the affinity in smp_affinity, then
> > irqbalance will override it 10 seconds later.
>
> And here I was thinking the kernel round-robins IRQ delivery on the mask
> specified there. Are you talking about some daft userspace thing that
> writes into the irq smp_affinity to effect irq balancing?
>
Yep. That's exactly what irqbalance does.
Cheers,
-PJ
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter Zijlstra @ 2009-11-24 9:08 UTC (permalink / raw)
To: Peter P Waskiewicz Jr
Cc: Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org, Thomas Gleixner
In-Reply-To: <1259053156.2631.21.camel@ppwaskie-mobl2>
On Tue, 2009-11-24 at 00:59 -0800, Peter P Waskiewicz Jr wrote:
> > This all sounds backwards.. we've got a perfectly functional interface
> > for affinity -- which people object to being used for some reason. So
> > you add another interface on top, and that is ok?
> >
>
> But it's not functional. If I set the affinity in smp_affinity, then
> irqbalance will override it 10 seconds later.
And here I was thinking the kernel round-robins IRQ delivery on the mask
specified there. Are you talking about some daft userspace thing that
writes into the irq smp_affinity to effect irq balancing?
^ permalink raw reply
* Re: ixgbe question
From: Peter P Waskiewicz Jr @ 2009-11-24 9:07 UTC (permalink / raw)
To: Eric Dumazet
Cc: robert@herjulf.net, Jesper Dangaard Brouer, Linux Netdev List
In-Reply-To: <4B0B8F52.3010005@gmail.com>
On Tue, 2009-11-24 at 00:46 -0700, Eric Dumazet wrote:
> Waskiewicz Jr, Peter P a écrit :
> > Ok, I was confused earlier. I thought you were saying that all packets
> > were headed into a single Rx queue. This is different.
> >
> > Do you know what version of irqbalance you're running, or if it's running
> > at all? We've seen issues with irqbalance where it won't recognize the
> > ethernet device if the driver has been reloaded. In that case, it won't
> > balance the interrupts at all. If the default affinity was set to one
> > CPU, then well, you're screwed.
> >
> > My suggestion in this case is after you reload ixgbe and start your tests,
> > see if it all goes to one CPU. If it does, then restart irqbalance
> > (service irqbalance restart - or just kill it and restart by hand). Then
> > start running your test, and in 10 seconds you should see the interrupts
> > move and spread out.
> >
> > Let me know if this helps,
>
> Sure it helps !
>
> I tried without irqbalance and with irqbalance (Ubuntu 9.10 ships irqbalance 0.55-4)
> I can see irqbalance setting smp_affinities to 5555 or AAAA with no direct effect.
>
> I do receive 16 different irqs, but all serviced on one cpu.
>
> Only way to have irqs on different cpus is to manualy force irq affinities to be exclusive
> (one bit set in the mask, not several ones), and that is not optimal for moderate loads.
>
> echo 1 >`echo /proc/irq/*/fiber1-TxRx-0/../smp_affinity`
> echo 1 >`echo /proc/irq/*/fiber1-TxRx-1/../smp_affinity`
> echo 4 >`echo /proc/irq/*/fiber1-TxRx-2/../smp_affinity`
> echo 4 >`echo /proc/irq/*/fiber1-TxRx-3/../smp_affinity`
> echo 10 >`echo /proc/irq/*/fiber1-TxRx-4/../smp_affinity`
> echo 10 >`echo /proc/irq/*/fiber1-TxRx-5/../smp_affinity`
> echo 40 >`echo /proc/irq/*/fiber1-TxRx-6/../smp_affinity`
> echo 40 >`echo /proc/irq/*/fiber1-TxRx-7/../smp_affinity`
> echo 100 >`echo /proc/irq/*/fiber1-TxRx-8/../smp_affinity`
> echo 100 >`echo /proc/irq/*/fiber1-TxRx-9/../smp_affinity`
> echo 400 >`echo /proc/irq/*/fiber1-TxRx-10/../smp_affinity`
> echo 400 >`echo /proc/irq/*/fiber1-TxRx-11/../smp_affinity`
> echo 1000 >`echo /proc/irq/*/fiber1-TxRx-12/../smp_affinity`
> echo 1000 >`echo /proc/irq/*/fiber1-TxRx-13/../smp_affinity`
> echo 4000 >`echo /proc/irq/*/fiber1-TxRx-14/../smp_affinity`
> echo 4000 >`echo /proc/irq/*/fiber1-TxRx-15/../smp_affinity`
>
>
> One other problem is that after reload of ixgbe driver, link is 95% of the time
> at 1 Gbps speed, and I could not find an easy way to force it being 10 Gbps
>
You might have this elsewhere, but it sounds like you're connecting back
to back with another 82599 NIC. Our optics in that NIC are dual-rate,
and the software mechanism that tries to "autoneg" link speed gets out
of sync easily in back-to-back setups.
If it's really annoying, and you're willing to run with a local patch to
disable the autotry mechanism, try this:
diff --git a/drivers/net/ixgbe/ixgbe_main.c
b/drivers/net/ixgbe/ixgbe_main.c
index a5036f7..62c0915 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4670,6 +4670,10 @@ static void ixgbe_multispeed_fiber_task(struct
work_struct *work)
autoneg = hw->phy.autoneg_advertised;
if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
hw->mac.ops.get_link_capabilities(hw, &autoneg,
&negotiation);
+
+ /* force 10G only */
+ autoneg = IXGBE_LINK_SPEED_10GB_FULL;
+
if (hw->mac.ops.setup_link)
hw->mac.ops.setup_link(hw, autoneg, negotiation, true);
adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
Cheers,
-PJ
^ permalink raw reply related
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter P Waskiewicz Jr @ 2009-11-24 8:59 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org, Thomas Gleixner
In-Reply-To: <1259051902.4531.1053.camel@laptop>
On Tue, 2009-11-24 at 01:38 -0700, Peter Zijlstra wrote:
> On Mon, 2009-11-23 at 15:32 -0800, Waskiewicz Jr, Peter P wrote:
>
> > Unfortunately, a driver can't. The irq_set_affinity() function isn't
> > exported. I proposed a patch on netdev to export it, and then to tie down
> > an interrupt using IRQF_NOBALANCING, so irqbalance won't touch it. That
> > was rejected, since the driver is enforcing policy of the interrupt
> > balancing, not irqbalance.
>
> Why would a patch touching the irq subsystem go to netdev?
The only change to the IRQ subsystem was:
EXPORT_SYMBOL(irq_set_affinity);
The majority of the changeset was for the ixgbe driver.
> What is wrong with exporting irq_set_affinity(), and wtf do you need
> IRQF_NOBALANCING for?
>
Again, the pushback I received was with allowing anything other than
irqbalance to dictate interrupt affinity policy.
And if I set interrupt affinity from the driver or from /proc,
irqbalance will happily rebalance the interrupt elsewhere. The
IRQF_NOBALANCING flag will prevent irqbalance from being able to move
the interrupt.
> > I and Jesse Brandeburg had a meeting with Arjan about this. What we came
> > up with was this interface, so drivers can set what they'd like to see, if
> > irqbalance decides to honor it. That way interrupt affinity policies are
> > set only by irqbalance, but this interface gives us a mechanism to hint to
> > irqbalance what we'd like it to do.
>
> If all you want is to expose policy to userspace then you don't need any
> of this, simply expose the NICs home node through a sysfs device thingy
> (I was under the impression its already there somewhere, but I can't
> ever find anything in /sys).
>
> No need what so ever to poke at the IRQ subsystem.
The point is we need something common that the kernel side (whether a
driver or /proc can modify) that irqbalance can use.
> > Also, if you use the /proc interface to change smp_affinity on an
> > interrupt without any of these changes, irqbalance will override it on its
> > next poll interval. This also is not desirable.
>
> This all sounds backwards.. we've got a perfectly functional interface
> for affinity -- which people object to being used for some reason. So
> you add another interface on top, and that is ok?
>
But it's not functional. If I set the affinity in smp_affinity, then
irqbalance will override it 10 seconds later.
> All the while not CC'ing the IRQ folks,.. brilliant approach.
If I knew who I should CC, I'd be happy to add them. Can you provide
email addresses please?
Cheers,
-PJ Waskiewicz
^ permalink raw reply
* Re: ixgbe question
From: Badalian Vyacheslav @ 2009-11-24 8:46 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Waskiewicz Jr, Peter P, Linux Netdev List
In-Reply-To: <4B0B8F52.3010005@gmail.com>
Eric Dumazet пишет:
> Waskiewicz Jr, Peter P a écrit :
>> Ok, I was confused earlier. I thought you were saying that all packets
>> were headed into a single Rx queue. This is different.
>>
>> Do you know what version of irqbalance you're running, or if it's running
>> at all? We've seen issues with irqbalance where it won't recognize the
>> ethernet device if the driver has been reloaded. In that case, it won't
>> balance the interrupts at all. If the default affinity was set to one
>> CPU, then well, you're screwed.
>>
>> My suggestion in this case is after you reload ixgbe and start your tests,
>> see if it all goes to one CPU. If it does, then restart irqbalance
>> (service irqbalance restart - or just kill it and restart by hand). Then
>> start running your test, and in 10 seconds you should see the interrupts
>> move and spread out.
>>
>> Let me know if this helps,
>
> Sure it helps !
>
> I tried without irqbalance and with irqbalance (Ubuntu 9.10 ships irqbalance 0.55-4)
> I can see irqbalance setting smp_affinities to 5555 or AAAA with no direct effect.
>
> I do receive 16 different irqs, but all serviced on one cpu.
>
> Only way to have irqs on different cpus is to manualy force irq affinities to be exclusive
> (one bit set in the mask, not several ones), and that is not optimal for moderate loads.
>
> echo 1 >`echo /proc/irq/*/fiber1-TxRx-0/../smp_affinity`
> echo 1 >`echo /proc/irq/*/fiber1-TxRx-1/../smp_affinity`
> echo 4 >`echo /proc/irq/*/fiber1-TxRx-2/../smp_affinity`
> echo 4 >`echo /proc/irq/*/fiber1-TxRx-3/../smp_affinity`
> echo 10 >`echo /proc/irq/*/fiber1-TxRx-4/../smp_affinity`
> echo 10 >`echo /proc/irq/*/fiber1-TxRx-5/../smp_affinity`
> echo 40 >`echo /proc/irq/*/fiber1-TxRx-6/../smp_affinity`
> echo 40 >`echo /proc/irq/*/fiber1-TxRx-7/../smp_affinity`
> echo 100 >`echo /proc/irq/*/fiber1-TxRx-8/../smp_affinity`
> echo 100 >`echo /proc/irq/*/fiber1-TxRx-9/../smp_affinity`
> echo 400 >`echo /proc/irq/*/fiber1-TxRx-10/../smp_affinity`
> echo 400 >`echo /proc/irq/*/fiber1-TxRx-11/../smp_affinity`
> echo 1000 >`echo /proc/irq/*/fiber1-TxRx-12/../smp_affinity`
> echo 1000 >`echo /proc/irq/*/fiber1-TxRx-13/../smp_affinity`
> echo 4000 >`echo /proc/irq/*/fiber1-TxRx-14/../smp_affinity`
> echo 4000 >`echo /proc/irq/*/fiber1-TxRx-15/../smp_affinity`
>
>
> One other problem is that after reload of ixgbe driver, link is 95% of the time
> at 1 Gbps speed, and I could not find an easy way to force it being 10 Gbps
>
> I run following script many times and stop it when 10 Gbps speed if reached.
>
> ethtool -A fiber0 rx off tx off
> ip link set fiber0 down
> ip link set fiber1 down
> sleep 2
> ethtool fiber0
> ethtool -s fiber0 speed 10000
> ethtool -s fiber1 speed 10000
> ethtool -r fiber0 &
> ethtool -r fiber1 &
> ethtool fiber0
> ip link set fiber1 up &
> ip link set fiber0 up &
> ethtool fiber0
>
> [ 33.625689] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 2.0.44-k2
> [ 33.625692] ixgbe: Copyright (c) 1999-2009 Intel Corporation.
> [ 33.625741] ixgbe 0000:07:00.0: PCI INT A -> GSI 32 (level, low) -> IRQ 32
> [ 33.625760] ixgbe 0000:07:00.0: setting latency timer to 64
> [ 33.735579] ixgbe 0000:07:00.0: irq 100 for MSI/MSI-X
> [ 33.735583] ixgbe 0000:07:00.0: irq 101 for MSI/MSI-X
> [ 33.735585] ixgbe 0000:07:00.0: irq 102 for MSI/MSI-X
> [ 33.735587] ixgbe 0000:07:00.0: irq 103 for MSI/MSI-X
> [ 33.735589] ixgbe 0000:07:00.0: irq 104 for MSI/MSI-X
> [ 33.735591] ixgbe 0000:07:00.0: irq 105 for MSI/MSI-X
> [ 33.735593] ixgbe 0000:07:00.0: irq 106 for MSI/MSI-X
> [ 33.735595] ixgbe 0000:07:00.0: irq 107 for MSI/MSI-X
> [ 33.735597] ixgbe 0000:07:00.0: irq 108 for MSI/MSI-X
> [ 33.735599] ixgbe 0000:07:00.0: irq 109 for MSI/MSI-X
> [ 33.735602] ixgbe 0000:07:00.0: irq 110 for MSI/MSI-X
> [ 33.735604] ixgbe 0000:07:00.0: irq 111 for MSI/MSI-X
> [ 33.735606] ixgbe 0000:07:00.0: irq 112 for MSI/MSI-X
> [ 33.735608] ixgbe 0000:07:00.0: irq 113 for MSI/MSI-X
> [ 33.735610] ixgbe 0000:07:00.0: irq 114 for MSI/MSI-X
> [ 33.735612] ixgbe 0000:07:00.0: irq 115 for MSI/MSI-X
> [ 33.735614] ixgbe 0000:07:00.0: irq 116 for MSI/MSI-X
> [ 33.735633] ixgbe: 0000:07:00.0: ixgbe_init_interrupt_scheme: Multiqueue Enabled: Rx Queue count = 16, Tx Queue count = 16
> [ 33.735638] ixgbe 0000:07:00.0: (PCI Express:5.0Gb/s:Width x8) 00:1b:21:4a:fe:54
> [ 33.735722] ixgbe 0000:07:00.0: MAC: 2, PHY: 11, SFP+: 5, PBA No: e66562-003
> [ 33.738111] ixgbe 0000:07:00.0: Intel(R) 10 Gigabit Network Connection
> [ 33.738135] ixgbe 0000:07:00.1: PCI INT B -> GSI 42 (level, low) -> IRQ 42
> [ 33.738151] ixgbe 0000:07:00.1: setting latency timer to 64
> [ 33.853526] ixgbe 0000:07:00.1: irq 117 for MSI/MSI-X
> [ 33.853529] ixgbe 0000:07:00.1: irq 118 for MSI/MSI-X
> [ 33.853532] ixgbe 0000:07:00.1: irq 119 for MSI/MSI-X
> [ 33.853534] ixgbe 0000:07:00.1: irq 120 for MSI/MSI-X
> [ 33.853536] ixgbe 0000:07:00.1: irq 121 for MSI/MSI-X
> [ 33.853538] ixgbe 0000:07:00.1: irq 122 for MSI/MSI-X
> [ 33.853540] ixgbe 0000:07:00.1: irq 123 for MSI/MSI-X
> [ 33.853542] ixgbe 0000:07:00.1: irq 124 for MSI/MSI-X
> [ 33.853544] ixgbe 0000:07:00.1: irq 125 for MSI/MSI-X
> [ 33.853546] ixgbe 0000:07:00.1: irq 126 for MSI/MSI-X
> [ 33.853548] ixgbe 0000:07:00.1: irq 127 for MSI/MSI-X
> [ 33.853550] ixgbe 0000:07:00.1: irq 128 for MSI/MSI-X
> [ 33.853552] ixgbe 0000:07:00.1: irq 129 for MSI/MSI-X
> [ 33.853554] ixgbe 0000:07:00.1: irq 130 for MSI/MSI-X
> [ 33.853556] ixgbe 0000:07:00.1: irq 131 for MSI/MSI-X
> [ 33.853558] ixgbe 0000:07:00.1: irq 132 for MSI/MSI-X
> [ 33.853560] ixgbe 0000:07:00.1: irq 133 for MSI/MSI-X
> [ 33.853580] ixgbe: 0000:07:00.1: ixgbe_init_interrupt_scheme: Multiqueue Enabled: Rx Queue count = 16, Tx Queue count = 16
> [ 33.853585] ixgbe 0000:07:00.1: (PCI Express:5.0Gb/s:Width x8) 00:1b:21:4a:fe:55
> [ 33.853669] ixgbe 0000:07:00.1: MAC: 2, PHY: 11, SFP+: 5, PBA No: e66562-003
> [ 33.855956] ixgbe 0000:07:00.1: Intel(R) 10 Gigabit Network Connection
>
> [ 85.208233] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: RX/TX
> [ 85.237453] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: RX/TX
> [ 96.080713] ixgbe: fiber1 NIC Link is Down
> [ 102.094610] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 102.119572] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 142.524691] ixgbe: fiber1 NIC Link is Down
> [ 148.421332] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 148.449465] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 160.728643] ixgbe: fiber1 NIC Link is Down
> [ 172.832301] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 173.659038] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 184.554501] ixgbe: fiber0 NIC Link is Down
> [ 185.376273] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 186.493598] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 190.564383] ixgbe: fiber0 NIC Link is Down
> [ 191.391149] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 192.484492] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 192.545424] ixgbe: fiber1 NIC Link is Down
> [ 205.858197] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 206.684940] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 211.991875] ixgbe: fiber1 NIC Link is Down
> [ 220.833478] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 220.833630] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 229.804853] ixgbe: fiber1 NIC Link is Down
> [ 248.395672] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
> [ 249.222408] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
> [ 484.631598] ixgbe: fiber1 NIC Link is Down
> [ 490.138931] ixgbe: fiber1 NIC Link is Up 10 Gbps, Flow Control: None
> [ 490.167880] ixgbe: fiber0 NIC Link is Up 10 Gbps, Flow Control: None
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
May be its Flow Director?
Multuqueue in this network card work only if you set 1 queue to 1 cpu core in smp_affinity :(
In README:
Intel(R) Ethernet Flow Director
-------------------------------
Supports advanced filters that direct receive packets by their flows to
different queues. Enables tight control on routing a flow in the platform.
Matches flows and CPU cores for flow affinity. Supports multiple parameters
for flexible flow classification and load balancing.
Flow director is enabled only if the kernel is multiple TX queue capable.
An included script (set_irq_affinity.sh) automates setting the IRQ to CPU
affinity.
You can verify that the driver is using Flow Director by looking at the counter
in ethtool: fdir_miss and fdir_match.
The following three parameters impact Flow Director.
FdirMode
--------
Valid Range: 0-2 (0=off, 1=ATR, 2=Perfect filter mode)
Default Value: 1
Flow Director filtering modes.
FdirPballoc
-----------
Valid Range: 0-2 (0=64k, 1=128k, 2=256k)
Default Value: 0
Flow Director allocated packet buffer size.
AtrSampleRate
--------------
Valid Range: 1-100
Default Value: 20
Software ATR Tx packet sample rate. For example, when set to 20, every 20th
packet, looks to see if the packet will create a new flow.
^ permalink raw reply
* Re: [PATCH 2/4] macvlan: cleanup rx statistics
From: Arnd Bergmann @ 2009-11-24 8:45 UTC (permalink / raw)
To: virtualization
Cc: Eric Dumazet, Herbert Xu, Anna Fischer, netdev, bridge,
linux-kernel, Mark Smith, Gerhard Stenzel, Eric W. Biederman,
Jens Osterkamp, Patrick Mullaney, Stephen Hemminger,
Edge Virtual Bridging, David Miller
In-Reply-To: <4B0B9639.4070607@gmail.com>
On Tuesday 24 November 2009 08:15:53 Eric Dumazet wrote:
> Arnd Bergmann a écrit :
> >
> > +static inline void macvlan_count_rx(const struct macvlan_dev *vlan, int length,
> > + int success, int multicast)
>
> success and multicast should be declared as bool
ok
> > +{
> > + struct macvlan_rx_stats *rx_stats;
> > +
> > + rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
> > + rx_stats->rx_packets += success != 0;
> > + rx_stats->rx_bytes += success ? length : 0;
> > + rx_stats->multicast += success && multicast;
> > + rx_stats->rx_errors += !success;
> > +}
> > +
>
> I find following more readable, it probably generates more branches,
> but avoid dirtying rx_errors if it is in another cache line.
>
> if (likely(success)) {
> rx_stats->rx_packets++;
> rx_stats->rx_bytes += length;
> if (multicast)
> rx_stats->multicast++;
> } else {
> rx_stats->rx_errors++;
> }
Given that the structure only has four members and alloc_percpu requests
cache aligned data, it is rather likely to be in the same cache line.
I'll have a look at what gcc generates on x86-64 for both versions
and use the version you suggested unless it looks significantly more
expensive.
Since we're into micro-optimization territory, do you think it should
be marked inline or not?
> > - rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
> > skb = skb_share_check(skb, GFP_ATOMIC);
> > - if (skb == NULL) {
> > - rx_stats->rx_errors++;
> > - return NULL;
> > - }
> > -
> > - rx_stats->rx_bytes += skb->len + ETH_HLEN;
> > - rx_stats->rx_packets++;
> > + macvlan_count_rx(vlan, skb->len + ETH_HLEN, likely(skb != NULL), 0);
>
> its not _likely_ that skb != NULL, its a fact :)
>
> -> macvlan_count_rx(vlan, skb->len + ETH_HLEN, true, false);
I don't understand. Note how I removed the check for NULL above and
the skb pointer may be the result of a failing skb_clone().
Looking at this again, I actually introduced a bug by calling netif_rx
on a possibly NULL skb, I'll fix that.
Thanks!
Arnd <><
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter Zijlstra @ 2009-11-24 8:39 UTC (permalink / raw)
To: Arjan van de Ven
Cc: Peter P Waskiewicz Jr, Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org
In-Reply-To: <4B0B782A.4030901@linux.intel.com>
On Mon, 2009-11-23 at 22:07 -0800, Arjan van de Ven wrote:
> Peter Zijlstra wrote:
> > On Mon, 2009-11-23 at 01:36 -0800, Peter P Waskiewicz Jr wrote:
> >
> >> This mechanism isn't going to be used by any internal kernel mechanism
> >> for determining interrupt placement or operation. It's purely something
> >> that either a driver can modify, or external script (through /proc),
> >> that irqbalance will make use of. If irqbalance isn't running, or the
> >> current version of irqbalance doesn't support reading node_affinity,
> >> then it won't affect the system's operation.
> >>
> >> If irqbalance does support it, it'll read whatever the supplied mask is,
> >> and then will try and balance interrupts within that mask. It will bail
> >> if the mask is invalid, or won't apply to the running system, just like
> >> how putting a bogus mask into smp_affinity is ignored.
> >>
> >> If there's something I'm missing beyond this with the two suggestions
> >> you've made (I looked into those two parameters and tried to draw
> >> conclusions), please let me know.
> >
> > I don't see the point in adding it, if the driver wants to set a node
> > cpu mask it can already do that using the regular smp affinity settings.
> >
> > Same for userspace.
>
> the problem is that there is no way currently that the driver can communicate
> "I allocated all my metadata on THIS numa node". irqbalance and sysadmins need
> that to not make really stupid decisions.....
And what exactly is struct device::numa_node good for then?
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter P Waskiewicz Jr @ 2009-11-24 8:39 UTC (permalink / raw)
To: Yong Zhang
Cc: linux-kernel@vger.kernel.org, arjan@linux.jf.intel.com,
davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <2674af740911232117l275e933yaca3f1b8c1207bce@mail.gmail.com>
On Mon, 2009-11-23 at 22:17 -0700, Yong Zhang wrote:
> [snip]
> >>
> >> 1) I think you should consider CONFIG_CPUMASK_OFFSTACK which will affect
> >> node_affinity.
> >> 2) It seems like this patch can't work with SPARSE_IRQ.
> >
> > This mechanism isn't going to be used by any internal kernel mechanism
> > for determining interrupt placement or operation. It's purely something
> > that either a driver can modify, or external script (through /proc),
> > that irqbalance will make use of. If irqbalance isn't running, or the
> > current version of irqbalance doesn't support reading node_affinity,
> > then it won't affect the system's operation.
> >
> > If irqbalance does support it, it'll read whatever the supplied mask is,
> > and then will try and balance interrupts within that mask. It will bail
> > if the mask is invalid, or won't apply to the running system, just like
> > how putting a bogus mask into smp_affinity is ignored.
> >
> > If there's something I'm missing beyond this with the two suggestions
> > you've made (I looked into those two parameters and tried to draw
> > conclusions), please let me know.
>
> My two suggestions are both about your adding node_affinity. Before you can
> use this element, you must initialise it firstly. You can refer how
> irq_desc::affinity
> is used in function alloc_desc_masks().
> include/linux/irq.h:
> static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
> bool boot)
> {
> gfp_t gfp = GFP_ATOMIC;
>
> if (boot)
> gfp = GFP_NOWAIT;
>
> #ifdef CONFIG_CPUMASK_OFFSTACK
> if (!alloc_cpumask_var_node(&desc->affinity, gfp, node))
> return false;
>
> #ifdef CONFIG_GENERIC_PENDING_IRQ
> if (!alloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
> free_cpumask_var(desc->affinity);
> return false;
> }
> #endif
> #endif
> return true;
> }
>
Ah, ok. I see what you were referring to now. Let me respin the patch
and send a second version.
Thanks Yong,
-PJ Waskiewicz
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Peter Zijlstra @ 2009-11-24 8:38 UTC (permalink / raw)
To: Waskiewicz Jr, Peter P
Cc: Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org, Thomas Gleixner
In-Reply-To: <Pine.WNT.4.64.0911231529240.10056@ppwaskie-MOBL2.amr.corp.intel.com>
On Mon, 2009-11-23 at 15:32 -0800, Waskiewicz Jr, Peter P wrote:
> Unfortunately, a driver can't. The irq_set_affinity() function isn't
> exported. I proposed a patch on netdev to export it, and then to tie down
> an interrupt using IRQF_NOBALANCING, so irqbalance won't touch it. That
> was rejected, since the driver is enforcing policy of the interrupt
> balancing, not irqbalance.
Why would a patch touching the irq subsystem go to netdev?
What is wrong with exporting irq_set_affinity(), and wtf do you need
IRQF_NOBALANCING for?
> I and Jesse Brandeburg had a meeting with Arjan about this. What we came
> up with was this interface, so drivers can set what they'd like to see, if
> irqbalance decides to honor it. That way interrupt affinity policies are
> set only by irqbalance, but this interface gives us a mechanism to hint to
> irqbalance what we'd like it to do.
If all you want is to expose policy to userspace then you don't need any
of this, simply expose the NICs home node through a sysfs device thingy
(I was under the impression its already there somewhere, but I can't
ever find anything in /sys).
No need what so ever to poke at the IRQ subsystem.
> Also, if you use the /proc interface to change smp_affinity on an
> interrupt without any of these changes, irqbalance will override it on its
> next poll interval. This also is not desirable.
This all sounds backwards.. we've got a perfectly functional interface
for affinity -- which people object to being used for some reason. So
you add another interface on top, and that is ok?
All the while not CC'ing the IRQ folks,.. brilliant approach.
^ permalink raw reply
* Re: [PATCH 2/4] macvlan: cleanup rx statistics
From: Eric Dumazet @ 2009-11-24 8:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, netdev, David Miller, Stephen Hemminger, Herbert Xu,
Patrick Mullaney, Eric W. Biederman, Edge Virtual Bridging,
Anna Fischer, bridge, virtualization, Jens Osterkamp,
Gerhard Stenzel, Patrick McHardy, Mark Smith
In-Reply-To: <1259024166-28158-3-git-send-email-arnd@arndb.de>
Arnd Bergmann a écrit :
> We have very similar code for rx statistics in
> two places in the macvlan driver, with a third
> one being added in the next patch.
>
> Consolidate them into one function to improve
> overall readability of the driver.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/macvlan.c | 63 +++++++++++++++++++++++++-----------------------
> 1 files changed, 33 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index ae2b5c7..a0dea23 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -116,42 +116,53 @@ static int macvlan_addr_busy(const struct macvlan_port *port,
> return 0;
> }
>
> +static inline void macvlan_count_rx(const struct macvlan_dev *vlan, int length,
> + int success, int multicast)
success and multicast should be declared as bool
> +{
> + struct macvlan_rx_stats *rx_stats;
> +
> + rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
> + rx_stats->rx_packets += success != 0;
> + rx_stats->rx_bytes += success ? length : 0;
> + rx_stats->multicast += success && multicast;
> + rx_stats->rx_errors += !success;
> +}
> +
I find following more readable, it probably generates more branches,
but avoid dirtying rx_errors if it is in another cache line.
if (likely(success)) {
rx_stats->rx_packets++;
rx_stats->rx_bytes += length;
if (multicast)
rx_stats->multicast++;
} else {
rx_stats->rx_errors++;
}
> - rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
> skb = skb_share_check(skb, GFP_ATOMIC);
> - if (skb == NULL) {
> - rx_stats->rx_errors++;
> - return NULL;
> - }
> -
> - rx_stats->rx_bytes += skb->len + ETH_HLEN;
> - rx_stats->rx_packets++;
> + macvlan_count_rx(vlan, skb->len + ETH_HLEN, likely(skb != NULL), 0);
its not _likely_ that skb != NULL, its a fact :)
-> macvlan_count_rx(vlan, skb->len + ETH_HLEN, true, false);
^ permalink raw reply
* Re: icmp redirects problem
From: Jarek Poplawski @ 2009-11-24 7:58 UTC (permalink / raw)
To: Alex Samad; +Cc: netdev
In-Reply-To: <20091124001230.GC14245@samad.com.au>
On Tue, Nov 24, 2009 at 11:12:30AM +1100, Alex Samad wrote:
> On Mon, Nov 23, 2009 at 10:58:38PM +0100, Jarek Poplawski wrote:
> > Alex Samad wrote, On 11/23/2009 05:31 AM:
> >
>
> [snip]
>
> > >
> > > laptop gets its ip from dchp server that make 192.168.11.1 the default
> > > gateway and its 192.168.11.1 that sends out the icmp redirect.
> >
> > Btw, it seems you should fix your routing (by adding sydrt01's eth0
> > the second ip or advertising 192.168.11.10 more) to avoid those
> > redirects.
>
> sorry I am lost on this statement, I can't add 192.168.11.10 to sydrt01
> as it is not physically connected to the 192.168.10.0/24 any more, which
> is why I had added the route on sydrt01 and which is why it send
> icmp_rediercts.
>
> I have updated the route table on each static machine, but the problem
> is on the machines that get their ip via dhcp - I haven't looked at
> pushing out route information via dhcp - I am not sure that it would
> work in a mixed windows / linux environment.
>
> what do you mean by advertising 192.168.11.10 more ?
I meant just what you've described, but wasn't sure of your config.
>
> >
> > >
> > > I had a quick look at the kernel tree for 2.6.31 (which is what I am
> > > using).
> >
> > ...
> >
> > > Line 680
> > > secure_redirects - BOOLEAN
> > > 681 Accept ICMP redirect messages only for gateways,
> > > 682 listed in default gateway list.
> > > 683 secure_redirects for the interface will be enabled if at
> > > least one of
> > > 684 conf/{all,interface}/secure_redirects is set to TRUE,
> > > 685 it will be disabled otherwise
> > > 686 default TRUE
> >
> > Very helpful links. So, as you wrote "the documentation seems to suggest"
> > something, and IMHO even if it doesn't, it's needlessly too concise
> > considering your "lost time", and I'd suggest you sending a patch to fix
> > this. (It seems it could "touch" shared_media, as well.)
>
> Which is wrong the code or the documentation and which part the test or
> the reliance on the shared_media or on the redirects flags
The code looks consistent to me. The documentation isn't wrong either,
until it only "seems to suggest", but it might be better, if it
metioned just what you tested: both things depend on accept_redirects.
Jarek P.
^ permalink raw reply
* Re: ixgbe question
From: Eric Dumazet @ 2009-11-24 7:46 UTC (permalink / raw)
To: Waskiewicz Jr, Peter P
Cc: robert@herjulf.net, Jesper Dangaard Brouer, Linux Netdev List
In-Reply-To: <Pine.WNT.4.64.0911231525180.10056@ppwaskie-MOBL2.amr.corp.intel.com>
Waskiewicz Jr, Peter P a écrit :
> Ok, I was confused earlier. I thought you were saying that all packets
> were headed into a single Rx queue. This is different.
>
> Do you know what version of irqbalance you're running, or if it's running
> at all? We've seen issues with irqbalance where it won't recognize the
> ethernet device if the driver has been reloaded. In that case, it won't
> balance the interrupts at all. If the default affinity was set to one
> CPU, then well, you're screwed.
>
> My suggestion in this case is after you reload ixgbe and start your tests,
> see if it all goes to one CPU. If it does, then restart irqbalance
> (service irqbalance restart - or just kill it and restart by hand). Then
> start running your test, and in 10 seconds you should see the interrupts
> move and spread out.
>
> Let me know if this helps,
Sure it helps !
I tried without irqbalance and with irqbalance (Ubuntu 9.10 ships irqbalance 0.55-4)
I can see irqbalance setting smp_affinities to 5555 or AAAA with no direct effect.
I do receive 16 different irqs, but all serviced on one cpu.
Only way to have irqs on different cpus is to manualy force irq affinities to be exclusive
(one bit set in the mask, not several ones), and that is not optimal for moderate loads.
echo 1 >`echo /proc/irq/*/fiber1-TxRx-0/../smp_affinity`
echo 1 >`echo /proc/irq/*/fiber1-TxRx-1/../smp_affinity`
echo 4 >`echo /proc/irq/*/fiber1-TxRx-2/../smp_affinity`
echo 4 >`echo /proc/irq/*/fiber1-TxRx-3/../smp_affinity`
echo 10 >`echo /proc/irq/*/fiber1-TxRx-4/../smp_affinity`
echo 10 >`echo /proc/irq/*/fiber1-TxRx-5/../smp_affinity`
echo 40 >`echo /proc/irq/*/fiber1-TxRx-6/../smp_affinity`
echo 40 >`echo /proc/irq/*/fiber1-TxRx-7/../smp_affinity`
echo 100 >`echo /proc/irq/*/fiber1-TxRx-8/../smp_affinity`
echo 100 >`echo /proc/irq/*/fiber1-TxRx-9/../smp_affinity`
echo 400 >`echo /proc/irq/*/fiber1-TxRx-10/../smp_affinity`
echo 400 >`echo /proc/irq/*/fiber1-TxRx-11/../smp_affinity`
echo 1000 >`echo /proc/irq/*/fiber1-TxRx-12/../smp_affinity`
echo 1000 >`echo /proc/irq/*/fiber1-TxRx-13/../smp_affinity`
echo 4000 >`echo /proc/irq/*/fiber1-TxRx-14/../smp_affinity`
echo 4000 >`echo /proc/irq/*/fiber1-TxRx-15/../smp_affinity`
One other problem is that after reload of ixgbe driver, link is 95% of the time
at 1 Gbps speed, and I could not find an easy way to force it being 10 Gbps
I run following script many times and stop it when 10 Gbps speed if reached.
ethtool -A fiber0 rx off tx off
ip link set fiber0 down
ip link set fiber1 down
sleep 2
ethtool fiber0
ethtool -s fiber0 speed 10000
ethtool -s fiber1 speed 10000
ethtool -r fiber0 &
ethtool -r fiber1 &
ethtool fiber0
ip link set fiber1 up &
ip link set fiber0 up &
ethtool fiber0
[ 33.625689] ixgbe: Intel(R) 10 Gigabit PCI Express Network Driver - version 2.0.44-k2
[ 33.625692] ixgbe: Copyright (c) 1999-2009 Intel Corporation.
[ 33.625741] ixgbe 0000:07:00.0: PCI INT A -> GSI 32 (level, low) -> IRQ 32
[ 33.625760] ixgbe 0000:07:00.0: setting latency timer to 64
[ 33.735579] ixgbe 0000:07:00.0: irq 100 for MSI/MSI-X
[ 33.735583] ixgbe 0000:07:00.0: irq 101 for MSI/MSI-X
[ 33.735585] ixgbe 0000:07:00.0: irq 102 for MSI/MSI-X
[ 33.735587] ixgbe 0000:07:00.0: irq 103 for MSI/MSI-X
[ 33.735589] ixgbe 0000:07:00.0: irq 104 for MSI/MSI-X
[ 33.735591] ixgbe 0000:07:00.0: irq 105 for MSI/MSI-X
[ 33.735593] ixgbe 0000:07:00.0: irq 106 for MSI/MSI-X
[ 33.735595] ixgbe 0000:07:00.0: irq 107 for MSI/MSI-X
[ 33.735597] ixgbe 0000:07:00.0: irq 108 for MSI/MSI-X
[ 33.735599] ixgbe 0000:07:00.0: irq 109 for MSI/MSI-X
[ 33.735602] ixgbe 0000:07:00.0: irq 110 for MSI/MSI-X
[ 33.735604] ixgbe 0000:07:00.0: irq 111 for MSI/MSI-X
[ 33.735606] ixgbe 0000:07:00.0: irq 112 for MSI/MSI-X
[ 33.735608] ixgbe 0000:07:00.0: irq 113 for MSI/MSI-X
[ 33.735610] ixgbe 0000:07:00.0: irq 114 for MSI/MSI-X
[ 33.735612] ixgbe 0000:07:00.0: irq 115 for MSI/MSI-X
[ 33.735614] ixgbe 0000:07:00.0: irq 116 for MSI/MSI-X
[ 33.735633] ixgbe: 0000:07:00.0: ixgbe_init_interrupt_scheme: Multiqueue Enabled: Rx Queue count = 16, Tx Queue count = 16
[ 33.735638] ixgbe 0000:07:00.0: (PCI Express:5.0Gb/s:Width x8) 00:1b:21:4a:fe:54
[ 33.735722] ixgbe 0000:07:00.0: MAC: 2, PHY: 11, SFP+: 5, PBA No: e66562-003
[ 33.738111] ixgbe 0000:07:00.0: Intel(R) 10 Gigabit Network Connection
[ 33.738135] ixgbe 0000:07:00.1: PCI INT B -> GSI 42 (level, low) -> IRQ 42
[ 33.738151] ixgbe 0000:07:00.1: setting latency timer to 64
[ 33.853526] ixgbe 0000:07:00.1: irq 117 for MSI/MSI-X
[ 33.853529] ixgbe 0000:07:00.1: irq 118 for MSI/MSI-X
[ 33.853532] ixgbe 0000:07:00.1: irq 119 for MSI/MSI-X
[ 33.853534] ixgbe 0000:07:00.1: irq 120 for MSI/MSI-X
[ 33.853536] ixgbe 0000:07:00.1: irq 121 for MSI/MSI-X
[ 33.853538] ixgbe 0000:07:00.1: irq 122 for MSI/MSI-X
[ 33.853540] ixgbe 0000:07:00.1: irq 123 for MSI/MSI-X
[ 33.853542] ixgbe 0000:07:00.1: irq 124 for MSI/MSI-X
[ 33.853544] ixgbe 0000:07:00.1: irq 125 for MSI/MSI-X
[ 33.853546] ixgbe 0000:07:00.1: irq 126 for MSI/MSI-X
[ 33.853548] ixgbe 0000:07:00.1: irq 127 for MSI/MSI-X
[ 33.853550] ixgbe 0000:07:00.1: irq 128 for MSI/MSI-X
[ 33.853552] ixgbe 0000:07:00.1: irq 129 for MSI/MSI-X
[ 33.853554] ixgbe 0000:07:00.1: irq 130 for MSI/MSI-X
[ 33.853556] ixgbe 0000:07:00.1: irq 131 for MSI/MSI-X
[ 33.853558] ixgbe 0000:07:00.1: irq 132 for MSI/MSI-X
[ 33.853560] ixgbe 0000:07:00.1: irq 133 for MSI/MSI-X
[ 33.853580] ixgbe: 0000:07:00.1: ixgbe_init_interrupt_scheme: Multiqueue Enabled: Rx Queue count = 16, Tx Queue count = 16
[ 33.853585] ixgbe 0000:07:00.1: (PCI Express:5.0Gb/s:Width x8) 00:1b:21:4a:fe:55
[ 33.853669] ixgbe 0000:07:00.1: MAC: 2, PHY: 11, SFP+: 5, PBA No: e66562-003
[ 33.855956] ixgbe 0000:07:00.1: Intel(R) 10 Gigabit Network Connection
[ 85.208233] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: RX/TX
[ 85.237453] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: RX/TX
[ 96.080713] ixgbe: fiber1 NIC Link is Down
[ 102.094610] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 102.119572] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 142.524691] ixgbe: fiber1 NIC Link is Down
[ 148.421332] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 148.449465] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 160.728643] ixgbe: fiber1 NIC Link is Down
[ 172.832301] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 173.659038] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 184.554501] ixgbe: fiber0 NIC Link is Down
[ 185.376273] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 186.493598] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 190.564383] ixgbe: fiber0 NIC Link is Down
[ 191.391149] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 192.484492] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 192.545424] ixgbe: fiber1 NIC Link is Down
[ 205.858197] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 206.684940] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 211.991875] ixgbe: fiber1 NIC Link is Down
[ 220.833478] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 220.833630] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 229.804853] ixgbe: fiber1 NIC Link is Down
[ 248.395672] ixgbe: fiber0 NIC Link is Up 1 Gbps, Flow Control: None
[ 249.222408] ixgbe: fiber1 NIC Link is Up 1 Gbps, Flow Control: None
[ 484.631598] ixgbe: fiber1 NIC Link is Down
[ 490.138931] ixgbe: fiber1 NIC Link is Up 10 Gbps, Flow Control: None
[ 490.167880] ixgbe: fiber0 NIC Link is Up 10 Gbps, Flow Control: None
^ permalink raw reply
* [PATCH 1/2] drivers/net/bna: Use pr_<level>, dev_<level>, remove DPRINTK
From: Joe Perches @ 2009-11-24 7:24 UTC (permalink / raw)
To: Rasesh Mody; +Cc: adapter_linux_open_src_team, netdev
In-Reply-To: <cover.1259047344.git.joe@perches.com>
Remove DPRINTK(LEVEL, fmt, arg) and convert uses to pr_<level>
Convert printk(KERN_<LEVEL> to pr_<level>
Use dev_<level> as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bna/bfa_csdebug.c | 10 +--
drivers/net/bna/bfa_ioc.c | 5 +-
drivers/net/bna/bfad_fwimg.c | 8 +-
drivers/net/bna/bna_fn.c | 7 +-
drivers/net/bna/bna_if.c | 48 +++++-------
drivers/net/bna/bnad.c | 171 +++++++++++++++-------------------------
drivers/net/bna/bnad_compat.h | 13 ---
drivers/net/bna/cna.h | 5 -
8 files changed, 97 insertions(+), 170 deletions(-)
diff --git a/drivers/net/bna/bfa_csdebug.c b/drivers/net/bna/bfa_csdebug.c
index c0ef773..c9f3480 100644
--- a/drivers/net/bna/bfa_csdebug.c
+++ b/drivers/net/bna/bfa_csdebug.c
@@ -20,6 +20,8 @@
* pbind.c BFA FC Persistent target binding
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "cs/bfa_debug.h"
#include "cna.h"
#include "cs/bfa_q.h"
@@ -31,18 +33,14 @@
void
bfa_panic(int line, char *file, char *panicstr)
{
-
- DPRINTK(ERR, "Assertion failure: %s:%d: %s",
- file, line, panicstr);
+ pr_err("Assertion failure: %s:%d: %s\n", file, line, panicstr);
bfa_os_panic();
}
void
bfa_sm_panic(struct bfa_log_mod *logm, int line, char *file, int event)
{
-
- DPRINTK(ERR, "SM Assertion failure: %s:%d: event = %d",
- file, line, event);
+ pr_err("SM Assertion failure: %s:%d: event = %d\n", file, line, event);
bfa_os_panic();
}
diff --git a/drivers/net/bna/bfa_ioc.c b/drivers/net/bna/bfa_ioc.c
index b572cc5..f601850 100644
--- a/drivers/net/bna/bfa_ioc.c
+++ b/drivers/net/bna/bfa_ioc.c
@@ -16,6 +16,8 @@
* www.brocade.com
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "bfa_ioc.h"
#include "bfa_fwimg_priv.h"
#include "cs/bfa_debug.h"
@@ -1015,8 +1017,7 @@ bfa_ioc_hb_check(void *cbarg)
hb_count = bfa_reg_read(ioc->ioc_regs.heartbeat);
if (ioc->hb_count == hb_count) {
-
- DPRINTK(CRIT, "Firmware heartbeat failure at %d", hb_count);
+ pr_crit("Firmware heartbeat failure at %d\n", hb_count);
bfa_ioc_recover(ioc);
return;
} else {
diff --git a/drivers/net/bna/bfad_fwimg.c b/drivers/net/bna/bfad_fwimg.c
index 37fa6d5..d1ad2e2 100644
--- a/drivers/net/bna/bfad_fwimg.c
+++ b/drivers/net/bna/bfad_fwimg.c
@@ -16,6 +16,8 @@
* www.brocade.com
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
/**
* bfad_fwimg.c Linux driver PCI interface module.
*/
@@ -47,14 +49,14 @@ bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
const struct firmware *fw;
if (request_firmware(&fw, fw_name, &pdev->dev)) {
- printk(KERN_ALERT "Can't locate firmware %s\n", fw_name);
+ pr_alert("Can't locate firmware %s\n", fw_name);
goto error;
}
*bfi_image = vmalloc(fw->size);
if (NULL == *bfi_image) {
- printk(KERN_ALERT "Fail to allocate buffer for fw image "
- "size=%x!\n", (u32) fw->size);
+ pr_alert("Fail to allocate buffer for fw image size=%x!\n",
+ (u32)fw->size);
goto error;
}
diff --git a/drivers/net/bna/bna_fn.c b/drivers/net/bna/bna_fn.c
index 01218ca..03d4e94 100644
--- a/drivers/net/bna/bna_fn.c
+++ b/drivers/net/bna/bna_fn.c
@@ -18,6 +18,8 @@
* @file bna_fn.c BNA Rx and Tx Function Management
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "cna.h"
#include "bna.h"
#include "bna_hwreg.h"
@@ -657,14 +659,11 @@ enum bna_status_e bna_rxf_mcast_mac_set_list(struct bna_dev *dev,
{
u32 i, j;
int found;
- char message[BNA_MESSAGE_SIZE];
BNA_ASSERT(rxf_id < BNA_RXF_ID_MAX);
if (mac_addr_num > BNA_MCAST_TABLE_SIZE) {
- sprintf(message, "Too many Multicast Addresses [%d]",
- mac_addr_num);
- DPRINTK(INFO, "%s", message);
+ pr_info("Too many Multicast Addresses [%d]\n", mac_addr_num);
return BNA_FAIL;
}
diff --git a/drivers/net/bna/bna_if.c b/drivers/net/bna/bna_if.c
index 034b352..7f327fb 100644
--- a/drivers/net/bna/bna_if.c
+++ b/drivers/net/bna/bna_if.c
@@ -17,6 +17,9 @@
*
* file bna_if.c BNA Hardware and Firmware Interface
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "cna.h"
#include "bna.h"
#include "bna_hwreg.h"
@@ -271,30 +274,24 @@ enum bna_status_e bna_mbox_send(struct bna_dev *dev, void *cmd,
struct bna_mbox_q *q;
struct bfi_mhdr *mh = (struct bfi_mhdr *)cmd;
- char message[BNA_MESSAGE_SIZE];
BNA_ASSERT(cmd_len <= BNA_MAX_MBOX_CMD_LEN);
if (dev->ioc_disable_pending) {
- sprintf(message,
- "IOC Disable is pending : Cannot queue Cmd "
- "class %d id %d", mh->msg_class, mh->msg_id);
- DPRINTK(INFO, "%s", message);
+ pr_info("IOC Disable is pending : Cannot queue Cmd class %d id %d\n",
+ mh->msg_class, mh->msg_id);
return BNA_AGAIN;
}
if (!bfa_ioc_is_operational(&dev->ioc)) {
- sprintf(message,
- "IOC is not operational : Cannot queue Cmd "
- "class %d id %d", mh->msg_class, mh->msg_id);
- DPRINTK(INFO, "%s", message);
+ pr_info("IOC is not operational : Cannot queue Cmd class %d id %d\n",
+ mh->msg_class, mh->msg_id);
return BNA_AGAIN;
}
q = &dev->mbox_q;
qe = bna_mbox_enq(q, cmd, cmd_len, cbarg);
if (qe == NULL) {
- sprintf(message, "No free Mbox Command Element");
- DPRINTK(INFO, "%s", message);
+ pr_info("No free Mbox Command Element\n");
return BNA_FAIL;
}
return bna_chk_n_snd_q(dev);
@@ -312,11 +309,9 @@ static int bna_is_aen(u8 msg_id)
static void bna_err_handler(struct bna_dev *dev, u32 intr_status)
{
u32 curr_mask, init_halt;
- char message[BNA_MESSAGE_SIZE];
- sprintf(message, "HW ERROR : INT statux 0x%x on port %d",
- intr_status, dev->port);
- DPRINTK(INFO, "%s", message);
+ pr_info("HW ERROR : INT statux 0x%x on port %d\n",
+ intr_status, dev->port);
if (intr_status & __HALT_STATUS_BITS) {
init_halt = bfa_reg_read(dev->ioc.ioc_regs.ll_halt);
@@ -343,7 +338,6 @@ void bna_ll_isr(void *llarg, struct bfi_mbmsg *msg)
struct bna_mbox_cmd_qe *qe = NULL;
struct bna_mbox_q *mbox_q = NULL;
struct bfi_ll_rsp *mb_rsp = NULL;
- char message[BNA_MESSAGE_SIZE];
mb_rsp = (struct bfi_ll_rsp *)(msg);
@@ -359,17 +353,14 @@ void bna_ll_isr(void *llarg, struct bfi_mbmsg *msg)
if (BFA_I2HM(((struct bfi_mhdr *)(&qe->cmd.msg[0]))->msg_id)
!= mb_rsp->mh.msg_id) {
- sprintf(message,
- "Invalid Rsp Msg %d:%d (Expected %d:%d) "
- "on %d", mb_rsp->mh.msg_class,
- mb_rsp->mh.msg_id,
- ((struct bfi_mhdr *)(&qe->cmd.
- msg[0]))->
+ pr_info("Invalid Rsp Msg %d:%d (Expected %d:%d) on %d\n",
+ mb_rsp->mh.msg_class,
+ mb_rsp->mh.msg_id,
+ ((struct bfi_mhdr *)(&qe->cmd.msg[0]))->
msg_class,
- BFA_I2HM(((struct bfi_mhdr *)
- (&qe->cmd.msg[0]))->msg_id),
- dev->port);
- DPRINTK(INFO, "%s", message);
+ BFA_I2HM(((struct bfi_mhdr *)
+ (&qe->cmd.msg[0]))->msg_id),
+ dev->port);
BNA_ASSERT(0);
return;
}
@@ -523,14 +514,11 @@ void bna_iocll_attach(struct bna_dev *dev, void *bnad,
enum bna_status_e bna_iocll_disable(struct bna_dev *dev)
{
enum bna_status_e ret;
- char message[BNA_MESSAGE_SIZE];
dev->ioc_disable_pending = 1;
ret = bna_flush_mbox_q(dev, 1);
if (ret != BNA_OK) {
- sprintf(message, "Unable to flush Mbox Queues [%d]",
- ret);
- DPRINTK(INFO, "%s", message);
+ pr_info("Unable to flush Mbox Queues [%d]\n", ret);
return ret;
}
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 26bd9c8..28df975 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -20,6 +20,8 @@
* bnad.c Brocade 10G PCIe Ethernet driver.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
@@ -602,7 +604,6 @@ static int bnad_request_txrx_irqs(struct bnad *bnad)
struct msix_entry *entries;
int i;
int err;
- char message[BNA_MESSAGE_SIZE];
if (!(bnad->config & BNAD_CF_MSIX)) {
u32 mask;
@@ -618,8 +619,9 @@ static int bnad_request_txrx_irqs(struct bnad *bnad)
for (i = 0; i < bnad->txq_num; i++) {
err = bnad_request_txq_irq(bnad, i);
if (err) {
- sprintf(message, "%s request irq for TxQ %d failed %d",
- bnad->netdev->name, i, err);
+ dev_info(&bnad->netdev->dev,
+ "request irq for TxQ %d failed %d\n",
+ i, err);
while (--i >= 0) {
free_irq(entries[i].vector,
&bnad->txq_table[i]);
@@ -631,8 +633,9 @@ static int bnad_request_txrx_irqs(struct bnad *bnad)
for (i = 0; i < bnad->cq_num; i++) {
err = bnad_request_cq_irq(bnad, i);
if (err) {
- sprintf(message, "%s request irq for CQ %u failed %d",
- bnad->netdev->name, i, err);
+ dev_info(&bnad->netdev->dev,
+ "request irq for CQ %u failed %d\n",
+ i, err);
while (--i >= 0) {
free_irq(entries[bnad->txq_num + i].vector,
&bnad->cq_table[i]);
@@ -793,7 +796,6 @@ static void bnad_stats_get_cb(void *arg, u8 status)
static void bnad_hw_error(struct bnad *bnad, u8 status)
{
unsigned int irq;
- char message[BNA_MESSAGE_SIZE];
set_bit(BNAD_F_HWERROR, &bnad->flags);
@@ -801,10 +803,9 @@ static void bnad_hw_error(struct bnad *bnad, u8 status)
if (bnad->config & BNAD_CF_MSIX) {
if (!test_and_set_bit(BNAD_F_MBOX_IRQ_DISABLED, &bnad->flags)) {
irq = bnad->msix_table[bnad->msix_num - 1].vector;
- sprintf(message, "Disabling Mbox IRQ %d for port %d",
- irq, bnad->bna_id);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&bnad->netdev->dev,
+ "Disabling Mbox IRQ %d for port %d\n",
+ irq, bnad->bna_id);
disable_irq_nosync(irq);
}
}
@@ -841,16 +842,15 @@ static int bnad_alloc_unmap_queues(struct bnad *bnad)
int i, err = 0;
struct bnad_txq_info *txqinfo;
struct bnad_rxq_info *rxqinfo;
- char message[BNA_MESSAGE_SIZE];
for (i = 0; i < bnad->txq_num; i++) {
txqinfo = &bnad->txq_table[i];
err = bnad_alloc_unmap_q(&txqinfo->skb_unmap_q,
txqinfo->txq.q.q_depth * 4);
if (err) {
- sprintf(message,
- "%s allocating Tx unmap Q %d failed: %d",
- bnad->netdev->name, i, err);
+ dev_info(&bnad->netdev->dev,
+ "allocating Tx unmap Q %d failed: %d\n",
+ i, err);
return err;
}
}
@@ -859,9 +859,9 @@ static int bnad_alloc_unmap_queues(struct bnad *bnad)
err = bnad_alloc_unmap_q(&rxqinfo->skb_unmap_q,
rxqinfo->rxq.q.q_depth);
if (err) {
- sprintf(message,
- "%s allocating Rx unmap Q %d failed: %d",
- bnad->netdev->name, i, err);
+ dev_info(&bnad->netdev->dev,
+ "allocating Rx unmap Q %d failed: %d\n",
+ i, err);
return err;
}
}
@@ -918,7 +918,6 @@ static void bnad_flush_rxbufs(struct bnad_rxq_info *rxqinfo)
static int bnad_disable_txq(struct bnad *bnad, u32 txq_id)
{
int err;
- char message[BNA_MESSAGE_SIZE];
WARN_ON(in_interrupt());
@@ -949,9 +948,9 @@ static int bnad_disable_txq(struct bnad *bnad, u32 txq_id)
txq_stop_exit:
if (err) {
- sprintf(message, "%s stop TxQ %u failed %d", bnad->netdev->name,
- txq_id, err);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev,
+ "stop TxQ %u failed %d\n",
+ txq_id, err);
}
return err;
@@ -961,7 +960,6 @@ txq_stop_exit:
int bnad_disable_rxqs(struct bnad *bnad, u64 rxq_id_mask)
{
int err;
- char message[BNA_MESSAGE_SIZE];
WARN_ON(in_interrupt());
@@ -993,9 +991,8 @@ int bnad_disable_rxqs(struct bnad *bnad, u64 rxq_id_mask)
rxq_stop_exit:
if (err) {
- sprintf(message, "%s stop RxQs(0x%llu) failed %d",
- bnad->netdev->name, rxq_id_mask, err);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "stop RxQs(0x%llu) failed %d\n",
+ rxq_id_mask, err);
}
return err;
@@ -1125,15 +1122,13 @@ static void bnad_port_admin_locked(struct bnad *bnad, u8 up)
static int bnad_stop_locked_internal(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
- char message[BNA_MESSAGE_SIZE];
switch (bnad->state) {
case BNAD_S_OPEN:
bnad->state = BNAD_S_CLOSING;
bnad_disable_locked(bnad);
bnad->state = BNAD_S_INIT;
- sprintf(message, "%s is stopped", bnad->netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "is stopped\n");
break;
case BNAD_S_OPEN_DOWN:
bnad->state = BNAD_S_INIT_DOWN;
@@ -1889,33 +1884,26 @@ static int bnad_enable_locked(struct bnad *bnad)
struct net_device *netdev = bnad->netdev;
int err = 0;
uint i;
- char message[BNA_MESSAGE_SIZE];
bnad->state = BNAD_S_OPENING;
err = bnad_init(bnad);
if (err) {
- sprintf(message, "%s init failed %d", netdev->name, err);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&netdev->dev, "init failed %d\n", err);
bnad->state = BNAD_S_INIT;
return err;
}
err = bnad_config_hw(bnad);
if (err) {
- sprintf(message, "%s config HW failed %d", netdev->name, err);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&netdev->dev, "config HW failed %d\n", err);
goto init_failed;
}
err = bnad_request_txrx_irqs(bnad);
if (err) {
- sprintf(message, "%s requests Tx/Rx irqs failed: %d",
- bnad->netdev->name, err);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&bnad->netdev->dev,
+ "requests Tx/Rx irqs failed: %d\n", err);
goto init_failed;
}
bnad_napi_init(bnad);
@@ -1924,8 +1912,7 @@ static int bnad_enable_locked(struct bnad *bnad)
bnad_alloc_for_rxq(bnad, i);
bnad->state = BNAD_S_OPEN;
- sprintf(message, "%s is opened", bnad->netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "is opened\n");
spin_lock_irq(&bnad->priv_lock);
if (BNAD_NOT_READY(bnad)) {
@@ -1951,7 +1938,6 @@ static int bnad_open_locked_internal(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
int err = 0;
- char message[BNA_MESSAGE_SIZE];
switch (bnad->state) {
case BNAD_S_INIT:
@@ -1959,14 +1945,11 @@ static int bnad_open_locked_internal(struct net_device *netdev)
break;
case BNAD_S_INIT_DOWN:
bnad->state = BNAD_S_OPEN_DOWN;
- sprintf(message, "%s is not ready yet: IOC down", netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "is not ready yet: IOC down\n");
break;
case BNAD_S_INIT_DISABLED:
bnad->state = BNAD_S_OPEN_DISABLED;
- sprintf(message, "%s is not ready yet: IOC disabled",
- netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "is not ready yet: IOC disabled\n");
break;
default:
BNA_ASSERT(0);
@@ -1992,16 +1975,13 @@ int bnad_open(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
int err = 0;
- char message[BNA_MESSAGE_SIZE];
- sprintf(message, "%s open", netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "open\n");
bnad_conf_lock();
if (test_bit(BNAD_F_BCU_DISABLED, &bnad->flags)) {
- sprintf(message, "%s is disabled", netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "is disabled\n");
} else
err = bnad_open_locked(netdev);
@@ -2050,16 +2030,13 @@ int bnad_stop(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
int err = 0;
- char message[BNA_MESSAGE_SIZE];
- sprintf(message, "%s stop", netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "stop\n");
bnad_conf_lock();
if (test_bit(BNAD_F_BCU_DISABLED, &bnad->flags)) {
- sprintf(message, "%s port is disabled", netdev->name);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "port is disabled\n");
} else
err = bnad_stop_locked(netdev);
@@ -2073,25 +2050,25 @@ int bnad_sw_reset_locked_internal(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
int err;
- char message[BNA_MESSAGE_SIZE];
err = bnad_stop_locked_internal(netdev);
if (err) {
- sprintf(message, "%s sw reset internal: stop failed %d",
- bnad->netdev->name, err);
+ dev_info(&bnad->netdev->dev,
+ "sw reset internal: stop failed %d\n",
+ err);
goto done;
}
err = bnad_open_locked_internal(netdev);
if (err) {
- sprintf(message, "%s sw reset internal: open failed %d",
- bnad->netdev->name, err);
+ dev_info(&bnad->netdev->dev,
+ "sw reset internal: open failed %d\n",
+ err);
goto done;
}
return 0;
done:
- DPRINTK(INFO, "%s", message);
return err;
}
@@ -2100,7 +2077,6 @@ int bnad_sw_reset_locked(struct net_device *netdev)
{
struct bnad *bnad = netdev_priv(netdev);
int err;
- char message[BNA_MESSAGE_SIZE];
if (bnad->state != BNAD_S_OPEN)
return 0;
@@ -2110,9 +2086,7 @@ int bnad_sw_reset_locked(struct net_device *netdev)
err = bnad_sw_reset_locked_internal(netdev);
if (err) {
- sprintf(message, "%s sw reset: failed %d", bnad->netdev->name,
- err);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "sw reset: failed %d\n", err);
return err;
}
@@ -2484,7 +2458,6 @@ int bnad_ucast_mac(struct bnad *bnad, unsigned int rxf_id, u8 * mac_ptr,
unsigned int cmd)
{
int err = 0;
- char message[BNA_MESSAGE_SIZE];
enum bna_status_e(*ucast_mac_func) (struct bna_dev *bna_dev,
unsigned int rxf_id, const struct mac *mac_addr_ptr) = NULL;
@@ -2520,10 +2493,9 @@ int bnad_ucast_mac(struct bnad *bnad, unsigned int rxf_id, u8 * mac_ptr,
ucast_mac_exit:
if (err) {
- sprintf(message, "%s unicast MAC address command %d failed: %d",
- bnad->netdev->name, cmd, err);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&bnad->netdev->dev,
+ "unicast MAC address command %d failed: %d\n",
+ cmd, err);
return -EINVAL;
}
@@ -2793,7 +2765,6 @@ static void bnad_resume_after_reset(struct bnad *bnad)
{
int err;
struct net_device *netdev = bnad->netdev;
- char message[BNA_MESSAGE_SIZE];
switch (bnad->state) {
case BNAD_S_INIT_DOWN:
@@ -2809,11 +2780,9 @@ static void bnad_resume_after_reset(struct bnad *bnad)
case BNAD_S_OPEN_DOWN:
err = bnad_enable_locked(bnad);
if (err) {
- sprintf(message,
- "%s bnad_enable failed after reset: %d",
- bnad->netdev->name, err);
- DPRINTK(INFO, "%s",
- message);
+ dev_info(&bnad->netdev->dev,
+ "bnad_enable failed after reset: %d\n",
+ err);
} else {
bnad_port_admin_locked(bnad, BNA_ENABLE);
}
@@ -2875,12 +2844,10 @@ static void bnad_link_state_notify(struct bnad *bnad)
enum bnad_link_state link_state;
u8 cee_linkup;
unsigned int prio = 0;
- char message[BNA_MESSAGE_SIZE];
if (bnad->state != BNAD_S_OPEN) {
- sprintf(message, "%s link up in state %d", netdev->name,
- bnad->state);
- DPRINTK(INFO, "%s", message);
+ dev_info(&bnad->netdev->dev, "link up in state %d\n",
+ bnad->state);
return;
}
@@ -3138,7 +3105,7 @@ static int bnad_priv_init(struct bnad *bnad)
/* XXX could be vmalloc? */
bnad->trcmod = kzalloc(sizeof(struct bfa_trc_mod), GFP_KERNEL);
if (!bnad->trcmod) {
- printk(KERN_ERR "port %u failed allocating trace buffer!\n",
+ pr_err("port %u failed allocating trace buffer!\n",
bnad->bna_id);
return -ENOMEM;
}
@@ -3149,7 +3116,7 @@ static int bnad_priv_init(struct bnad *bnad)
bnad->priv = kzalloc(bna_get_handle_size(), GFP_KERNEL);
if (!bnad->priv) {
- printk(KERN_ERR "port %u failed allocating memory for bna\n",
+ pr_err("port %u failed allocating memory\n",
bnad->bna_id);
err = -ENOMEM;
goto free_trcmod;
@@ -3158,8 +3125,7 @@ static int bnad_priv_init(struct bnad *bnad)
pci_alloc_consistent(bnad->pcidev, BNA_HW_STATS_SIZE,
&dma_addr);
if (!bnad->priv_stats) {
- printk(KERN_ERR
- "port %u failed allocating memory for bna stats\n",
+ pr_err("port %u failed allocating memory for bna stats\n",
bnad->bna_id);
err = -ENOMEM;
goto free_priv_mem;
@@ -3203,9 +3169,7 @@ static int bnad_priv_init(struct bnad *bnad)
break;
}
if (!bnad->ioc_meminfo[i].kva) {
- printk(KERN_ERR
- "port %u failed allocating %u "
- "bytes memory for IOC\n",
+ pr_err("port %u failed allocating %u bytes memory for IOC\n",
bnad->bna_id, bnad->ioc_meminfo[i].len);
err = -ENOMEM;
goto free_ioc_mem;
@@ -3223,8 +3187,7 @@ static int bnad_priv_init(struct bnad *bnad)
err = bnad_cee_attach(bnad);
if (err) {
- printk(KERN_ERR "port %u cee_attach failed: %d\n", bnad->bna_id,
- err);
+ pr_err("port %u cee_attach failed: %d\n", bnad->bna_id, err);
goto iocll_detach;
}
@@ -3287,7 +3250,6 @@ static void bnad_priv_uninit(struct bnad *bnad)
{
int i;
enum bna_status_e err;
- char message[BNA_MESSAGE_SIZE];
if (bnad->priv) {
@@ -3304,10 +3266,7 @@ static void bnad_priv_uninit(struct bnad *bnad)
}
if (err) {
/* Probably firmware crashed. */
- sprintf(message,
- "bna_iocll_disable failed, "
- "clean up and try again");
- DPRINTK(INFO, "%s", message);
+ pr_info("bna_iocll_disable failed, clean up and try again\n");
spin_lock_irq(&bnad->priv_lock);
bna_cleanup(bnad->priv);
err = bna_iocll_disable(bnad->priv);
@@ -3316,8 +3275,7 @@ static void bnad_priv_uninit(struct bnad *bnad)
}
wait_for_completion(&bnad->ioc_comp);
- sprintf(message, "port %u IOC is disabled", bnad->bna_id);
- DPRINTK(INFO, "%s", message);
+ pr_info("port %u IOC is disabled\n", bnad->bna_id);
bnad->state = BNAD_S_UNLOADING;
@@ -3370,11 +3328,11 @@ static int __devinit bnad_pci_probe(struct pci_dev *pdev,
unsigned long mmio_start, mmio_len;
static u32 bna_id;
- printk(KERN_INFO "bnad_pci_probe : (0x%p, 0x%p) PCI Func : (%d)\n",
- pdev, pcidev_id, PCI_FUNC(pdev->devfn));
+ pr_info("%s: (0x%p, 0x%p) PCI Func : (%d)\n",
+ __func__, pdev, pcidev_id, PCI_FUNC(pdev->devfn));
if (!bfad_get_firmware_buf(pdev)) {
- printk(KERN_WARNING "Failed to load Firmware Image!\n");
+ pr_warning("Failed to load Firmware Image!\n");
return -ENODEV;
}
@@ -3434,7 +3392,7 @@ static int __devinit bnad_pci_probe(struct pci_dev *pdev,
err = -ENOMEM;
goto free_devices;
}
- printk(KERN_INFO "bar0 mapped to %p, len %lu\n", bnad->bar0, mmio_len);
+ pr_info("bar0 mapped to %p, len %lu\n", bnad->bar0, mmio_len);
netdev->netdev_ops = &bnad_netdev_ops;
@@ -3460,7 +3418,7 @@ static int __devinit bnad_pci_probe(struct pci_dev *pdev,
bnad->bna_id = bna_id;
err = bnad_priv_init(bnad);
if (err) {
- printk(KERN_ERR "port %u init failed: %d\n", bnad->bna_id, err);
+ pr_err("port %u init failed: %d\n", bnad->bna_id, err);
goto unmap_bar0;
}
@@ -3471,7 +3429,7 @@ static int __devinit bnad_pci_probe(struct pci_dev *pdev,
netif_carrier_off(netdev);
err = register_netdev(netdev);
if (err) {
- printk(KERN_ERR "port %u register_netdev failed: %d\n",
+ pr_err("port %u register_netdev failed: %d\n",
bnad->bna_id, err);
goto bnad_device_uninit;
}
@@ -3501,7 +3459,7 @@ static void __devexit bnad_pci_remove(struct pci_dev *pdev)
if (!netdev)
return;
- printk(KERN_INFO "%s bnad_pci_remove\n", netdev->name);
+ pr_info("%s bnad_pci_remove\n", netdev->name);
bnad = netdev_priv(netdev);
unregister_netdev(netdev);
@@ -3523,8 +3481,7 @@ static struct pci_driver bnad_pci_driver = {
static int __init bnad_module_init(void)
{
-
- printk(KERN_INFO "Brocade 10G Ethernet driver\n");
+ pr_info("Brocade 10G Ethernet driver\n");
bfa_ioc_auto_recover(bnad_ioc_auto_recover);
diff --git a/drivers/net/bna/bnad_compat.h b/drivers/net/bna/bnad_compat.h
index 98232e8..4e3c80c 100644
--- a/drivers/net/bna/bnad_compat.h
+++ b/drivers/net/bna/bnad_compat.h
@@ -73,19 +73,6 @@
#define VERIFY_READ 0
#endif
-#ifndef dev_err
-#define dev_err(dev, format, arg...) \
- printk(KERN_ERR "bna: " format, ## arg)
-#endif
-#ifndef dev_info
-#define dev_info(dev, format, arg...) \
- printk(KERN_INFO "bna: " format, ## arg)
-#endif
-#ifndef dev_warn
-#define dev_warn(dev, format, arg...) \
- printk(KERN_WARNING "bna: " format, ## arg)
-#endif
-
#ifndef __force
#define __force
#endif
diff --git a/drivers/net/bna/cna.h b/drivers/net/bna/cna.h
index c75cdf5..4907041 100644
--- a/drivers/net/bna/cna.h
+++ b/drivers/net/bna/cna.h
@@ -49,11 +49,6 @@
#define bfa_wtole(_x) cpu_to_le32((_x))
-#define PFX "BNA: "
-#define DPRINTK(klevel, fmt, args...) do { \
- printk(KERN_##klevel PFX fmt, ## args); \
-} while (0)
-
extern char bfa_version[];
void bfa_ioc_auto_recover(bool auto_recover);
--
1.6.5.2.153.g6e31f
^ permalink raw reply related
* [PATCH 2/2] drivers/net/bna: Use kcalloc
From: Joe Perches @ 2009-11-24 7:24 UTC (permalink / raw)
To: Rasesh Mody; +Cc: adapter_linux_open_src_team, netdev
In-Reply-To: <cover.1259047344.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bna/bnad.c | 45 +++++++++++++++++++--------------------------
1 files changed, 19 insertions(+), 26 deletions(-)
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 28df975..edc4a3a 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -1186,9 +1186,8 @@ static int bnad_alloc_ibs(struct bnad *bnad)
int err;
bnad->ib_num = bnad->txq_num + bnad->cq_num;
- bnad->ib_table =
- kzalloc(bnad->ib_num * sizeof(struct bnad_ib_entry),
- GFP_KERNEL);
+ bnad->ib_table = kcalloc(bnad->ib_num, sizeof(struct bnad_ib_entry),
+ GFP_KERNEL);
if (!bnad->ib_table)
return -ENOMEM;
@@ -1250,7 +1249,7 @@ static int bnad_alloc_q(struct bnad *bnad, struct bna_qpt *qpt,
return -ENOMEM;
BNA_SET_DMA_ADDR(dma_addr, &qpt->hw_qpt_ptr);
- q->qpt_ptr = kzalloc(qpt->page_count * sizeof(void *), GFP_KERNEL);
+ q->qpt_ptr = kcalloc(qpt->page_count, sizeof(void *), GFP_KERNEL);
if (!q->qpt_ptr)
return -ENOMEM;
qpt->qpt_ptr = q->qpt_ptr;
@@ -1386,9 +1385,8 @@ static int bnad_txqs_init(struct bnad *bnad)
{
int i, err = 0;
- bnad->txq_table =
- kzalloc(bnad->txq_num * sizeof(struct bnad_txq_info),
- GFP_KERNEL);
+ bnad->txq_table = kcalloc(bnad->txq_num, sizeof(struct bnad_txq_info),
+ GFP_KERNEL);
if (!bnad->txq_table)
return -ENOMEM;
@@ -1425,9 +1423,8 @@ static int bnad_rxqs_init(struct bnad *bnad)
{
int i, err = 0;
- bnad->rxq_table =
- kzalloc(bnad->rxq_num * sizeof(struct bnad_rxq_info),
- GFP_KERNEL);
+ bnad->rxq_table = kcalloc(bnad->rxq_num, sizeof(struct bnad_rxq_info),
+ GFP_KERNEL);
if (!bnad->rxq_table)
return -EINVAL;
@@ -1470,8 +1467,8 @@ static int bnad_cqs_init(struct bnad *bnad)
{
int i, err = 0;
- bnad->cq_table =
- kzalloc(bnad->cq_num * sizeof(struct bnad_cq_info), GFP_KERNEL);
+ bnad->cq_table = kcalloc(bnad->cq_num, sizeof(struct bnad_cq_info),
+ GFP_KERNEL);
if (!bnad->cq_table)
return -ENOMEM;
@@ -1633,16 +1630,14 @@ void bnad_rxf_init(struct bnad *bnad, uint rxf_id, u8 rit_offset, int rss)
static int bnad_init_funcs(struct bnad *bnad)
{
- bnad->txf_table =
- kzalloc(sizeof(struct bnad_txf_info) * bnad->txf_num,
- GFP_KERNEL);
+ bnad->txf_table = kcalloc(bnad->txf_num, sizeof(struct bnad_txf_info),
+ GFP_KERNEL);
if (!bnad->txf_table)
return -ENOMEM;
bnad_txf_init(bnad, BNAD_TX_FUNC_ID);
- bnad->rxf_table =
- kzalloc(sizeof(struct bnad_rxf_info) * bnad->rxf_num,
- GFP_KERNEL);
+ bnad->rxf_table = kcalloc(bnad->rxf_num, sizeof(struct bnad_rxf_info),
+ GFP_KERNEL);
if (!bnad->rxf_table)
return -ENOMEM;
bnad_rxf_init(bnad, BNAD_RX_FUNC_ID, BNAD_RIT_OFFSET,
@@ -1866,9 +1861,8 @@ static int bnad_init(struct bnad *bnad)
if (err)
goto finished;
- bnad->rit =
- kzalloc(bnad->cq_num * sizeof(struct bna_rit_entry),
- GFP_KERNEL);
+ bnad->rit = kcalloc(bnad->cq_num, sizeof(struct bna_rit_entry),
+ GFP_KERNEL);
if (!bnad->rit)
goto finished;
@@ -2421,9 +2415,8 @@ static void bnad_set_rx_mode_locked(struct net_device *netdev)
struct dev_mc_list *mc;
int i;
- mcaddr_list =
- kzalloc((netdev->mc_count + 1) * sizeof(struct mac),
- GFP_ATOMIC);
+ mcaddr_list = kcalloc((netdev->mc_count + 1),
+ sizeof(struct mac), GFP_ATOMIC);
if (!mcaddr_list)
return;
@@ -2663,8 +2656,8 @@ static void bnad_enable_msix(struct bnad *bnad)
if (!(bnad->config & BNAD_CF_MSIX) || bnad->msix_table)
return;
- bnad->msix_table =
- kzalloc(bnad->msix_num * sizeof(struct msix_entry), GFP_KERNEL);
+ bnad->msix_table = kcalloc(bnad->msix_num, sizeof(struct msix_entry),
+ GFP_KERNEL);
if (!bnad->msix_table)
goto intx_mode;
--
1.6.5.2.153.g6e31f
^ permalink raw reply related
* [PATCH 0/2] Trivial cleanups
From: Joe Perches @ 2009-11-24 7:24 UTC (permalink / raw)
To: Rasesh Mody; +Cc: adapter_linux_open_src_team, netdev
Just a couple of cleanup patches on your latest submission.
Joe Perches (2):
drivers/net/bna: Use pr_<level>, dev_<level>, remove DPRINTK
drivers/net/bna: Use kcalloc
drivers/net/bna/bfa_csdebug.c | 10 +-
drivers/net/bna/bfa_ioc.c | 5 +-
drivers/net/bna/bfad_fwimg.c | 8 +-
drivers/net/bna/bna_fn.c | 7 +-
drivers/net/bna/bna_if.c | 48 ++++------
drivers/net/bna/bnad.c | 216 ++++++++++++++++-------------------------
drivers/net/bna/bnad_compat.h | 13 ---
drivers/net/bna/cna.h | 5 -
8 files changed, 116 insertions(+), 196 deletions(-)
^ permalink raw reply
* Re: large packet loss take2 2.6.31.x
From: Caleb Cushing @ 2009-11-24 6:17 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Frans Pop, Andi Kleen, linux-kernel, netdev
In-Reply-To: <20091122205054.GA7361@ami.dom.local>
> Btw, currently I don't consider this dropping means there has to be
> a bug. It could be otherwise - a feature... e.g. when a new kernel
> can transmit faster (then dropping in some other, slower place can
> happen).
um... where would it be dropping that we wouldn't have a bug? I mean
sure faster is great... but if it makes my network not work right...
I've added all (I think) information you've asked for to the bug
http://bugzilla.kernel.org/show_bug.cgi?id=13835 except for ethtool
and netstat on the router side. ethtool complains about not having
driver or capability (maybe because it's a 2.4 kernel?) and the
version of netstat doesn't support -s. I disabled everything that I
can think of that would send/receive packets before doing the test
client side, except dhcp/dns windows box's were probably sending some
broadcasts too. but the traffic should be pretty low. I did remember
to set the txqueuelen didn't seem to make a difference
only error in dmesg I see is
e1000e 0000:00:19.0: pci_enable_pcie_error_reporting failed 0xfffffffb
but it's in working versions too.
--
Caleb Cushing
http://xenoterracide.blogspot.com
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Arjan van de Ven @ 2009-11-24 6:07 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Peter P Waskiewicz Jr, Yong Zhang, linux-kernel@vger.kernel.org,
arjan@linux.jf.intel.com, davem@davemloft.net,
netdev@vger.kernel.org
In-Reply-To: <1258995923.4531.715.camel@laptop>
Peter Zijlstra wrote:
> On Mon, 2009-11-23 at 01:36 -0800, Peter P Waskiewicz Jr wrote:
>
>> This mechanism isn't going to be used by any internal kernel mechanism
>> for determining interrupt placement or operation. It's purely something
>> that either a driver can modify, or external script (through /proc),
>> that irqbalance will make use of. If irqbalance isn't running, or the
>> current version of irqbalance doesn't support reading node_affinity,
>> then it won't affect the system's operation.
>>
>> If irqbalance does support it, it'll read whatever the supplied mask is,
>> and then will try and balance interrupts within that mask. It will bail
>> if the mask is invalid, or won't apply to the running system, just like
>> how putting a bogus mask into smp_affinity is ignored.
>>
>> If there's something I'm missing beyond this with the two suggestions
>> you've made (I looked into those two parameters and tried to draw
>> conclusions), please let me know.
>
> I don't see the point in adding it, if the driver wants to set a node
> cpu mask it can already do that using the regular smp affinity settings.
>
> Same for userspace.
the problem is that there is no way currently that the driver can communicate
"I allocated all my metadata on THIS numa node". irqbalance and sysadmins need
that to not make really stupid decisions.....
^ permalink raw reply
* Re: [PATCH] irq: Add node_affinity CPU masks for smarter irqbalance hints
From: Yong Zhang @ 2009-11-24 5:17 UTC (permalink / raw)
To: Peter P Waskiewicz Jr
Cc: linux-kernel@vger.kernel.org, arjan@linux.jf.intel.com,
davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <1258968980.2697.9.camel@ppwaskie-mobl2>
[snip]
>>
>> 1) I think you should consider CONFIG_CPUMASK_OFFSTACK which will affect
>> node_affinity.
>> 2) It seems like this patch can't work with SPARSE_IRQ.
>
> This mechanism isn't going to be used by any internal kernel mechanism
> for determining interrupt placement or operation. It's purely something
> that either a driver can modify, or external script (through /proc),
> that irqbalance will make use of. If irqbalance isn't running, or the
> current version of irqbalance doesn't support reading node_affinity,
> then it won't affect the system's operation.
>
> If irqbalance does support it, it'll read whatever the supplied mask is,
> and then will try and balance interrupts within that mask. It will bail
> if the mask is invalid, or won't apply to the running system, just like
> how putting a bogus mask into smp_affinity is ignored.
>
> If there's something I'm missing beyond this with the two suggestions
> you've made (I looked into those two parameters and tried to draw
> conclusions), please let me know.
My two suggestions are both about your adding node_affinity. Before you can
use this element, you must initialise it firstly. You can refer how
irq_desc::affinity
is used in function alloc_desc_masks().
include/linux/irq.h:
static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
bool boot)
{
gfp_t gfp = GFP_ATOMIC;
if (boot)
gfp = GFP_NOWAIT;
#ifdef CONFIG_CPUMASK_OFFSTACK
if (!alloc_cpumask_var_node(&desc->affinity, gfp, node))
return false;
#ifdef CONFIG_GENERIC_PENDING_IRQ
if (!alloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
free_cpumask_var(desc->affinity);
return false;
}
#endif
#endif
return true;
}
Thanks,
Yong
>
> Cheers,
> -PJ Waskiewicz
>
>
^ permalink raw reply
* Re: Subject: [PATCH 3/6] bna: Brocade 10Gb Ethernet device driver
From: Joe Perches @ 2009-11-24 4:58 UTC (permalink / raw)
To: Rasesh Mody; +Cc: netdev, adapter_linux_open_src_team
In-Reply-To: <200911240351.nAO3p1bG025630@blc-10-10.brocade.com>
> +#ifndef dev_err
> +#define dev_err(dev, format, arg...) \
> + printk(KERN_ERR "bna: " format, ## arg)
> +#endif
> +#ifndef dev_info
> +#define dev_info(dev, format, arg...) \
> + printk(KERN_INFO "bna: " format, ## arg)
> +#endif
> +#ifndef dev_warn
> +#define dev_warn(dev, format, arg...) \
> + printk(KERN_WARNING "bna: " format, ## arg)
> +#endif
Don't do this. Just include device.h
^ permalink raw reply
* Re: Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver
From: Stephen Hemminger @ 2009-11-24 4:28 UTC (permalink / raw)
To: Rasesh Mody; +Cc: netdev, adapter_linux_open_src_team
In-Reply-To: <200911240351.nAO3p1AY025627@blc-10-10.brocade.com>
On Mon, 23 Nov 2009 19:51:01 -0800
Rasesh Mody <rmody@brocade.com> wrote:
> +
> +/* Currently we assume just 2 columns, col 0 = small, col 1 = large */
> +u32 intr_mod_vector[BNA_LOAD_TYPES + 1][BNA_BIAS_TYPES] = {
static? const?
^ permalink raw reply
* Re: Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver
From: Stephen Hemminger @ 2009-11-24 4:27 UTC (permalink / raw)
To: Rasesh Mody; +Cc: netdev, adapter_linux_open_src_team
In-Reply-To: <200911240351.nAO3p1AY025627@blc-10-10.brocade.com>
On Mon, 23 Nov 2009 19:51:01 -0800
Rasesh Mody <rmody@brocade.com> wrote:
> cmd.rxf_id_mask[0] = htonl((u32) rxf_id_mask);
> + cmd.rxf_id_mask[1] = htonl((u32) (rxf_id_mask >> 32));
You could use the lower32() and upper32() macros here.
^ permalink raw reply
* Re: Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver
From: Stephen Hemminger @ 2009-11-24 4:26 UTC (permalink / raw)
To: Rasesh Mody; +Cc: netdev, adapter_linux_open_src_team
In-Reply-To: <200911240351.nAO3p1AY025627@blc-10-10.brocade.com>
On Mon, 23 Nov 2009 19:51:01 -0800
Rasesh Mody <rmody@brocade.com> wrote:
> +/**
> + * bna_rxf_frame_stats_get()
> + *
> + * For RxF "rxf_id", it loads frame statistics into "stats_ptr".
> + *
> + * @param[in] dev - pointer to BNA device structure
> + * @param[in] rxf_id - rx-function ID.
> + * @param[out] stats_ptr - pointer to stats structure to fill
> + *
> + * @return BNA_OK - successful
> + * @return BNA_FAIL - failed on sanity checks.
> + */
> +void bna_rxf_frame_stats_get(struct bna_dev *dev, unsigned int rxf_id,
> + struct bna_stats_rxf **stats_ptr)
> +{
> +
> + BNA_ASSERT(rxf_id < BNA_RXF_ID_MAX);
> +
> + *stats_ptr = &dev->stats.rxf_stats[rxf_id];
> +}
20 lines to do the work of 1!
^ permalink raw reply
* Re: Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver
From: Stephen Hemminger @ 2009-11-24 4:24 UTC (permalink / raw)
To: Rasesh Mody; +Cc: netdev, adapter_linux_open_src_team
In-Reply-To: <200911240351.nAO3p1AY025627@blc-10-10.brocade.com>
On Mon, 23 Nov 2009 19:51:01 -0800
Rasesh Mody <rmody@brocade.com> wrote:
> /**
> + * bna_mcast_mac_reset_list()
> + *
> + * Resets the multicast MAC address list kept by driver.
> + * Called when the hw gets reset.
> + *
> + * @param[in] dev - pointer to BNA device structure
> + *
> + * @return BNA_OK - successful
> + * @return BNA_FAIL - failed on sanity checks.
> + */
> +void bna_mcast_mac_reset_list(struct bna_dev *dev)
> +{
> + memset(&dev->mcast_addr[0], 0, sizeof(dev->mcast_addr));
> +}
> +
If you are going to wrap and add kernel-doc to everything,
please check (or get rid of the boilerplate). This obviously doesn't
take param[in] or return those values.
^ 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