* Re: [PATCH] HDLC driver: use unregister_netdev instead of unregister_netdevice
From: David Miller @ 2007-12-14 21:36 UTC (permalink / raw)
To: khc; +Cc: wangchen, jgarzik, netdev
In-Reply-To: <m3ve71t194.fsf@maximus.localdomain>
From: Krzysztof Halasa <khc@pm.waw.pl>
Date: Fri, 14 Dec 2007 22:28:07 +0100
> Wang Chen <wangchen@cn.fujitsu.com> writes:
>
> > [PATCH] HDLC driver: use unregister_netdev instead of unregister_netdevice
> >
> > Since the caller and the upper caller doesn't hod the rtnl semaphore.
> > We should use unregister_netdev instead of unregister_netdevice.
>
> NAK, not-a-bug. The caller actually holds rtnl, it goes through
> the netdev core ioctl dispatcher:
>
> (unregister_netdevice+0x0/0x24) from (fr_ioctl+0x688/0x75c)
> /* fr_del_pvc() and fr_add_pvc() optimized out by gcc */
> (fr_ioctl+0x0/0x75c) from (hdlc_ioctl+0x4c/0x8c)
> (hdlc_ioctl+0x0/0x8c) from (hss_ioctl+0x3c/0x324)
> (hss_ioctl+0x0/0x324) from (dev_ifsioc+0x428/0x4e8)
> (dev_ifsioc+0x0/0x4e8) from (dev_ioctl+0x5d8/0x664)
> (dev_ioctl+0x0/0x664) from (sock_ioctl+0x90/0x254)
> (sock_ioctl+0x0/0x254) from (do_ioctl+0x34/0x78)
> (do_ioctl+0x0/0x78) from (vfs_ioctl+0x78/0x2a8)
> (vfs_ioctl+0x0/0x2a8) from (sys_ioctl+0x40/0x64)
> (sys_ioctl+0x0/0x64) from (ret_fast_syscall+0x0/0x2c)
>
> The patch would make it deadlock.
Ok, I'll drop this patch, thanks for checking.
^ permalink raw reply
* Re: [NETFILTER] xt_hashlimit : speedups hash_dst()
From: Eric Dumazet @ 2007-12-14 21:37 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Patrick McHardy, netfilter-devel, netdev
In-Reply-To: <4762EEB2.1080608@gmail.com>
Jarek Poplawski a écrit :
> Eric Dumazet wrote, On 12/14/2007 12:09 PM:
> ...
>
>> + /*
>> + * Instead of returning hash % ht->cfg.size (implying a divide)
>> + * we return the high 32 bits of the (hash * ht->cfg.size) that will
>> + * give results between [0 and cfg.size-1] and same hash distribution,
>> + * but using a multiply, less expensive than a divide
>> + */
>> + return ((u64)hash * ht->cfg.size) >> 32;
>
> Are we sure of the same hash distribution? Probably I miss something,
> but: if this 'hash' is well distributed on 32 bits, and ht->cfg.size
> is smaller than 32 bits, e.g. 256 (8 bits), then this multiplication
> moves to the higher 32 of u64 only max. 8 bits of the most significant
> byte, and the other three bytes are never used, while division is
> always affected by all four bytes...
Not sure what you are saying... but if size=256, then, yes, we want a final
result between 0 and 255, so three bytes are nul.
'size' is the size of hashtable, its not a random 32bits value :)
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [NETFILTER] xt_hashlimit : speedups hash_dst()
From: Jarek Poplawski @ 2007-12-14 21:40 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: Eric Dumazet, Patrick McHardy, netfilter-devel, netdev
In-Reply-To: <4762EEB2.1080608@gmail.com>
Jarek Poplawski wrote, On 12/14/2007 09:59 PM:
> Eric Dumazet wrote, On 12/14/2007 12:09 PM:
> ...
>
>> + /*
>> + * Instead of returning hash % ht->cfg.size (implying a divide)
>> + * we return the high 32 bits of the (hash * ht->cfg.size) that will
>> + * give results between [0 and cfg.size-1] and same hash distribution,
>> + * but using a multiply, less expensive than a divide
>> + */
>> + return ((u64)hash * ht->cfg.size) >> 32;
>
> Are we sure of the same hash distribution? Probably I miss something,
> but: if this 'hash' is well distributed on 32 bits, and ht->cfg.size
> is smaller than 32 bits, e.g. 256 (8 bits), then this multiplication
> moves to the higher 32 of u64 only max. 8 bits of the most significant
> byte, and the other three bytes are never used, while division is
> always affected by all four bytes...
OOPS! So, I've missed this division here is also affected by only one
byte, but from the other side - so, almost the same... It seems this
could have been replaced with masking from the beginning...
Sorry,
Jarek P.
^ permalink raw reply
* Re: [PATCH 04/29] mm: kmem_estimate_pages()
From: Daniel Phillips @ 2007-12-14 22:05 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Linus Torvalds, Andrew Morton, linux-kernel, linux-mm, netdev,
trond.myklebust
In-Reply-To: <20071214154439.489413000@chello.nl>
On Friday 14 December 2007 07:39, Peter Zijlstra wrote:
> Provide a method to get the upper bound on the pages needed to
> allocate a given number of objects from a given kmem_cache.
>
> This lays the foundation for a generic reserve framework as presented
> in a later patch in this series. This framework needs to convert
> object demand (kmalloc() bytes, kmem_cache_alloc() objects) to pages.
And hence the big idea that all reserve accounting can be done in units
of pages, allowing the use of a single global reserve that already
exists.
The other big idea here is that reserve accounting can be independent of
the actual resource allocations. This is a powerful idea which we may
not have explained clearly yet.
Daniel
^ permalink raw reply
* Re: [Bugme-new] [Bug 9543] New: RTNL: assertion failed at net/ipv6/addrconf.c (2164)/RTNL: assertion failed at net/ipv4/devinet.c (1055)
From: Andy Gospodarek @ 2007-12-14 22:03 UTC (permalink / raw)
To: Krzysztof Oledzki
Cc: Andy Gospodarek, Jay Vosburgh, Herbert Xu, Andrew Morton,
bugme-daemon, shemminger, davem, netdev
In-Reply-To: <Pine.LNX.4.64.0712141955080.12202@bizon.gios.gov.pl>
On Fri, Dec 14, 2007 at 07:57:42PM +0100, Krzysztof Oledzki wrote:
>
>
> On Fri, 14 Dec 2007, Andy Gospodarek wrote:
>
> >On Fri, Dec 14, 2007 at 05:14:57PM +0100, Krzysztof Oledzki wrote:
> >>
> >>
> >>On Wed, 12 Dec 2007, Jay Vosburgh wrote:
> >>
> >>>Herbert Xu <herbert@gondor.apana.org.au> wrote:
> >>>
> >>>>>diff -puN drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
> >>>>>drivers/net/bonding/bond_sysfs.c
> >>>>>--- a/drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
> >>>>>+++ a/drivers/net/bonding/bond_sysfs.c
> >>>>>@@ -1111,8 +1111,6 @@ static ssize_t bonding_store_primary(str
> >>>>>out:
> >>>>> write_unlock_bh(&bond->lock);
> >>>>>
> >>>>>- rtnl_unlock();
> >>>>>-
> >>>>
> >>>>Looking at the changeset that added this perhaps the intention
> >>>>is to hold the lock? If so we should add an rtnl_lock to the start
> >>>>of the function.
> >>>
> >>> Yes, this function needs to hold locks, and more than just
> >>>what's there now. I believe the following should be correct; I haven't
> >>>tested it, though (I'm supposedly on vacation right now).
> >>>
> >>> The following change should be correct for the
> >>>bonding_store_primary case discussed in this thread, and also corrects
> >>>the bonding_store_active case which performs similar functions.
> >>>
> >>> The bond_change_active_slave and bond_select_active_slave
> >>>functions both require rtnl, bond->lock for read and curr_slave_lock for
> >>>write_bh, and no other locks. This is so that the lower level
> >>>mode-specific functions can release locks down to just rtnl in order to
> >>>call, e.g., dev_set_mac_address with the locks it expects (rtnl only).
> >>>
> >>>Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
> >>>
> >>>diff --git a/drivers/net/bonding/bond_sysfs.c
> >>>b/drivers/net/bonding/bond_sysfs.c
> >>>index 11b76b3..28a2d80 100644
> >>>--- a/drivers/net/bonding/bond_sysfs.c
> >>>+++ b/drivers/net/bonding/bond_sysfs.c
> >>>@@ -1075,7 +1075,10 @@ static ssize_t bonding_store_primary(struct device
> >>>*d,
> >>> struct slave *slave;
> >>> struct bonding *bond = to_bond(d);
> >>>
> >>>- write_lock_bh(&bond->lock);
> >>>+ rtnl_lock();
> >>>+ read_lock(&bond->lock);
> >>>+ write_lock_bh(&bond->curr_slave_lock);
F
> >>>+
> >>> if (!USES_PRIMARY(bond->params.mode)) {
> >>> printk(KERN_INFO DRV_NAME
> >>> ": %s: Unable to set primary slave; %s is in mode
> >>> %d\n",
> >>>@@ -1109,8 +1112,8 @@ static ssize_t bonding_store_primary(struct device
> >>>*d,
> >>> }
> >>> }
> >>>out:
> >>>- write_unlock_bh(&bond->lock);
> >>>-
> >>>+ write_unlock_bh(&bond->curr_slave_lock);
> >>>+ read_unlock(&bond->lock);
> >>> rtnl_unlock();
> >>>
> >>> return count;
> >>>@@ -1190,7 +1193,8 @@ static ssize_t bonding_store_active_slave(struct
> >>>device *d,
> >>> struct bonding *bond = to_bond(d);
> >>>
> >>> rtnl_lock();
> >>>- write_lock_bh(&bond->lock);
> >>>+ read_lock(&bond->lock);
> >>>+ write_lock_bh(&bond->curr_slave_lock);
> >>>
> >>> if (!USES_PRIMARY(bond->params.mode)) {
> >>> printk(KERN_INFO DRV_NAME
> >>>@@ -1247,7 +1251,8 @@ static ssize_t bonding_store_active_slave(struct
> >>>device *d,
> >>> }
> >>> }
> >>>out:
> >>>- write_unlock_bh(&bond->lock);
> >>>+ write_unlock_bh(&bond->curr_slave_lock);
> >>>+ read_unlock(&bond->lock);
> >>> rtnl_unlock();
> >>>
> >>> return count;
> >>
> >>Vanilla 2.6.24-rc5 plus this patch:
> >>
> >>=========================================================
> >>[ INFO: possible irq lock inversion dependency detected ]
> >>2.6.24-rc5 #1
> >>---------------------------------------------------------
> >>events/0/9 just changed the state of lock:
> >> (&mc->mca_lock){-+..}, at: [<c0411c7a>] mld_ifc_timer_expire+0x130/0x1fb
> >>but this lock took another, soft-read-irq-unsafe lock in the past:
> >> (&bond->lock){-.--}
> >>
> >>and interrupts could create inverse lock ordering between them.
> >>
> >>
> >
> >Grrr, I should have seen that -- sorry. Try your luck with this instead:
> <CUT>
>
> No luck.
>
> bonding: bond0: setting mode to active-backup (1).
> bonding: bond0: Setting MII monitoring interval to 100.
> ADDRCONF(NETDEV_UP): bond0: link is not ready
> bonding: bond0: Adding slave eth0.
> e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow
> Control: RX/TX
> bonding: bond0: making interface eth0 the new active one.
> bonding: bond0: first active interface up!
> bonding: bond0: enslaving eth0 as an active interface with an up link.
> bonding: bond0: Adding slave eth1.
> ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
<SNIP>
> bonding: bond0: enslaving eth1 as a backup interface with a down link.
> bonding: bond0: Setting eth0 as primary slave.
> bond0: no IPv6 routers present
>
Based on the console log, I'm guessing your initialization scripts use
sysfs to set eth0 as the primary interface for bond0? Can you confirm?
If you did somehow use sysfs to set the primary device as eth0, I'm
guessing you never see this issue without that line or without this
patch. Please confirm this as well.
Thanks,
-andy
^ permalink raw reply
* Re: [Bugme-new] [Bug 9543] New: RTNL: assertion failed at net/ipv6/addrconf.c (2164)/RTNL: assertion failed at net/ipv4/devinet.c (1055)
From: Krzysztof Oledzki @ 2007-12-14 22:11 UTC (permalink / raw)
To: Andy Gospodarek
Cc: Jay Vosburgh, Herbert Xu, Andrew Morton, bugme-daemon, shemminger,
davem, netdev
In-Reply-To: <20071214220300.GA8515@gospo.usersys.redhat.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 5915 bytes --]
On Fri, 14 Dec 2007, Andy Gospodarek wrote:
> On Fri, Dec 14, 2007 at 07:57:42PM +0100, Krzysztof Oledzki wrote:
>>
>>
>> On Fri, 14 Dec 2007, Andy Gospodarek wrote:
>>
>>> On Fri, Dec 14, 2007 at 05:14:57PM +0100, Krzysztof Oledzki wrote:
>>>>
>>>>
>>>> On Wed, 12 Dec 2007, Jay Vosburgh wrote:
>>>>
>>>>> Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>>>>
>>>>>>> diff -puN drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
>>>>>>> drivers/net/bonding/bond_sysfs.c
>>>>>>> --- a/drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
>>>>>>> +++ a/drivers/net/bonding/bond_sysfs.c
>>>>>>> @@ -1111,8 +1111,6 @@ static ssize_t bonding_store_primary(str
>>>>>>> out:
>>>>>>> write_unlock_bh(&bond->lock);
>>>>>>>
>>>>>>> - rtnl_unlock();
>>>>>>> -
>>>>>>
>>>>>> Looking at the changeset that added this perhaps the intention
>>>>>> is to hold the lock? If so we should add an rtnl_lock to the start
>>>>>> of the function.
>>>>>
>>>>> Yes, this function needs to hold locks, and more than just
>>>>> what's there now. I believe the following should be correct; I haven't
>>>>> tested it, though (I'm supposedly on vacation right now).
>>>>>
>>>>> The following change should be correct for the
>>>>> bonding_store_primary case discussed in this thread, and also corrects
>>>>> the bonding_store_active case which performs similar functions.
>>>>>
>>>>> The bond_change_active_slave and bond_select_active_slave
>>>>> functions both require rtnl, bond->lock for read and curr_slave_lock for
>>>>> write_bh, and no other locks. This is so that the lower level
>>>>> mode-specific functions can release locks down to just rtnl in order to
>>>>> call, e.g., dev_set_mac_address with the locks it expects (rtnl only).
>>>>>
>>>>> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
>>>>>
>>>>> diff --git a/drivers/net/bonding/bond_sysfs.c
>>>>> b/drivers/net/bonding/bond_sysfs.c
>>>>> index 11b76b3..28a2d80 100644
>>>>> --- a/drivers/net/bonding/bond_sysfs.c
>>>>> +++ b/drivers/net/bonding/bond_sysfs.c
>>>>> @@ -1075,7 +1075,10 @@ static ssize_t bonding_store_primary(struct device
>>>>> *d,
>>>>> struct slave *slave;
>>>>> struct bonding *bond = to_bond(d);
>>>>>
>>>>> - write_lock_bh(&bond->lock);
>>>>> + rtnl_lock();
>>>>> + read_lock(&bond->lock);
>>>>> + write_lock_bh(&bond->curr_slave_lock);
> F
>>>>> +
>>>>> if (!USES_PRIMARY(bond->params.mode)) {
>>>>> printk(KERN_INFO DRV_NAME
>>>>> ": %s: Unable to set primary slave; %s is in mode
>>>>> %d\n",
>>>>> @@ -1109,8 +1112,8 @@ static ssize_t bonding_store_primary(struct device
>>>>> *d,
>>>>> }
>>>>> }
>>>>> out:
>>>>> - write_unlock_bh(&bond->lock);
>>>>> -
>>>>> + write_unlock_bh(&bond->curr_slave_lock);
>>>>> + read_unlock(&bond->lock);
>>>>> rtnl_unlock();
>>>>>
>>>>> return count;
>>>>> @@ -1190,7 +1193,8 @@ static ssize_t bonding_store_active_slave(struct
>>>>> device *d,
>>>>> struct bonding *bond = to_bond(d);
>>>>>
>>>>> rtnl_lock();
>>>>> - write_lock_bh(&bond->lock);
>>>>> + read_lock(&bond->lock);
>>>>> + write_lock_bh(&bond->curr_slave_lock);
>>>>>
>>>>> if (!USES_PRIMARY(bond->params.mode)) {
>>>>> printk(KERN_INFO DRV_NAME
>>>>> @@ -1247,7 +1251,8 @@ static ssize_t bonding_store_active_slave(struct
>>>>> device *d,
>>>>> }
>>>>> }
>>>>> out:
>>>>> - write_unlock_bh(&bond->lock);
>>>>> + write_unlock_bh(&bond->curr_slave_lock);
>>>>> + read_unlock(&bond->lock);
>>>>> rtnl_unlock();
>>>>>
>>>>> return count;
>>>>
>>>> Vanilla 2.6.24-rc5 plus this patch:
>>>>
>>>> =========================================================
>>>> [ INFO: possible irq lock inversion dependency detected ]
>>>> 2.6.24-rc5 #1
>>>> ---------------------------------------------------------
>>>> events/0/9 just changed the state of lock:
>>>> (&mc->mca_lock){-+..}, at: [<c0411c7a>] mld_ifc_timer_expire+0x130/0x1fb
>>>> but this lock took another, soft-read-irq-unsafe lock in the past:
>>>> (&bond->lock){-.--}
>>>>
>>>> and interrupts could create inverse lock ordering between them.
>>>>
>>>>
>>>
>>> Grrr, I should have seen that -- sorry. Try your luck with this instead:
>> <CUT>
>>
>> No luck.
>>
>> bonding: bond0: setting mode to active-backup (1).
>> bonding: bond0: Setting MII monitoring interval to 100.
>> ADDRCONF(NETDEV_UP): bond0: link is not ready
>> bonding: bond0: Adding slave eth0.
>> e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow
>> Control: RX/TX
>> bonding: bond0: making interface eth0 the new active one.
>> bonding: bond0: first active interface up!
>> bonding: bond0: enslaving eth0 as an active interface with an up link.
>> bonding: bond0: Adding slave eth1.
>> ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
>
> <SNIP>
>
>> bonding: bond0: enslaving eth1 as a backup interface with a down link.
>> bonding: bond0: Setting eth0 as primary slave.
>> bond0: no IPv6 routers present
>>
>
> Based on the console log, I'm guessing your initialization scripts use
> sysfs to set eth0 as the primary interface for bond0? Can you confirm?
Yep, that's correct:
postup() {
if [[ ${IFACE} == "bond0" ]] ; then
echo -n +eth0 > /sys/class/net/${IFACE}/bonding/slaves
echo -n +eth1 > /sys/class/net/${IFACE}/bonding/slaves
echo -n eth0 > /sys/class/net/${IFACE}/bonding/primary
fi
}
> If you did somehow use sysfs to set the primary device as eth0, I'm
> guessing you never see this issue without that line or without this
> patch. Please confirm this as well.
Without this patch I get another error, of course. Unfortunately checking
what happens without using sysfs to set the primary device as eth0, have
to wait, as I am not able to test it before Monday.
Best regards,
Krzysztof Olędzki
^ permalink raw reply
* Re: [Bugme-new] [Bug 9543] New: RTNL: assertion failed at net/ipv6/addrconf.c (2164)/RTNL: assertion failed at net/ipv4/devinet.c (1055)
From: Andy Gospodarek @ 2007-12-14 22:27 UTC (permalink / raw)
To: Krzysztof Oledzki
Cc: Andy Gospodarek, Jay Vosburgh, Herbert Xu, Andrew Morton,
bugme-daemon, shemminger, davem, netdev
In-Reply-To: <Pine.LNX.4.64.0712142304470.23504@bizon.gios.gov.pl>
On Fri, Dec 14, 2007 at 11:11:15PM +0100, Krzysztof Oledzki wrote:
>
>
> On Fri, 14 Dec 2007, Andy Gospodarek wrote:
>
> >On Fri, Dec 14, 2007 at 07:57:42PM +0100, Krzysztof Oledzki wrote:
> >>
> >>
> >>On Fri, 14 Dec 2007, Andy Gospodarek wrote:
> >>
> >>>On Fri, Dec 14, 2007 at 05:14:57PM +0100, Krzysztof Oledzki wrote:
> >>>>
> >>>>
> >>>>On Wed, 12 Dec 2007, Jay Vosburgh wrote:
> >>>>
> >>>>>Herbert Xu <herbert@gondor.apana.org.au> wrote:
> >>>>>
> >>>>>>>diff -puN drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
> >>>>>>>drivers/net/bonding/bond_sysfs.c
> >>>>>>>--- a/drivers/net/bonding/bond_sysfs.c~bonding-locking-fix
> >>>>>>>+++ a/drivers/net/bonding/bond_sysfs.c
> >>>>>>>@@ -1111,8 +1111,6 @@ static ssize_t bonding_store_primary(str
> >>>>>>>out:
> >>>>>>> write_unlock_bh(&bond->lock);
> >>>>>>>
> >>>>>>>- rtnl_unlock();
> >>>>>>>-
> >>>>>>
> >>>>>>Looking at the changeset that added this perhaps the intention
> >>>>>>is to hold the lock? If so we should add an rtnl_lock to the start
> >>>>>>of the function.
> >>>>>
> >>>>> Yes, this function needs to hold locks, and more than just
> >>>>>what's there now. I believe the following should be correct; I haven't
> >>>>>tested it, though (I'm supposedly on vacation right now).
> >>>>>
> >>>>> The following change should be correct for the
> >>>>>bonding_store_primary case discussed in this thread, and also corrects
> >>>>>the bonding_store_active case which performs similar functions.
> >>>>>
> >>>>> The bond_change_active_slave and bond_select_active_slave
> >>>>>functions both require rtnl, bond->lock for read and curr_slave_lock
> >>>>>for
> >>>>>write_bh, and no other locks. This is so that the lower level
> >>>>>mode-specific functions can release locks down to just rtnl in order to
> >>>>>call, e.g., dev_set_mac_address with the locks it expects (rtnl only).
> >>>>>
> >>>>>Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
> >>>>>
> >>>>>diff --git a/drivers/net/bonding/bond_sysfs.c
> >>>>>b/drivers/net/bonding/bond_sysfs.c
> >>>>>index 11b76b3..28a2d80 100644
> >>>>>--- a/drivers/net/bonding/bond_sysfs.c
> >>>>>+++ b/drivers/net/bonding/bond_sysfs.c
> >>>>>@@ -1075,7 +1075,10 @@ static ssize_t bonding_store_primary(struct
> >>>>>device
> >>>>>*d,
> >>>>> struct slave *slave;
> >>>>> struct bonding *bond = to_bond(d);
> >>>>>
> >>>>>- write_lock_bh(&bond->lock);
> >>>>>+ rtnl_lock();
> >>>>>+ read_lock(&bond->lock);
> >>>>>+ write_lock_bh(&bond->curr_slave_lock);
> >F
> >>>>>+
> >>>>> if (!USES_PRIMARY(bond->params.mode)) {
> >>>>> printk(KERN_INFO DRV_NAME
> >>>>> ": %s: Unable to set primary slave; %s is in mode
> >>>>> %d\n",
> >>>>>@@ -1109,8 +1112,8 @@ static ssize_t bonding_store_primary(struct
> >>>>>device
> >>>>>*d,
> >>>>> }
> >>>>> }
> >>>>>out:
> >>>>>- write_unlock_bh(&bond->lock);
> >>>>>-
> >>>>>+ write_unlock_bh(&bond->curr_slave_lock);
> >>>>>+ read_unlock(&bond->lock);
> >>>>> rtnl_unlock();
> >>>>>
> >>>>> return count;
> >>>>>@@ -1190,7 +1193,8 @@ static ssize_t bonding_store_active_slave(struct
> >>>>>device *d,
> >>>>> struct bonding *bond = to_bond(d);
> >>>>>
> >>>>> rtnl_lock();
> >>>>>- write_lock_bh(&bond->lock);
> >>>>>+ read_lock(&bond->lock);
> >>>>>+ write_lock_bh(&bond->curr_slave_lock);
> >>>>>
> >>>>> if (!USES_PRIMARY(bond->params.mode)) {
> >>>>> printk(KERN_INFO DRV_NAME
> >>>>>@@ -1247,7 +1251,8 @@ static ssize_t bonding_store_active_slave(struct
> >>>>>device *d,
> >>>>> }
> >>>>> }
> >>>>>out:
> >>>>>- write_unlock_bh(&bond->lock);
> >>>>>+ write_unlock_bh(&bond->curr_slave_lock);
> >>>>>+ read_unlock(&bond->lock);
> >>>>> rtnl_unlock();
> >>>>>
> >>>>> return count;
> >>>>
> >>>>Vanilla 2.6.24-rc5 plus this patch:
> >>>>
> >>>>=========================================================
> >>>>[ INFO: possible irq lock inversion dependency detected ]
> >>>>2.6.24-rc5 #1
> >>>>---------------------------------------------------------
> >>>>events/0/9 just changed the state of lock:
> >>>>(&mc->mca_lock){-+..}, at: [<c0411c7a>] mld_ifc_timer_expire+0x130/0x1fb
> >>>>but this lock took another, soft-read-irq-unsafe lock in the past:
> >>>>(&bond->lock){-.--}
> >>>>
> >>>>and interrupts could create inverse lock ordering between them.
> >>>>
> >>>>
> >>>
> >>>Grrr, I should have seen that -- sorry. Try your luck with this instead:
> >><CUT>
> >>
> >>No luck.
> >>
> >>bonding: bond0: setting mode to active-backup (1).
> >>bonding: bond0: Setting MII monitoring interval to 100.
> >>ADDRCONF(NETDEV_UP): bond0: link is not ready
> >>bonding: bond0: Adding slave eth0.
> >>e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex, Flow
> >>Control: RX/TX
> >>bonding: bond0: making interface eth0 the new active one.
> >>bonding: bond0: first active interface up!
> >>bonding: bond0: enslaving eth0 as an active interface with an up link.
> >>bonding: bond0: Adding slave eth1.
> >>ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
> >
> ><SNIP>
> >
> >>bonding: bond0: enslaving eth1 as a backup interface with a down link.
> >>bonding: bond0: Setting eth0 as primary slave.
> >>bond0: no IPv6 routers present
> >>
> >
> >Based on the console log, I'm guessing your initialization scripts use
> >sysfs to set eth0 as the primary interface for bond0? Can you confirm?
>
> Yep, that's correct:
>
> postup() {
> if [[ ${IFACE} == "bond0" ]] ; then
> echo -n +eth0 > /sys/class/net/${IFACE}/bonding/slaves
> echo -n +eth1 > /sys/class/net/${IFACE}/bonding/slaves
> echo -n eth0 > /sys/class/net/${IFACE}/bonding/primary
> fi
> }
>
Good. Thanks for the confirmation.
> >If you did somehow use sysfs to set the primary device as eth0, I'm
> >guessing you never see this issue without that line or without this
> >patch. Please confirm this as well.
>
> Without this patch I get another error, of course. Unfortunately checking
:-/
> what happens without using sysfs to set the primary device as eth0, have
> to wait, as I am not able to test it before Monday.
>
No problem, thanks for the feedback and quick response.
^ permalink raw reply
* [PATCH 01/11] drivers/net/ax88796.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Paul Gortmaker, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ax88796.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 7495a9e..107c11f 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -750,14 +750,10 @@ static int ax_init_dev(struct net_device *dev, int first_init)
ax_NS8390_init(dev, 0);
if (first_init) {
- printk("AX88796: %dbit, irq %d, %lx, MAC: ",
- ei_status.word16 ? 16:8, dev->irq, dev->base_addr);
-
- for (i = 0; i < ETHER_ADDR_LEN; i++)
- printk("%2.2x%c", dev->dev_addr[i],
- (i < (ETHER_ADDR_LEN-1) ? ':' : ' '));
^ permalink raw reply related
* [PATCH 02/11] drivers/net/hplance.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/hplance.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/hplance.c b/drivers/net/hplance.c
index be6e5bc..2748b47 100644
--- a/drivers/net/hplance.c
+++ b/drivers/net/hplance.c
@@ -77,7 +77,7 @@ static int __devinit hplance_init_one(struct dio_dev *d,
{
struct net_device *dev;
int err = -ENOMEM;
- int i;
+ DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct hplance_private));
if (!dev)
@@ -95,13 +95,9 @@ static int __devinit hplance_init_one(struct dio_dev *d,
dio_set_drvdata(d, dev);
- printk(KERN_INFO "%s: %s; select code %d, addr %2.2x", dev->name, d->name, d->scode, dev->dev_addr[0]);
-
- for (i=1; i<6; i++) {
- printk(":%2.2x", dev->dev_addr[i]);
- }
^ permalink raw reply related
* [PATCH 03/11] drivers/net/mac8390.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Paul Gortmaker, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/mac8390.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index 9e70074..4eccebb 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -483,6 +483,7 @@ void cleanup_module(void)
static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
enum mac8390_type type)
{
+ DECLARE_MAC_BUF(mac);
static u32 fwrd4_offsets[16]={
0, 4, 8, 12,
16, 20, 24, 28,
@@ -612,18 +613,11 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
/* Good, done, now spit out some messages */
printk(KERN_INFO "%s: %s in slot %X (type %s)\n",
dev->name, ndev->board->name, ndev->board->slot, cardname[type]);
- printk(KERN_INFO "MAC ");
- {
- int i;
- for (i = 0; i < 6; i++) {
- printk("%2.2x", dev->dev_addr[i]);
- if (i < 5)
- printk(":");
- }
- }
- printk(" IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
- dev->irq, (int)((dev->mem_end - dev->mem_start)/0x1000) * 4,
- dev->mem_start, access_bitmode?32:16);
+ printk(KERN_INFO "MAC %s IRQ %d, %d KB shared memory at %#lx, "
+ "%d-bit access.\n",
+ print_mac(mac, dev->dev_addr), dev->irq,
+ (int)((dev->mem_end - dev->mem_start)/0x1000) * 4,
+ dev->mem_start, access_bitmode?32:16);
return 0;
}
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 04/11] drivers/net/mac89x0.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/mac89x0.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c
index a19b595..45b56ca 100644
--- a/drivers/net/mac89x0.c
+++ b/drivers/net/mac89x0.c
@@ -584,11 +584,12 @@ static void set_multicast_list(struct net_device *dev)
static int set_mac_address(struct net_device *dev, void *addr)
{
+ DECLARE_MAC_BUF(mac);
int i;
- printk("%s: Setting MAC address to ", dev->name);
for (i = 0; i < 6; i++)
- printk(" %2.2x", dev->dev_addr[i] = ((unsigned char *)addr)[i]);
- printk(".\n");
+ dev->dev_addr[i] = ((unsigned char *)addr)[i];
+ printk(KERN_INFO "%s: Setting MAC address to %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
/* set the Ethernet address */
for (i=0; i < ETH_ALEN/2; i++)
writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 05/11] drivers/net/niu.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/niu.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index abfc61c..8a0f8f8 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7392,12 +7392,10 @@ static void __devinit niu_assign_netdev_ops(struct net_device *dev)
static void __devinit niu_device_announce(struct niu *np)
{
struct net_device *dev = np->dev;
- int i;
+ DECLARE_MAC_BUF(mac);
- pr_info("%s: NIU Ethernet ", dev->name);
- for (i = 0; i < 6; i++)
- printk("%2.2x%c", dev->dev_addr[i],
- i == 5 ? '\n' : ':');
+ pr_info("%s: NIU Ethernet %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
pr_info("%s: Port type[%s] mode[%s:%s] XCVR[%s] phy[%s]\n",
dev->name,
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 06/11] drivers/net/pcnet32.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Don Fry, Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/pcnet32.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ff92aca..87edeb6 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1769,8 +1769,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
memset(dev->dev_addr, 0, sizeof(dev->dev_addr));
if (pcnet32_debug & NETIF_MSG_PROBE) {
- for (i = 0; i < 6; i++)
- printk(" %2.2x", dev->dev_addr[i]);
+ DECLARE_MAC_BUF(mac);
+ printk(" %s", print_mac(mac, dev->dev_addr));
/* Version 0x2623 and 0x2624 */
if (((chip_version + 1) & 0xfffe) == 0x2624) {
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 07/11] drivers/net/smc911x.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/smc911x.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 76cc1d3..f503b73 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -2086,10 +2086,9 @@ static int __init smc911x_probe(struct net_device *dev, unsigned long ioaddr)
"set using ifconfig\n", dev->name);
} else {
/* Print the Ethernet address */
- printk("%s: Ethernet addr: ", dev->name);
- for (i = 0; i < 5; i++)
- printk("%2.2x:", dev->dev_addr[i]);
- printk("%2.2x\n", dev->dev_addr[5]);
+ DECLARE_MAC_BUF(mac);
+ printk("%s: Ethernet addr: %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
}
if (lp->phy_type == 0) {
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 08/11] drivers/net/sunvnet.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/sunvnet.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index ff1028a..4a0035f 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -1149,6 +1149,7 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev,
struct vnet *vp;
const u64 *rmac;
int len, i, err, switch_port;
+ DECLARE_MAC_BUF(mac);
print_version();
@@ -1213,12 +1214,9 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev,
dev_set_drvdata(&vdev->dev, port);
- printk(KERN_INFO "%s: PORT ( remote-mac ", vp->dev->name);
- for (i = 0; i < 6; i++)
- printk("%2.2x%c", port->raddr[i], i == 5 ? ' ' : ':');
- if (switch_port)
- printk("switch-port ");
- printk(")\n");
+ printk(KERN_INFO "%s: PORT ( remote-mac %s%s )\n",
+ vp->dev->name, print_mac(mac, port->raddr),
+ switch_port ? " switch-port" : "");
vio_port_up(&port->vio);
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 09/11] drivers/net/tg3.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Michael Chan, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/tg3.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4942f7d..eea7da9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -12351,9 +12351,10 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
unsigned long tg3reg_base, tg3reg_len;
struct net_device *dev;
struct tg3 *tp;
- int i, err, pm_cap;
+ int err, pm_cap;
char str[40];
u64 dma_mask, persist_dma_mask;
+ DECLARE_MAC_BUF(mac);
if (tg3_version_printed++ == 0)
printk(KERN_INFO "%s", version);
@@ -12632,7 +12633,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
goto err_out_apeunmap;
}
- printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (%s) %s Ethernet ",
+ printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] "
+ "(%s) %s Ethernet %s\n",
dev->name,
tp->board_part_number,
tp->pci_chip_rev_id,
@@ -12640,11 +12642,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
tg3_bus_string(tp, str),
((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
- "10/100/1000Base-T")));
^ permalink raw reply related
* [PATCH 10/11] drivers/net/tulip/de4x5.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev, tulip-users
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/tulip/de4x5.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 41f34bb..288f994 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -5361,14 +5361,11 @@ de4x5_dbg_open(struct net_device *dev)
{
struct de4x5_private *lp = netdev_priv(dev);
int i;
+ DECLARE_MAC_BUF(mac);
if (de4x5_debug & DEBUG_OPEN) {
printk("%s: de4x5 opening with irq %d\n",dev->name,dev->irq);
- printk("\tphysical address: ");
- for (i=0;i<6;i++) {
- printk("%2.2x:",(short)dev->dev_addr[i]);
- }
- printk("\n");
+ printk("\tphysical address: %s\n", print_mac(mac, dev->dev_addr));
printk("Descriptor head addresses:\n");
printk("\t0x%8.8lx 0x%8.8lx\n",(u_long)lp->rx_ring,(u_long)lp->tx_ring);
printk("Descriptor addresses:\nRX: ");
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 11/11] drivers/net/usb/catc.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Greg Kroah-Hartman, Jeff Garzik, linux-usb-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
drivers/net/usb/catc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 76752d8..e20db50 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -757,6 +757,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
struct catc *catc;
u8 broadcast[6];
int i, pktsz;
+ DECLARE_MAC_BUF(mac);
if (usb_set_interface(usbdev,
intf->altsetting->desc.bInterfaceNumber, 1)) {
@@ -891,11 +892,10 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
f5u011_rxmode(catc, catc->rxmode);
}
dbg("Init done.");
- printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, ",
+ printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %s\n",
netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
- usbdev->bus->bus_name, usbdev->devpath);
- for (i = 0; i < 5; i++) printk("%2.2x:", netdev->dev_addr[i]);
- printk("%2.2x.\n", netdev->dev_addr[i]);
+ usbdev->bus->bus_name, usbdev->devpath,
+ print_mac(mac, netdev->dev_addr));
usb_set_intfdata(intf, catc);
SET_NETDEV_DEV(netdev, &intf->dev);
--
1.5.3.7.949.g2221a6
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 11/11] drivers/net/usb/catc.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Jeff Garzik, linux-usb, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/usb/catc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 76752d8..e20db50 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -757,6 +757,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
struct catc *catc;
u8 broadcast[6];
int i, pktsz;
+ DECLARE_MAC_BUF(mac);
if (usb_set_interface(usbdev,
intf->altsetting->desc.bInterfaceNumber, 1)) {
@@ -891,11 +892,10 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
f5u011_rxmode(catc, catc->rxmode);
}
dbg("Init done.");
- printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, ",
+ printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %s\n",
netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
- usbdev->bus->bus_name, usbdev->devpath);
- for (i = 0; i < 5; i++) printk("%2.2x:", netdev->dev_addr[i]);
- printk("%2.2x.\n", netdev->dev_addr[i]);
+ usbdev->bus->bus_name, usbdev->devpath,
+ print_mac(mac, netdev->dev_addr));
usb_set_intfdata(intf, catc);
SET_NETDEV_DEV(netdev, &intf->dev);
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 01/11] drivers/net/ax88796.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Paul Gortmaker, netdev
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ax88796.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 7495a9e..107c11f 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -750,14 +750,10 @@ static int ax_init_dev(struct net_device *dev, int first_init)
ax_NS8390_init(dev, 0);
if (first_init) {
- printk("AX88796: %dbit, irq %d, %lx, MAC: ",
- ei_status.word16 ? 16:8, dev->irq, dev->base_addr);
-
- for (i = 0; i < ETHER_ADDR_LEN; i++)
- printk("%2.2x%c", dev->dev_addr[i],
- (i < (ETHER_ADDR_LEN-1) ? ':' : ' '));
-
- printk("\n");
+ DECLARE_MAC_BUF(mac);
+ printk("AX88796: %dbit, irq %d, %lx, MAC: %s\n",
+ ei_status.word16 ? 16:8, dev->irq, dev->base_addr,
+ print_mac(mac, dev->dev_addr));
}
ret = register_netdev(dev);
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 02/11] drivers/net/hplance.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/hplance.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/hplance.c b/drivers/net/hplance.c
index be6e5bc..2748b47 100644
--- a/drivers/net/hplance.c
+++ b/drivers/net/hplance.c
@@ -77,7 +77,7 @@ static int __devinit hplance_init_one(struct dio_dev *d,
{
struct net_device *dev;
int err = -ENOMEM;
- int i;
+ DECLARE_MAC_BUF(mac);
dev = alloc_etherdev(sizeof(struct hplance_private));
if (!dev)
@@ -95,13 +95,9 @@ static int __devinit hplance_init_one(struct dio_dev *d,
dio_set_drvdata(d, dev);
- printk(KERN_INFO "%s: %s; select code %d, addr %2.2x", dev->name, d->name, d->scode, dev->dev_addr[0]);
-
- for (i=1; i<6; i++) {
- printk(":%2.2x", dev->dev_addr[i]);
- }
-
- printk(", irq %d\n", d->ipl);
+ printk(KERN_INFO "%s: %s; select code %d, addr %s, irq %d\n",
+ dev->name, d->name, d->scode,
+ print_mac(mac, dev->dev_addr), d->irq);
return 0;
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 03/11] drivers/net/mac8390.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Paul Gortmaker, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/mac8390.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index 9e70074..4eccebb 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -483,6 +483,7 @@ void cleanup_module(void)
static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * ndev,
enum mac8390_type type)
{
+ DECLARE_MAC_BUF(mac);
static u32 fwrd4_offsets[16]={
0, 4, 8, 12,
16, 20, 24, 28,
@@ -612,18 +613,11 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
/* Good, done, now spit out some messages */
printk(KERN_INFO "%s: %s in slot %X (type %s)\n",
dev->name, ndev->board->name, ndev->board->slot, cardname[type]);
- printk(KERN_INFO "MAC ");
- {
- int i;
- for (i = 0; i < 6; i++) {
- printk("%2.2x", dev->dev_addr[i]);
- if (i < 5)
- printk(":");
- }
- }
- printk(" IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
- dev->irq, (int)((dev->mem_end - dev->mem_start)/0x1000) * 4,
- dev->mem_start, access_bitmode?32:16);
+ printk(KERN_INFO "MAC %s IRQ %d, %d KB shared memory at %#lx, "
+ "%d-bit access.\n",
+ print_mac(mac, dev->dev_addr), dev->irq,
+ (int)((dev->mem_end - dev->mem_start)/0x1000) * 4,
+ dev->mem_start, access_bitmode?32:16);
return 0;
}
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 04/11] drivers/net/mac89x0.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/mac89x0.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c
index a19b595..45b56ca 100644
--- a/drivers/net/mac89x0.c
+++ b/drivers/net/mac89x0.c
@@ -584,11 +584,12 @@ static void set_multicast_list(struct net_device *dev)
static int set_mac_address(struct net_device *dev, void *addr)
{
+ DECLARE_MAC_BUF(mac);
int i;
- printk("%s: Setting MAC address to ", dev->name);
for (i = 0; i < 6; i++)
- printk(" %2.2x", dev->dev_addr[i] = ((unsigned char *)addr)[i]);
- printk(".\n");
+ dev->dev_addr[i] = ((unsigned char *)addr)[i];
+ printk(KERN_INFO "%s: Setting MAC address to %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
/* set the Ethernet address */
for (i=0; i < ETH_ALEN/2; i++)
writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 06/11] drivers/net/pcnet32.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Don Fry, Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/pcnet32.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ff92aca..87edeb6 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1769,8 +1769,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
memset(dev->dev_addr, 0, sizeof(dev->dev_addr));
if (pcnet32_debug & NETIF_MSG_PROBE) {
- for (i = 0; i < 6; i++)
- printk(" %2.2x", dev->dev_addr[i]);
+ DECLARE_MAC_BUF(mac);
+ printk(" %s", print_mac(mac, dev->dev_addr));
/* Version 0x2623 and 0x2624 */
if (((chip_version + 1) & 0xfffe) == 0x2624) {
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
* [PATCH 05/11] drivers/net/niu.c: Use print_mac
From: Joe Perches @ 2007-12-14 22:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, netdev
In-Reply-To: <9fc484fc034428ab68ecb2711c8456df9e98d56d.1197671367.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/niu.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index abfc61c..8a0f8f8 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7392,12 +7392,10 @@ static void __devinit niu_assign_netdev_ops(struct net_device *dev)
static void __devinit niu_device_announce(struct niu *np)
{
struct net_device *dev = np->dev;
- int i;
+ DECLARE_MAC_BUF(mac);
- pr_info("%s: NIU Ethernet ", dev->name);
- for (i = 0; i < 6; i++)
- printk("%2.2x%c", dev->dev_addr[i],
- i == 5 ? '\n' : ':');
+ pr_info("%s: NIU Ethernet %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
pr_info("%s: Port type[%s] mode[%s:%s] XCVR[%s] phy[%s]\n",
dev->name,
--
1.5.3.7.949.g2221a6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox