ionic: use mc sync for multicast filters
We should be using the multicast sync routines for the multicast
filters. Also, let's just flatten the logic a bit and pull
the small unicast routine back into ionic_set_rx_mode().
Fixes: 1800eee166 ("net: ionic: Replace in_interrupt() usage.")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
a8205ab620
commit
e0243e1966
@@ -1149,15 +1149,6 @@ static void _ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ionic_dev_uc_sync(struct net_device *netdev, bool from_ndo)
|
|
||||||
{
|
|
||||||
if (from_ndo)
|
|
||||||
__dev_uc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del);
|
|
||||||
else
|
|
||||||
__dev_uc_sync(netdev, ionic_addr_add, ionic_addr_del);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
|
static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
|
||||||
{
|
{
|
||||||
struct ionic_lif *lif = netdev_priv(netdev);
|
struct ionic_lif *lif = netdev_priv(netdev);
|
||||||
@@ -1177,7 +1168,10 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
|
|||||||
* we remove our overflow flag and check the netdev flags
|
* we remove our overflow flag and check the netdev flags
|
||||||
* to see if we can disable NIC PROMISC
|
* to see if we can disable NIC PROMISC
|
||||||
*/
|
*/
|
||||||
ionic_dev_uc_sync(netdev, from_ndo);
|
if (from_ndo)
|
||||||
|
__dev_uc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del);
|
||||||
|
else
|
||||||
|
__dev_uc_sync(netdev, ionic_addr_add, ionic_addr_del);
|
||||||
nfilters = le32_to_cpu(lif->identity->eth.max_ucast_filters);
|
nfilters = le32_to_cpu(lif->identity->eth.max_ucast_filters);
|
||||||
if (netdev_uc_count(netdev) + 1 > nfilters) {
|
if (netdev_uc_count(netdev) + 1 > nfilters) {
|
||||||
rx_mode |= IONIC_RX_MODE_F_PROMISC;
|
rx_mode |= IONIC_RX_MODE_F_PROMISC;
|
||||||
@@ -1189,7 +1183,10 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* same for multicast */
|
/* same for multicast */
|
||||||
ionic_dev_uc_sync(netdev, from_ndo);
|
if (from_ndo)
|
||||||
|
__dev_mc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del);
|
||||||
|
else
|
||||||
|
__dev_mc_sync(netdev, ionic_addr_add, ionic_addr_del);
|
||||||
nfilters = le32_to_cpu(lif->identity->eth.max_mcast_filters);
|
nfilters = le32_to_cpu(lif->identity->eth.max_mcast_filters);
|
||||||
if (netdev_mc_count(netdev) > nfilters) {
|
if (netdev_mc_count(netdev) > nfilters) {
|
||||||
rx_mode |= IONIC_RX_MODE_F_ALLMULTI;
|
rx_mode |= IONIC_RX_MODE_F_ALLMULTI;
|
||||||
|
|||||||
Reference in New Issue
Block a user