netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* octeon dev_addrs list usage
@ 2010-02-23 20:41 Jiri Pirko
  2010-02-24 18:10 ` David Daney
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2010-02-23 20:41 UTC (permalink / raw)
  To: ddaney; +Cc: davem, netdev

Hello David.

Lookin at octeon driver, drivers/net/octeon/octeon_mgmt.c,
octeon_mgmt_set_rx_filtering function and following code:

503         if (cam_mode == 1) {
504                 /* Add primary address. */
505                 octeon_mgmt_cam_state_add(&cam_state, netdev->dev_addr);
506                 list_for_each(pos, &netdev->dev_addrs.list) {
507                         struct netdev_hw_addr *hw_addr;
508                         hw_addr = list_entry(pos, struct netdev_hw_addr, list);
509                         octeon_mgmt_cam_state_add(&cam_state, hw_addr->addr);
510                         list = list->next;
511                 }
512         }

besides netdev->dev_addr is first entry in netdev->dev_addrs.list and
"list = list->next;" makes no sense here (I posted a patch correcting
these earlier), are you sure you are traversing the right list? This list is
currently not filled in anywhere (besides ixgbe driver). Don't you want
to traverse through unicast_list instead? Maybe I'm missing something...

Thanks.

Jirka

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: octeon dev_addrs list usage
  2010-02-23 20:41 octeon dev_addrs list usage Jiri Pirko
@ 2010-02-24 18:10 ` David Daney
  0 siblings, 0 replies; 2+ messages in thread
From: David Daney @ 2010-02-24 18:10 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: davem, netdev

On 02/23/2010 12:41 PM, Jiri Pirko wrote:
> Hello David.
>
> Lookin at octeon driver, drivers/net/octeon/octeon_mgmt.c,
> octeon_mgmt_set_rx_filtering function and following code:
>
> 503         if (cam_mode == 1) {
> 504                 /* Add primary address. */
> 505                 octeon_mgmt_cam_state_add(&cam_state, netdev->dev_addr);
> 506                 list_for_each(pos,&netdev->dev_addrs.list) {
> 507                         struct netdev_hw_addr *hw_addr;
> 508                         hw_addr = list_entry(pos, struct netdev_hw_addr, list);
> 509                         octeon_mgmt_cam_state_add(&cam_state, hw_addr->addr);
> 510                         list = list->next;
> 511                 }
> 512         }
>
> besides netdev->dev_addr is first entry in netdev->dev_addrs.list and

Ok.

> "list = list->next;" makes no sense here (I posted a patch correcting
> these earlier),

Right, that does look wrong.


> are you sure you are traversing the right list? This list is
> currently not filled in anywhere (besides ixgbe driver). Don't you want
> to traverse through unicast_list instead? Maybe I'm missing something...
>

You are likely right. I will revisit this code, but it could be a couple 
of days.

Thanks for looking at it,
David Daney



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-24 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23 20:41 octeon dev_addrs list usage Jiri Pirko
2010-02-24 18:10 ` David Daney

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).