* invalid requirement from ethtool?
@ 2011-07-26 12:42 Eli Cohen
2011-07-28 5:43 ` David Miller
2011-08-15 17:24 ` Ben Hutchings
0 siblings, 2 replies; 8+ messages in thread
From: Eli Cohen @ 2011-07-26 12:42 UTC (permalink / raw)
To: davem; +Cc: netdev
Hi,
I see the following text in include/linux/ethtool.h and wonder what is
the reasoning for requiring that both params cannot be zero. I could
not track when and who inserted this text as it dates before git was
used to track kernel code, but my feeling is that is related to a
specific hardware limitation.
/* How many packets to delay an RX interrupt after
* a packet arrives. If 0, only rx_coalesce_usecs is
* used. It is illegal to set both usecs and max frames
* to zero as this would cause RX interrupts to never be
* generated.
*/
__u32 rx_max_coalesced_frames;
/* How many packets to delay a TX interrupt after
* a packet is sent. If 0, only tx_coalesce_usecs is
* used. It is illegal to set both usecs and max frames
* to zero as this would cause TX interrupts to never be
* generated.
*/
__u32 tx_max_coalesced_frames;
I found this in tg3 driver:
/* No rx interrupts will be generated if both are zero */
if ((ec->rx_coalesce_usecs == 0) &&
(ec->rx_max_coalesced_frames == 0))
return -EINVAL;
However, bnx2 for example allows setting both to zero.
I think both params zero should be allowed and mean coalescing is not
operational, thus we can remove these comments from ethtool.h
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: invalid requirement from ethtool? 2011-07-26 12:42 invalid requirement from ethtool? Eli Cohen @ 2011-07-28 5:43 ` David Miller 2011-07-28 7:23 ` Eli Cohen 2011-08-15 17:24 ` Ben Hutchings 1 sibling, 1 reply; 8+ messages in thread From: David Miller @ 2011-07-28 5:43 UTC (permalink / raw) To: eli; +Cc: netdev From: Eli Cohen <eli@dev.mellanox.co.il> Date: Tue, 26 Jul 2011 15:42:22 +0300 > I think both params zero should be allowed and mean coalescing is not > operational, thus we can remove these comments from ethtool.h The existing precendence has existed for more than 10 years. You can't just change it like this. You'll need to find a new way to encode "disabled" coalescing. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-07-28 5:43 ` David Miller @ 2011-07-28 7:23 ` Eli Cohen 2011-07-28 7:37 ` David Miller 0 siblings, 1 reply; 8+ messages in thread From: Eli Cohen @ 2011-07-28 7:23 UTC (permalink / raw) To: David Miller; +Cc: netdev On Wed, Jul 27, 2011 at 10:43:09PM -0700, David Miller wrote: > From: Eli Cohen <eli@dev.mellanox.co.il> > Date: Tue, 26 Jul 2011 15:42:22 +0300 > > > I think both params zero should be allowed and mean coalescing is not > > operational, thus we can remove these comments from ethtool.h > > The existing precendence has existed for more than 10 years. You can't > just change it like this. > > You'll need to find a new way to encode "disabled" coalescing. I can't see the text explicitly specifies how to "disable" coalescing. If I ignore the specific comment that disallows both params 0, I could interpret the text such that when they're both zero, the feature is disabled. BTW, I checked also Intel 10GBE Nic (ixgbe) driver and it allows setting both 0. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-07-28 7:23 ` Eli Cohen @ 2011-07-28 7:37 ` David Miller 2011-07-28 10:22 ` Ben Hutchings 0 siblings, 1 reply; 8+ messages in thread From: David Miller @ 2011-07-28 7:37 UTC (permalink / raw) To: eli; +Cc: netdev From: Eli Cohen <eli@dev.mellanox.co.il> Date: Thu, 28 Jul 2011 10:23:26 +0300 > On Wed, Jul 27, 2011 at 10:43:09PM -0700, David Miller wrote: >> From: Eli Cohen <eli@dev.mellanox.co.il> >> Date: Tue, 26 Jul 2011 15:42:22 +0300 >> >> > I think both params zero should be allowed and mean coalescing is not >> > operational, thus we can remove these comments from ethtool.h >> >> The existing precendence has existed for more than 10 years. You can't >> just change it like this. >> >> You'll need to find a new way to encode "disabled" coalescing. > > I can't see the text explicitly specifies how to "disable" coalescing. > If I ignore the specific comment that disallows both params 0, I could > interpret the text such that when they're both zero, the feature is > disabled. The documentation does not determine what the rules are, the cpu does not execute the documentation it executes the code, and that's what determines the rules. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-07-28 7:37 ` David Miller @ 2011-07-28 10:22 ` Ben Hutchings 2011-07-28 14:55 ` Eli Cohen 0 siblings, 1 reply; 8+ messages in thread From: Ben Hutchings @ 2011-07-28 10:22 UTC (permalink / raw) To: David Miller; +Cc: eli, netdev On Thu, 2011-07-28 at 00:37 -0700, David Miller wrote: > From: Eli Cohen <eli@dev.mellanox.co.il> > Date: Thu, 28 Jul 2011 10:23:26 +0300 > > > On Wed, Jul 27, 2011 at 10:43:09PM -0700, David Miller wrote: > >> From: Eli Cohen <eli@dev.mellanox.co.il> > >> Date: Tue, 26 Jul 2011 15:42:22 +0300 > >> > >> > I think both params zero should be allowed and mean coalescing is not > >> > operational, thus we can remove these comments from ethtool.h > >> > >> The existing precendence has existed for more than 10 years. You can't > >> just change it like this. > >> > >> You'll need to find a new way to encode "disabled" coalescing. > > > > I can't see the text explicitly specifies how to "disable" coalescing. > > If I ignore the specific comment that disallows both params 0, I could > > interpret the text such that when they're both zero, the feature is > > disabled. > > The documentation does not determine what the rules are, the cpu > does not execute the documentation it executes the code, and that's > what determines the rules. The ethtool core doesn't check the values in struct ethtool_coalesce, so the rules are really driver-specific. Ben. -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-07-28 10:22 ` Ben Hutchings @ 2011-07-28 14:55 ` Eli Cohen 0 siblings, 0 replies; 8+ messages in thread From: Eli Cohen @ 2011-07-28 14:55 UTC (permalink / raw) To: Ben Hutchings; +Cc: David Miller, netdev On Thu, Jul 28, 2011 at 12:22:33PM +0200, Ben Hutchings wrote: > > The ethtool core doesn't check the values in struct ethtool_coalesce, so > the rules are really driver-specific. > Exactly. That's why I think those comments are not in place. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-07-26 12:42 invalid requirement from ethtool? Eli Cohen 2011-07-28 5:43 ` David Miller @ 2011-08-15 17:24 ` Ben Hutchings 2011-08-15 20:49 ` David Miller 1 sibling, 1 reply; 8+ messages in thread From: Ben Hutchings @ 2011-08-15 17:24 UTC (permalink / raw) To: Eli Cohen, David Miller; +Cc: netdev On Tue, 2011-07-26 at 15:42 +0300, Eli Cohen wrote: > Hi, > I see the following text in include/linux/ethtool.h and wonder what is > the reasoning for requiring that both params cannot be zero. I could > not track when and who inserted this text as it dates before git was > used to track kernel code, but my feeling is that is related to a > specific hardware limitation. > > /* How many packets to delay an RX interrupt after > * a packet arrives. If 0, only rx_coalesce_usecs is > * used. It is illegal to set both usecs and max frames > * to zero as this would cause RX interrupts to never be > * generated. > */ > __u32 rx_max_coalesced_frames; > > /* How many packets to delay a TX interrupt after > * a packet is sent. If 0, only tx_coalesce_usecs is > * used. It is illegal to set both usecs and max frames > * to zero as this would cause TX interrupts to never be > * generated. > */ > __u32 tx_max_coalesced_frames; > > I found this in tg3 driver: > /* No rx interrupts will be generated if both are zero */ > if ((ec->rx_coalesce_usecs == 0) && > (ec->rx_max_coalesced_frames == 0)) > return -EINVAL; > > However, bnx2 for example allows setting both to zero. > > I think both params zero should be allowed and mean coalescing is not > operational, thus we can remove these comments from ethtool.h If coalescing is not operational, the maximum number of completions before an interrupt is 1. So logically {rx,tx}_max_coalesced_frames should be 1, right? Although the comment does say 'How many packets ... after ...' which implies that the value of the field must be 1 less than the wanted maximum, i.e. 0, which is supposedly invalid. The first implementation of ethtool coalescing control was in tg3, so it should be a useful reference. David, I know you maintained tg3 for some time so I assume you have a hardware reference. Can you confirm whether a value of 1 in HOSTCC_{RX,TX}MAX_FRAMES results in an interrupt after 1 completion or after 2 completions? Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: invalid requirement from ethtool? 2011-08-15 17:24 ` Ben Hutchings @ 2011-08-15 20:49 ` David Miller 0 siblings, 0 replies; 8+ messages in thread From: David Miller @ 2011-08-15 20:49 UTC (permalink / raw) To: bhutchings; +Cc: eli, netdev From: Ben Hutchings <bhutchings@solarflare.com> Date: Mon, 15 Aug 2011 18:24:00 +0100 > David, I know you maintained tg3 for some time so I assume you have a > hardware reference. Can you confirm whether a value of 1 in > HOSTCC_{RX,TX}MAX_FRAMES results in an interrupt after 1 completion or > after 2 completions? A value of 1 results in an interrupt after 1 completion. If you put a zero there, the packet count comparison never triggers. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-08-15 20:52 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-07-26 12:42 invalid requirement from ethtool? Eli Cohen 2011-07-28 5:43 ` David Miller 2011-07-28 7:23 ` Eli Cohen 2011-07-28 7:37 ` David Miller 2011-07-28 10:22 ` Ben Hutchings 2011-07-28 14:55 ` Eli Cohen 2011-08-15 17:24 ` Ben Hutchings 2011-08-15 20:49 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox