Commit 7f9e4b2a authored by Martin Habets's avatar Martin Habets Committed by Jakub Kicinski
Browse files

sfc/siena: Rename RX/TX functions to avoid conflicts with sfc



For siena use efx_siena_ as the function prefix.
Several functions are not used in Siena, so they are removed.

Use a Siena specific variable name for module parameter
efx_separate_tx_channels.
Move efx_fini_tx_queue() to avoid a forward declaration of
efx_dequeue_buffer().

Signed-off-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 71ad88f6
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -58,8 +58,9 @@ MODULE_PARM_DESC(rss_cpus, "Number of CPUs to use for Receive-Side Scaling");
 *
 * This is only used in MSI-X interrupt mode
 */
bool efx_separate_tx_channels;
module_param(efx_separate_tx_channels, bool, 0444);
bool efx_siena_separate_tx_channels;
module_param_named(efx_separate_tx_channels, efx_siena_separate_tx_channels,
		   bool, 0444);
MODULE_PARM_DESC(efx_separate_tx_channels,
		 "Use separate channels for TX and RX");

@@ -306,7 +307,7 @@ static int efx_probe_nic(struct efx_nic *efx)
	if (efx->n_channels > 1)
		netdev_rss_key_fill(efx->rss_context.rx_hash_key,
				    sizeof(efx->rss_context.rx_hash_key));
	efx_set_default_rx_indir_table(efx, &efx->rss_context);
	efx_siena_set_default_rx_indir_table(efx, &efx->rss_context);

	/* Initialise the interrupt moderation settings */
	efx->irq_mod_step_us = DIV_ROUND_UP(efx->timer_quantum_ns, 1000);
@@ -366,7 +367,7 @@ static int efx_probe_all(struct efx_nic *efx)
			   " VFs may not function\n", rc);
#endif

	rc = efx_probe_filters(efx);
	rc = efx_siena_probe_filters(efx);
	if (rc) {
		netif_err(efx, probe, efx->net_dev,
			  "failed to create filter tables\n");
@@ -380,7 +381,7 @@ static int efx_probe_all(struct efx_nic *efx)
	return 0;

 fail5:
	efx_remove_filters(efx);
	efx_siena_remove_filters(efx);
 fail4:
#ifdef CONFIG_SFC_SRIOV
	efx->type->vswitching_remove(efx);
@@ -400,7 +401,7 @@ static void efx_remove_all(struct efx_nic *efx)
	rtnl_unlock();

	efx_siena_remove_channels(efx);
	efx_remove_filters(efx);
	efx_siena_remove_filters(efx);
#ifdef CONFIG_SFC_SRIOV
	efx->type->vswitching_remove(efx);
#endif
@@ -602,7 +603,7 @@ static const struct net_device_ops efx_netdev_ops = {
	.ndo_get_phys_port_name	= efx_siena_get_phys_port_name,
	.ndo_setup_tc		= efx_siena_setup_tc,
#ifdef CONFIG_RFS_ACCEL
	.ndo_rx_flow_steer	= efx_filter_rfs,
	.ndo_rx_flow_steer	= efx_siena_filter_rfs,
#endif
	.ndo_xdp_xmit		= efx_xdp_xmit,
	.ndo_bpf		= efx_xdp
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ static inline void efx_rx_flush_packet(struct efx_channel *channel)
 * TSO skbs.
 */
#define EFX_RXQ_MIN_ENT		128U
#define EFX_TXQ_MIN_ENT(efx)	(2 * efx_tx_max_skb_descs(efx))
#define EFX_TXQ_MIN_ENT(efx)	(2 * efx_siena_tx_max_skb_descs(efx))

/* All EF10 architecture NICs steal one bit of the DMAQ size for various
 * other purposes when counting TxQ entries, so we halve the queue size.
@@ -78,7 +78,7 @@ static inline bool efx_rss_enabled(struct efx_nic *efx)
 *
 * 2. If the existing filters have higher priority, return -%EPERM.
 *
 * 3. If !efx_filter_is_mc_recipient(@spec), or the NIC does not
 * 3. If !efx_siena_filter_is_mc_recipient(@spec), or the NIC does not
 *    support delivery to multiple recipients, return -%EEXIST.
 *
 * This implies that filters for multiple multicast recipients must
+18 −17
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
	int n_xdp_tx;
	int n_xdp_ev;

	if (efx_separate_tx_channels)
	if (efx_siena_separate_tx_channels)
		n_channels *= 2;
	n_channels += extra_channels;

@@ -220,7 +220,7 @@ static int efx_allocate_msix_channels(struct efx_nic *efx,
	/* Ignore XDP tx channels when creating rx channels. */
	n_channels -= efx->n_xdp_channels;

	if (efx_separate_tx_channels) {
	if (efx_siena_separate_tx_channels) {
		efx->n_tx_channels =
			min(max(n_channels / 2, 1U),
			    efx->max_tx_channels);
@@ -321,7 +321,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)

	/* Assume legacy interrupts */
	if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) {
		efx->n_channels = 1 + (efx_separate_tx_channels ? 1 : 0);
		efx->n_channels = 1 + (efx_siena_separate_tx_channels ? 1 : 0);
		efx->n_rx_channels = 1;
		efx->n_tx_channels = 1;
		efx->n_xdp_channels = 0;
@@ -521,7 +521,8 @@ static void efx_filter_rfs_expire(struct work_struct *data)
	channel = container_of(dwork, struct efx_channel, filter_work);
	time = jiffies - channel->rfs_last_expiry;
	quota = channel->rfs_filter_count * time / (30 * HZ);
	if (quota >= 20 && __efx_filter_rfs_expire(channel, min(channel->rfs_filter_count, quota)))
	if (quota >= 20 && __efx_siena_filter_rfs_expire(channel,
					min(channel->rfs_filter_count, quota)))
		channel->rfs_last_expiry += time;
	/* Ensure we do more work eventually even if NAPI poll is not happening */
	schedule_delayed_work(dwork, 30 * HZ);
@@ -558,7 +559,7 @@ static struct efx_channel *efx_alloc_channel(struct efx_nic *efx, int i)

	rx_queue = &channel->rx_queue;
	rx_queue->efx = efx;
	timer_setup(&rx_queue->slow_fill, efx_rx_slow_fill, 0);
	timer_setup(&rx_queue->slow_fill, efx_siena_rx_slow_fill, 0);

	return channel;
}
@@ -631,7 +632,7 @@ struct efx_channel *efx_copy_channel(const struct efx_channel *old_channel)
	rx_queue = &channel->rx_queue;
	rx_queue->buffer = NULL;
	memset(&rx_queue->rxd, 0, sizeof(rx_queue->rxd));
	timer_setup(&rx_queue->slow_fill, efx_rx_slow_fill, 0);
	timer_setup(&rx_queue->slow_fill, efx_siena_rx_slow_fill, 0);
#ifdef CONFIG_RFS_ACCEL
	INIT_DELAYED_WORK(&channel->filter_work, efx_filter_rfs_expire);
#endif
@@ -657,13 +658,13 @@ static int efx_probe_channel(struct efx_channel *channel)
		goto fail;

	efx_for_each_channel_tx_queue(tx_queue, channel) {
		rc = efx_probe_tx_queue(tx_queue);
		rc = efx_siena_probe_tx_queue(tx_queue);
		if (rc)
			goto fail;
	}

	efx_for_each_channel_rx_queue(rx_queue, channel) {
		rc = efx_probe_rx_queue(rx_queue);
		rc = efx_siena_probe_rx_queue(rx_queue);
		if (rc)
			goto fail;
	}
@@ -751,9 +752,9 @@ void efx_siena_remove_channel(struct efx_channel *channel)
		  "destroy chan %d\n", channel->channel);

	efx_for_each_channel_rx_queue(rx_queue, channel)
		efx_remove_rx_queue(rx_queue);
		efx_siena_remove_rx_queue(rx_queue);
	efx_for_each_channel_tx_queue(tx_queue, channel)
		efx_remove_tx_queue(tx_queue);
		efx_siena_remove_tx_queue(tx_queue);
	efx_remove_eventq(channel);
	channel->type->post_remove(channel);
}
@@ -963,7 +964,7 @@ int efx_siena_set_channels(struct efx_nic *efx)
	int rc;

	efx->tx_channel_offset =
		efx_separate_tx_channels ?
		efx_siena_separate_tx_channels ?
		efx->n_channels - efx->n_tx_channels : 0;

	if (efx->xdp_tx_queue_count) {
@@ -1130,15 +1131,15 @@ void efx_siena_start_channels(struct efx_nic *efx)

	efx_for_each_channel_rev(channel, efx) {
		efx_for_each_channel_tx_queue(tx_queue, channel) {
			efx_init_tx_queue(tx_queue);
			efx_siena_init_tx_queue(tx_queue);
			atomic_inc(&efx->active_queues);
		}

		efx_for_each_channel_rx_queue(rx_queue, channel) {
			efx_init_rx_queue(rx_queue);
			efx_siena_init_rx_queue(rx_queue);
			atomic_inc(&efx->active_queues);
			efx_siena_stop_eventq(channel);
			efx_fast_push_rx_descriptors(rx_queue, false);
			efx_siena_fast_push_rx_descriptors(rx_queue, false);
			efx_siena_start_eventq(channel);
		}

@@ -1184,9 +1185,9 @@ void efx_siena_stop_channels(struct efx_nic *efx)

	efx_for_each_channel(channel, efx) {
		efx_for_each_channel_rx_queue(rx_queue, channel)
			efx_fini_rx_queue(rx_queue);
			efx_siena_fini_rx_queue(rx_queue);
		efx_for_each_channel_tx_queue(tx_queue, channel)
			efx_fini_tx_queue(tx_queue);
			efx_siena_fini_tx_queue(tx_queue);
	}
}

@@ -1228,7 +1229,7 @@ static int efx_process_channel(struct efx_channel *channel, int budget)
			efx_channel_get_rx_queue(channel);

		efx_rx_flush_packet(channel);
		efx_fast_push_rx_descriptors(rx_queue, true);
		efx_siena_fast_push_rx_descriptors(rx_queue, true);
	}

	/* Update BQL */
+2 −2
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ static void efx_start_datapath(struct efx_nic *efx)
		efx->rx_buffer_order = get_order(rx_buf_len);
	}

	efx_rx_config_page_split(efx);
	efx_siena_rx_config_page_split(efx);
	if (efx->rx_buffer_order)
		netif_dbg(efx, drv, efx->net_dev,
			  "RX buf len=%u; page order=%u batch=%u\n",
@@ -428,7 +428,7 @@ static void efx_start_datapath(struct efx_nic *efx)
	 * the ring completely.  We wake it when half way back to
	 * empty.
	 */
	efx->txq_stop_thresh = efx->txq_entries - efx_tx_max_skb_descs(efx);
	efx->txq_stop_thresh = efx->txq_entries - efx_siena_tx_max_skb_descs(efx);
	efx->txq_wake_thresh = efx->txq_stop_thresh / 2;

	/* Initialise the channels */
+8 −7
Original line number Diff line number Diff line
@@ -824,7 +824,8 @@ int efx_ethtool_get_rxnfc(struct net_device *net_dev,

		mutex_lock(&efx->rss_lock);
		if (info->flow_type & FLOW_RSS && info->rss_context) {
			ctx = efx_find_rss_context_entry(efx, info->rss_context);
			ctx = efx_siena_find_rss_context_entry(efx,
							info->rss_context);
			if (!ctx) {
				rc = -ENOENT;
				goto out_unlock;
@@ -1213,7 +1214,7 @@ int efx_ethtool_get_rxfh_context(struct net_device *net_dev, u32 *indir,
		return -EOPNOTSUPP;

	mutex_lock(&efx->rss_lock);
	ctx = efx_find_rss_context_entry(efx, rss_context);
	ctx = efx_siena_find_rss_context_entry(efx, rss_context);
	if (!ctx) {
		rc = -ENOENT;
		goto out_unlock;
@@ -1257,18 +1258,18 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
			rc = -EINVAL;
			goto out_unlock;
		}
		ctx = efx_alloc_rss_context_entry(efx);
		ctx = efx_siena_alloc_rss_context_entry(efx);
		if (!ctx) {
			rc = -ENOMEM;
			goto out_unlock;
		}
		ctx->context_id = EFX_MCDI_RSS_CONTEXT_INVALID;
		/* Initialise indir table and key to defaults */
		efx_set_default_rx_indir_table(efx, ctx);
		efx_siena_set_default_rx_indir_table(efx, ctx);
		netdev_rss_key_fill(ctx->rx_hash_key, sizeof(ctx->rx_hash_key));
		allocated = true;
	} else {
		ctx = efx_find_rss_context_entry(efx, *rss_context);
		ctx = efx_siena_find_rss_context_entry(efx, *rss_context);
		if (!ctx) {
			rc = -ENOENT;
			goto out_unlock;
@@ -1279,7 +1280,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev,
		/* delete this context */
		rc = efx->type->rx_push_rss_context_config(efx, ctx, NULL, NULL);
		if (!rc)
			efx_free_rss_context_entry(ctx);
			efx_siena_free_rss_context_entry(ctx);
		goto out_unlock;
	}

@@ -1290,7 +1291,7 @@ int efx_ethtool_set_rxfh_context(struct net_device *net_dev,

	rc = efx->type->rx_push_rss_context_config(efx, ctx, indir, key);
	if (rc && allocated)
		efx_free_rss_context_entry(ctx);
		efx_siena_free_rss_context_entry(ctx);
	else
		*rss_context = ctx->user_id;
out_unlock:
Loading