Linux wireless drivers development
 help / color / mirror / Atom feed
* ethtool_ops.set_coalesce parameters
@ 2014-09-11 13:29 Vladimir Kondratiev
  0 siblings, 0 replies; only message in thread
From: Vladimir Kondratiev @ 2014-09-11 13:29 UTC (permalink / raw)
  To: linux-wireless

Hi,

 I have question regarding ethtool_ops.set_coalesce parameters.

>From one side, documentation (include/uapi/linux/ethtool.h) states:

 * Each pair of (usecs, max_frames) fields specifies that interrupts
 * should be coalesced until
 *	(usecs > 0 && time_since_first_completion >= usecs) ||
 *	(max_frames > 0 && completed_frames >= max_frames)
 *
 * It is illegal to set both usecs and max_frames to zero as this
 * would cause interrupts to never be generated.  To disable
 * coalescing, set usecs = 0 and max_frames = 1.

So, it suggests:

 Drivers for hardware that does not support
 counting completions should validate that max_frames == !rx_usecs.

Thus, I can conclude I should verify this for every pair.

Then, same documentation states following must not be 0:
- stats_block_coalesce_usecs
- rate_sample_interval


But, I see drivers either ignore unsupported values, or check that all of it are 0,
see for example in drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c:
	/* Check for not supported parameters  */
	if ((ec->rx_coalesce_usecs_irq) ||
	    (ec->rx_max_coalesced_frames_irq) ||
	    (ec->tx_coalesce_usecs_irq) ||
	    (ec->tx_max_coalesced_frames_irq) ||
	    (ec->stats_block_coalesce_usecs) ||
	    (ec->use_adaptive_rx_coalesce) ||
	    (ec->use_adaptive_tx_coalesce) ||
	    (ec->pkt_rate_low) ||
	    (ec->rx_coalesce_usecs_low) ||
	    (ec->rx_max_coalesced_frames_low) ||
	    (ec->tx_coalesce_usecs_low) ||
	    (ec->tx_max_coalesced_frames_low) ||
	    (ec->pkt_rate_high) ||
	    (ec->rx_coalesce_usecs_high) ||
	    (ec->rx_max_coalesced_frames_high) ||
	    (ec->tx_coalesce_usecs_high) ||
	    (ec->tx_max_coalesced_frames_high) ||
	    (ec->rate_sample_interval))
		return -EOPNOTSUPP;


Bottom line, my question is: what is the right way to handle parameters in
ethtool_ops.set_coalesce?

Thanks, Vladimir

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-11 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 13:29 ethtool_ops.set_coalesce parameters Vladimir Kondratiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox