Skip to contentSkip to conversation

octeon dev_addrs list usage

DISCUSSION Jiri Pirko 2 participants 2 messages Feb 23, 2010 – Feb 24, 2010

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

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

#1 lore raw
Quoted 13 lines · Jiri Pirko

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;
Quoted 4 lines

511 }
512 }

besides netdev->dev_addr is first entry in netdev->dev_addrs.list and

Ok.

Quoted 2 lines

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

Right, that does look wrong.

Quoted 4 lines

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