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
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to