Skip to content

Commit

Permalink
ehea: fix allmulticast support
Browse files Browse the repository at this point in the history
There was a bug in the mask of regtype parameter for registering a
multicast filter. It was ignoring the scope bit, which was wrongly being
used for all filters. The SCOPE_ALL value adds a filter that allows all
multicast packets and ignores the MAC parameter, just what allmulticast
needs. The normals filters, however, should not use SCOPE_ALL.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and David S. Miller committed Apr 26, 2012
1 parent 62ad6fc commit 5d38457
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions drivers/net/ethernet/ibm/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void)

arr[i].adh = adapter->handle;
arr[i].port_id = port->logical_port_id;
arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
EHEA_BCMC_MULTICAST |
arr[i].reg_type = EHEA_BCMC_MULTICAST |
EHEA_BCMC_UNTAGGED;
if (mc_entry->macaddr == 0)
arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
arr[i++].macaddr = mc_entry->macaddr;

arr[i].adh = adapter->handle;
arr[i].port_id = port->logical_port_id;
arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
EHEA_BCMC_MULTICAST |
arr[i].reg_type = EHEA_BCMC_MULTICAST |
EHEA_BCMC_VLANID_ALL;
if (mc_entry->macaddr == 0)
arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
arr[i++].macaddr = mc_entry->macaddr;
num_registrations -= 2;
}
Expand Down Expand Up @@ -1838,17 +1840,19 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
u64 hret;
u8 reg_type;

reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST
| EHEA_BCMC_UNTAGGED;
reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED;
if (mc_mac_addr == 0)
reg_type |= EHEA_BCMC_SCOPE_ALL;

hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
port->logical_port_id,
reg_type, mc_mac_addr, 0, hcallid);
if (hret)
goto out;

reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST
| EHEA_BCMC_VLANID_ALL;
reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL;
if (mc_mac_addr == 0)
reg_type |= EHEA_BCMC_SCOPE_ALL;

hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
port->logical_port_id,
Expand Down Expand Up @@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
netdev_err(dev,
"failed enabling IFF_ALLMULTI\n");
}
} else
} else {
if (!enable) {
/* Disable ALLMULTI */
hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC);
Expand All @@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
netdev_err(dev,
"failed disabling IFF_ALLMULTI\n");
}
}
}

static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
Expand Down Expand Up @@ -2463,6 +2468,7 @@ static int ehea_down(struct net_device *dev)
return 0;

ehea_drop_multicast_list(dev);
ehea_allmulti(dev, 0);
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);

ehea_free_interrupts(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/ibm/ehea/ehea_phyp.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
void *cb_addr);

#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63)
#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(61, 63)
#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(60, 63)
#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)

Expand Down

0 comments on commit 5d38457

Please sign in to comment.