* [PATCH 3/4] iseries_veth: Don't leak skbs in RX path
From: Michael Ellerman @ 2005-05-12 7:55 UTC (permalink / raw)
To: Andrew Morton, Jeff Garzik; +Cc: netdev, linux-kernel
Hi Andrew, Jeff,
Under some strange circumstances the iseries_veth driver can leak skbs.
Fix is simply to call dev_kfree_skb() in the right place.
Fix up the comment as well.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
--
iseries_veth.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
Index: veth-fixes/drivers/net/iseries_veth.c
===================================================================
--- veth-fixes.orig/drivers/net/iseries_veth.c
+++ veth-fixes/drivers/net/iseries_veth.c
@@ -1264,13 +1264,18 @@ static void veth_receive(struct veth_lpa
vlan = skb->data[9];
dev = veth_dev[vlan];
- if (! dev)
- /* Some earlier versions of the driver sent
- broadcasts down all connections, even to
- lpars that weren't on the relevant vlan.
- So ignore packets belonging to a vlan we're
- not on. */
+ if (! dev) {
+ /*
+ * Some earlier versions of the driver sent
+ * broadcasts down all connections, even to lpars
+ * that weren't on the relevant vlan. So ignore
+ * packets belonging to a vlan we're not on.
+ * We can also be here if we receive packets while
+ * the driver is going down, because then dev is NULL.
+ */
+ dev_kfree_skb_irq(skb);
continue;
+ }
port = (struct veth_port *)dev->priv;
dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000;
^ permalink raw reply
* Re: [TG3]: Add hw coalescing infrastructure.
From: Robert Olsson @ 2005-05-12 7:53 UTC (permalink / raw)
To: David S. Miller; +Cc: mchan, netdev
In-Reply-To: <20050511.192819.24336786.davem@davemloft.net>
David S. Miller writes:
> From: "Michael Chan" <mchan@broadcom.com>
> Subject: Re: [TG3]: Add hw coalescing infrastructure.
> Date: Wed, 11 May 2005 14:17:36 -0700
> > Yes, and MTU size dependent too. But we may not want to coalesce the
> > same way when running at 10/100 Mbps. For example, if one packet has
> > arrived, we don't want to wait 120 usec or 1200 usec to see if another
> > packet will arrive before we interrupt at 100 and 10 Mbps respectively.
>
> That's a good point. I think it would be wise for us to try
> and come up with a dynamic mitigation algorithm that is as MTU
> and link speed agnostic as possible.
Size of RX-ring is also to be taken to account. You probably have to design
for samllest packets otherwise you risk RX-ring overrun and packet drop.
> One thing to note is that what we're really trying to do is
> maximize the amount of work done per interrupt, without
> unduly adding latency to packet reception.
>
> Work done per-interrupt, and maximum latency, are better goals
> because formulas based upon those values will automatically take
> differences in CPU and BUS I/O speed into account.
Yes.
Cheers.
--ro
^ permalink raw reply
* [PATCH 2/4] iseries_veth: Set dev->trans_start so watchdog timer works right
From: Michael Ellerman @ 2005-05-12 7:53 UTC (permalink / raw)
To: Andrew Morton, Jeff Garzik; +Cc: netdev, linux-kernel
Hi Andrew, Jeff,
The iseries_veth driver doesn't set dev->trans_start in it's TX path. This
will cause the net device watchdog timer to fire earlier than we want it to,
which causes the driver to needlessly reset its connections to other LPARs.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
--
iseries_veth.c | 2 ++
1 files changed, 2 insertions(+)
Index: veth-fixes/drivers/net/iseries_veth.c
===================================================================
--- veth-fixes.orig/drivers/net/iseries_veth.c
+++ veth-fixes/drivers/net/iseries_veth.c
@@ -1023,6 +1023,8 @@ static int veth_start_xmit(struct sk_buf
lpmask = veth_transmit_to_many(skb, lpmask, dev);
+ dev->trans_start = jiffies;
+
if (! lpmask) {
dev_kfree_skb(skb);
} else {
^ permalink raw reply
* [PATCH 1/4] iseries_veth: Don't send packets to LPARs which aren't up
From: Michael Ellerman @ 2005-05-12 7:47 UTC (permalink / raw)
To: Andrew Morton, Jeff Garzik; +Cc: netdev, linux-kernel
Hi Andrew, Jeff,
The iseries_veth driver has a logic bug which means it will erroneously
send packets to LPARs for which we don't have a connection.
This usually isn't a big problem because the Hypervisor call fails
gracefully and we return, but if packets are TX'ed during the negotiation
of the connection bad things might happen.
Regardless, the right thing is to bail early if we know there's no
connection.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
--
iseries_veth.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: veth-fixes/drivers/net/iseries_veth.c
===================================================================
--- veth-fixes.orig/drivers/net/iseries_veth.c
+++ veth-fixes/drivers/net/iseries_veth.c
@@ -924,7 +924,7 @@ static int veth_transmit_to_one(struct s
spin_lock_irqsave(&cnx->lock, flags);
- if (! cnx->state & VETH_STATE_READY)
+ if (! (cnx->state & VETH_STATE_READY))
goto drop;
if ((skb->len - 14) > VETH_MAX_MTU)
^ permalink raw reply
* Sis900 and VLAN 8021q.o incompatible/MTU troubles
From: Axel Reinhold @ 2005-05-12 7:43 UTC (permalink / raw)
To: netdev
Dear Venza,
my sis900 is running fine in standard mode. Together with 8021q.o
i get
all kinds of troubles - for example samba is no more working at
all -
without vlan everything is fine - with vlans everything basically
works
- but only to a certain point, then it screws up. Is sis900.o
incompatible with 8021q.o? Has the driver the MTU-troubles known
from other
old ethernet drivers?
May 11 20:03:20 bongo kernel: sis900.c: v1.08.07 11/02/2003
May 11 20:03:20 bongo kernel: PCI: Found IRQ 12 for device 00:01.1
May 11 20:03:20 bongo kernel: eth0: SiS 900 Internal MII PHY
transceiver found at address 1.
May 11 20:03:20 bongo kernel: eth0: Using transceiver found at
address 1 as default
May 11 20:03:20 bongo kernel: eth0: SiS 900 PCI Fast Ethernet at
0xd400, IRQ 12, 00:e0:18:3a:db:1a.
May 11 20:03:20 bongo kernel: 802.1Q VLAN Support v1.8 Ben Greear
<greearb@candelatech.com>
May 11 20:03:20 bongo kernel: All bugs added by David S. Miller
<davem@redhat.com>
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/access.c:check_access(328)
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/util_sock.c:write_socket_data(430)
write_socket_data: write failure. Error = Connection reset by
peer
[2005/05/11 21:01:23, 0] lib/util_sock.c:write_socket(455)
write_socket: Error writing 5 bytes to socket 30: ERRNO =
Connection reset by peer
[2005/05/11 21:01:23, 0] lib/util_sock.c:send_smb(647)
Error writing 5 bytes to client. -1. (Connection reset by peer)
[2005/05/11 21:23:14, 0] smbd/server.c:main(798)
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/util_sock.c:get_peer_addr(1150)
getpeername failed. Error was Transport endpoint is not
connected
[2005/05/11 21:01:23, 0] lib/util_sock.c:write_socket_data(430)
write_socket_data: write failure. Error = Connection reset by
peer
[2005/05/11 21:01:23, 0] lib/util_sock.c:write_socket(455)
write_socket: Error writing 5 bytes to socket 30: ERRNO =
Connection reset by peer
[2005/05/11 21:01:23, 0] lib/util_sock.c:send_smb(647)
Error writing 5 bytes to client. -1. (Connection reset by peer)
[2005/05/11 21:23:14, 0] smbd/server.c:main(798)
--
|------------------------+--------------------------------------|
| Axel Reinhold | Fax: +49-9287-8244 |
| Franz-Heinrich-Str. 20 | eMail: axel@freakout.de |
| 95100 Selb | http://www.freakout.de |
| Germany | Please do not send more than 100 kilobytes |
|------------------+--------------------------------------------|
| Fingerprint: 8D EF 9F 22 DF 9A 9B 68 E5 8C 12 C7 8D 6A 97 4E |
|---------------------------------------------------------------|
| Legal Warning: Do NOT send unsolicited commercial email to me |
^ permalink raw reply
* Re: RFC: PHY Abstraction Layer II
From: Pantelis Antoniou @ 2005-05-12 6:08 UTC (permalink / raw)
To: Andy Fleming; +Cc: netdev, linuxppc-embedded, David S. Miller
In-Reply-To: <30d87aabd768216ef8bee800f3e09b9e@freescale.com>
Andy Fleming wrote:
>
> On Apr 17, 2005, at 08:00, James Chapman wrote:
>
>> Andy Fleming wrote:
>>
>>> Ok, here's the new patch with changes suggested by James Chapman:
>>
>>
>> I guess I still have questions about the way interrupts are used.
>>
>> Using an interrupt to schedule a work queue which then sets a variable
>> that is used by a timer seems odd. Why not do all the work in the work
>> queue and schedule it from the interrupt handler or timer?
>
>
> Ok, I've set up a new system for handling interrupts. There are now two
> "special" interrupt values, PHY_POLL, and PHY_IGNORE_INTERRUPT. The
> first one is used to indicate that the PHY layer will poll the PHY for
> state changes, and won't enable interrupts. The second indicates that
> the PHY layer will neither poll, nor enable interrupts, and thus will
> allow the driver to handle interrupts. The PHY layer will still operate
> its state machine, though.
>
> The driver must insure a couple things:
>
> 1) It must set phydev->state to PHY_CHANGELINK
> 2) It must do that in a work queue (or other non-interrupt time)
>
> The first one tells the PHY layer that the link state changed (it has to
> grab a lock to do this). The second one is required in order to
> properly take the lock.
>
>>
>> Also, did you mean to leave the #if 0 code in davicom.c?
>
>
> For now. It worked around a problem some people were reporting, so I'd
> like to see if they report it again now that the code's out. If so,
> they have a fairly easy fix, and I can reinsert it (or at least
> reevaluate it) in the future.
>
>>
>> /james
>
>
> Andy
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Hi Andy.
Mind taking a look at the combined FEC/FCC driver I've posted and
comment on how hard it'll be to use your PAL? I'd be especially
interested at any API mismatches, and problems you might find.
Regards
Pantelis
^ permalink raw reply
* issue with new TCP TSO stuff
From: David S. Miller @ 2005-05-12 5:30 UTC (permalink / raw)
To: netdev
It's more expensive than the old code. And I know the main reason.
There is a higher cost now because we do a large number of page
refcount grabs and releases now, that never occurred before. Before,
we just cloned and thus grabbed a ref to the whole TSO data area in
one go.
This shows up in testing where the connection is application limited.
For example, an "scp" goes more slowly over TSO now, there are less
cpu cycles available for the encryption.
It's tricky to come up with a scheme to fix this. I would love to be
able to not do the page grabs/releases in the actual TSO frame. I
really haven't come up with a clean way to do that however.
Basically, if we could somehow delay the freeing of the actual SKBs in
the socket write queue until the device frees up the TSO frame, we
could avoid the page gets and puts. Almost all the time, this delay
would never actually be needed, because the ACKs come back _long_
after the device liberates the TSO frame. But it can due to packet
taps, packet reordering, and other reasons. So we do have to handle
it.
I don't know, maybe we can do something clever with the
skb_shinfo(skb)->frag_list pointer.
Any bright ideas? :-)
^ permalink raw reply
* A different question, on SGI's STP for Linux
From: Jonathan Day @ 2005-05-12 4:47 UTC (permalink / raw)
To: netdev
Hi,
Another quick question, chasing the ones on QoS. At
one point, SGI had an intriguing prototype
implementation of something called the "Scheduled
Transfer Protocol" for Linux. Sadly, this project
seems to have vanished into the mists. I -think- I
have a copy, somewhere, that I downloaded from the
Open Source projects site.
I presume, from the fact that nobody else seems to
have picked it up, that STP isn't as useful as it
sounds. Is it something that would be worth
forward-porting to a recent kernel, or is it more of a
dead-end approach that can be done as well by other
means?
Jonathan
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
^ permalink raw reply
* Questions wrt QoS code on Linux
From: Jonathan Day @ 2005-05-12 4:40 UTC (permalink / raw)
To: netdev
Hi,
Wondering if someone can answer a few questions on the
QoS code in Linux.
First off, I notice that all the code is lumped
together and much of it is generically labelled
"scheduling". I'm wondering if it might not be more
readable if the list were divided into four sections -
"queueing disciplines", "scheduling", "packet
classification" and "everything else". Would that seem
sensible? Or would it risk making things
over-structured?
Secondly, there seem to be an awful lot of QoS methods
not represented in Linux. Implementing them all might
easily double the kernel size for not very much
benefit, even if anyone could find the time to do so.
On the other hand, there are probably some that are
under development and others high on the wishlist.
Does anyone know what projects are currently underway
or being planned?
Jonathan
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
^ permalink raw reply
* Re: [TG3]: Add hw coalescing infrastructure.
From: David S. Miller @ 2005-05-12 2:28 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1115846256.8570.109.camel@rh4>
From: "Michael Chan" <mchan@broadcom.com>
Subject: Re: [TG3]: Add hw coalescing infrastructure.
Date: Wed, 11 May 2005 14:17:36 -0700
> On Wed, 2005-05-11 at 14:15 -0700, David S.Miller wrote:
>
> > Another thing which occurred to me is that these settings are line
> > rate dependant. For example, the 20 usec value is for gigabit.
> > So we may wish to adjust the values we use based upon the negotiated
> > line speed. But that's a future refinement that can wait.
> >
> Yes, and MTU size dependent too. But we may not want to coalesce the
> same way when running at 10/100 Mbps. For example, if one packet has
> arrived, we don't want to wait 120 usec or 1200 usec to see if another
> packet will arrive before we interrupt at 100 and 10 Mbps respectively.
That's a good point. I think it would be wise for us to try
and come up with a dynamic mitigation algorithm that is as MTU
and link speed agnostic as possible.
One thing to note is that what we're really trying to do is
maximize the amount of work done per interrupt, without
unduly adding latency to packet reception.
Work done per-interrupt, and maximum latency, are better goals
because formulas based upon those values will automatically take
differences in CPU and BUS I/O speed into account.
> > I think with the removal of that I/O readback done by the tagged
> > status changes, and this coalescing stuff below, the SGI NUMA
> > performance should be significantly higher.
> >
> > Comments?
>
> Other than adding a check for netif_carrier_ok() before setting the
> HOSTCC_STAT_COAL_TICKS register in tg3_set_coalesce(), everything looks
> good to me.
Good catch. Here is the final version.
I'm still debating whether to pursue the dynamic mitigation
setting idea. I'd like to see some new numbers from the
SGI NUMA folks first.
I think we certainly should add ETHTOOL_SCOALESCE support.
It isn't in there now because I have to think a bit about
how to verify the user's settings. As you know, some
combinations of values could wedge the driver and cause
no interrupts to be generated for TX or RX even when packets
are transmitted/received. And there's that 256 limit on
5705_plus chips which you mentioned.
[TG3]: Set minimal hw interrupt mitigation.
Even though we do software interrupt mitigation
via NAPI, it still helps to have some minimal
hw assisted mitigation.
This helps, particularly, on systems where register
I/O overhead is much greater than the CPU horsepower.
For example, it helps on NUMA systems. In such cases
the PIO overhead to disable interrupts for NAPI accounts
for the majority of the packet processing cost. The
CPU is fast enough such that only a single packet is
processed by each NAPI poll call.
Thanks to Michael Chan for reviewing this patch.
Signed-off-by: David S. Miller <davem@davemloft.net>
--- 1/drivers/net/tg3.c.~1~ 2005-05-11 11:46:11.000000000 -0700
+++ 2/drivers/net/tg3.c 2005-05-11 19:26:28.000000000 -0700
@@ -2507,7 +2507,7 @@ static int tg3_setup_phy(struct tg3 *tp,
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
if (netif_carrier_ok(tp->dev)) {
tw32(HOSTCC_STAT_COAL_TICKS,
- DEFAULT_STAT_COAL_TICKS);
+ tp->coal.stats_block_coalesce_usecs);
} else {
tw32(HOSTCC_STAT_COAL_TICKS, 0);
}
@@ -5094,6 +5094,27 @@ static void tg3_set_bdinfo(struct tg3 *t
}
static void __tg3_set_rx_mode(struct net_device *);
+static void tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+{
+ tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
+ tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs);
+ tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
+ tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames);
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+ tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq);
+ tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq);
+ }
+ tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
+ tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq);
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+ u32 val = ec->stats_block_coalesce_usecs;
+
+ if (!netif_carrier_ok(tp->dev))
+ val = 0;
+
+ tw32(HOSTCC_STAT_COAL_TICKS, val);
+ }
+}
/* tp->lock is held. */
static int tg3_reset_hw(struct tg3 *tp)
@@ -5416,16 +5437,7 @@ static int tg3_reset_hw(struct tg3 *tp)
udelay(10);
}
- tw32(HOSTCC_RXCOL_TICKS, 0);
- tw32(HOSTCC_TXCOL_TICKS, LOW_TXCOL_TICKS);
- tw32(HOSTCC_RXMAX_FRAMES, 1);
- tw32(HOSTCC_TXMAX_FRAMES, LOW_RXMAX_FRAMES);
- if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
- tw32(HOSTCC_RXCOAL_TICK_INT, 0);
- tw32(HOSTCC_TXCOAL_TICK_INT, 0);
- }
- tw32(HOSTCC_RXCOAL_MAXF_INT, 1);
- tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
+ tg3_set_coalesce(tp, &tp->coal);
/* set status block DMA address */
tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH,
@@ -5438,8 +5450,6 @@ static int tg3_reset_hw(struct tg3 *tp)
* the tg3_periodic_fetch_stats call there, and
* tg3_get_stats to see how this works for 5705/5750 chips.
*/
- tw32(HOSTCC_STAT_COAL_TICKS,
- DEFAULT_STAT_COAL_TICKS);
tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH,
((u64) tp->stats_mapping >> 32));
tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW,
@@ -7284,6 +7294,14 @@ static void tg3_vlan_rx_kill_vid(struct
}
#endif
+static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
+{
+ struct tg3 *tp = netdev_priv(dev);
+
+ memcpy(ec, &tp->coal, sizeof(*ec));
+ return 0;
+}
+
static struct ethtool_ops tg3_ethtool_ops = {
.get_settings = tg3_get_settings,
.set_settings = tg3_set_settings,
@@ -7316,6 +7334,7 @@ static struct ethtool_ops tg3_ethtool_op
.get_strings = tg3_get_strings,
.get_stats_count = tg3_get_stats_count,
.get_ethtool_stats = tg3_get_ethtool_stats,
+ .get_coalesce = tg3_get_coalesce,
};
static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
@@ -9096,6 +9115,31 @@ static struct pci_dev * __devinit tg3_fi
return peer;
}
+static void __devinit tg3_init_coal(struct tg3 *tp)
+{
+ struct ethtool_coalesce *ec = &tp->coal;
+
+ memset(ec, 0, sizeof(*ec));
+ ec->cmd = ETHTOOL_GCOALESCE;
+ ec->rx_coalesce_usecs = LOW_RXCOL_TICKS;
+ ec->tx_coalesce_usecs = LOW_TXCOL_TICKS;
+ ec->rx_max_coalesced_frames = LOW_RXMAX_FRAMES;
+ ec->tx_max_coalesced_frames = LOW_TXMAX_FRAMES;
+ ec->rx_coalesce_usecs_irq = DEFAULT_RXCOAL_TICK_INT;
+ ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT;
+ ec->rx_max_coalesced_frames_irq = DEFAULT_RXCOAL_MAXF_INT;
+ ec->tx_max_coalesced_frames_irq = DEFAULT_TXCOAL_MAXF_INT;
+ ec->stats_block_coalesce_usecs = DEFAULT_STAT_COAL_TICKS;
+
+ if (tp->coalesce_mode & (HOSTCC_MODE_CLRTICK_RXBD |
+ HOSTCC_MODE_CLRTICK_TXBD)) {
+ ec->rx_coalesce_usecs = LOW_RXCOL_TICKS_CLRTCKS;
+ ec->rx_coalesce_usecs_irq = DEFAULT_RXCOAL_TICK_INT_CLRTCKS;
+ ec->tx_coalesce_usecs = LOW_TXCOL_TICKS_CLRTCKS;
+ ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT_CLRTCKS;
+ }
+}
+
static int __devinit tg3_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -9341,6 +9385,8 @@ static int __devinit tg3_init_one(struct
/* flow control autonegotiation is default behavior */
tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
+ tg3_init_coal(tp);
+
err = register_netdev(dev);
if (err) {
printk(KERN_ERR PFX "Cannot register net device, "
--- 1/drivers/net/tg3.h.~1~ 2005-05-11 11:46:11.000000000 -0700
+++ 2/drivers/net/tg3.h 2005-05-11 13:48:14.000000000 -0700
@@ -876,10 +876,12 @@
#define HOSTCC_STATUS_ERROR_ATTN 0x00000004
#define HOSTCC_RXCOL_TICKS 0x00003c08
#define LOW_RXCOL_TICKS 0x00000032
+#define LOW_RXCOL_TICKS_CLRTCKS 0x00000014
#define DEFAULT_RXCOL_TICKS 0x00000048
#define HIGH_RXCOL_TICKS 0x00000096
#define HOSTCC_TXCOL_TICKS 0x00003c0c
#define LOW_TXCOL_TICKS 0x00000096
+#define LOW_TXCOL_TICKS_CLRTCKS 0x00000048
#define DEFAULT_TXCOL_TICKS 0x0000012c
#define HIGH_TXCOL_TICKS 0x00000145
#define HOSTCC_RXMAX_FRAMES 0x00003c10
@@ -892,8 +894,10 @@
#define HIGH_TXMAX_FRAMES 0x00000052
#define HOSTCC_RXCOAL_TICK_INT 0x00003c18
#define DEFAULT_RXCOAL_TICK_INT 0x00000019
+#define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c
#define DEFAULT_TXCOAL_TICK_INT 0x00000019
+#define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20
#define DEFAULT_RXCOAL_MAXF_INT 0x00000005
#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24
@@ -2227,7 +2231,7 @@ struct tg3 {
#define SST_25VF0X0_PAGE_SIZE 4098
-
+ struct ethtool_coalesce coal;
};
#endif /* !(_T3_H) */
^ permalink raw reply
* Re: 2.6.12-rc4-tcp2
From: Arnaldo Carvalho de Melo @ 2005-05-12 0:12 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David S. Miller, Baruch Even, Daniele Lacamera,
Angelo Dell'Aera, netdev
In-Reply-To: <20050511164939.1ec95f2f@dxpl.pdx.osdl.net>
On 5/11/05, Stephen Hemminger <shemminger@osdl.org> wrote:
> http://developer.osdl.org/shemminger/patches/2.6.12-rc4-tcp2
>
> Patches that should probably go in 2.6.13.
> Note: Westwood and Hybla need more debugging and don't seem
> to work correctly.
>
> # stuff to cleanup netif_rx
> fastroute-stats-remove.diff
> no-congestion.diff
> no-throttle.diff
> bigger-backlog.diff
> fix-weightp.diff
>
> tso-reloaded.patch
>
> # TCP congestion infrastructure
> tcp_infra.patches
+ /* cleanup private data (optional) */
+ void (*destory)(struct tcp_sock *tp);
^^^^^
Typo 8)
+ /* return slow satrt threshold (required) */
> tcp_bic.patch
> westwood.patch
> hstcp.patch
> hybla.patch
> vegas.patch
> h-tcp.patch
>
> # Rearrange sk_buff to make room for bigger cb[]
> # This allows adding ptr for SACK improvement without
> # more memory
> skbuff-del-security.patch
>
>
--
- Arnaldo
^ permalink raw reply
* 2.6.12-rc4-tcp2
From: Stephen Hemminger @ 2005-05-11 23:49 UTC (permalink / raw)
To: David S. Miller, Baruch Even, Daniele Lacamera,
Angelo Dell'Aera; +Cc: netdev
http://developer.osdl.org/shemminger/patches/2.6.12-rc4-tcp2
Patches that should probably go in 2.6.13.
Note: Westwood and Hybla need more debugging and don't seem
to work correctly.
# stuff to cleanup netif_rx
fastroute-stats-remove.diff
no-congestion.diff
no-throttle.diff
bigger-backlog.diff
fix-weightp.diff
tso-reloaded.patch
# TCP congestion infrastructure
tcp_infra.patches
tcp_bic.patch
westwood.patch
hstcp.patch
hybla.patch
vegas.patch
h-tcp.patch
# Rearrange sk_buff to make room for bigger cb[]
# This allows adding ptr for SACK improvement without
# more memory
skbuff-del-security.patch
^ permalink raw reply
* Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122)
From: Herbert Xu @ 2005-05-11 23:17 UTC (permalink / raw)
To: Tommy Christensen; +Cc: Ken-ichirou MATSUZAWA, netdev, David S. Miller
In-Reply-To: <4282846F.6070403@tpack.net>
On Thu, May 12, 2005 at 12:17:19AM +0200, Tommy Christensen wrote:
>
> What about an alternative fix, that avoids even more cloning (where
> possible)? This resurrects the skb_orphan call that was moved out, last
> time we had 'shared-skb troubles'. It is practically a no-op in the
> common case, but still prevents the possible race with recvmsg.
> (And I have a weakness for one-line-fixes). :-)
BTW, we could also move the skb_orphan to the skb_get path since the
cloned packets don't need the orphan call.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] netlink: defer socket destruction a bit
From: Herbert Xu @ 2005-05-11 23:03 UTC (permalink / raw)
To: Tommy Christensen; +Cc: David S. Miller, netdev, Ken-ichirou MATSUZAWA
In-Reply-To: <4282889A.7080409@tpack.net>
On Thu, May 12, 2005 at 12:35:06AM +0200, Tommy Christensen wrote:
>
> No, skb2 cannot be shared with a listening socket. As I read the code,
> it can only be non-null when delivery has failed.
What about this code path:
1) skb2 = skb, refcnt++.
2) Devliered to socket 1.
3) Socket 1 frees skb through recvmsg.
4) skb2 = skb, refcnt++.
5) Delivery fails.
Now skb2 is identical to skb and they both refer to socket 1.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] netlink: defer socket destruction a bit
From: Tommy Christensen @ 2005-05-11 22:35 UTC (permalink / raw)
To: Herbert Xu; +Cc: David S. Miller, netdev, Ken-ichirou MATSUZAWA
In-Reply-To: <20050511222421.GA21331@gondor.apana.org.au>
Herbert Xu wrote:
> On Thu, May 12, 2005 at 12:19:02AM +0200, Tommy Christensen wrote:
>
>>diff -ru linux-2.6.12-rc4/net/netlink/af_netlink.c linux-2.6.12-work/net/netlink/af_netlink.c
>>--- linux-2.6.12-rc4/net/netlink/af_netlink.c 2005-05-11 11:10:20.000000000 +0200
>>+++ linux-2.6.12-work/net/netlink/af_netlink.c 2005-05-12 00:11:08.990990172 +0200
>>@@ -785,11 +785,12 @@
>> sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
>> do_one_broadcast(sk, &info);
>>
>>+ kfree_skb(skb);
>>+
>> netlink_unlock_table();
>>
>> if (info.skb2)
>> kfree_skb(info.skb2);
>>- kfree_skb(skb);
>
>
> Good catch. But doesn't this affect skb2 as well?
No, skb2 cannot be shared with a listening socket. As I read the code,
it can only be non-null when delivery has failed.
-Tommy
^ permalink raw reply
* Re: [PATCH] netlink: defer socket destruction a bit
From: Herbert Xu @ 2005-05-11 22:24 UTC (permalink / raw)
To: Tommy Christensen; +Cc: David S. Miller, netdev, Ken-ichirou MATSUZAWA
In-Reply-To: <428284D6.9000804@tpack.net>
On Thu, May 12, 2005 at 12:19:02AM +0200, Tommy Christensen wrote:
>
> diff -ru linux-2.6.12-rc4/net/netlink/af_netlink.c linux-2.6.12-work/net/netlink/af_netlink.c
> --- linux-2.6.12-rc4/net/netlink/af_netlink.c 2005-05-11 11:10:20.000000000 +0200
> +++ linux-2.6.12-work/net/netlink/af_netlink.c 2005-05-12 00:11:08.990990172 +0200
> @@ -785,11 +785,12 @@
> sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
> do_one_broadcast(sk, &info);
>
> + kfree_skb(skb);
> +
> netlink_unlock_table();
>
> if (info.skb2)
> kfree_skb(info.skb2);
> - kfree_skb(skb);
Good catch. But doesn't this affect skb2 as well?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122)
From: Herbert Xu @ 2005-05-11 22:22 UTC (permalink / raw)
To: Tommy Christensen; +Cc: Ken-ichirou MATSUZAWA, netdev, David S. Miller
In-Reply-To: <4282846F.6070403@tpack.net>
On Thu, May 12, 2005 at 12:17:19AM +0200, Tommy Christensen wrote:
>
> I actually thought this was caused by another race. More on that later.
Please elaborate.
> What about an alternative fix, that avoids even more cloning (where
> possible)? This resurrects the skb_orphan call that was moved out, last
> time we had 'shared-skb troubles'. It is practically a no-op in the
> common case, but still prevents the possible race with recvmsg.
> (And I have a weakness for one-line-fixes). :-)
Yep this is much better. Thanks Tommy.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH] netlink: defer socket destruction a bit
From: Tommy Christensen @ 2005-05-11 22:19 UTC (permalink / raw)
To: David S. Miller, Herbert Xu; +Cc: netdev, Ken-ichirou MATSUZAWA
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
In netlink_broadcast() we're sending shared skb's to netlink listeners
when possible (saves some copying). This is OK, since we hold the only
other reference to the skb.
However, this implies that we must drop our reference on the skb, before
allowing a receiving socket to disappear. Otherwise, the socket buffer
accounting is disrupted.
Signed-off-by: Tommy S. Christensen <tommy.christensen@tpack.net>
[-- Attachment #2: netlink-2.patch --]
[-- Type: text/plain, Size: 568 bytes --]
diff -ru linux-2.6.12-rc4/net/netlink/af_netlink.c linux-2.6.12-work/net/netlink/af_netlink.c
--- linux-2.6.12-rc4/net/netlink/af_netlink.c 2005-05-11 11:10:20.000000000 +0200
+++ linux-2.6.12-work/net/netlink/af_netlink.c 2005-05-12 00:11:08.990990172 +0200
@@ -785,11 +785,12 @@
sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
do_one_broadcast(sk, &info);
+ kfree_skb(skb);
+
netlink_unlock_table();
if (info.skb2)
kfree_skb(info.skb2);
- kfree_skb(skb);
if (info.delivered) {
if (info.congested && (allocation & __GFP_WAIT))
^ permalink raw reply
* Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122)
From: Tommy Christensen @ 2005-05-11 22:17 UTC (permalink / raw)
To: Herbert Xu; +Cc: Ken-ichirou MATSUZAWA, netdev, David S. Miller
In-Reply-To: <20050511005836.GA1674@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
Herbert Xu wrote:
> I think I understand your patch now. What's happening is that
>
> 1) The skb is sent to socket 1.
> 2) Someone does a recvmsg on socket 1 and drops the ref on the skb.
> Note that the rmalloc is not returned at this point since the
> skb is still referenced.
> 3) The same skb is now sent to socket 2.
Ahh, even I get the point now.
I actually thought this was caused by another race. More on that later.
> I agree with your solution except that we should still do the skb_get
> if we can. Here is my version where we only do the skb_get at the
> start.
What about an alternative fix, that avoids even more cloning (where
possible)? This resurrects the skb_orphan call that was moved out, last
time we had 'shared-skb troubles'. It is practically a no-op in the
common case, but still prevents the possible race with recvmsg.
(And I have a weakness for one-line-fixes). :-)
Signed-off-by: Tommy S. Christensen <tommy.christensen@tpack.net>
[-- Attachment #2: netlink-1.patch --]
[-- Type: text/plain, Size: 506 bytes --]
diff -ru linux-2.6.12-rc4/net/netlink/af_netlink.c linux-2.6.12-work/net/netlink/af_netlink.c
--- linux-2.6.12-rc4/net/netlink/af_netlink.c 2005-05-11 11:10:20.000000000 +0200
+++ linux-2.6.12-work/net/netlink/af_netlink.c 2005-05-12 00:08:33.634344658 +0200
@@ -697,6 +697,7 @@
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
!test_bit(0, &nlk->state)) {
+ skb_orphan(skb);
skb_set_owner_r(skb, sk);
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, skb->len);
^ permalink raw reply
* ipw2100: invasive cleanups
From: Pavel Machek @ 2005-05-11 22:05 UTC (permalink / raw)
To: jketreno, netdev, kernel list
Hi!
Here are some more invasive cleanups for ipw2100... I do not know what
X__ prefixes were meant for. I removed them. Along with some debugging
infrastructure and tests for obsolete kernels.
Maybe this makes it more acceptable at least for -mm tree?
Oh BTW DRV_COPYRIGHT probably needs an update, its 2005 now :-).
Pavel
--- /data/l/clean-mm/drivers/net/wireless/ipw2100.c 2005-05-11 22:00:02.000000000 +0200
+++ linux-mm/drivers/net/wireless/ipw2100.c 2005-05-11 23:58:20.000000000 +0200
@@ -106,7 +106,7 @@
tx_pend_list : Holds used Tx buffers waiting to go into the TBD ring
TAIL modified ipw2100_tx()
- HEAD modified by X__ipw2100_tx_send_data()
+ HEAD modified by ipw2100_tx_send_data()
msg_free_list : Holds pre-allocated Msg (Command) buffers
TAIL modified in __ipw2100_tx_process()
@@ -114,7 +114,7 @@
msg_pend_list : Holds used Msg buffers waiting to go into the TBD ring
TAIL modified in ipw2100_hw_send_command()
- HEAD modified in X__ipw2100_tx_send_commands()
+ HEAD modified in ipw2100_tx_send_commands()
The flow of data on the TX side is as follows:
@@ -150,7 +150,6 @@
#include <linux/skbuff.h>
#include <asm/uaccess.h>
#include <asm/io.h>
-#define __KERNEL_SYSCALLS__
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/slab.h>
@@ -174,11 +173,6 @@
#define DRV_COPYRIGHT "Copyright(c) 2003-2004 Intel Corporation"
-/* Debugging stuff */
-#ifdef CONFIG_IPW_DEBUG
-#define CONFIG_IPW2100_RX_DEBUG /* Reception debugging */
-#endif
-
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_VERSION(DRV_VERSION);
MODULE_AUTHOR(DRV_COPYRIGHT);
@@ -189,9 +183,7 @@
static int channel = 0;
static int associate = 1;
static int disable = 0;
-#ifdef CONFIG_PM
static struct ipw2100_fw ipw2100_firmware;
-#endif
#include <linux/moduleparam.h>
module_param(debug, int, 0444);
@@ -286,8 +278,8 @@
/* Pre-decl until we get the code solid and then we can clean it up */
-static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv);
-static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv);
+static void ipw2100_tx_send_commands(struct ipw2100_priv *priv);
+static void ipw2100_tx_send_data(struct ipw2100_priv *priv);
static int ipw2100_adapter_setup(struct ipw2100_priv *priv);
static void ipw2100_queues_initialize(struct ipw2100_priv *priv);
@@ -735,8 +727,8 @@
list_add_tail(element, &priv->msg_pend_list);
INC_STAT(&priv->msg_pend_stat);
- X__ipw2100_tx_send_commands(priv);
- X__ipw2100_tx_send_data(priv);
+ ipw2100_tx_send_commands(priv);
+ ipw2100_tx_send_data(priv);
spin_unlock_irqrestore(&priv->low_lock, flags);
@@ -915,12 +907,10 @@
if (i == 10000)
return -EIO; /* TODO: better error value */
-//#if CONFIG_IPW2100_D0ENABLED
/* set D0 standby bit */
read_register(priv->net_dev, IPW_REG_GP_CNTRL, &r);
write_register(priv->net_dev, IPW_REG_GP_CNTRL,
r | IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY);
-//#endif
return 0;
}
@@ -940,11 +930,8 @@
{
u32 address;
int err;
-
-#ifndef CONFIG_PM
/* Fetch the firmware and microcode */
struct ipw2100_fw ipw2100_firmware;
-#endif
if (priv->fatal_error) {
IPW_DEBUG_ERROR("%s: ipw2100_download_firmware called after "
@@ -953,7 +940,6 @@
return -EINVAL;
}
-#ifdef CONFIG_PM
if (!ipw2100_firmware.version) {
err = ipw2100_get_firmware(priv, &ipw2100_firmware);
if (err) {
@@ -963,15 +949,6 @@
goto fail;
}
}
-#else
- err = ipw2100_get_firmware(priv, &ipw2100_firmware);
- if (err) {
- IPW_DEBUG_ERROR("%s: ipw2100_get_firmware failed: %d\n",
- priv->net_dev->name, err);
- priv->fatal_error = IPW2100_ERR_FW_LOAD;
- goto fail;
- }
-#endif
priv->firmware_version = ipw2100_firmware.version;
/* s/w reset and clock stabilization */
@@ -1026,7 +1003,6 @@
goto fail;
}
-#ifndef CONFIG_PM
/*
* When the .resume method of the driver is called, the other
* part of the system, i.e. the ide driver could still stay in
@@ -1036,7 +1012,6 @@
/* free any storage allocated for firmware image */
ipw2100_release_firmware(priv, &ipw2100_firmware);
-#endif
/* zero out Domain 1 area indirectly (Si requirement) */
for (address = IPW_HOST_FW_SHARED_AREA0;
@@ -1083,8 +1058,6 @@
{
struct ipw2100_ordinals *ord = &priv->ordinals;
- IPW_DEBUG_INFO("enter\n");
-
read_register(priv->net_dev, IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1,
&ord->table1_addr);
@@ -1095,10 +1068,6 @@
read_nic_dword(priv->net_dev, ord->table2_addr, &ord->table2_size);
ord->table2_size &= 0x0000FFFF;
-
- IPW_DEBUG_INFO("table 1 size: %d\n", ord->table1_size);
- IPW_DEBUG_INFO("table 2 size: %d\n", ord->table2_size);
- IPW_DEBUG_INFO("exit\n");
}
static inline void ipw2100_hw_set_gpio(struct ipw2100_priv *priv)
@@ -1117,7 +1086,6 @@
{
#define MAX_RF_KILL_CHECKS 5
#define RF_KILL_CHECK_DELAY 40
-#define RF_KILL_CHECK_THRESHOLD 3
unsigned short value = 0;
u32 reg = 0;
@@ -1198,8 +1166,6 @@
int i;
u32 inta, inta_mask, gpio;
- IPW_DEBUG_INFO("enter\n");
-
if (priv->status & STATUS_RUNNING)
return 0;
@@ -1286,9 +1252,6 @@
/* The adapter has been reset; we are not associated */
priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
@@ -1598,8 +1561,6 @@
};
int err;
- IPW_DEBUG_INFO("enter\n");
-
IPW_DEBUG_SCAN("setting scan options\n");
cmd.host_command_parameters[0] = 0;
@@ -1643,8 +1604,6 @@
return 0;
}
- IPW_DEBUG_INFO("enter\n");
-
/* Not clearing here; doing so makes iwlist always return nothing...
*
* We should modify the table logic to use aging tables vs. clearing
@@ -1657,8 +1616,6 @@
if (err)
priv->status &= ~STATUS_SCANNING;
- IPW_DEBUG_INFO("exit\n");
-
return err;
}
@@ -2285,18 +2242,10 @@
* The size of the constructed ethernet
*
*/
-#ifdef CONFIG_IPW2100_RX_DEBUG
-u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH];
-#endif
static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv,
int i)
{
-#ifdef CONFIG_IPW_DEBUG_C3
- struct ipw2100_status *status = &priv->status_queue.drv[i];
- u32 match, reg;
- int j;
-#endif
#ifdef ACPI_CSTATE_LIMIT_DEFINED
int limit;
#endif
@@ -2314,35 +2263,6 @@
}
#endif
-#ifdef CONFIG_IPW_DEBUG_C3
- /* Halt the fimrware so we can get a good image */
- write_register(priv->net_dev, IPW_REG_RESET_REG,
- IPW_AUX_HOST_RESET_REG_STOP_MASTER);
- j = 5;
- do {
- udelay(IPW_WAIT_RESET_MASTER_ASSERT_COMPLETE_DELAY);
- read_register(priv->net_dev, IPW_REG_RESET_REG, ®);
-
- if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED)
- break;
- } while (j--);
-
- match = ipw2100_match_buf(priv, (u8*)status,
- sizeof(struct ipw2100_status),
- SEARCH_SNAPSHOT);
- if (match < SEARCH_SUCCESS)
- IPW_DEBUG_INFO("%s: DMA status match in Firmware at "
- "offset 0x%06X, length %d:\n",
- priv->net_dev->name, match,
- sizeof(struct ipw2100_status));
- else
- IPW_DEBUG_INFO("%s: No DMA status match in "
- "Firmware.\n", priv->net_dev->name);
-
- printk_buf((u8*)priv->status_queue.drv,
- sizeof(struct ipw2100_status) * RX_QUEUE_LENGTH);
-#endif
-
priv->fatal_error = IPW2100_ERR_C3_CORRUPTION;
priv->ieee->stats.rx_errors++;
schedule_reset(priv);
@@ -2394,19 +2314,7 @@
skb_put(packet->skb, status->frame_size);
-#ifdef CONFIG_IPW2100_RX_DEBUG
- /* Make a copy of the frame so we can dump it to the logs if
- * ieee80211_rx fails */
- memcpy(packet_data, packet->skb->data,
- min(status->frame_size, IPW_RX_NIC_BUFFER_LENGTH));
-#endif
-
if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
-#ifdef CONFIG_IPW2100_RX_DEBUG
- IPW_DEBUG_DROP("%s: Non consumed packet:\n",
- priv->net_dev->name);
- printk_buf(IPW_DL_DROP, packet_data, status->frame_size);
-#endif
priv->ieee->stats.rx_errors++;
/* ieee80211_rx failed, so it didn't free the SKB */
@@ -2847,7 +2755,7 @@
}
-static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv)
+static void ipw2100_tx_send_commands(struct ipw2100_priv *priv)
{
struct list_head *element;
struct ipw2100_tx_packet *packet;
@@ -2915,10 +2823,10 @@
/*
- * X__ipw2100_tx_send_data
+ * ipw2100_tx_send_data
*
*/
-static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv)
+static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
{
struct list_head *element;
struct ipw2100_tx_packet *packet;
@@ -3133,8 +3041,8 @@
IPW2100_INTA_TX_TRANSFER);
__ipw2100_tx_complete(priv);
- X__ipw2100_tx_send_commands(priv);
- X__ipw2100_tx_send_data(priv);
+ ipw2100_tx_send_commands(priv);
+ ipw2100_tx_send_data(priv);
}
if (inta & IPW2100_INTA_TX_COMPLETE) {
@@ -3192,8 +3100,6 @@
ipw2100_enable_interrupts(priv);
spin_unlock_irqrestore(&priv->low_lock, flags);
-
- IPW_DEBUG_ISR("exit\n");
}
@@ -3285,7 +3191,7 @@
list_add_tail(element, &priv->tx_pend_list);
INC_STAT(&priv->tx_pend_stat);
- X__ipw2100_tx_send_data(priv);
+ ipw2100_tx_send_data(priv);
spin_unlock_irqrestore(&priv->low_lock, flags);
return 0;
@@ -3662,96 +3568,6 @@
}
static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL);
-
-static ssize_t show_memory(struct device *d, char *buf)
-{
- struct ipw2100_priv *priv = dev_get_drvdata(d);
- struct net_device *dev = priv->net_dev;
- static unsigned long loop = 0;
- int len = 0;
- u32 buffer[4];
- int i;
- char line[81];
-
- if (loop >= 0x30000)
- loop = 0;
-
- /* sysfs provides us PAGE_SIZE buffer */
- while (len < PAGE_SIZE - 128 && loop < 0x30000) {
-
- if (priv->snapshot[0]) for (i = 0; i < 4; i++)
- buffer[i] = *(u32 *)SNAPSHOT_ADDR(loop + i * 4);
- else for (i = 0; i < 4; i++)
- read_nic_dword(dev, loop + i * 4, &buffer[i]);
-
- if (priv->dump_raw)
- len += sprintf(buf + len,
- "%c%c%c%c"
- "%c%c%c%c"
- "%c%c%c%c"
- "%c%c%c%c",
- ((u8*)buffer)[0x0],
- ((u8*)buffer)[0x1],
- ((u8*)buffer)[0x2],
- ((u8*)buffer)[0x3],
- ((u8*)buffer)[0x4],
- ((u8*)buffer)[0x5],
- ((u8*)buffer)[0x6],
- ((u8*)buffer)[0x7],
- ((u8*)buffer)[0x8],
- ((u8*)buffer)[0x9],
- ((u8*)buffer)[0xa],
- ((u8*)buffer)[0xb],
- ((u8*)buffer)[0xc],
- ((u8*)buffer)[0xd],
- ((u8*)buffer)[0xe],
- ((u8*)buffer)[0xf]);
- else
- len += sprintf(buf + len, "%s\n",
- snprint_line(line, sizeof(line),
- (u8*)buffer, 16, loop));
- loop += 16;
- }
-
- return len;
-}
-
-static ssize_t store_memory(struct device *d, const char *buf, size_t count)
-{
- struct ipw2100_priv *priv = dev_get_drvdata(d);
- struct net_device *dev = priv->net_dev;
- const char *p = buf;
-
- if (count < 1)
- return count;
-
- if (p[0] == '1' ||
- (count >= 2 && tolower(p[0]) == 'o' && tolower(p[1]) == 'n')) {
- IPW_DEBUG_INFO("%s: Setting memory dump to RAW mode.\n",
- dev->name);
- priv->dump_raw = 1;
-
- } else if (p[0] == '0' || (count >= 2 && tolower(p[0]) == 'o' &&
- tolower(p[1]) == 'f')) {
- IPW_DEBUG_INFO("%s: Setting memory dump to HEX mode.\n",
- dev->name);
- priv->dump_raw = 0;
-
- } else if (tolower(p[0]) == 'r') {
- IPW_DEBUG_INFO("%s: Resetting firmware snapshot.\n",
- dev->name);
- ipw2100_snapshot_free(priv);
-
- } else
- IPW_DEBUG_INFO("%s: Usage: 0|on = HEX, 1|off = RAW, "
- "reset = clear memory snapshot\n",
- dev->name);
-
- return count;
-}
-static DEVICE_ATTR(memory, S_IWUSR|S_IRUGO, show_memory, store_memory);
-
-
static ssize_t show_ordinals(struct device *d, char *buf)
{
struct ipw2100_priv *priv = dev_get_drvdata(d);
@@ -3837,11 +3653,9 @@
priv->ieee->iw_mode = mode;
-#ifdef CONFIG_PM
/* Indicate ipw2100_download_firmware download firmware
* from disk instead of memory. */
ipw2100_firmware.version = 0;
-#endif
printk(KERN_INFO "%s: Reseting on mode change.\n",
priv->net_dev->name);
@@ -4030,8 +3844,6 @@
unsigned long val;
char *p = buffer;
- IPW_DEBUG_INFO("enter\n");
-
strncpy(buffer, buf, len);
buffer[len] = 0;
@@ -4049,8 +3861,6 @@
priv->ieee->scan_age = val;
IPW_DEBUG_INFO("set scan_age = %u\n", priv->ieee->scan_age);
}
-
- IPW_DEBUG_INFO("exit\n");
return len;
}
static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age);
@@ -4117,7 +3927,6 @@
&dev_attr_stats.attr,
&dev_attr_internals.attr,
&dev_attr_bssinfo.attr,
- &dev_attr_memory.attr,
&dev_attr_scan_age.attr,
&dev_attr_fatal_error.attr,
&dev_attr_rf_kill.attr,
@@ -4136,8 +3945,6 @@
{
struct ipw2100_status_queue *q = &priv->status_queue;
- IPW_DEBUG_INFO("enter\n");
-
q->size = entries * sizeof(struct ipw2100_status);
q->drv = (struct ipw2100_status *)pci_alloc_consistent(
priv->pci_dev, q->size, &q->nic);
@@ -4148,31 +3955,22 @@
}
memset(q->drv, 0, q->size);
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
static void status_queue_free(struct ipw2100_priv *priv)
{
- IPW_DEBUG_INFO("enter\n");
-
if (priv->status_queue.drv) {
pci_free_consistent(
priv->pci_dev, priv->status_queue.size,
priv->status_queue.drv, priv->status_queue.nic);
priv->status_queue.drv = NULL;
}
-
- IPW_DEBUG_INFO("exit\n");
}
static int bd_queue_allocate(struct ipw2100_priv *priv,
struct ipw2100_bd_queue *q, int entries)
{
- IPW_DEBUG_INFO("enter\n");
-
memset(q, 0, sizeof(struct ipw2100_bd_queue));
q->entries = entries;
@@ -4183,17 +3981,12 @@
return -ENOMEM;
}
memset(q->drv, 0, q->size);
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
static void bd_queue_free(struct ipw2100_priv *priv,
struct ipw2100_bd_queue *q)
{
- IPW_DEBUG_INFO("enter\n");
-
if (!q)
return;
@@ -4202,24 +3995,18 @@
q->size, q->drv, q->nic);
q->drv = NULL;
}
-
- IPW_DEBUG_INFO("exit\n");
}
static void bd_queue_initialize(
struct ipw2100_priv *priv, struct ipw2100_bd_queue * q,
u32 base, u32 size, u32 r, u32 w)
{
- IPW_DEBUG_INFO("enter\n");
-
IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, q->nic);
write_register(priv->net_dev, base, q->nic);
write_register(priv->net_dev, size, q->entries);
write_register(priv->net_dev, r, q->oldest);
write_register(priv->net_dev, w, q->next);
-
- IPW_DEBUG_INFO("exit\n");
}
static void ipw2100_kill_workqueue(struct ipw2100_priv *priv)
@@ -4243,8 +4030,6 @@
void *v;
dma_addr_t p;
- IPW_DEBUG_INFO("enter\n");
-
err = bd_queue_allocate(priv, &priv->tx_queue, TX_QUEUE_LENGTH);
if (err) {
IPW_DEBUG_ERROR("%s: failed bd_queue_allocate\n",
@@ -4299,8 +4084,6 @@
{
int i;
- IPW_DEBUG_INFO("enter\n");
-
/*
* reinitialize packet info lists
*/
@@ -4339,17 +4122,12 @@
IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE,
IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX,
IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX);
-
- IPW_DEBUG_INFO("exit\n");
-
}
static void ipw2100_tx_free(struct ipw2100_priv *priv)
{
int i;
- IPW_DEBUG_INFO("enter\n");
-
bd_queue_free(priv, &priv->tx_queue);
if (!priv->tx_buffers)
@@ -4370,8 +4148,6 @@
kfree(priv->tx_buffers);
priv->tx_buffers = NULL;
-
- IPW_DEBUG_INFO("exit\n");
}
@@ -4380,8 +4156,6 @@
{
int i, j, err = -EINVAL;
- IPW_DEBUG_INFO("enter\n");
-
err = bd_queue_allocate(priv, &priv->rx_queue, RX_QUEUE_LENGTH);
if (err) {
IPW_DEBUG_INFO("failed bd_queue_allocate\n");
@@ -4448,8 +4222,6 @@
static void ipw2100_rx_initialize(struct ipw2100_priv *priv)
{
- IPW_DEBUG_INFO("enter\n");
-
priv->rx_queue.oldest = 0;
priv->rx_queue.available = priv->rx_queue.entries - 1;
priv->rx_queue.next = priv->rx_queue.entries - 1;
@@ -4466,16 +4238,12 @@
/* set up the status queue */
write_register(priv->net_dev, IPW_MEM_HOST_SHARED_RX_STATUS_BASE,
priv->status_queue.nic);
-
- IPW_DEBUG_INFO("exit\n");
}
static void ipw2100_rx_free(struct ipw2100_priv *priv)
{
int i;
- IPW_DEBUG_INFO("enter\n");
-
bd_queue_free(priv, &priv->rx_queue);
status_queue_free(priv);
@@ -4494,8 +4262,6 @@
kfree(priv->rx_buffers);
priv->rx_buffers = NULL;
-
- IPW_DEBUG_INFO("exit\n");
}
static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
@@ -4536,8 +4302,6 @@
IPW_DEBUG_HC("SET_MAC_ADDRESS\n");
- IPW_DEBUG_INFO("enter\n");
-
if (priv->config & CFG_CUSTOM_MAC) {
memcpy(cmd.host_command_parameters, priv->mac_addr,
ETH_ALEN);
@@ -4547,8 +4311,6 @@
ETH_ALEN);
err = ipw2100_hw_send_command(priv, &cmd);
-
- IPW_DEBUG_INFO("exit\n");
return err;
}
@@ -4805,47 +4567,6 @@
return 0;
}
-#if 0
-int ipw2100_set_fragmentation_threshold(struct ipw2100_priv *priv,
- u32 threshold, int batch_mode)
-{
- struct host_command cmd = {
- .host_command = FRAG_THRESHOLD,
- .host_command_sequence = 0,
- .host_command_length = 4,
- .host_command_parameters[0] = 0,
- };
- int err;
-
- if (!batch_mode) {
- err = ipw2100_disable_adapter(priv);
- if (err)
- return err;
- }
-
- if (threshold == 0)
- threshold = DEFAULT_FRAG_THRESHOLD;
- else {
- threshold = max(threshold, MIN_FRAG_THRESHOLD);
- threshold = min(threshold, MAX_FRAG_THRESHOLD);
- }
-
- cmd.host_command_parameters[0] = threshold;
-
- IPW_DEBUG_HC("FRAG_THRESHOLD: %u\n", threshold);
-
- err = ipw2100_hw_send_command(priv, &cmd);
-
- if (!batch_mode)
- ipw2100_enable_adapter(priv);
-
- if (!err)
- priv->frag_threshold = threshold;
-
- return err;
-}
-#endif
-
int ipw2100_set_short_retry(struct ipw2100_priv *priv, u32 retry)
{
struct host_command cmd = {
@@ -4935,8 +4656,6 @@
int err;
int len;
- IPW_DEBUG_HC("DISASSOCIATION_BSSID\n");
-
len = ETH_ALEN;
/* The Firmware currently ignores the BSSID and just disassociates from
* the currently associated AP -- but in the off chance that a future
@@ -4950,37 +4669,6 @@
}
#endif
-/*
- * Pseudo code for setting up wpa_frame:
- */
-#if 0
-void x(struct ieee80211_assoc_frame *wpa_assoc)
-{
- struct ipw2100_wpa_assoc_frame frame;
- frame->fixed_ie_mask = IPW_WPA_CAPABILTIES |
- IPW_WPA_LISTENINTERVAL |
- IPW_WPA_AP_ADDRESS;
- frame->capab_info = wpa_assoc->capab_info;
- frame->lisen_interval = wpa_assoc->listent_interval;
- memcpy(frame->current_ap, wpa_assoc->current_ap, ETH_ALEN);
-
- /* UNKNOWN -- I'm not postivive about this part; don't have any WPA
- * setup here to test it with.
- *
- * Walk the IEs in the wpa_assoc and figure out the total size of all
- * that data. Stick that into frame->var_ie_len. Then memcpy() all of
- * the IEs from wpa_frame into frame.
- */
- frame->var_ie_len = calculate_ie_len(wpa_assoc);
- memcpy(frame->var_ie, wpa_assoc->variable, frame->var_ie_len);
-
- ipw2100_set_wpa_ie(priv, &frame, 0);
-}
-#endif
-
-
-
-
static int ipw2100_set_wpa_ie(struct ipw2100_priv *,
struct ipw2100_wpa_assoc_frame *, int)
__attribute__ ((unused));
@@ -4996,8 +4684,6 @@
};
int err;
- IPW_DEBUG_HC("SET_WPA_IE\n");
-
if (!batch_mode) {
err = ipw2100_disable_adapter(priv);
if (err)
@@ -5123,8 +4809,6 @@
cmd.host_command_parameters[0] = interval;
- IPW_DEBUG_INFO("enter\n");
-
if (priv->ieee->iw_mode == IW_MODE_ADHOC) {
if (!batch_mode) {
err = ipw2100_disable_adapter(priv);
@@ -5140,9 +4824,6 @@
return err;
}
}
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
@@ -5502,8 +5183,6 @@
int batch_mode = 1;
u8 *bssid;
- IPW_DEBUG_INFO("enter\n");
-
err = ipw2100_disable_adapter(priv);
if (err)
return err;
@@ -5512,9 +5191,6 @@
err = ipw2100_set_channel(priv, priv->channel, batch_mode);
if (err)
return err;
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
#endif /* CONFIG_IPW2100_MONITOR */
@@ -5591,9 +5267,6 @@
if (err)
return err;
*/
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
@@ -5656,8 +5329,6 @@
struct list_head *element;
struct ipw2100_tx_packet *packet;
- IPW_DEBUG_INFO("enter\n");
-
spin_lock_irqsave(&priv->low_lock, flags);
if (priv->status & STATUS_ASSOCIATED)
@@ -5679,9 +5350,6 @@
INC_STAT(&priv->tx_free_stat);
}
spin_unlock_irqrestore(&priv->low_lock, flags);
-
- IPW_DEBUG_INFO("exit\n");
-
return 0;
}
@@ -6440,8 +6108,6 @@
int registered = 0;
u32 val;
- IPW_DEBUG_INFO("enter\n");
-
mem_start = pci_resource_start(pci_dev, 0);
mem_len = pci_resource_len(pci_dev, 0);
mem_flags = pci_resource_flags(pci_dev, 0);
@@ -6589,8 +6255,6 @@
ipw2100_start_scan(priv);
}
- IPW_DEBUG_INFO("exit\n");
-
priv->status |= STATUS_INITIALIZED;
up(&priv->action_sem);
@@ -6644,10 +6308,9 @@
dev = priv->net_dev;
sysfs_remove_group(&pci_dev->dev.kobj, &ipw2100_attribute_group);
-#ifdef CONFIG_PM
if (ipw2100_firmware.version)
ipw2100_release_firmware(priv, &ipw2100_firmware);
-#endif
+
/* Take down the hardware */
ipw2100_down(priv);
@@ -6680,17 +6343,11 @@
pci_release_regions(pci_dev);
pci_disable_device(pci_dev);
-
- IPW_DEBUG_INFO("exit\n");
}
#ifdef CONFIG_PM
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
-static int ipw2100_suspend(struct pci_dev *pci_dev, u32 state)
-#else
static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
-#endif
{
struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
struct net_device *dev = priv->net_dev;
@@ -6707,17 +6364,9 @@
/* Remove the PRESENT state of the device */
netif_device_detach(dev);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
- pci_save_state(pci_dev, priv->pm_state);
-#else
pci_save_state(pci_dev);
-#endif
pci_disable_device (pci_dev);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
- pci_set_power_state(pci_dev, state);
-#else
pci_set_power_state(pci_dev, PCI_D3hot);
-#endif
up(&priv->action_sem);
@@ -6738,17 +6387,9 @@
IPW_DEBUG_INFO("%s: Coming out of suspend...\n",
dev->name);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
- pci_set_power_state(pci_dev, 0);
-#else
pci_set_power_state(pci_dev, PCI_D0);
-#endif
pci_enable_device(pci_dev);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
- pci_restore_state(pci_dev, priv->pm_state);
-#else
pci_restore_state(pci_dev);
-#endif
/*
* Suspend/Resume resets the PCI configuration space, so we have to
@@ -8295,8 +7936,6 @@
down(&priv->action_sem);
- IPW_DEBUG_WX("enter\n");
-
up(&priv->action_sem);
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
--
Boycott Kodak -- for their patent abuse against Java.
^ permalink raw reply
* kill unused define in ipw
From: Pavel Machek @ 2005-05-11 21:43 UTC (permalink / raw)
To: jketreno; +Cc: kernel list, netdev
Hi!
This kills unused KILL_CHECK_THRESHOLD and KERNEL_SYSCALLS. They
should not be needed any more. Please apply,
[What is the merge status? Version 1.1 seems quite okay, but it could
use some "#ifdef 2.6.10" removal". Can I help?]
Pavel
PS: Please Cc me, I'm not on netdev.
Signed-off-by: Pavel Machek <pavel@suse.cz>
--- /data/l/clean-mm/drivers/net/wireless/ipw2100.c 2005-05-11 22:00:02.000000000 +0200
+++ linux-mm/drivers/net/wireless/ipw2100.c 2005-05-11 23:37:25.000000000 +0200
@@ -150,7 +150,6 @@
#include <linux/skbuff.h>
#include <asm/uaccess.h>
#include <asm/io.h>
-#define __KERNEL_SYSCALLS__
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/slab.h>
@@ -1117,7 +1116,6 @@
{
#define MAX_RF_KILL_CHECKS 5
#define RF_KILL_CHECK_DELAY 40
-#define RF_KILL_CHECK_THRESHOLD 3
unsigned short value = 0;
u32 reg = 0;
--
Boycott Kodak -- for their patent abuse against Java.
^ permalink raw reply
* Re: 2.4.30-hf1 do_IRQ stack overflows
From: Herbert Xu @ 2005-05-11 21:38 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: manfred99, linux-kernel, davem, netdev
In-Reply-To: <20050511124640.GE8541@logos.cnet>
Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
> May 11 04:22:09 server kernel: [__switch_to+82/256] [schedule+738/1344] [schedule_timeout+84/160] [process_timeout+0/96] [st:__insmod_st_O/lib/modules/2.4.30-hf1/kernel/drivers/scsi/st+4294702743/96] [st:__insmod_st_O/lib/modules/2.4.30-hf1/kernel/drivers/scsi/st+4294703097/96]
The stack trace becomes unreadable at this point. Please run klogd
with -X and then decode the messages with ksymoops. Alternatively
run ksymoops on the output of dmesg directly.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [TG3]: Add hw coalescing infrastructure.
From: Michael Chan @ 2005-05-11 21:17 UTC (permalink / raw)
To: David S.Miller; +Cc: netdev
In-Reply-To: <20050511.141530.57445142.davem@davemloft.net>
On Wed, 2005-05-11 at 14:15 -0700, David S.Miller wrote:
> It seems that we should also be avoiding the HOSTCC_{R,T}XCOAL_MAXF_INT
> registers when TG3_FLG2_5705_PLUS. I didn't make that change yet, just
> preserving what we were doing previously.
These registers are still defined for 5705_PLUS chips, only the maximum
value has been reduced to 255. So we're ok.
>
> Another thing which occurred to me is that these settings are line
> rate dependant. For example, the 20 usec value is for gigabit.
> So we may wish to adjust the values we use based upon the negotiated
> line speed. But that's a future refinement that can wait.
>
Yes, and MTU size dependent too. But we may not want to coalesce the
same way when running at 10/100 Mbps. For example, if one packet has
arrived, we don't want to wait 120 usec or 1200 usec to see if another
packet will arrive before we interrupt at 100 and 10 Mbps respectively.
> I think with the removal of that I/O readback done by the tagged
> status changes, and this coalescing stuff below, the SGI NUMA
> performance should be significantly higher.
>
> Comments?
Other than adding a check for netif_carrier_ok() before setting the
HOSTCC_STAT_COAL_TICKS register in tg3_set_coalesce(), everything looks
good to me.
^ permalink raw reply
* [TG3]: Add hw coalescing infrastructure.
From: David S. Miller @ 2005-05-11 21:15 UTC (permalink / raw)
To: netdev; +Cc: mchan
Ok, now that we have the tagged status stuff sorted I began
to work on putting the hw mitigation bits back into the
driver. The discussion on the DMA rw-ctrl settings is still
ongoing, but I will get back to it shortly.
This is the first step, we cache the settings in the tg3
struct and put those values into the chip via tg3_set_coalesce().
ETHTOOL_GCOALESCE is supported, setting is not.
The idea is that if we add dynamnic mitigation or ETHTOOL_SCOALESCE,
it will simply invoke this routine to program the hardware.
It seems that we should also be avoiding the HOSTCC_{R,T}XCOAL_MAXF_INT
registers when TG3_FLG2_5705_PLUS. I didn't make that change yet, just
preserving what we were doing previously.
Another thing which occurred to me is that these settings are line
rate dependant. For example, the 20 usec value is for gigabit.
So we may wish to adjust the values we use based upon the negotiated
line speed. But that's a future refinement that can wait.
I think with the removal of that I/O readback done by the tagged
status changes, and this coalescing stuff below, the SGI NUMA
performance should be significantly higher.
Comments?
Signed-off-by: David S. Miller <davem@davemloft.net>
--- 1/drivers/net/tg3.c.~1~ 2005-05-11 11:46:11.000000000 -0700
+++ 2/drivers/net/tg3.c 2005-05-11 13:47:17.000000000 -0700
@@ -2507,7 +2507,7 @@ static int tg3_setup_phy(struct tg3 *tp,
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
if (netif_carrier_ok(tp->dev)) {
tw32(HOSTCC_STAT_COAL_TICKS,
- DEFAULT_STAT_COAL_TICKS);
+ tp->coal.stats_block_coalesce_usecs);
} else {
tw32(HOSTCC_STAT_COAL_TICKS, 0);
}
@@ -5094,6 +5094,22 @@ static void tg3_set_bdinfo(struct tg3 *t
}
static void __tg3_set_rx_mode(struct net_device *);
+static void tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
+{
+ tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
+ tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs);
+ tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
+ tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames);
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+ tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq);
+ tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq);
+ }
+ tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
+ tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq);
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+ tw32(HOSTCC_STAT_COAL_TICKS,
+ ec->stats_block_coalesce_usecs);
+}
/* tp->lock is held. */
static int tg3_reset_hw(struct tg3 *tp)
@@ -5416,16 +5432,7 @@ static int tg3_reset_hw(struct tg3 *tp)
udelay(10);
}
- tw32(HOSTCC_RXCOL_TICKS, 0);
- tw32(HOSTCC_TXCOL_TICKS, LOW_TXCOL_TICKS);
- tw32(HOSTCC_RXMAX_FRAMES, 1);
- tw32(HOSTCC_TXMAX_FRAMES, LOW_RXMAX_FRAMES);
- if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
- tw32(HOSTCC_RXCOAL_TICK_INT, 0);
- tw32(HOSTCC_TXCOAL_TICK_INT, 0);
- }
- tw32(HOSTCC_RXCOAL_MAXF_INT, 1);
- tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
+ tg3_set_coalesce(tp, &tp->coal);
/* set status block DMA address */
tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH,
@@ -5438,8 +5445,6 @@ static int tg3_reset_hw(struct tg3 *tp)
* the tg3_periodic_fetch_stats call there, and
* tg3_get_stats to see how this works for 5705/5750 chips.
*/
- tw32(HOSTCC_STAT_COAL_TICKS,
- DEFAULT_STAT_COAL_TICKS);
tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_HIGH,
((u64) tp->stats_mapping >> 32));
tw32(HOSTCC_STATS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW,
@@ -7284,6 +7289,14 @@ static void tg3_vlan_rx_kill_vid(struct
}
#endif
+static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
+{
+ struct tg3 *tp = netdev_priv(dev);
+
+ memcpy(ec, &tp->coal, sizeof(*ec));
+ return 0;
+}
+
static struct ethtool_ops tg3_ethtool_ops = {
.get_settings = tg3_get_settings,
.set_settings = tg3_set_settings,
@@ -7316,6 +7329,7 @@ static struct ethtool_ops tg3_ethtool_op
.get_strings = tg3_get_strings,
.get_stats_count = tg3_get_stats_count,
.get_ethtool_stats = tg3_get_ethtool_stats,
+ .get_coalesce = tg3_get_coalesce,
};
static void __devinit tg3_get_eeprom_size(struct tg3 *tp)
@@ -9096,6 +9110,31 @@ static struct pci_dev * __devinit tg3_fi
return peer;
}
+static void __devinit tg3_init_coal(struct tg3 *tp)
+{
+ struct ethtool_coalesce *ec = &tp->coal;
+
+ memset(ec, 0, sizeof(*ec));
+ ec->cmd = ETHTOOL_GCOALESCE;
+ ec->rx_coalesce_usecs = LOW_RXCOL_TICKS;
+ ec->tx_coalesce_usecs = LOW_TXCOL_TICKS;
+ ec->rx_max_coalesced_frames = LOW_RXMAX_FRAMES;
+ ec->tx_max_coalesced_frames = LOW_TXMAX_FRAMES;
+ ec->rx_coalesce_usecs_irq = DEFAULT_RXCOAL_TICK_INT;
+ ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT;
+ ec->rx_max_coalesced_frames_irq = DEFAULT_RXCOAL_MAXF_INT;
+ ec->tx_max_coalesced_frames_irq = DEFAULT_TXCOAL_MAXF_INT;
+ ec->stats_block_coalesce_usecs = DEFAULT_STAT_COAL_TICKS;
+
+ if (tp->coalesce_mode & (HOSTCC_MODE_CLRTICK_RXBD |
+ HOSTCC_MODE_CLRTICK_TXBD)) {
+ ec->rx_coalesce_usecs = LOW_RXCOL_TICKS_CLRTCKS;
+ ec->rx_coalesce_usecs_irq = DEFAULT_RXCOAL_TICK_INT_CLRTCKS;
+ ec->tx_coalesce_usecs = LOW_TXCOL_TICKS_CLRTCKS;
+ ec->tx_coalesce_usecs_irq = DEFAULT_TXCOAL_TICK_INT_CLRTCKS;
+ }
+}
+
static int __devinit tg3_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -9341,6 +9380,8 @@ static int __devinit tg3_init_one(struct
/* flow control autonegotiation is default behavior */
tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
+ tg3_init_coal(tp);
+
err = register_netdev(dev);
if (err) {
printk(KERN_ERR PFX "Cannot register net device, "
--- 1/drivers/net/tg3.h.~1~ 2005-05-11 11:46:11.000000000 -0700
+++ 2/drivers/net/tg3.h 2005-05-11 13:48:14.000000000 -0700
@@ -876,10 +876,12 @@
#define HOSTCC_STATUS_ERROR_ATTN 0x00000004
#define HOSTCC_RXCOL_TICKS 0x00003c08
#define LOW_RXCOL_TICKS 0x00000032
+#define LOW_RXCOL_TICKS_CLRTCKS 0x00000014
#define DEFAULT_RXCOL_TICKS 0x00000048
#define HIGH_RXCOL_TICKS 0x00000096
#define HOSTCC_TXCOL_TICKS 0x00003c0c
#define LOW_TXCOL_TICKS 0x00000096
+#define LOW_TXCOL_TICKS_CLRTCKS 0x00000048
#define DEFAULT_TXCOL_TICKS 0x0000012c
#define HIGH_TXCOL_TICKS 0x00000145
#define HOSTCC_RXMAX_FRAMES 0x00003c10
@@ -892,8 +894,10 @@
#define HIGH_TXMAX_FRAMES 0x00000052
#define HOSTCC_RXCOAL_TICK_INT 0x00003c18
#define DEFAULT_RXCOAL_TICK_INT 0x00000019
+#define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c
#define DEFAULT_TXCOAL_TICK_INT 0x00000019
+#define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20
#define DEFAULT_RXCOAL_MAXF_INT 0x00000005
#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24
@@ -2227,7 +2231,7 @@ struct tg3 {
#define SST_25VF0X0_PAGE_SIZE 4098
-
+ struct ethtool_coalesce coal;
};
#endif /* !(_T3_H) */
^ permalink raw reply
* Re: [PATCH] fix long-standing bug in 2.6/2.4 skb_copy/skb_copy_expand
From: David S. Miller @ 2005-05-11 20:56 UTC (permalink / raw)
To: pizza; +Cc: herbert, linux-kernel, netdev
In-Reply-To: <20050511203845.GA10770@shaftnet.org>
From: Stuffed Crust <pizza@shaftnet.org>
Subject: Re: [PATCH] fix long-standing bug in 2.6/2.4 skb_copy/skb_copy_expand
Date: Wed, 11 May 2005 16:38:45 -0400
> As I said in my original message, it was a crude hack which has since
> been relegated to the great bitbucket of the sky. All that's left is
> that "bugfix" patch.
If alloc_skb() does not do an skb_reserve(), then the bug fix
patch is unnecessary. The "bug" only exists if you happen to
change alloc_skb() to do an skb_reserve().
^ 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