All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "Kok, Auke" <auke-jan.h.kok@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: [E1000 05/05]: Secondary unicast address support
Date: Mon, 25 Jun 2007 21:05:54 +0200	[thread overview]
Message-ID: <46801212.6040002@trash.net> (raw)
In-Reply-To: <468010F9.6060406@intel.com>

Kok, Auke wrote:
> Patrick McHardy wrote:
>> @@ -2449,9 +2450,16 @@ e1000_set_multi(struct net_device *netdev)
>>          rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
>>      } else if (netdev->flags & IFF_ALLMULTI) {
>>          rctl |= E1000_RCTL_MPE;
>> -        rctl &= ~E1000_RCTL_UPE;
>>      } else {
>> -        rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
>> +        rctl &= ~E1000_RCTL_MPE;
>> +    }
>> +
>> +    uc_ptr = NULL;
>> +    if (netdev->uc_count > rar_entries - 1) {
>> +        rctl |= E1000_RCTL_UPE;
>> +    } else if (!(netdev->flags & IFF_PROMISC)) {
>> +        rctl &= ~E1000_RCTL_UPE;
>> +        uc_ptr = netdev->uc_list;
>>      }
>>  
>>      E1000_WRITE_REG(hw, RCTL, rctl);
>> @@ -2461,7 +2469,10 @@ e1000_set_multi(struct net_device *netdev)
>>      if (hw->mac_type == e1000_82542_rev2_0)
>>          e1000_enter_82542_rst(adapter);
>>  
>> -    /* load the first 14 multicast address into the exact filters 1-14
>> +    /* load the first 14 addresses into the exact filters 1-14. Unicast
>> +     * addresses take precedence to avoid disabling unicast filtering
>> +     * when possible.
>> +     *
>>       * RAR 0 is used for the station MAC adddress
>>       * if there are not 14 addresses, go ahead and clear the filters
>>       * -- with 82571 controllers only 0-13 entries are filled here
>> @@ -2469,8 +2480,11 @@ e1000_set_multi(struct net_device *netdev)
>>      mc_ptr = netdev->mc_list;
>>  
>>      for (i = 1; i < rar_entries; i++) {
>> -        if (mc_ptr) {
>> -            e1000_rar_set(hw, mc_ptr->dmi_addr, i);
>> +        if (uc_ptr) {
>> +            e1000_rar_set(hw, uc_ptr->da_addr, i);
>> +            uc_ptr = uc_ptr->next;
>> +        } else 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);
>> @@ -2479,6 +2493,7 @@ e1000_set_multi(struct net_device *netdev)
>>              E1000_WRITE_FLUSH(hw);
>>          }
>>      }
>> +    WARN_ON(uc_ptr != NULL);
>>   
>
> noted. I'm (like a lot of people) on the road and still need to dig 
> into this deeper.

Please take your time, this was mainly an example and for testing.
If its OK I wouldn't object to you applying it of course :)

> I think it's OK for as far as I can see, except the WARN_ON, can't we 
> pre-check to see if we have enough room in the rar_entries first?


It does, the WARN_ON would only trigger if I made a mistake:

+    if (netdev->uc_count > rar_entries - 1) {



      reply	other threads:[~2007-06-25 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-22 12:24 [NET 00/05]: Secondary unicast address support v2 Patrick McHardy
2007-06-22 12:24 ` [NET 01/05]: dev_mcast: unexport dev_mc_upload Patrick McHardy
2007-06-27  8:25   ` David Miller
2007-06-22 12:24 ` [NET 02/05]: dev: introduce generic net_device address lists Patrick McHardy
2007-06-27  8:26   ` David Miller
2007-06-22 12:24 ` [NET 03/05]: dev_mcast: switch to " Patrick McHardy
2007-06-27  8:27   ` David Miller
2007-06-22 12:24 ` [NET 04/05]: dev: secondary unicast address support Patrick McHardy
2007-06-27  8:28   ` David Miller
2007-06-27  8:30     ` Patrick McHardy
2007-06-27  8:55       ` David Miller
2007-06-22 12:24 ` [E1000 05/05]: Secondary " Patrick McHardy
2007-06-25 19:01   ` Kok, Auke
2007-06-25 19:05     ` Patrick McHardy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46801212.6040002@trash.net \
    --to=kaber@trash.net \
    --cc=auke-jan.h.kok@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.