Commit 5d384574 authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by David S. Miller

ehea: fix allmulticast support

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: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 62ad6fcd
...@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void) ...@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void)
arr[i].adh = adapter->handle; arr[i].adh = adapter->handle;
arr[i].port_id = port->logical_port_id; arr[i].port_id = port->logical_port_id;
arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | arr[i].reg_type = EHEA_BCMC_MULTICAST |
EHEA_BCMC_MULTICAST |
EHEA_BCMC_UNTAGGED; EHEA_BCMC_UNTAGGED;
if (mc_entry->macaddr == 0)
arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
arr[i++].macaddr = mc_entry->macaddr; arr[i++].macaddr = mc_entry->macaddr;
arr[i].adh = adapter->handle; arr[i].adh = adapter->handle;
arr[i].port_id = port->logical_port_id; arr[i].port_id = port->logical_port_id;
arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | arr[i].reg_type = EHEA_BCMC_MULTICAST |
EHEA_BCMC_MULTICAST |
EHEA_BCMC_VLANID_ALL; EHEA_BCMC_VLANID_ALL;
if (mc_entry->macaddr == 0)
arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
arr[i++].macaddr = mc_entry->macaddr; arr[i++].macaddr = mc_entry->macaddr;
num_registrations -= 2; num_registrations -= 2;
} }
...@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, ...@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
u64 hret; u64 hret;
u8 reg_type; u8 reg_type;
reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED;
| EHEA_BCMC_UNTAGGED; if (mc_mac_addr == 0)
reg_type |= EHEA_BCMC_SCOPE_ALL;
hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
port->logical_port_id, port->logical_port_id,
...@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, ...@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
if (hret) if (hret)
goto out; goto out;
reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL;
| EHEA_BCMC_VLANID_ALL; if (mc_mac_addr == 0)
reg_type |= EHEA_BCMC_SCOPE_ALL;
hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
port->logical_port_id, port->logical_port_id,
...@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) ...@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
netdev_err(dev, netdev_err(dev,
"failed enabling IFF_ALLMULTI\n"); "failed enabling IFF_ALLMULTI\n");
} }
} else } else {
if (!enable) { if (!enable) {
/* Disable ALLMULTI */ /* Disable ALLMULTI */
hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC); hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC);
...@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) ...@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
netdev_err(dev, netdev_err(dev,
"failed disabling IFF_ALLMULTI\n"); "failed disabling IFF_ALLMULTI\n");
} }
}
} }
static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
...@@ -2463,6 +2468,7 @@ static int ehea_down(struct net_device *dev) ...@@ -2463,6 +2468,7 @@ static int ehea_down(struct net_device *dev)
return 0; return 0;
ehea_drop_multicast_list(dev); ehea_drop_multicast_list(dev);
ehea_allmulti(dev, 0);
ehea_broadcast_reg_helper(port, H_DEREG_BCMC); ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
ehea_free_interrupts(dev); ehea_free_interrupts(dev);
......
...@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num, ...@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
void *cb_addr); void *cb_addr);
#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63) #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_MACADDR EHEA_BMASK_IBM(16, 63)
#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63) #define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment