Commit b941ea05 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller
Browse files

ionic: flatten calls to set-rx-mode



Since only two functions call through ionic_set_rx_mode(), one
that can sleep and one that can't, we can split the function
and put the bits of code into the callers.  This removes an
unnecessary calling layer.

Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56c8a53b
Loading
Loading
Loading
Loading
+9 −18
Original line number Diff line number Diff line
@@ -1444,12 +1444,11 @@ static void ionic_lif_rx_mode(struct ionic_lif *lif)
	mutex_unlock(&lif->config_lock);
}

static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep)
static void ionic_ndo_set_rx_mode(struct net_device *netdev)
{
	struct ionic_lif *lif = netdev_priv(netdev);
	struct ionic_deferred_work *work;

	if (!can_sleep) {
	work = kzalloc(sizeof(*work), GFP_ATOMIC);
	if (!work) {
		netdev_err(lif->netdev, "rxmode change dropped\n");
@@ -1458,14 +1457,6 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep)
	work->type = IONIC_DW_TYPE_RX_MODE;
	netdev_dbg(lif->netdev, "deferred: rx_mode\n");
	ionic_lif_deferred_enqueue(&lif->deferred, work);
	} else {
		ionic_lif_rx_mode(lif);
	}
}

static void ionic_ndo_set_rx_mode(struct net_device *netdev)
{
	ionic_set_rx_mode(netdev, CAN_NOT_SLEEP);
}

static __le64 ionic_netdev_features_to_nic(netdev_features_t features)
@@ -2101,7 +2092,7 @@ static int ionic_txrx_init(struct ionic_lif *lif)
	if (lif->netdev->features & NETIF_F_RXHASH)
		ionic_lif_rss_init(lif);

	ionic_set_rx_mode(lif->netdev, CAN_SLEEP);
	ionic_lif_rx_mode(lif);

	return 0;