* [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr
@ 2010-02-22 19:10 Jiri Pirko
2010-02-22 23:47 ` David Miller
2010-02-23 0:54 ` Jesse Brandeburg
0 siblings, 2 replies; 4+ messages in thread
From: Jiri Pirko @ 2010-02-22 19:10 UTC (permalink / raw)
To: netdev; +Cc: davem
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
drivers/net/e1000/e1000_main.c | 37 +++++++++++++++++--------------------
1 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 3b14dd7..c99f95c 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2161,29 +2161,26 @@ static void e1000_set_rx_mode(struct net_device *netdev)
WARN_ON(i == rar_entries);
- mc_ptr = netdev->mc_list;
-
- for (; i < rar_entries; i++) {
- if (mc_ptr) {
- e1000_rar_set(hw, mc_ptr->da_addr, i);
- mc_ptr = mc_ptr->next;
- } else {
- E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
- E1000_WRITE_FLUSH();
- E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
- E1000_WRITE_FLUSH();
+ netdev_for_each_mc_addr(mc_ptr, netdev) {
+ if (i == rar_entries) {
+ /* load any remaining addresses into the hash table */
+ u32 hash_reg, hash_bit, mta;
+ hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
+ hash_reg = (hash_value >> 5) & 0x7F;
+ hash_bit = hash_value & 0x1F;
+ mta = (1 << hash_bit);
+ mcarray[hash_reg] |= mta;
+ }
+ else {
+ e1000_rar_set(hw, mc_ptr->da_addr, i++);
}
}
- /* load any remaining addresses into the hash table */
-
- for (; mc_ptr; mc_ptr = mc_ptr->next) {
- u32 hash_reg, hash_bit, mta;
- hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
- hash_reg = (hash_value >> 5) & 0x7F;
- hash_bit = hash_value & 0x1F;
- mta = (1 << hash_bit);
- mcarray[hash_reg] |= mta;
+ for (; i < rar_entries; i++) {
+ E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
+ E1000_WRITE_FLUSH();
+ E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
+ E1000_WRITE_FLUSH();
}
/* write the hash table completely, write from bottom to avoid
--
1.6.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr
2010-02-22 19:10 [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr Jiri Pirko
@ 2010-02-22 23:47 ` David Miller
2010-02-23 0:54 ` Jesse Brandeburg
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-02-22 23:47 UTC (permalink / raw)
To: jpirko; +Cc: netdev
From: Jiri Pirko <jpirko@redhat.com>
Date: Mon, 22 Feb 2010 20:10:44 +0100
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr
2010-02-22 19:10 [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr Jiri Pirko
2010-02-22 23:47 ` David Miller
@ 2010-02-23 0:54 ` Jesse Brandeburg
2010-02-23 7:32 ` Jiri Pirko
1 sibling, 1 reply; 4+ messages in thread
From: Jesse Brandeburg @ 2010-02-23 0:54 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem
On Mon, Feb 22, 2010 at 11:10 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> ---
> drivers/net/e1000/e1000_main.c | 37 +++++++++++++++++--------------------
> 1 files changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index 3b14dd7..c99f95c 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -2161,29 +2161,26 @@ static void e1000_set_rx_mode(struct net_device *netdev)
>
> WARN_ON(i == rar_entries);
>
> - mc_ptr = netdev->mc_list;
> -
> - for (; i < rar_entries; i++) {
> - if (mc_ptr) {
> - e1000_rar_set(hw, mc_ptr->da_addr, i);
> - mc_ptr = mc_ptr->next;
> - } else {
> - E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
> - E1000_WRITE_FLUSH();
> - E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
> - E1000_WRITE_FLUSH();
> + netdev_for_each_mc_addr(mc_ptr, netdev) {
> + if (i == rar_entries) {
> + /* load any remaining addresses into the hash table */
> + u32 hash_reg, hash_bit, mta;
> + hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
> + hash_reg = (hash_value >> 5) & 0x7F;
> + hash_bit = hash_value & 0x1F;
> + mta = (1 << hash_bit);
> + mcarray[hash_reg] |= mta;
> + }
> + else {
nit - else should be in the same line like "} else {"
> + e1000_rar_set(hw, mc_ptr->da_addr, i++);
> }
> }
>
> - /* load any remaining addresses into the hash table */
> -
> - for (; mc_ptr; mc_ptr = mc_ptr->next) {
> - u32 hash_reg, hash_bit, mta;
> - hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
> - hash_reg = (hash_value >> 5) & 0x7F;
> - hash_bit = hash_value & 0x1F;
> - mta = (1 << hash_bit);
> - mcarray[hash_reg] |= mta;
> + for (; i < rar_entries; i++) {
> + E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
> + E1000_WRITE_FLUSH();
> + E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
> + E1000_WRITE_FLUSH();
> }
>
> /* write the hash table completely, write from bottom to avoid
otherwise seems okay. Thanks for your work on cleaning this stuff,
we'll be testing it as part of the net next testing already going on.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr
2010-02-23 0:54 ` Jesse Brandeburg
@ 2010-02-23 7:32 ` Jiri Pirko
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2010-02-23 7:32 UTC (permalink / raw)
To: Jesse Brandeburg; +Cc: netdev, davem
Tue, Feb 23, 2010 at 01:54:13AM CET, jesse.brandeburg@gmail.com wrote:
>On Mon, Feb 22, 2010 at 11:10 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>> ---
>> drivers/net/e1000/e1000_main.c | 37 +++++++++++++++++--------------------
>> 1 files changed, 17 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
>> index 3b14dd7..c99f95c 100644
>> --- a/drivers/net/e1000/e1000_main.c
>> +++ b/drivers/net/e1000/e1000_main.c
>> @@ -2161,29 +2161,26 @@ static void e1000_set_rx_mode(struct net_device *netdev)
>>
>> WARN_ON(i == rar_entries);
>>
>> - mc_ptr = netdev->mc_list;
>> -
>> - for (; i < rar_entries; i++) {
>> - if (mc_ptr) {
>> - e1000_rar_set(hw, mc_ptr->da_addr, i);
>> - mc_ptr = mc_ptr->next;
>> - } else {
>> - E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
>> - E1000_WRITE_FLUSH();
>> - E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
>> - E1000_WRITE_FLUSH();
>> + netdev_for_each_mc_addr(mc_ptr, netdev) {
>> + if (i == rar_entries) {
>> + /* load any remaining addresses into the hash table */
>> + u32 hash_reg, hash_bit, mta;
>> + hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
>> + hash_reg = (hash_value >> 5) & 0x7F;
>> + hash_bit = hash_value & 0x1F;
>> + mta = (1 << hash_bit);
>> + mcarray[hash_reg] |= mta;
>> + }
>> + else {
>
>nit - else should be in the same line like "} else {"
Oh right, but patch is already applied. Will post correction.
>
>> + e1000_rar_set(hw, mc_ptr->da_addr, i++);
>> }
>> }
>>
>> - /* load any remaining addresses into the hash table */
>> -
>> - for (; mc_ptr; mc_ptr = mc_ptr->next) {
>> - u32 hash_reg, hash_bit, mta;
>> - hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
>> - hash_reg = (hash_value >> 5) & 0x7F;
>> - hash_bit = hash_value & 0x1F;
>> - mta = (1 << hash_bit);
>> - mcarray[hash_reg] |= mta;
>> + for (; i < rar_entries; i++) {
>> + E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
>> + E1000_WRITE_FLUSH();
>> + E1000_WRITE_REG_ARRAY(hw, RA, (i << 1) + 1, 0);
>> + E1000_WRITE_FLUSH();
>> }
>>
>> /* write the hash table completely, write from bottom to avoid
>
>otherwise seems okay. Thanks for your work on cleaning this stuff,
>we'll be testing it as part of the net next testing already going on.
Cool, thanks
Jirka
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-23 7:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 19:10 [net-next-2.6 PATCH] e1000: convert to use netdev_for_each_mc_addr Jiri Pirko
2010-02-22 23:47 ` David Miller
2010-02-23 0:54 ` Jesse Brandeburg
2010-02-23 7:32 ` Jiri Pirko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).