[Differential] D24937: Add tunable net.iflib.tx_update_freq to set transmit descriptor update frequency

markj (Mark Johnston) phabric-noreply at FreeBSD.org
Wed Jun 24 17:09:30 UTC 2020


markj added inline comments.

INLINE COMMENTS

> aleksandr.fedorov_itglobal.com wrote in iflib.c:2916
> I am worried that if the user sets the value to 1, then this will lead to division by zero and to kernel panic. I think additional checks are needed.

Well, the division is performed first, so the only value that should cause a panic is 0, but yes, we need a sysctl handler to validate this. The tricky thing is that the set of valid values for ift_update_freq depends on the size of the hardware transmit queues, which of course can vary. So it's not clear to me that a global sysctl really makes sense.

> iflib.c:589
>  		   &iflib_no_tx_batch, 0, "minimize transmit latency at the possible expense of throughput");
> +int iflib_tx_update_freq = IFLIB_DEFAULT_TX_UPDATE_FREQ;
> +SYSCTL_UINT(_net_iflib, OID_AUTO, tx_update_freq, CTLFLAG_RWTUN,

Note, ift_update_freq has type uint8_t.

> iflib.c:592
> +		   &iflib_tx_update_freq, IFLIB_DEFAULT_TX_UPDATE_FREQ,
> +		   "tramsmit descriptor updates per second");
>  

The description is wrong. From my reading of the code, which may be incorrect, this tunable really controls the number of outstanding buffers queued for transmit before we make them visible to the hardware. It also controls the rate at which the hardware will generate interrupts in response to completed transmits. The precise relationship is hard to explain.

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST ACTION
  https://reviews.freebsd.org/D24937/new/

REVISION DETAIL
  https://reviews.freebsd.org/D24937

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: neel_neelc.org, shurd, #iflib
Cc: markj, gallatin, aleksandr.fedorov_itglobal.com, koobs, imp, ae, melifaro, #contributor_reviews_base, freebsd-net-list, mmacy, kpraveen.lkml_gmail.com, marcnarc_gmail.com, simonvella_gmail.com, novice_techie.com, tommi.pernila_iki.fi, krzysztof.galazka_intel.com


More information about the freebsd-net mailing list