Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/9 Rev3] Implement batching skb API and support in IPoIB
From: Krishna Kumar2 @ 2007-08-23  2:43 UTC (permalink / raw)
  To: David Miller
  Cc: gaagaan, general, hadi, herbert, jagana, jeff, johnpol, kaber,
	kumarkr, mcarlson, mchan, netdev, peter.p.waskiewicz.jr, rdreier,
	rick.jones2, Robert.Olsson, shemminger, sri, tgraf, xma
In-Reply-To: <20070822.021440.123973929.davem@davemloft.net>

David Miller <davem@davemloft.net> wrote on 08/22/2007 02:44:40 PM:

> From: Krishna Kumar2 <krkumar2@in.ibm.com>
> Date: Wed, 22 Aug 2007 12:33:04 +0530
>
> > Does turning off batching solve that problem? What I mean by that is:
> > batching can be disabled if a TSO device is worse for some cases.
>
> This new batching stuff isn't going to be enabled or disabled
> on a per-device basis just to get "parity" with how things are
> now.
>
> It should be enabled by default, and give at least as good
> performance as what can be obtained right now.

That was how it was in earlier revisions. In revision4 I coded it so
that it is enabled only if explicitly set by the user. I can revert
that change.

> Otherwise it's a clear regression.

Definitely. For drivers that support it, it should not reduce performance.

Thanks,

- KK


^ permalink raw reply

* [ofa-general] Re: [PATCH 10/10 Rev4] [E1000] Implement batching
From: Krishna Kumar2 @ 2007-08-23  2:44 UTC (permalink / raw)
  To: Kok, Auke
  Cc: jagana, johnpol, herbert, gaagaan, Robert.Olsson, kumarkr,
	mcarlson, peter.p.waskiewicz.jr, hadi, kaber, jeff, general,
	mchan, tgraf, netdev, sri, shemminger, davem, rdreier
In-Reply-To: <46CC4AA3.5030607@intel.com>

Hi Auke,

"Kok, Auke" <auke-jan.h.kok@intel.com> wrote on 08/22/2007 08:09:31 PM:

> Krishna,
>
> while I appreciate the patch I would have preferred a patch to e1000e.
Not only
> does the e1000e driver remove a lot of the workarounds for old silicon,
it is
> also a good way for us to move the current e1000 driver into a bit more
stable
> maintenance mode.
>
> Do you think you can write this patch for e1000e instead? code-wise a lot
of
> things are still the same, so your patch should be relatively easy to
generate.
>
> e1000e currently lives in a branch from jeff garzik's netdev-2.6 tree

Definitely, I will pick it up and generate a patch.

Thanks,

- KK

^ permalink raw reply

* Re: [PATCH 1/10 Rev4] [Doc] HOWTO Documentation for batching
From: Krishna Kumar2 @ 2007-08-23  2:48 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: davem, gaagaan, general, hadi, herbert, jagana, jeff, johnpol,
	kaber, kumarkr, mcarlson, mchan, netdev, peter.p.waskiewicz.jr,
	rdreier, rick.jones2, Robert.Olsson, shemminger, sri, tgraf, xma
In-Reply-To: <20070822085013.d20e1fd4.randy.dunlap@oracle.com>

Hi Randy,

Thanks for your suggestions. Will clean up those changes.

- KK

Randy Dunlap <randy.dunlap@oracle.com> wrote on 08/22/2007 09:20:13 PM:

> On Wed, 22 Aug 2007 13:58:58 +0530 Krishna Kumar wrote:
>
> > Add Documentation describing batching skb xmit capability.
> >
> > Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
> > ---
> >  batching_skb_xmit.txt |   78
++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 78 insertions(+)
> >
> > diff -ruNp org/Documentation/networking/batching_skb_xmit.txt
> new/Documentation/networking/batching_skb_xmit.txt
> > --- org/Documentation/networking/batching_skb_xmit.txt   1970-01-01
05:30:
> 00.000000000 +0530
> > +++ new/Documentation/networking/batching_skb_xmit.txt   2007-08-22
10:21:
> 19.000000000 +0530
> > @@ -0,0 +1,78 @@
> > +       HOWTO for batching skb xmit support
> > +       -----------------------------------
> > +
> > +Section 1: What is batching skb xmit
> > +Section 2: How batching xmit works vs the regular xmit
> > +Section 3: How drivers can support batching
> > +Section 4: How users can work with batching
> > +
> > +
> > +Introduction: Kernel support for batching skb
> > +----------------------------------------------
> > +
> > +A new capability to support xmit of multiple skbs is provided in the
netdevice
> > +layer. Drivers which enable this capability should be able to process
multiple
> > +skbs in a single call to their xmit handler.
> > +
> > +
> > +Section 1: What is batching skb xmit
> > +-------------------------------------
> > +
> > +   This capability is optionally enabled by a driver by setting the
> > +   NETIF_F_BATCH_SKBS bit in dev->features. The pre-requisite for a
>
>                                                      prerequisite
>
> > +   driver to use this capability is that it should have a reasonably
>
>    I would say "reasonably-sized".
>
> > +   sized hardware queue that can process multiple skbs.
> > +
> > +
> > +Section 2: How batching xmit works vs the regular xmit
> > +-------------------------------------------------------
> > +
> > +   The network stack gets called from upper layer protocols with a
single
> > +   skb to transmit. This skb is first enqueue'd and an attempt is made
to
>
>                                            enqueued
>
> > +   transmit it immediately (via qdisc_run). However, events like tx
lock
> > +   contention, tx queue stopped, etc, can result in the skb not
getting
>
>                                       etc.,
>
> > +   sent out and it remains in the queue. When the next xmit is called
or
> > +   when the queue is re-enabled, qdisc_run could potentially find
> > +   multiple packets in the queue, and iteratively send them all out
> > +   one-by-one.
> > +
> > +   Batching skb xmit is a mechanism to exploit this situation where
all
> > +   skbs can be passed in one shot to the device. This reduces driver
> > +   processing, locking at the driver (or in stack for ~LLTX drivers)
> > +   gets amortized over multiple skbs, and in case of specific drivers
> > +   where every xmit results in a completion processing (like IPoIB) -
> > +   optimizations can be made in the driver to request a completion for
> > +   only the last skb that was sent which results in saving interrupts
> > +   for every (but the last) skb that was sent in the same batch.
> > +
> > +   Batching can result in significant performance gains for systems
that
> > +   have multiple data stream paths over the same network interface
card.
> > +
> > +
> > +Section 3: How drivers can support batching
> > +---------------------------------------------
> > +
> > +   Batching requires the driver to set the NETIF_F_BATCH_SKBS bit in
> > +   dev->features.
> > +
> > +   The driver's xmit handler should be modified to process multiple
skbs
> > +   instead of one skb. The driver's xmit handler is called either with
a
>
>
an
>
> > +   skb to transmit or NULL skb, where the latter case should be
handled
> > +   as a call to xmit multiple skbs. This is done by sending out all
skbs
> > +   in the dev->skb_blist list (where it was added by the core stack).
> > +
> > +
> > +Section 4: How users can work with batching
> > +---------------------------------------------
> > +
> > +   Batching can be disabled for a particular device, e.g. on desktop
> > +   systems if only one stream of network activity for that device is
> > +   taking place, since performance could be slightly affected due to
> > +   extra processing that batching adds (unless packets are getting
> > +   sent fast resulting in stopped queue's). Batching can be enabled if
>
>                                        queues).
>
> > +   more than one stream of network activity per device is being done,
> > +   e.g. on servers; or even desktop usage with multiple browser, chat,
> > +   file transfer sessions, etc.
> > +
> > +   Per device batching can be enabled/disabled by passing 'on' or
'off'
> > +   respectively to ethtool.
>
>    with what other parameter(s), e.g.,
>
>    ethtool <dev> batching on/off ?
>
> ---
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code
***


^ permalink raw reply

* [PATCH] ucc_geth: kill unused include
From: Kumar Gala @ 2007-08-23  2:51 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Paul Mackerras, netdev, linuxppc-dev, Li Yang

The ucc_geth_mii code is based on the gianfar_mii code that use to include
ocp.h.  ucc never need this and it causes issues when we want to kill
arch/ppc includes from arch/powerpc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---

Jeff, if you issue with this for 2.6.23, I'd prefer to push this via
the powerpc.git trees in 2.6.24 as part of a larger cleanup.  Let me know
one way or the other.

- k

 drivers/net/ucc_geth_mii.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b8..df884f0 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -32,7 +32,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <asm/ocp.h>
 #include <linux/crc32.h>
 #include <linux/mii.h>
 #include <linux/phy.h>
-- 
1.5.2.4


^ permalink raw reply related

* Re: [PATCH] ucc_geth: kill unused include
From: David Gibson @ 2007-08-23  2:54 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Jeff Garzik, netdev, Li Yang, Paul Mackerras, linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0708222144440.6464@blarg.am.freescale.net>

On Wed, Aug 22, 2007 at 09:51:03PM -0500, Kumar Gala wrote:
> The ucc_geth_mii code is based on the gianfar_mii code that use to include
> ocp.h.  ucc never need this and it causes issues when we want to kill
> arch/ppc includes from arch/powerpc.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH] improved xfrm_audit_log() patch
From: David Miller @ 2007-08-23  3:05 UTC (permalink / raw)
  To: latten; +Cc: netdev, linux-audit
In-Reply-To: <1187832557.15699.687.camel@faith.austin.ibm.com>

From: Joy Latten <latten@austin.ibm.com>
Date: Wed, 22 Aug 2007 20:29:17 -0500

> On Wed, 2007-08-22 at 12:51 -0700, David Miller wrote:
> > From: David Miller <davem@davemloft.net>
> > Date: Tue, 21 Aug 2007 00:24:05 -0700 (PDT)
> > 
> > > Looks good, applied to net-2.6.24, thanks Joy.
> > 
> > Something is still buggered up in this patch, you can't add this local
> > "audit_info" variable unconditionally to these functions, and
> > alternatively you also can't add a bunch of ifdefs to xfrm_user.c to
> > cover it up either.
> > 
> I wonder if I am subconsciously trying to break a record or 
> something! My apologies as time is valuable. 
> 
> I mean to get this right. My rationale for using audit_info was to
> reduce amount of arguments to xfrm_audit_log(). However, I now like
> it better when I just called xfrm_audit_log(NETLINK_CB(skb).loginuid,
> NETLINK_CB(skb).sid, ...). User determines where/how to get loginuid and
> secid and nothing happens when AUDIT not configured. But would make
> xfrm_audit_log() have 7 arguments instead of 6.
> 
> My alternative is to remove xfrm_get_auditinfo() out of the 
> #ifdef CONFIG_AUDITSYSCALL and always fill in audit_info
> regardless if AUDIT is configured or not. Less calls to
> xfrm_audit_log() but perhaps unnecessary info when AUDIT 
> not configured.
> 
> Would first solution be acceptable?

I don't like either of these ideas, sorry.

I would suggest, at this point, to make purpose built situation
specific interfaces that pass specific objects (the ones being
operated upon) to the audit layer.

Let the audit layer pick out the bits it actually wants in the
format it likes.

For example, if we're creating a template, pass the policy and
the templace to the audit layer via a function called:

xfrm_audit_template_add()

or something like that.  That function only needs two arguments.

All of these call sites will rarely need more than 2 or 3 arguments in
any given situation, and the on-stack audit thing will be gone too.

This is the suggestion I made to you over a month ago, but you choose
to do the on-stack thing.

You must make this cost absolutely nothing when it is either
not configured, and have next to no cost when not enabled at
run time.  And it is very doable.

^ permalink raw reply

* [PATCH 0/3] cxgb3 driver update
From: Divy Le Ray @ 2007-08-23  6:35 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-kernel, Steve Wise

Hi Jeff,

I'm submitting three more patches for inclusion in netdev#upstream.
These patches are built over the series I resent yesterday night.
The patch numbering reflects the stacking.

Here is a brief description:
-   avoid false positives in the xgmac hang workaround
-   Properly set the CQ_ERR bit in RDMA CQ contexts.
-   Update CQ context operations time out values

Cheers,
Divy



^ permalink raw reply

* [PATCH 12/11] cxgb3 - remove false positive in xgmac workaround
From: Divy Le Ray @ 2007-08-23  6:37 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

Qualify toggling of xgmac tx enable with not getting pause frames, 
we might not make forward progress because the peer is sending 
lots of pause frames.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 drivers/net/cxgb3/common.h |    1 +
 drivers/net/cxgb3/xgmac.c  |    4 +++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index ff867c2..3e5b0db 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -514,6 +514,7 @@ struct cmac {
 	u64 rx_mcnt;
 	unsigned int toggle_cnt;
 	unsigned int txen;
+	u64 rx_pause;
 	struct mac_stats stats;
 };
 
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index 1d1c391..ff9e9dc 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -452,6 +452,7 @@ int t3_mac_enable(struct cmac *mac, int which)
 						A_XGM_TX_SPI4_SOP_EOP_CNT +
 						oft)));
 		mac->rx_mcnt = s->rx_frames;
+		mac->rx_pause = s->rx_pause;
 		mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
 						A_XGM_RX_SPI4_SOP_EOP_CNT +
 						oft)));
@@ -504,7 +505,7 @@ int t3b2_mac_watchdog_task(struct cmac *mac)
 	tx_xcnt = 1;		/* By default tx_xcnt is making progress */
 	tx_tcnt = mac->tx_tcnt;	/* If tx_mcnt is progressing ignore tx_tcnt */
 	rx_xcnt = 1;		/* By default rx_xcnt is making progress */
-	if (tx_mcnt == mac->tx_mcnt) {
+	if (tx_mcnt == mac->tx_mcnt && mac->rx_pause == s->rx_pause) {
 		tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
 						A_XGM_TX_SPI4_SOP_EOP_CNT +
 					       	mac->offset)));
@@ -560,6 +561,7 @@ out:
 	mac->tx_mcnt = s->tx_frames;
 	mac->rx_xcnt = rx_xcnt;
 	mac->rx_mcnt = s->rx_frames;
+	mac->rx_pause = s->rx_pause;
 	if (status == 1) {
 		t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
 		t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);  /* flush */

^ permalink raw reply related

* [PATCH 13/11] cxgb3 -  Set the CQ_ERR bit in CQ contexts.
From: Divy Le Ray @ 2007-08-23  6:38 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

The cxgb3 driver is incorrectly configuring the HW CQ context for CQ's
that use overflow-avoidance.  Namely the RDMA control CQ.  This results
in a bad DMA from the device to bus address 0.  The solution is to set
the CQ_ERR bit in the context for these types of CQs.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 drivers/net/cxgb3/sge_defs.h |    4 ++++
 drivers/net/cxgb3/t3_hw.c    |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/cxgb3/sge_defs.h b/drivers/net/cxgb3/sge_defs.h
index 514869e..29b6c80 100644
--- a/drivers/net/cxgb3/sge_defs.h
+++ b/drivers/net/cxgb3/sge_defs.h
@@ -106,6 +106,10 @@
 #define V_CQ_GEN(x) ((x) << S_CQ_GEN)
 #define F_CQ_GEN    V_CQ_GEN(1U)
 
+#define S_CQ_ERR    30
+#define V_CQ_ERR(x) ((x) << S_CQ_ERR)
+#define F_CQ_ERR    V_CQ_ERR(1U)
+
 #define S_CQ_OVERFLOW_MODE    31
 #define V_CQ_OVERFLOW_MODE(x) ((x) << S_CQ_OVERFLOW_MODE)
 #define F_CQ_OVERFLOW_MODE    V_CQ_OVERFLOW_MODE(1U)
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 538b254..9358959 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -2043,7 +2043,8 @@ int t3_sge_init_cqcntxt(struct adapter *adapter, unsigned int id, u64 base_addr,
 	base_addr >>= 32;
 	t3_write_reg(adapter, A_SG_CONTEXT_DATA2,
 		     V_CQ_BASE_HI((u32) base_addr) | V_CQ_RSPQ(rspq) |
-		     V_CQ_GEN(1) | V_CQ_OVERFLOW_MODE(ovfl_mode));
+		     V_CQ_GEN(1) | V_CQ_OVERFLOW_MODE(ovfl_mode) |
+		     V_CQ_ERR(ovfl_mode));
 	t3_write_reg(adapter, A_SG_CONTEXT_DATA3, V_CQ_CREDITS(credits) |
 		     V_CQ_CREDIT_THRES(credit_thres));
 	return t3_sge_write_context(adapter, id, F_CQ);

^ permalink raw reply related

* [PATCH 14/11] cxgb3 - CQ context operations time out too soon.
From: Divy Le Ray @ 2007-08-23  6:38 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

Currently, the driver only tries up to 5 times (5us) to get the results
of a CQ context operation.  Testing has shown the chip can take as much
as 50us to return the response on SG_CONTEXT_CMD operations.  So we up
the retry count to 100 to cover high loads.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 drivers/net/cxgb3/t3_hw.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 9358959..8f6efdb 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1867,6 +1867,8 @@ void t3_port_intr_clear(struct adapter *adapter, int idx)
 	phy->ops->intr_clear(phy);
 }
 
+#define SG_CONTEXT_CMD_ATTEMPTS 100
+
 /**
  * 	t3_sge_write_context - write an SGE context
  * 	@adapter: the adapter
@@ -1886,7 +1888,7 @@ static int t3_sge_write_context(struct adapter *adapter, unsigned int id,
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(1) | type | V_CONTEXT(id));
 	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-			       0, 5, 1);
+			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
 }
 
 /**
@@ -2072,7 +2074,7 @@ int t3_sge_enable_ecntxt(struct adapter *adapter, unsigned int id, int enable)
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(1) | F_EGRESS | V_CONTEXT(id));
 	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-			       0, 5, 1);
+			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
 }
 
 /**
@@ -2096,7 +2098,7 @@ int t3_sge_disable_fl(struct adapter *adapter, unsigned int id)
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(1) | F_FREELIST | V_CONTEXT(id));
 	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-			       0, 5, 1);
+			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
 }
 
 /**
@@ -2120,7 +2122,7 @@ int t3_sge_disable_rspcntxt(struct adapter *adapter, unsigned int id)
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(1) | F_RESPONSEQ | V_CONTEXT(id));
 	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-			       0, 5, 1);
+			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
 }
 
 /**
@@ -2144,7 +2146,7 @@ int t3_sge_disable_cqcntxt(struct adapter *adapter, unsigned int id)
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(1) | F_CQ | V_CONTEXT(id));
 	return t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-			       0, 5, 1);
+			       0, SG_CONTEXT_CMD_ATTEMPTS, 1);
 }
 
 /**
@@ -2169,7 +2171,7 @@ int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD, V_CONTEXT_CMD_OPCODE(op) |
 		     V_CONTEXT(id) | F_CQ);
 	if (t3_wait_op_done_val(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY,
-				0, 5, 1, &val))
+				0, SG_CONTEXT_CMD_ATTEMPTS, 1, &val))
 		return -EIO;
 
 	if (op >= 2 && op < 7) {
@@ -2179,7 +2181,8 @@ int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
 		t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 			     V_CONTEXT_CMD_OPCODE(0) | F_CQ | V_CONTEXT(id));
 		if (t3_wait_op_done(adapter, A_SG_CONTEXT_CMD,
-				    F_CONTEXT_CMD_BUSY, 0, 5, 1))
+				    F_CONTEXT_CMD_BUSY, 0,
+				    SG_CONTEXT_CMD_ATTEMPTS, 1))
 			return -EIO;
 		return G_CQ_INDEX(t3_read_reg(adapter, A_SG_CONTEXT_DATA0));
 	}
@@ -2205,7 +2208,7 @@ static int t3_sge_read_context(unsigned int type, struct adapter *adapter,
 	t3_write_reg(adapter, A_SG_CONTEXT_CMD,
 		     V_CONTEXT_CMD_OPCODE(0) | type | V_CONTEXT(id));
 	if (t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY, 0,
-			    5, 1))
+			    SG_CONTEXT_CMD_ATTEMPTS, 1))
 		return -EIO;
 	data[0] = t3_read_reg(adapter, A_SG_CONTEXT_DATA0);
 	data[1] = t3_read_reg(adapter, A_SG_CONTEXT_DATA1);

^ permalink raw reply related

* Re: [PATCH 0/3] cxgb3 driver update
From: Al Viro @ 2007-08-23  7:02 UTC (permalink / raw)
  To: Divy Le Ray; +Cc: Jeff Garzik, netdev, linux-kernel, Steve Wise
In-Reply-To: <46CD2AA8.9070507@chelsio.com>

On Wed, Aug 22, 2007 at 11:35:20PM -0700, Divy Le Ray wrote:
> Hi Jeff,
> 
> I'm submitting three more patches for inclusion in netdev#upstream.
> These patches are built over the series I resent yesterday night.
> The patch numbering reflects the stacking.
> 
> Here is a brief description:
> -   avoid false positives in the xgmac hang workaround
> -   Properly set the CQ_ERR bit in RDMA CQ contexts.
> -   Update CQ context operations time out values

Speaking of cxgb3, could you explain what the hell is
static int do_term(struct t3cdev *dev, struct sk_buff *skb)
{
        unsigned int hwtid = ntohl(skb->priority) >> 8 & 0xfffff;
doing?  AFAIK, skb->priority is not net-endian...

Another odd place is
int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data)
{   
        u16 val;
        int attempts = EEPROM_MAX_POLL;
        unsigned int base = adapter->params.pci.vpd_cap_addr;

        if ((addr >= EEPROMSIZE && addr != EEPROM_STAT_ADDR) || (addr & 3))   
                return -EINVAL;

        pci_write_config_dword(adapter->pdev, base + PCI_VPD_DATA,
                               cpu_to_le32(data));
with callers like
int t3_seeprom_wp(struct adapter *adapter, int enable)
{
        return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0);

IOW, you really get little-endian values passed to pci_write_config_dword()
and it expects a host-endian as the last argument...

^ permalink raw reply

* Re: eHEA driver issues from net-2.6.24
From: Jan-Bernd Themann @ 2007-08-23  6:55 UTC (permalink / raw)
  To: Andrew Theurer; +Cc: David Miller, netdev
In-Reply-To: <46CCB696.7090703@us.ibm.com>

On Thursday 23 August 2007 00:20, Andrew Theurer wrote:
> David Miller wrote:
> > From: Andrew Theurer <habanero@us.ibm.com>
> > Date: Wed, 22 Aug 2007 16:55:03 -0500
> >
> > Thanks for finally getting to test this, I thought nobody
> > would test this until it got merged into 2.6.24 :-/
> >

Yes, sorry for the delay. 

> >   
> >> kernel BUG at include/linux/netdevice.h:318!
> >> enter ? for help
> >> [c00000000f613e40] c0000000003fe394 .net_rx_action+0x1b8/0x254
> >> [c00000000f613ef0] c000000000057b70 .__do_softirq+0xa8/0x164
> >> [c00000000f613f90] c000000000024438 .call_do_softirq+0x14/0x24
> >> [c000000b8ffbf9f0] c00000000000bd30 .do_softirq+0x68/0xac
> >> [c000000b8ffbfa80] c000000000057cc4 .irq_exit+0x54/0x6c
> >> [c000000b8ffbfb00] c00000000000c358 .do_IRQ+0x170/0x1ac
> >> [c000000b8ffbfb90] c000000000004780 hardware_interrupt_entry+0x18/0x98
> >> --- Exception: 501 (Hardware Interrupt) at c000000000010bdc 
> >> .cpu_idle+0x114/0x1e0
> >> [c000000b8ffbfe80] c000000000010bd0 .cpu_idle+0x108/0x1e0 (unreliable)
> >> [c000000b8ffbff00] c000000000026db0 .start_secondary+0x160/0x184
> >> [c000000b8ffbff90] c000000000008364 .start_secondary_prolog+0xc/0x10
> >>
> >> I'm a little confused if the port_napi_enable() is being called when the 
> >> device is initialized, but then again, this is all new to me (should it 
> >> be called in ehea_open?).  I see it called on some reset routines, but 
> >> not on the first initialization.
> >>     
> >
> > This is similar to the problem that Arnaldo hit a few minutes
> > ago in the VIA Rhine driver.
> >
> > You can't only make a napi_enable() call when there has been
> > a previous napi_disable().
> >
> > One way to fix this would be to forcefully napi_disable() on
> > all the per-port NAPI structs at the beginning of ehea_open(),
> > which should set things up to satisfy the pre-condition of the
> > napi_enable() calls.
> >   
> OK, Ill try this. 

Let me fix this. I'll try to get it done today.

> > You'll need to audit the entire driver to make sure this invariant
> > is held properly.
> >
> >   
> >> Also, on this code, in ehea_sense_port_attr()
> >>
> >> /* Number of default QPs */
> >>         if (use_mcs)
> >>                 port->num_def_qps = cb0->num_default_qps;
> >>         else
> >>                 port->num_def_qps = 1;
> >>                
> >>
> >> When using napi, since we have multi-queue napi support now, wouldn't we 
> >> want to use all the default qps instead of 1?
> >>     
> >
> > I don't know how this hardware works, you tell me :-)
> >   
> Heh, I don't know it well, either. Maybe Jan Bernd can chime in.

We'd like to keep the possibility to switch back to a single queue for now.
However, we could activate multi queue support as default now.
I'll include this in the patch.

> 
> Thanks for your help,
> 
> -Andrew
> 
> 

^ permalink raw reply

* UDPv4 port allocation problem
From: Tóth László Attila @ 2007-08-23  7:16 UTC (permalink / raw)
  To: netdev

Hello,

I noticed that it is possible that the kernel allocates the same UDP
port to an application that was used and closed immediately before the
new application got it. This means that applications that do not specify
an exact port and rely on the  kernel to allocate a port for them might
see traffic originally meant for another application.

Imagine that two applications want to resolve a name in DNS at about the
same time. The following happens:
 * first app sends out the DNS query then closes the socket without
waiting for an answer (e.g. it got interrupted by Ctrl+C)
 * second app opens an UDP socket, and gets the same port, originally
assigned to app#1, sends out the DNS query
 * DNS server responds, the response goes to app#2

DNS might not be the perfect example, but you get the idea. 
Applications do not expect to receive data on newly opened sockets, not
to mention the security implications.

TCP on the other hand increases the allocated port number for each new
socket, the same behaviour for UDP would add certain amount of time that
decreases this risk.

Is the current behaviour intended?

Regards,
Laszlo Attila Toth

^ permalink raw reply

* Re: eHEA driver issues from net-2.6.24
From: David Miller @ 2007-08-23  8:17 UTC (permalink / raw)
  To: ossthema; +Cc: habanero, netdev
In-Reply-To: <200708230855.29961.ossthema@de.ibm.com>

From: Jan-Bernd Themann <ossthema@de.ibm.com>
Date: Thu, 23 Aug 2007 08:55:29 +0200

> We'd like to keep the possibility to switch back to a single queue
> for now.

Please do not do this, we already have way too much configurability
out there.

If you have the physical hardware queues enabled, use multiqueue napi
support.

If you add a knob to use or not use multi-napi, this makes life
more miserable for your users and your driver more complicated
and harder to maintain.

^ permalink raw reply

* Re: eHEA driver issues from net-2.6.24
From: Jan-Bernd Themann @ 2007-08-23  7:56 UTC (permalink / raw)
  To: David Miller; +Cc: habanero, netdev
In-Reply-To: <20070823.011710.01771014.davem@davemloft.net>

Hi David,

On Thursday 23 August 2007 10:17, David Miller wrote:
> From: Jan-Bernd Themann <ossthema@de.ibm.com>
> Date: Thu, 23 Aug 2007 08:55:29 +0200
> 
> > We'd like to keep the possibility to switch back to a single queue
> > for now.
> 
> Please do not do this, we already have way too much configurability
> out there.

ok, we decided to remove the switch for kernel 2.6.24

Regards,
Jan-Bernd

^ permalink raw reply

* [PATCH -mm] ath5k: remove sysctl(2) support
From: Alexey Dobriyan @ 2007-08-23  8:33 UTC (permalink / raw)
  To: jeff; +Cc: jirislaby, linville, netdev

sysctl(2) is supported but frozen.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 drivers/net/wireless/ath5k_base.c |   21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

--- a/drivers/net/wireless/ath5k_base.c
+++ b/drivers/net/wireless/ath5k_base.c
@@ -2438,21 +2438,12 @@ static struct pci_driver ath_pci_drv_id = {
 	.resume		= ath_pci_resume,
 };
 
-/*
- * Static (i.e. global) sysctls.  Note that the hal sysctls
- * are located under ours by sharing the setting for DEV_ATH.
- */
-enum {
-	DEV_ATH		= 9,			/* XXX known by hal */
-};
-
 static int mincalibrate = 1;
 static int maxcalibrate = INT_MAX / 1000;
-#define	CTL_AUTO	-2	/* cannot be CTL_ANY or CTL_NONE */
 
 static ctl_table ath_static_sysctls[] = {
 #if AR_DEBUG
-	{ .ctl_name	= CTL_AUTO,
+	{
 	  .procname	= "debug",
 	  .mode		= 0644,
 	  .data		= &ath_debug,
@@ -2460,28 +2451,28 @@ static ctl_table ath_static_sysctls[] = {
 	  .proc_handler	= proc_dointvec
 	},
 #endif
-	{ .ctl_name	= CTL_AUTO,
+	{
 	  .procname	= "countrycode",
 	  .mode		= 0444,
 	  .data		= &countrycode,
 	  .maxlen	= sizeof(countrycode),
 	  .proc_handler	= proc_dointvec
 	},
-	{ .ctl_name	= CTL_AUTO,
+	{
 	  .procname	= "outdoor",
 	  .mode		= 0444,
 	  .data		= &outdoor,
 	  .maxlen	= sizeof(outdoor),
 	  .proc_handler	= proc_dointvec
 	},
-	{ .ctl_name	= CTL_AUTO,
+	{
 	  .procname	= "xchanmode",
 	  .mode		= 0444,
 	  .data		= &xchanmode,
 	  .maxlen	= sizeof(xchanmode),
 	  .proc_handler	= proc_dointvec
 	},
-	{ .ctl_name	= CTL_AUTO,
+	{
 	  .procname	= "calibrate",
 	  .mode		= 0644,
 	  .data		= &ath_calinterval,
@@ -2493,7 +2484,7 @@ static ctl_table ath_static_sysctls[] = {
 	{ 0 }
 };
 static ctl_table ath_ath_table[] = {
-	{ .ctl_name	= DEV_ATH,
+	{
 	  .procname	= "ath",
 	  .mode		= 0555,
 	  .child	= ath_static_sysctls


^ permalink raw reply

* [PATCH (take 2)] request_irq fix DEBUG_SHIRQ handling Re: 2.6.23-rc2-mm1: rtl8139 inconsistent lock state
From: Jarek Poplawski @ 2007-08-23  8:44 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mariusz Kozlowski, netdev, Jeff Garzik, David Woodhouse,
	Ingo Molnar, Thomas Gleixner, linux-kernel
In-Reply-To: <200708100149.14446.m.kozlowski@tuxland.pl>

Andrew Morton pointed out that my changelog was unusable. Sorry!
Here is a second try with the changelog and kernel version changed.

Regards,
Jarek P.

------------>(take 2)

Subject: request_irq() - fix DEBUG_SHIRQ handling

Mariusz Kozlowski reported lockdep's warning:

> =================================
> [ INFO: inconsistent lock state ]
> 2.6.23-rc2-mm1 #7
> ---------------------------------
> inconsistent {in-hardirq-W} -> {hardirq-on-W} usage.
> ifconfig/5492 [HC0[0]:SC0[0]:HE1:SE1] takes:
>  (&tp->lock){+...}, at: [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
> {in-hardirq-W} state was registered at:
>   [<c0138eeb>] __lock_acquire+0x949/0x11ac
>   [<c01397e7>] lock_acquire+0x99/0xb2
>   [<c0452ff3>] _spin_lock+0x35/0x42
>   [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
>   [<c0147a5d>] handle_IRQ_event+0x28/0x59
>   [<c01493ca>] handle_level_irq+0xad/0x10b
>   [<c0105a13>] do_IRQ+0x93/0xd0
>   [<c010441e>] common_interrupt+0x2e/0x34
...
> other info that might help us debug this:
> 1 lock held by ifconfig/5492:
>  #0:  (rtnl_mutex){--..}, at: [<c0451778>] mutex_lock+0x1c/0x1f
> 
> stack backtrace:
...
>  [<c0452ff3>] _spin_lock+0x35/0x42
>  [<de8706e0>] rtl8139_interrupt+0x27/0x46b [8139too]
>  [<c01480fd>] free_irq+0x11b/0x146
>  [<de871d59>] rtl8139_close+0x8a/0x14a [8139too]
>  [<c03bde63>] dev_close+0x57/0x74
...

This shows that a driver's irq handler was running both in hard interrupt
and process contexts with irqs enabled. The latter was done during
free_irq() call and was possible only with CONFIG_DEBUG_SHIRQ enabled.
This was fixed by another patch.

But similar problem is possible with request_irq(): any locks taken from
irq handler could be vulnerable - especially with soft interrupts. This
patch fixes it by disabling local interrupts during handler's run. (It
seems, disabling softirqs should be enough, but it needs more checking
on possible races or other special cases).

This patch is recommended to all stable versions since 2.6.21, too.

Reported-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>

---

diff -Nurp 2.6.23-rc3-git6-/kernel/irq/manage.c 2.6.23-rc3-git6/kernel/irq/manage.c
--- 2.6.23-rc3-git6-/kernel/irq/manage.c	2007-08-23 10:11:35.000000000 +0200
+++ 2.6.23-rc3-git6/kernel/irq/manage.c	2007-08-23 10:16:29.000000000 +0200
@@ -555,14 +555,11 @@ int request_irq(unsigned int irq, irq_ha
 		 * We do this before actually registering it, to make sure that
 		 * a 'real' IRQ doesn't run in parallel with our fake
 		 */
-		if (irqflags & IRQF_DISABLED) {
-			unsigned long flags;
+		unsigned long flags;
 
-			local_irq_save(flags);
-			handler(irq, dev_id);
-			local_irq_restore(flags);
-		} else
-			handler(irq, dev_id);
+		local_irq_save(flags);
+		handler(irq, dev_id);
+		local_irq_restore(flags);
 	}
 #endif
 

^ permalink raw reply

* [PATCH 1/2] E1000: Fix ifdown hang in git-2.6.24
From: Krishna Kumar @ 2007-08-23  9:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: Krishna Kumar

Doing napi_disable twice hangs "ifdown" of the device. e1000_down is the
common place to call napi_disable.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 e1000_main.c |    4 ----
 1 files changed, 4 deletions(-)

diff -ruNp org/drivers/net/e1000/e1000_main.c new/drivers/net/e1000/e1000_main.c
--- org/drivers/net/e1000/e1000_main.c	2007-08-23 13:32:16.000000000 +0530
+++ new/drivers/net/e1000/e1000_main.c	2007-08-23 13:32:34.000000000 +0530
@@ -1477,10 +1477,6 @@ e1000_close(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
-#ifdef CONFIG_E1000_NAPI
-	napi_disable(&adapter->napi);
-#endif
-
 	WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
 	e1000_down(adapter);
 	e1000_power_down_phy(adapter);

^ permalink raw reply

* [PATCH 2/2] [RFC] E1000: Fix hang in netdev_wait_allrefs()
From: Krishna Kumar @ 2007-08-23  9:04 UTC (permalink / raw)
  To: netdev, davem; +Cc: Krishna Kumar
In-Reply-To: <20070823090418.13099.89298.sendpatchset@localhost.localdomain>

After applying patch1, I started getting "waiting for count" messages when
doing ifdown. Not sure if this is the right fix since the count was already
showing as -1 in that message, but this patch fixes the problem.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 e1000_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -ruNp new/drivers/net/e1000/e1000_main.c new2/drivers/net/e1000/e1000_main.c
--- new/drivers/net/e1000/e1000_main.c	2007-08-23 13:32:34.000000000 +0530
+++ new2/drivers/net/e1000/e1000_main.c	2007-08-23 14:28:12.000000000 +0530
@@ -1219,12 +1219,13 @@ e1000_remove(struct pci_dev *pdev)
 	 * would have already happened in close and is redundant. */
 	e1000_release_hw_control(adapter);
 
-	unregister_netdev(netdev);
 #ifdef CONFIG_E1000_NAPI
 	for (i = 0; i < adapter->num_rx_queues; i++)
 		dev_put(&adapter->polling_netdev[i]);
 #endif
 
+	unregister_netdev(netdev);
+
 	if (!e1000_check_phy_reset_block(&adapter->hw))
 		e1000_phy_hw_reset(&adapter->hw);
 

^ permalink raw reply

* Re: [PATCH] DM9000: fix interface hang under load
From: Ben Dooks @ 2007-08-23  9:37 UTC (permalink / raw)
  To: Florian Westphal; +Cc: akpm, jgarzik, netdev
In-Reply-To: <20070820233342.GG9315@Chamillionaire.breakpoint.cc>

On Tue, Aug 21, 2007 at 01:33:42AM +0200, Florian Westphal wrote:
> When transferring data at full speed, the DM9000 network interface
> sometimes stops sending/receiving data. Worse, ksoftirqd consumes
> 100% cpu and the net tx watchdog never triggers.

A newline here would have helped readability.

> Fix by spin_lock_irqsave() in dm9000_start_xmit() to prevent the
> interrupt handler from interfering.

I personally have not come across this during any of our testing,
but it is possible that an ARM9 has slightly different interrupt
behaviour to the PXAs.

Changing to use spin_lock_irqsave() is probably a much safer
way of stopping this happening than trying to disable the
interrupts comming from the chip, and spin_lock_irqsave() is
not exactly expensive. This will also stop dm9000_start_xmit from
being interrupted by the watchdog.

I will update my local DM9000 patch set for after the 2.6.23 release.

> Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Ben Dooks <ben-linux@fluff.org>
> ---
>  Actually the comments ('Disable all interrupts, iow(db, DM9000_IMR, IMR_PAR) etc)
>  give the impression that the interrupt handler cannot run during dm9000_start_xmit(),
>  however this isn't correct (perhaps the chipset has some weird timing issues?).
>  The interface lockup usually occurs between 30 and 360 seconds after starting transmitting
>  data (netcat /dev/zero) at full speed; with this patch applied I haven't been able
>  to reproduce hangs yet (ran for > 2h).
>  FTR: This is a dm9000 on XScale-PXA255 rev 6 (ARMv5TE)/Compulab CM-x255, i.e.
>  a module not supported by the vanilla kernel. Tested on (patched) 2.6.18.
> 
>  dm9000.c |   25 +++++++------------------
>  1 file changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index c3de81b..738aa59 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -700,6 +700,7 @@ dm9000_init_dm9000(struct net_device *dev)
>  static int
>  dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
> +	unsigned long flags;
>  	board_info_t *db = (board_info_t *) dev->priv;
>  
>  	PRINTK3("dm9000_start_xmit\n");
> @@ -707,10 +708,7 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	if (db->tx_pkt_cnt > 1)
>  		return 1;
>  
> -	netif_stop_queue(dev);
> -
> -	/* Disable all interrupts */
> -	iow(db, DM9000_IMR, IMR_PAR);
> +	spin_lock_irqsave(&db->lock, flags);
>  
>  	/* Move data to DM9000 TX RAM */
>  	writeb(DM9000_MWCMD, db->io_addr);
> @@ -718,12 +716,9 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	(db->outblk)(db->io_data, skb->data, skb->len);
>  	db->stats.tx_bytes += skb->len;
>  
> +	db->tx_pkt_cnt++;
>  	/* TX control: First packet immediately send, second packet queue */
> -	if (db->tx_pkt_cnt == 0) {
> -
> -		/* First Packet */
> -		db->tx_pkt_cnt++;
> -
> +	if (db->tx_pkt_cnt == 1) {
>  		/* Set TX length to DM9000 */
>  		iow(db, DM9000_TXPLL, skb->len & 0xff);
>  		iow(db, DM9000_TXPLH, (skb->len >> 8) & 0xff);
> @@ -732,23 +727,17 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  		iow(db, DM9000_TCR, TCR_TXREQ);	/* Cleared after TX complete */
>  
>  		dev->trans_start = jiffies;	/* save the time stamp */
> -
>  	} else {
>  		/* Second packet */
> -		db->tx_pkt_cnt++;
>  		db->queue_pkt_len = skb->len;
> +		netif_stop_queue(dev);
>  	}
>  
> +	spin_unlock_irqrestore(&db->lock, flags);
> +
>  	/* free this SKB */
>  	dev_kfree_skb(skb);
>  
> -	/* Re-enable resource check */
> -	if (db->tx_pkt_cnt == 1)
> -		netif_wake_queue(dev);
> -
> -	/* Re-enable interrupt */
> -	iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM);
> -
>  	return 0;
>  }

If I read this correctly, you've moved the netif_{stop,start}_queue()
calls so that the queue is only stopped if we have loaded 2 packets
into the chip instead of stopping and starting each time.
  
> -
> 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

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

^ permalink raw reply

* Re: [PATCH] DM9000: fix interface hang under load
From: Florian Westphal @ 2007-08-23 10:16 UTC (permalink / raw)
  To: Ben Dooks; +Cc: akpm, jgarzik, netdev
In-Reply-To: <20070823093749.GE12547@fluff.org.uk>

Ben Dooks <ben@fluff.org> wrote:
> On Tue, Aug 21, 2007 at 01:33:42AM +0200, Florian Westphal wrote:
> > @@ -700,6 +700,7 @@ dm9000_init_dm9000(struct net_device *dev)
[..]
> >  	} else {
> >  		/* Second packet */
> > -		db->tx_pkt_cnt++;
> >  		db->queue_pkt_len = skb->len;
> > +		netif_stop_queue(dev);
> >  	}

> If I read this correctly, you've moved the netif_{stop,start}_queue()
> calls so that the queue is only stopped if we have loaded 2 packets
> into the chip instead of stopping and starting each time.

Yes. For those that are not familiar with the dm9000 driver:
The queue is started again when a packet has been sent.

Thanks for taking the time to review this.

Florian

^ permalink raw reply

* [PATCH 1/1] NFS: change the ip_map cache code to handle IPv6 addresses
From: Aurélien Charbon @ 2007-08-23 13:18 UTC (permalink / raw)
  To: Mailing list NFSv4, netdev ML

According to Neil's comments, I have tried to correct the mistakes of my first sending
Thank you for these comments Neil.

This is a small part of missing pieces of IPv6 support for the server.
It deals with the ip_map caching code part.

It changes the ip_map structure to be able to store INET6 addresses.
It adds also the changes in address hashing, and mapping to test it with INET addresses.

Signed-off-by: Aurelien Charbon <aurelien.charbon@ext.bull.net>
---

 fs/nfsd/export.c               |   10 ++-
 fs/nfsd/nfsctl.c               |   21 ++++++-
 include/linux/sunrpc/svcauth.h |    4 -
 include/net/ipv6.h             |   17 +++++
 net/sunrpc/svcauth_unix.c      |  121 
++++++++++++++++++++++++++++-------------
 5 files changed, 129 insertions(+), 44 deletions(-)


diff -p -u -r -N linux-2.6.23-rc3/fs/nfsd/export.c 
linux-2.6.23-rc3-IPv6-ipmap-cache/fs/nfsd/export.c
--- linux-2.6.23-rc3/fs/nfsd/export.c    2007-08-23 13:18:16.000000000 +0200
+++ linux-2.6.23-rc3-IPv6-ipmap-cache/fs/nfsd/export.c    2007-08-23 
13:51:08.000000000 +0200
@@ -35,6 +35,7 @@
 #include <linux/lockd/bind.h>
 #include <linux/sunrpc/msg_prot.h>
 #include <linux/sunrpc/gss_api.h>
+#include <net/ipv6.h>
 
 #define NFSDDBG_FACILITY    NFSDDBG_EXPORT
 
@@ -1559,6 +1560,7 @@ exp_addclient(struct nfsctl_client *ncp)
 {
     struct auth_domain    *dom;
     int            i, err;
+    struct in6_addr addr6;
 
     /* First, consistency check. */
     err = -EINVAL;
@@ -1577,9 +1579,11 @@ exp_addclient(struct nfsctl_client *ncp)
         goto out_unlock;
 
     /* Insert client into hashtable. */
-    for (i = 0; i < ncp->cl_naddr; i++)
-        auth_unix_add_addr(ncp->cl_addrlist[i], dom);
-
+    for (i = 0; i < ncp->cl_naddr; i++) {
+        /* Mapping address */
+        ipv6_addr_map(ncp->cl_addrlist[i], addr6);
+        auth_unix_add_addr(addr6, dom);
+    }
     auth_unix_forget_old(dom);
     auth_domain_put(dom);
 
diff -p -u -r -N linux-2.6.23-rc3/fs/nfsd/nfsctl.c 
linux-2.6.23-rc3-IPv6-ipmap-cache/fs/nfsd/nfsctl.c
--- linux-2.6.23-rc3/fs/nfsd/nfsctl.c    2007-08-23 13:18:16.000000000 +0200
+++ linux-2.6.23-rc3-IPv6-ipmap-cache/fs/nfsd/nfsctl.c    2007-08-23 
13:25:28.000000000 +0200
@@ -222,7 +222,7 @@ static ssize_t write_getfs(struct file *
     struct auth_domain *clp;
     int err = 0;
     struct knfsd_fh *res;
-
+    struct in6_addr in6;
     if (size < sizeof(*data))
         return -EINVAL;
     data = (struct nfsctl_fsparm*)buf;
@@ -236,7 +236,14 @@ static ssize_t write_getfs(struct file *
     res = (struct knfsd_fh*)buf;
 
     exp_readlock();
-    if (!(clp = auth_unix_lookup(sin->sin_addr)))
+
+    /* IPv6 address mapping */
+    in6.s6_addr32[0] = 0;
+    in6.s6_addr32[1] = 0;
+    in6.s6_addr32[2] = htonl(0xffff);
+    in6.s6_addr32[3] = (uint32_t)sin->sin_addr.s_addr;
+
+    if (!(clp = auth_unix_lookup(in6)))
         err = -EPERM;
     else {
         err = exp_rootfh(clp, data->gd_path, res, data->gd_maxlen);
@@ -253,6 +260,7 @@ static ssize_t write_getfd(struct file *
 {
     struct nfsctl_fdparm *data;
     struct sockaddr_in *sin;
+    struct in6_addr in6;
     struct auth_domain *clp;
     int err = 0;
     struct knfsd_fh fh;
@@ -271,7 +279,14 @@ static ssize_t write_getfd(struct file *
     res = buf;
     sin = (struct sockaddr_in *)&data->gd_addr;
     exp_readlock();
-    if (!(clp = auth_unix_lookup(sin->sin_addr)))
+
+    /* IPv6 address mapping */
+    in6.s6_addr32[0] = 0;
+    in6.s6_addr32[1] = 0;
+    in6.s6_addr32[2] = htonl(0xffff);
+    in6.s6_addr32[3] = (uint32_t)sin->sin_addr.s_addr;
+
+    if (!(clp = auth_unix_lookup(in6)))
         err = -EPERM;
     else {
         err = exp_rootfh(clp, data->gd_path, &fh, NFS_FHSIZE);
diff -p -u -r -N linux-2.6.23-rc3/include/linux/sunrpc/svcauth.h 
linux-2.6.23-rc3-IPv6-ipmap-cache/include/linux/sunrpc/svcauth.h
--- linux-2.6.23-rc3/include/linux/sunrpc/svcauth.h    2007-08-23 
13:18:21.000000000 +0200
+++ linux-2.6.23-rc3-IPv6-ipmap-cache/include/linux/sunrpc/svcauth.h    
2007-08-23 13:25:28.000000000 +0200
@@ -120,10 +120,10 @@ extern void    svc_auth_unregister(rpc_auth
 
 extern struct auth_domain *unix_domain_find(char *name);
 extern void auth_domain_put(struct auth_domain *item);
-extern int auth_unix_add_addr(struct in_addr addr, struct auth_domain 
*dom);
+extern int auth_unix_add_addr(struct in6_addr addr, struct auth_domain 
*dom);
 extern struct auth_domain *auth_domain_lookup(char *name, struct 
auth_domain *new);
 extern struct auth_domain *auth_domain_find(char *name);
-extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
+extern struct auth_domain *auth_unix_lookup(struct in6_addr addr);
 extern int auth_unix_forget_old(struct auth_domain *dom);
 extern void svcauth_unix_purge(void);
 extern void svcauth_unix_info_release(void *);
diff -p -u -r -N linux-2.6.23-rc3/include/net/ipv6.h 
linux-2.6.23-rc3-IPv6-ipmap-cache/include/net/ipv6.h
--- linux-2.6.23-rc3/include/net/ipv6.h    2007-08-23 13:18:23.000000000 
+0200
+++ linux-2.6.23-rc3-IPv6-ipmap-cache/include/net/ipv6.h    2007-08-23 
13:25:28.000000000 +0200
@@ -21,6 +21,7 @@
 #include <net/ndisc.h>
 #include <net/flow.h>
 #include <net/snmp.h>
+#include <linux/in.h>
 
 #define SIN6_LEN_RFC2133    24
 
@@ -167,6 +168,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplit
     if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, 
field);         \
     else        SNMP_INC_STATS_USER(udp_stats_in6, field);    } while(0)
 
+#define IS_ADDR_MAPPED(a) \
+    (((uint32_t *) (a))[0] == 0            \
+    && ((uint32_t *) (a))[1] == 0            \
+    && (((uint32_t *) (a))[2] == 0            \
+    || ((uint32_t *) (a))[2] == htonl(0xffff)))
+
 struct ip6_ra_chain
 {
     struct ip6_ra_chain    *next;
@@ -377,6 +384,16 @@ static inline int ipv6_addr_any(const st
          a->s6_addr32[2] | a->s6_addr32[3] ) == 0);
 }
 
+/* Maps a IPv4 address into a wright IPv6 address */
+static inline int ipv6_addr_map(const struct in_addr a1, struct 
in6_addr a2)
+{
+    a2.s6_addr32[0] = 0;
+    a2.s6_addr32[1] = 0;
+    a2.s6_addr32[2] = htonl(0xffff);
+    a2.s6_addr32[3] = (uint32_t)a1.s_addr;
+    return 0;
+}
+
 /*
  * find the first different bit between two addresses
  * length of address must be a multiple of 32bits
diff -p -u -r -N linux-2.6.23-rc3/net/sunrpc/svcauth_unix.c 
linux-2.6.23-rc3-IPv6-ipmap-cache/net/sunrpc/svcauth_unix.c
--- linux-2.6.23-rc3/net/sunrpc/svcauth_unix.c    2007-08-23 
13:18:24.000000000 +0200
+++ linux-2.6.23-rc3-IPv6-ipmap-cache/net/sunrpc/svcauth_unix.c    
2007-08-23 13:52:02.000000000 +0200
@@ -11,7 +11,8 @@
 #include <linux/hash.h>
 #include <linux/string.h>
 #include <net/sock.h>
-
+#include <net/ipv6.h>
+#include <linux/kernel.h>
 #define RPCDBG_FACILITY    RPCDBG_AUTH
 
 
@@ -84,7 +85,7 @@ static void svcauth_unix_domain_release(
 struct ip_map {
     struct cache_head    h;
     char            m_class[8]; /* e.g. "nfsd" */
-    struct in_addr        m_addr;
+    struct in6_addr        m_addr;
     struct unix_domain    *m_client;
     int            m_add_change;
 };
@@ -112,12 +113,19 @@ static inline int hash_ip(__be32 ip)
     return (hash ^ (hash>>8)) & 0xff;
 }
 #endif
+static inline int hash_ip6(struct in6_addr ip)
+{
+    return (hash_ip(ip.s6_addr32[0]) ^
+        hash_ip(ip.s6_addr32[1]) ^
+        hash_ip(ip.s6_addr32[2]) ^
+        hash_ip(ip.s6_addr32[3]));
+}
 static int ip_map_match(struct cache_head *corig, struct cache_head *cnew)
 {
     struct ip_map *orig = container_of(corig, struct ip_map, h);
     struct ip_map *new = container_of(cnew, struct ip_map, h);
     return strcmp(orig->m_class, new->m_class) == 0
-        && orig->m_addr.s_addr == new->m_addr.s_addr;
+        && ipv6_addr_equal(&orig->m_addr, &new->m_addr);
 }
 static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
 {
@@ -125,7 +133,7 @@ static void ip_map_init(struct cache_hea
     struct ip_map *item = container_of(citem, struct ip_map, h);
 
     strcpy(new->m_class, item->m_class);
-    new->m_addr.s_addr = item->m_addr.s_addr;
+    memcpy(&(new->m_addr), &(item->m_addr), sizeof(struct in6_addr));
 }
 static void update(struct cache_head *cnew, struct cache_head *citem)
 {
@@ -151,20 +159,22 @@ static void ip_map_request(struct cache_
 {
     char text_addr[20];
     struct ip_map *im = container_of(h, struct ip_map, h);
-    __be32 addr = im->m_addr.s_addr;
-
-    snprintf(text_addr, 20, "%u.%u.%u.%u",
-         ntohl(addr) >> 24 & 0xff,
-         ntohl(addr) >> 16 & 0xff,
-         ntohl(addr) >>  8 & 0xff,
-         ntohl(addr) >>  0 & 0xff);
 
+    if (IS_ADDR_MAPPED(im->m_addr.s6_addr32)) {
+        snprintf(text_addr, 20, NIPQUAD_FMT,
+                ntohl(im->m_addr.s6_addr32[3]) >> 24 & 0xff,
+                ntohl(im->m_addr.s6_addr32[3]) >> 16 & 0xff,
+                ntohl(im->m_addr.s6_addr32[3]) >>  8 & 0xff,
+                ntohl(im->m_addr.s6_addr32[3]) >>  0 & 0xff);
+    } else {
+        snprintf(text_addr, 20, NIP6_FMT, NIP6(im->m_addr));
+    }
     qword_add(bpp, blen, im->m_class);
     qword_add(bpp, blen, text_addr);
     (*bpp)[-1] = '\n';
 }
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr);
+static struct ip_map *ip_map_lookup(char *class, struct in6_addr addr);
 static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, 
time_t expiry);
 
 static int ip_map_parse(struct cache_detail *cd,
@@ -175,10 +185,10 @@ static int ip_map_parse(struct cache_det
      * for scratch: */
     char *buf = mesg;
     int len;
-    int b1,b2,b3,b4;
+    int b1, b2, b3, b4, b5, b6, b7, b8;
     char c;
     char class[8];
-    struct in_addr addr;
+    struct in6_addr addr;
     int err;
 
     struct ip_map *ipmp;
@@ -197,9 +207,26 @@ static int ip_map_parse(struct cache_det
     len = qword_get(&mesg, buf, mlen);
     if (len <= 0) return -EINVAL;
 
-    if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
+    if (sscanf(buf, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) == 4) {
+        addr.s6_addr32[0] = 0;
+        addr.s6_addr32[1] = 0;
+        addr.s6_addr32[2] = htonl(0xffff);
+        addr.s6_addr32[3] =
+            htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4);
+       } else if (sscanf(buf, NIP6_FMT "%c",
+            &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) {
+        addr.s6_addr16[7] = htons(b1);
+        addr.s6_addr16[6] = htons(b2);
+        addr.s6_addr16[5] = htons(b3);
+        addr.s6_addr16[4] = htons(b4);
+        addr.s6_addr16[3] = htons(b5);
+        addr.s6_addr16[2] = htons(b6);
+        addr.s6_addr16[1] = htons(b7);
+        addr.s6_addr16[0] = htons(b8);
+       } else
         return -EINVAL;
 
+
     expiry = get_expiry(&mesg);
     if (expiry ==0)
         return -EINVAL;
@@ -215,9 +242,6 @@ static int ip_map_parse(struct cache_det
     } else
         dom = NULL;
 
-    addr.s_addr =
-        htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4);
-
     ipmp = ip_map_lookup(class,addr);
     if (ipmp) {
         err = ip_map_update(ipmp,
@@ -238,7 +262,7 @@ static int ip_map_show(struct seq_file *
                struct cache_head *h)
 {
     struct ip_map *im;
-    struct in_addr addr;
+    struct in6_addr addr;
     char *dom = "-no-domain-";
 
     if (h == NULL) {
@@ -247,20 +271,33 @@ static int ip_map_show(struct seq_file *
     }
     im = container_of(h, struct ip_map, h);
     /* class addr domain */
-    addr = im->m_addr;
+    memcpy(&addr, &im->m_addr, sizeof(struct in6_addr));
 
     if (test_bit(CACHE_VALID, &h->flags) &&
         !test_bit(CACHE_NEGATIVE, &h->flags))
         dom = im->m_client->h.name;
 
-    seq_printf(m, "%s %d.%d.%d.%d %s\n",
-           im->m_class,
-           ntohl(addr.s_addr) >> 24 & 0xff,
-           ntohl(addr.s_addr) >> 16 & 0xff,
-           ntohl(addr.s_addr) >>  8 & 0xff,
-           ntohl(addr.s_addr) >>  0 & 0xff,
-           dom
-           );
+    if (IS_ADDR_MAPPED(addr.s6_addr32)) {
+        seq_printf(m, "%s" NIPQUAD_FMT "%s\n",
+            im->m_class,
+            ntohl(addr.s6_addr32[3]) >> 24 & 0xff,
+            ntohl(addr.s6_addr32[3]) >> 16 & 0xff,
+            ntohl(addr.s6_addr32[3]) >>  8 & 0xff,
+            ntohl(addr.s6_addr32[3]) >>  0 & 0xff,
+            dom);
+    } else {
+        seq_printf(m, "%s" NIP6_FMT "%s\n",
+            im->m_class,
+            ntohl(addr.s6_addr16[7]),
+            ntohl(addr.s6_addr16[6]),
+            ntohl(addr.s6_addr16[5]),
+            ntohl(addr.s6_addr16[4]),
+            ntohl(addr.s6_addr16[3]),
+            ntohl(addr.s6_addr16[2]),
+            ntohl(addr.s6_addr16[1]),
+            ntohl(addr.s6_addr16[0]),
+            dom);
+    }
     return 0;
 }
 
@@ -280,16 +317,16 @@ struct cache_detail ip_map_cache = {
     .alloc        = ip_map_alloc,
 };
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr)
+static struct ip_map *ip_map_lookup(char *class, struct in6_addr addr)
 {
     struct ip_map ip;
     struct cache_head *ch;
 
     strcpy(ip.m_class, class);
-    ip.m_addr = addr;
+    memcpy(&ip.m_addr, &addr, sizeof(struct in6_addr));
     ch = sunrpc_cache_lookup(&ip_map_cache, &ip.h,
                  hash_str(class, IP_HASHBITS) ^
-                 hash_ip(addr.s_addr));
+                 hash_ip6(addr));
 
     if (ch)
         return container_of(ch, struct ip_map, h);
@@ -318,14 +355,14 @@ static int ip_map_update(struct ip_map *
     ch = sunrpc_cache_update(&ip_map_cache,
                  &ip.h, &ipm->h,
                  hash_str(ipm->m_class, IP_HASHBITS) ^
-                 hash_ip(ipm->m_addr.s_addr));
+                 hash_ip6(ipm->m_addr));
     if (!ch)
         return -ENOMEM;
     cache_put(ch, &ip_map_cache);
     return 0;
 }
 
-int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom)
+int auth_unix_add_addr(struct in6_addr addr, struct auth_domain *dom)
 {
     struct unix_domain *udom;
     struct ip_map *ipmp;
@@ -352,7 +389,7 @@ int auth_unix_forget_old(struct auth_dom
     return 0;
 }
 
-struct auth_domain *auth_unix_lookup(struct in_addr addr)
+struct auth_domain *auth_unix_lookup(struct in6_addr addr)
 {
     struct ip_map *ipm;
     struct auth_domain *rv;
@@ -641,7 +678,19 @@ static int unix_gid_find(uid_t uid, stru
 int
 svcauth_unix_set_client(struct svc_rqst *rqstp)
 {
-    struct sockaddr_in *sin = svc_addr_in(rqstp);
+    struct sockaddr_in *sin;
+    struct sockaddr_in6 *sin6;
+
+    switch (rqstp->rq_addr.ss_family) {
+    default:
+        BUG();
+    case AF_INET:
+        sin = svc_addr_in(rqstp);
+        ipv6_addr_map(sin->sin_addr, sin6->sin6_addr);
+    case AF_INET6:
+        sin6 = svc_addr_in6(rqstp);
+    }
+
     struct ip_map *ipm;
 
     rqstp->rq_client = NULL;
@@ -651,7 +700,7 @@ svcauth_unix_set_client(struct svc_rqst
     ipm = ip_map_cached_get(rqstp);
     if (ipm == NULL)
         ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class,
-                    sin->sin_addr);
+                    sin6->sin6_addr);
 
     if (ipm == NULL)
         return SVC_DENIED;

-- 

********************************
       Aurelien Charbon
       Linux NFSv4 team
           Bull SAS
     Echirolles - France
http://nfsv4.bullopensource.org/
********************************


^ permalink raw reply

* [PATCH net-2.6.24] introduce MAC_FMT/MAC_ARG
From: Johannes Berg @ 2007-08-22 18:46 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

The two different wireless code bases both define macros to ease
printing MAC addresses:

printk(KERN_INFO "MAC address is " MAC_FMT "\n", MAC_ARG(addr));

This patch moves those macros to if_ether.h and uses them all over the
tree.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
 drivers/net/3c505.c         |    4 +---
 drivers/net/8139cp.c        |   11 ++---------
 drivers/net/82596.c         |    4 ++--
 drivers/net/a2065.c         |    4 +---
 drivers/net/acenic.c        |    6 ++----
 drivers/net/ariadne.c       |    4 +---
 drivers/net/dl2k.c          |    6 ++----
 drivers/net/forcedeth.c     |   11 ++++-------
 drivers/net/hp100.c         |    5 ++---
 drivers/net/hydra.c         |    6 ++----
 drivers/net/ibmlana.c       |    6 ++----
 drivers/net/ioc3-eth.c      |    5 ++---
 drivers/net/lguest_net.c    |    3 +--
 drivers/net/lib82596.c      |    4 ++--
 drivers/net/macb.c          |    6 ++----
 drivers/net/meth.c          |    4 +---
 drivers/net/mv643xx_eth.c   |    5 ++---
 drivers/net/mvme147.c       |    7 ++-----
 drivers/net/myri_sbus.c     |    6 ++----
 drivers/net/ns83820.c       |    9 +++------
 drivers/net/pasemi_mac.c    |    5 ++---
 drivers/net/ps3_gelic_net.c |    6 ++----
 drivers/net/qla3xxx.c       |    6 ++----
 drivers/net/rionet.c        |    5 ++---
 drivers/net/s2io.c          |   10 ++--------
 drivers/net/skge.c          |    6 ++----
 drivers/net/sky2.c          |    6 ++----
 drivers/net/tsi108_eth.c    |    6 ++----
 drivers/net/zorro8390.c     |    6 ++----
 include/linux/etherdevice.h |    1 +
 include/linux/if_ether.h    |    5 +++++
 include/net/ieee80211.h     |    5 -----
 include/net/mac80211.h      |    4 ----
 33 files changed, 62 insertions(+), 125 deletions(-)

--- netdev-2.6.orig/drivers/net/3c505.c	2007-08-22 20:33:10.921906163 +0200
+++ netdev-2.6/drivers/net/3c505.c	2007-08-22 20:40:01.011906163 +0200
@@ -1540,9 +1540,7 @@ static int __init elplus_setup(struct ne
 	 */
 	printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, ",
 	       dev->name, dev->base_addr, dev->irq, dev->dma);
-	printk("addr %02x:%02x:%02x:%02x:%02x:%02x, ",
-	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	printk("addr " MAC_FMT ", ", MAC_ARG(dev->dev_addr));
 
 	/*
 	 * read more information from the adapter
--- netdev-2.6.orig/drivers/net/8139cp.c	2007-08-22 20:33:10.931906163 +0200
+++ netdev-2.6/drivers/net/8139cp.c	2007-08-22 20:40:01.011906163 +0200
@@ -1961,15 +1961,8 @@ static int cp_init_one (struct pci_dev *
 	if (rc)
 		goto err_out_iomap;
 
-	printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, "
-		"%02x:%02x:%02x:%02x:%02x:%02x, "
-		"IRQ %d\n",
-		dev->name,
-		dev->base_addr,
-		dev->dev_addr[0], dev->dev_addr[1],
-		dev->dev_addr[2], dev->dev_addr[3],
-		dev->dev_addr[4], dev->dev_addr[5],
-		dev->irq);
+	printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " MAC_FMT ", IRQ %d\n",
+		dev->name, dev->base_addr, MAC_ARG(dev->dev_addr), dev->irq);
 
 	pci_set_drvdata(pdev, dev);
 
--- netdev-2.6.orig/drivers/net/82596.c	2007-08-22 20:33:10.941906163 +0200
+++ netdev-2.6/drivers/net/82596.c	2007-08-22 20:40:01.021906163 +0200
@@ -1561,8 +1561,8 @@ static void set_multicast_list(struct ne
 		for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
 			memcpy(cp, dmi->dmi_addr, 6);
 			if (i596_debug > 1)
-				DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
-						dev->name, cp[0],cp[1],cp[2],cp[3],cp[4],cp[5]));
+				DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address " MAC_FMT "\n",
+						dev->name, MAC_ARG(cp));
 		}
 		i596_add_cmd(dev, &cmd->cmd);
 	}
--- netdev-2.6.orig/drivers/net/a2065.c	2007-08-22 20:33:10.991906163 +0200
+++ netdev-2.6/drivers/net/a2065.c	2007-08-22 20:40:01.031906163 +0200
@@ -802,9 +802,7 @@ static int __devinit a2065_init_one(stru
 	zorro_set_drvdata(z, dev);
 
 	printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address "
-	       "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, board,
-	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	       MAC_FMT "\n", dev->name, board, MAC_ARG(dev->dev_addr));
 
 	return 0;
 }
--- netdev-2.6.orig/drivers/net/acenic.c	2007-08-22 20:33:10.991906163 +0200
+++ netdev-2.6/drivers/net/acenic.c	2007-08-22 20:40:01.031906163 +0200
@@ -1013,10 +1013,6 @@ static int __devinit ace_init(struct net
 	writel(mac1, &regs->MacAddrHi);
 	writel(mac2, &regs->MacAddrLo);
 
-	printk("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
-	       (mac1 >> 8) & 0xff, mac1 & 0xff, (mac2 >> 24) &0xff,
-	       (mac2 >> 16) & 0xff, (mac2 >> 8) & 0xff, mac2 & 0xff);
-
 	dev->dev_addr[0] = (mac1 >> 8) & 0xff;
 	dev->dev_addr[1] = mac1 & 0xff;
 	dev->dev_addr[2] = (mac2 >> 24) & 0xff;
@@ -1024,6 +1020,8 @@ static int __devinit ace_init(struct net
 	dev->dev_addr[4] = (mac2 >> 8) & 0xff;
 	dev->dev_addr[5] = mac2 & 0xff;
 
+	printk("MAC: " MAC_FMT "\n", MAC_ARG(dev->dev_addr));
+
 	/*
 	 * Looks like this is necessary to deal with on all architectures,
 	 * even this %$#%$# N440BX Intel based thing doesn't get it right.
--- netdev-2.6.orig/drivers/net/ariadne.c	2007-08-22 20:33:11.661906163 +0200
+++ netdev-2.6/drivers/net/ariadne.c	2007-08-22 20:40:01.041906163 +0200
@@ -217,9 +217,7 @@ static int __devinit ariadne_init_one(st
     zorro_set_drvdata(z, dev);
 
     printk(KERN_INFO "%s: Ariadne at 0x%08lx, Ethernet Address "
-	   "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, board,
-	   dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	   dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	   MAC_FMT "\n", dev->name, board, MAC_ARG(dev->dev_addr));
 
     return 0;
 }
--- netdev-2.6.orig/drivers/net/dl2k.c	2007-08-22 20:33:12.181906163 +0200
+++ netdev-2.6/drivers/net/dl2k.c	2007-08-22 20:40:01.041906163 +0200
@@ -257,10 +257,8 @@ rio_probe1 (struct pci_dev *pdev, const 
 
 	card_idx++;
 
-	printk (KERN_INFO "%s: %s, %02x:%02x:%02x:%02x:%02x:%02x, IRQ %d\n",
-		dev->name, np->name,
-		dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-		dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], irq);
+	printk (KERN_INFO "%s: %s, " MAC_FMT ", IRQ %d\n",
+		dev->name, np->name, MAC_ARG(dev->dev_addr));
 	if (tx_coalesce > 1)
 		printk(KERN_INFO "tx_coalesce:\t%d packets\n",
 				tx_coalesce);
--- netdev-2.6.orig/drivers/net/forcedeth.c	2007-08-22 20:33:12.461906163 +0200
+++ netdev-2.6/drivers/net/forcedeth.c	2007-08-22 20:40:01.051906163 +0200
@@ -5201,10 +5201,8 @@ static int __devinit nv_probe(struct pci
 		 * Bad mac address. At least one bios sets the mac address
 		 * to 01:23:45:67:89:ab
 		 */
-		printk(KERN_ERR "%s: Invalid Mac address detected: %02x:%02x:%02x:%02x:%02x:%02x\n",
-			pci_name(pci_dev),
-			dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-			dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+		printk(KERN_ERR "%s: Invalid Mac address detected: " MAC_FMT "\n",
+			pci_name(pci_dev), MAC_ARG(dev->dev_addr));
 		printk(KERN_ERR "Please complain to your hardware vendor. Switching to a random MAC.\n");
 		dev->dev_addr[0] = 0x00;
 		dev->dev_addr[1] = 0x00;
@@ -5212,9 +5210,8 @@ static int __devinit nv_probe(struct pci
 		get_random_bytes(&dev->dev_addr[3], 3);
 	}
 
-	dprintk(KERN_DEBUG "%s: MAC Address %02x:%02x:%02x:%02x:%02x:%02x\n", pci_name(pci_dev),
-			dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-			dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	dprintk(KERN_DEBUG "%s: MAC Address " MAC_FMT "\n", pci_name(pci_dev),
+			MAC_ARG(dev->dev_addr));
 
 	/* set mac address */
 	nv_copy_mac_to_hw(dev);
--- netdev-2.6.orig/drivers/net/hp100.c	2007-08-22 20:33:12.751906163 +0200
+++ netdev-2.6/drivers/net/hp100.c	2007-08-22 20:40:01.061906163 +0200
@@ -2095,9 +2095,8 @@ static void hp100_set_multicast_list(str
 				addrs = dmi->dmi_addr;
 				if ((*addrs & 0x01) == 0x01) {	/* multicast address? */
 #ifdef HP100_DEBUG
-					printk("hp100: %s: multicast = %02x:%02x:%02x:%02x:%02x:%02x, ",
-						     dev->name, addrs[0], addrs[1], addrs[2],
-						     addrs[3], addrs[4], addrs[5]);
+					printk("hp100: %s: multicast = " MAC_FMT ", ",
+						     dev->name, MAC_ARG(addrs));
 #endif
 					for (j = idx = 0; j < 6; j++) {
 						idx ^= *addrs++ & 0x3f;
--- netdev-2.6.orig/drivers/net/hydra.c	2007-08-22 20:33:12.761906163 +0200
+++ netdev-2.6/drivers/net/hydra.c	2007-08-22 20:40:01.061906163 +0200
@@ -163,10 +163,8 @@ static int __devinit hydra_init(struct z
     zorro_set_drvdata(z, dev);
 
     printk(KERN_INFO "%s: Hydra at 0x%08lx, address "
-	   "%02x:%02x:%02x:%02x:%02x:%02x (hydra.c " HYDRA_VERSION ")\n",
-	   dev->name, z->resource.start, dev->dev_addr[0], dev->dev_addr[1],
-	   dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4],
-	   dev->dev_addr[5]);
+	   MAC_FMT " (hydra.c " HYDRA_VERSION ")\n",
+	   dev->name, z->resource.start, MAC_ARG(dev->dev_addr));
 
     return 0;
 }
--- netdev-2.6.orig/drivers/net/ibmlana.c	2007-08-22 20:33:12.791906163 +0200
+++ netdev-2.6/drivers/net/ibmlana.c	2007-08-22 20:40:01.071906163 +0200
@@ -992,11 +992,9 @@ static int ibmlana_probe(struct net_devi
 	/* print config */
 
 	printk(KERN_INFO "%s: IRQ %d, I/O %#lx, memory %#lx-%#lx, "
-	       "MAC address %02x:%02x:%02x:%02x:%02x:%02x.\n",
+	       "MAC address " MAC_FMT ".\n",
 	       dev->name, priv->realirq, dev->base_addr,
-	       dev->mem_start, dev->mem_end - 1,
-	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	       dev->mem_start, dev->mem_end - 1, MAC_ARG(dev->dev_addr));
 	printk(KERN_INFO "%s: %s medium\n", dev->name, MediaNames[priv->medium]);
 
 	/* reset board */
--- netdev-2.6.orig/drivers/net/ioc3-eth.c	2007-08-22 20:33:12.801906163 +0200
+++ netdev-2.6/drivers/net/ioc3-eth.c	2007-08-22 20:40:01.071906163 +0200
@@ -392,9 +392,8 @@ static int nic_init(struct ioc3 *ioc3)
 
 	printk("Found %s NIC", type);
 	if (type != unknown) {
-		printk (" registration number %02x:%02x:%02x:%02x:%02x:%02x,"
-			" CRC %02x", serial[0], serial[1], serial[2],
-			serial[3], serial[4], serial[5], crc);
+		printk (" registration number " MAC_FMT ", CRC %02x",
+			MAC_ARG(serial), crc);
 	}
 	printk(".\n");
 
--- netdev-2.6.orig/drivers/net/lguest_net.c	2007-08-22 20:33:12.921906163 +0200
+++ netdev-2.6/drivers/net/lguest_net.c	2007-08-22 20:40:01.081906163 +0200
@@ -236,8 +236,7 @@ static int lguestnet_start_xmit(struct s
 	/* Extract the destination ethernet address from the packet. */
 	const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
 
-	pr_debug("%s: xmit %02x:%02x:%02x:%02x:%02x:%02x\n",
-		 dev->name, dest[0],dest[1],dest[2],dest[3],dest[4],dest[5]);
+	pr_debug("%s: xmit " MAC_FMT "\n", dev->name, MAC_ARG(dest));
 
 	/* If it's a multicast packet, we broadcast to everyone.  That's not
 	 * very efficient, but there are very few applications which actually
--- netdev-2.6.orig/drivers/net/lib82596.c	2007-08-22 20:33:12.931906163 +0200
+++ netdev-2.6/drivers/net/lib82596.c	2007-08-22 20:40:01.081906163 +0200
@@ -1425,8 +1425,8 @@ static void set_multicast_list(struct ne
 			if (i596_debug > 1)
 				DEB(DEB_MULTI,
 				    printk(KERN_DEBUG
-					   "%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
-					   dev->name, cp[0], cp[1], cp[2], cp[3], cp[4], cp[5]));
+					   "%s: Adding address " MAC_FMT "\n",
+					   dev->name, MAC_ARG(cp));
 		}
 		DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd));
 		i596_add_cmd(dev, &cmd->cmd);
--- netdev-2.6.orig/drivers/net/macb.c	2007-08-22 20:33:12.931906163 +0200
+++ netdev-2.6/drivers/net/macb.c	2007-08-22 20:40:01.081906163 +0200
@@ -1189,10 +1189,8 @@ static int __devinit macb_probe(struct p
 	platform_set_drvdata(pdev, dev);
 
 	printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d "
-	       "(%02x:%02x:%02x:%02x:%02x:%02x)\n",
-	       dev->name, dev->base_addr, dev->irq,
-	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	       "(" MAC_FMT ")\n",
+	       dev->name, dev->base_addr, dev->irq, MAC_ARG(dev->dev_addr));
 
 	phydev = bp->phy_dev;
 	printk(KERN_INFO "%s: attached PHY driver [%s] "
--- netdev-2.6.orig/drivers/net/meth.c	2007-08-22 20:33:12.941906163 +0200
+++ netdev-2.6/drivers/net/meth.c	2007-08-22 20:40:01.101906163 +0200
@@ -96,11 +96,9 @@ char o2meth_eaddr[8]={0,0,0,0,0,0,0,0};
 static inline void load_eaddr(struct net_device *dev)
 {
 	int i;
-	DPRINTK("Loading MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
-		(int)o2meth_eaddr[0]&0xFF,(int)o2meth_eaddr[1]&0xFF,(int)o2meth_eaddr[2]&0xFF,
-		(int)o2meth_eaddr[3]&0xFF,(int)o2meth_eaddr[4]&0xFF,(int)o2meth_eaddr[5]&0xFF);
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = o2meth_eaddr[i];
+	DPRINTK("Loading MAC Address: " MAC_FMT "\n", MAC_ARG(dev->dev_addr));
 	mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16;
 }
 
--- netdev-2.6.orig/drivers/net/mv643xx_eth.c	2007-08-22 20:33:12.981906163 +0200
+++ netdev-2.6/drivers/net/mv643xx_eth.c	2007-08-22 20:40:01.111906163 +0200
@@ -1429,9 +1429,8 @@ static int mv643xx_eth_probe(struct plat
 		goto out;
 
 	p = dev->dev_addr;
-	printk(KERN_NOTICE
-		"%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
-		dev->name, port_num, p[0], p[1], p[2], p[3], p[4], p[5]);
+	printk(KERN_NOTICE "%s: port %d with MAC address " MAC_FMT "\n",
+		dev->name, port_num, MAC_ARG(p));
 
 	if (dev->features & NETIF_F_SG)
 		printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name);
--- netdev-2.6.orig/drivers/net/mvme147.c	2007-08-22 20:33:12.991906163 +0200
+++ netdev-2.6/drivers/net/mvme147.c	2007-08-22 20:40:01.111906163 +0200
@@ -103,12 +103,9 @@ struct net_device * __init mvme147lance_
 	address=address>>8;
 	dev->dev_addr[3]=address&0xff;
 
-	printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %02x:%02x:%02x:%02x:%02x:%02x\n",
+	printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address " MAC_FMT "\n",
 		dev->name, dev->base_addr, MVME147_LANCE_IRQ,
-		dev->dev_addr[0],
-		dev->dev_addr[1], dev->dev_addr[2],
-		dev->dev_addr[3], dev->dev_addr[4],
-		dev->dev_addr[5]);
+		MAC_ARG(dev->dev_addr));
 
 	lp = (struct m147lance_private *)dev->priv;
 	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
--- netdev-2.6.orig/drivers/net/ns83820.c	2007-08-22 20:33:16.621906163 +0200
+++ netdev-2.6/drivers/net/ns83820.c	2007-08-22 20:40:01.111906163 +0200
@@ -2082,14 +2082,11 @@ static int __devinit ns83820_init_one(st
 		ndev->features |= NETIF_F_HIGHDMA;
 	}
 
-	printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %02x:%02x:%02x:%02x:%02x:%02x io=0x%08lx irq=%d f=%s\n",
-		ndev->name,
+	printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: " MAC_FMT
+		" io=0x%08lx irq=%d f=%s\n", ndev->name,
 		(unsigned)readl(dev->base + SRR) >> 8,
 		(unsigned)readl(dev->base + SRR) & 0xff,
-		ndev->dev_addr[0], ndev->dev_addr[1],
-		ndev->dev_addr[2], ndev->dev_addr[3],
-		ndev->dev_addr[4], ndev->dev_addr[5],
-		addr, pci_dev->irq,
+		MAC_ARG(ndev->dev_addr) addr, pci_dev->irq,
 		(ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
 		);
 
--- netdev-2.6.orig/drivers/net/pasemi_mac.c	2007-08-22 20:33:16.691906163 +0200
+++ netdev-2.6/drivers/net/pasemi_mac.c	2007-08-22 20:40:01.121906163 +0200
@@ -1173,11 +1173,10 @@ pasemi_mac_probe(struct pci_dev *pdev, c
 		goto out;
 	} else
 		printk(KERN_INFO "%s: PA Semi %s: intf %d, txch %d, rxch %d, "
-		       "hw addr %02x:%02x:%02x:%02x:%02x:%02x\n",
+		       "hw addr " MAC_FMT "\n",
 		       dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI",
 		       mac->dma_if, mac->dma_txch, mac->dma_rxch,
-		       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-		       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+		       MAC_ARG(dev->dev_addr));
 
 	return err;
 
--- netdev-2.6.orig/drivers/net/ps3_gelic_net.c	2007-08-22 20:33:16.891906163 +0200
+++ netdev-2.6/drivers/net/ps3_gelic_net.c	2007-08-22 20:40:01.121906163 +0200
@@ -1397,10 +1397,8 @@ static int gelic_net_setup_netdev(struct
 	v1 <<= 16;
 	memcpy(addr.sa_data, &v1, ETH_ALEN);
 	memcpy(netdev->dev_addr, addr.sa_data, ETH_ALEN);
-	dev_info(ctodev(card), "MAC addr %02x:%02x:%02x:%02x:%02x:%02x\n",
-		 netdev->dev_addr[0], netdev->dev_addr[1],
-		 netdev->dev_addr[2], netdev->dev_addr[3],
-		 netdev->dev_addr[4], netdev->dev_addr[5]);
+	dev_info(ctodev(card), "MAC addr " MAC_FMT "\n",
+		 MAC_ARG(netdev->dev_addr));
 
 	card->vlan_index = -1;	/* no vlan */
 	for (i = 0; i < GELIC_NET_VLAN_MAX; i++) {
--- netdev-2.6.orig/drivers/net/qla3xxx.c	2007-08-22 20:33:16.901906163 +0200
+++ netdev-2.6/drivers/net/qla3xxx.c	2007-08-22 20:40:01.131906163 +0200
@@ -3576,10 +3576,8 @@ static void ql_display_dev_info(struct n
 
 	if (netif_msg_probe(qdev))
 		printk(KERN_INFO PFX
-		       "%s: MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
-		       ndev->name, ndev->dev_addr[0], ndev->dev_addr[1],
-		       ndev->dev_addr[2], ndev->dev_addr[3], ndev->dev_addr[4],
-		       ndev->dev_addr[5]);
+		       "%s: MAC address " MAC_FMT "\n",
+		       ndev->name, MAC_ARG(ndev->dev_addr));
 }
 
 static int ql_adapter_down(struct ql3_adapter *qdev, int do_reset)
--- netdev-2.6.orig/drivers/net/rionet.c	2007-08-22 20:33:16.901906163 +0200
+++ netdev-2.6/drivers/net/rionet.c	2007-08-22 20:40:01.141906163 +0200
@@ -482,13 +482,12 @@ static int rionet_setup_netdev(struct ri
 	if (rc != 0)
 		goto out;
 
-	printk("%s: %s %s Version %s, MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
+	printk("%s: %s %s Version %s, MAC " MAC_FMT "\n",
 	       ndev->name,
 	       DRV_NAME,
 	       DRV_DESC,
 	       DRV_VERSION,
-	       ndev->dev_addr[0], ndev->dev_addr[1], ndev->dev_addr[2],
-	       ndev->dev_addr[3], ndev->dev_addr[4], ndev->dev_addr[5]);
+	       MAC_ARG(ndev->dev_addr));
 
       out:
 	return rc;
--- netdev-2.6.orig/drivers/net/s2io.c	2007-08-22 20:33:16.991906163 +0200
+++ netdev-2.6/drivers/net/s2io.c	2007-08-22 20:40:01.151906163 +0200
@@ -7330,14 +7330,8 @@ s2io_init_nic(struct pci_dev *pdev, cons
 		  sp->product_name, pdev->revision);
 	DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,
 		  s2io_driver_version);
-	DBG_PRINT(ERR_DBG, "%s: MAC ADDR: "
-			  "%02x:%02x:%02x:%02x:%02x:%02x", dev->name,
-			  sp->def_mac_addr[0].mac_addr[0],
-			  sp->def_mac_addr[0].mac_addr[1],
-			  sp->def_mac_addr[0].mac_addr[2],
-			  sp->def_mac_addr[0].mac_addr[3],
-			  sp->def_mac_addr[0].mac_addr[4],
-			  sp->def_mac_addr[0].mac_addr[5]);
+	DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " MAC_FMT, dev->name,
+		  MAC_ARG(sp->def_mac_addr[0]));
 	DBG_PRINT(ERR_DBG, "SERIAL NUMBER: %s\n", sp->serial_num);
 	if (sp->device_type & XFRAME_II_DEVICE) {
 		mode = s2io_print_pci_mode(sp);
--- netdev-2.6.orig/drivers/net/skge.c	2007-08-22 20:33:18.721906163 +0200
+++ netdev-2.6/drivers/net/skge.c	2007-08-22 20:40:01.211906163 +0200
@@ -3621,10 +3621,8 @@ static void __devinit skge_show_addr(str
 	const struct skge_port *skge = netdev_priv(dev);
 
 	if (netif_msg_probe(skge))
-		printk(KERN_INFO PFX "%s: addr %02x:%02x:%02x:%02x:%02x:%02x\n",
-		       dev->name,
-		       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-		       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+		printk(KERN_INFO PFX "%s: addr " MAC_FMT "\n",
+		       dev->name, MAC_ARG(dev->dev_addr));
 }
 
 static int __devinit skge_probe(struct pci_dev *pdev,
--- netdev-2.6.orig/drivers/net/sky2.c	2007-08-22 20:33:18.921906163 +0200
+++ netdev-2.6/drivers/net/sky2.c	2007-08-22 20:40:01.221906163 +0200
@@ -3808,10 +3808,8 @@ static void __devinit sky2_show_addr(str
 	const struct sky2_port *sky2 = netdev_priv(dev);
 
 	if (netif_msg_probe(sky2))
-		printk(KERN_INFO PFX "%s: addr %02x:%02x:%02x:%02x:%02x:%02x\n",
-		       dev->name,
-		       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-		       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+		printk(KERN_INFO PFX "%s: addr " MAC_FMT "\n",
+		       dev->name, MAC_ARG(dev->dev_addr));
 }
 
 /* Handle software interrupt used during MSI test */
--- netdev-2.6.orig/drivers/net/tsi108_eth.c	2007-08-22 20:33:31.261906163 +0200
+++ netdev-2.6/drivers/net/tsi108_eth.c	2007-08-22 20:40:01.231906163 +0200
@@ -1628,10 +1628,8 @@ tsi108_init_one(struct platform_device *
 		goto register_fail;
 	}
 
-	printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: "
-	       "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name,
-	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+	printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: " MAC_FMT "\n",
+	       dev->name, MAC_ARG(dev->dev_addr));
 #ifdef DEBUG
 	data->msg_enable = DEBUG;
 	dump_eth_one(dev);
--- netdev-2.6.orig/drivers/net/zorro8390.c	2007-08-22 20:33:34.401906163 +0200
+++ netdev-2.6/drivers/net/zorro8390.c	2007-08-22 20:40:01.231906163 +0200
@@ -244,10 +244,8 @@ static int __devinit zorro8390_init(stru
 	return err;
     }
 
-    printk(KERN_INFO "%s: %s at 0x%08lx, Ethernet Address "
-	   "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, name, board,
-	   dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-	   dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+    printk(KERN_INFO "%s: %s at 0x%08lx, Ethernet Address " MAC_FMT "\n",
+	   dev->name, name, board, MAC_ARG(dev->dev_addr));
 
     return 0;
 }
--- netdev-2.6.orig/include/linux/etherdevice.h	2007-08-22 20:34:43.451906163 +0200
+++ netdev-2.6/include/linux/etherdevice.h	2007-08-22 20:40:02.101906163 +0200
@@ -133,6 +133,7 @@ static inline unsigned compare_ether_add
 	BUILD_BUG_ON(ETH_ALEN != 6);
 	return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
 }
+
 #endif	/* __KERNEL__ */
 
 #endif	/* _LINUX_ETHERDEVICE_H */
--- netdev-2.6.orig/drivers/net/myri_sbus.c	2007-08-22 20:33:16.251906163 +0200
+++ netdev-2.6/drivers/net/myri_sbus.c	2007-08-22 20:40:02.171906163 +0200
@@ -854,10 +854,8 @@ static inline void determine_reg_space_s
 static void dump_eeprom(struct myri_eth *mp)
 {
 	printk("EEPROM: clockval[%08x] cpuvers[%04x] "
-	       "id[%02x,%02x,%02x,%02x,%02x,%02x]\n",
-	       mp->eeprom.cval, mp->eeprom.cpuvers,
-	       mp->eeprom.id[0], mp->eeprom.id[1], mp->eeprom.id[2],
-	       mp->eeprom.id[3], mp->eeprom.id[4], mp->eeprom.id[5]);
+	       "id[" MAC_FMT "]\n",
+	       mp->eeprom.cval, mp->eeprom.cpuvers, MAC_ARG(mp->eeprom.id));
 	printk("EEPROM: ramsz[%08x]\n", mp->eeprom.ramsz);
 	printk("EEPROM: fvers[%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x\n",
 	       mp->eeprom.fvers[0], mp->eeprom.fvers[1], mp->eeprom.fvers[2],
--- netdev-2.6.orig/include/net/mac80211.h	2007-08-22 20:35:04.481906163 +0200
+++ netdev-2.6/include/net/mac80211.h	2007-08-22 20:40:02.171906163 +0200
@@ -1058,8 +1058,4 @@ static inline int ieee80211_get_morefrag
 		IEEE80211_FCTL_MOREFRAGS) != 0;
 }
 
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ARG(x) ((u8*)(x))[0], ((u8*)(x))[1], ((u8*)(x))[2], \
-		   ((u8*)(x))[3], ((u8*)(x))[4], ((u8*)(x))[5]
-
 #endif /* MAC80211_H */
--- netdev-2.6.orig/include/net/ieee80211.h	2007-08-22 20:35:03.981906163 +0200
+++ netdev-2.6/include/net/ieee80211.h	2007-08-22 20:40:02.181906163 +0200
@@ -119,11 +119,6 @@ do { if (ieee80211_debug_level & (level)
 #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
 #endif				/* CONFIG_IEEE80211_DEBUG */
 
-/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
-
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
-
 /* escape_essid() is intended to be used in debug (and possibly error)
  * messages. It should never be used for passing essid to user space. */
 const char *escape_essid(const char *essid, u8 essid_len);
--- netdev-2.6.orig/include/linux/if_ether.h	2007-08-22 20:34:43.751906163 +0200
+++ netdev-2.6/include/linux/if_ether.h	2007-08-22 20:40:02.181906163 +0200
@@ -120,6 +120,11 @@ static inline struct ethhdr *eth_hdr(con
 #ifdef CONFIG_SYSCTL
 extern struct ctl_table ether_table[];
 #endif
+
+/* helper macros to print MAC addresses */
+#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
+#define MAC_ARG(x) ((u8*)(x))[0], ((u8*)(x))[1], ((u8*)(x))[2], \
+		   ((u8*)(x))[3], ((u8*)(x))[4], ((u8*)(x))[5]
 #endif
 
 #endif	/* _LINUX_IF_ETHER_H */



^ permalink raw reply

* Re: [RFC IPROUTE]: Add flow classifier support
From: Patrick McHardy @ 2007-08-23 14:47 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev, hadi
In-Reply-To: <20070822.123651.50596407.davem@davemloft.net>

David Miller wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Wed, 22 Aug 2007 10:46:15 -0700
> 
> 
>>This patch is on hold since the netlink changes haven't made it upstream yet.
> 
> 
> I don't have the kernel side in my queue either, perhaps
> I lost it or I didn't see it when it was sent out.
> 
> Patrick?


I didn't send it since I wasn't completely happy with it. Not sure
if I ever finished it, I'll look into it :)

^ permalink raw reply

* Re: [PATCH 1/1] net/core: Fix crash in dev_mc_sync()/dev_mc_unsync()
From: Patrick McHardy @ 2007-08-23 14:48 UTC (permalink / raw)
  To: Benjamin Thery; +Cc: netdev, David Miller
In-Reply-To: <46CC3840.7050300@bull.net>

Benjamin Thery wrote:
> From: benjamin.thery@bull.net
> Subject: net/core: Fix crash in dev_mc_sync()/dev_mc_unsync()
> 
> This patch fixes a crash that may occur when the routine dev_mc_sync()
> deletes an address from the list it is currently going through. It 
> saves the pointer to the next element before deleting the current one.
> The problem may also exist in dev_mc_unsync().
> 
> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>

Looks good, thanks Benjamin.

Acked-by: Patrick McHardy <kaber@trash.net>


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox