ice: move prefetch enable to ice_setup_rx_ctx
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 10 Dec 2024 20:27:18 +0000 (12:27 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Dec 2024 04:13:01 +0000 (20:13 -0800)
commitac001acc4d353455dd9f7b8e74d2f9c01e83ace2
treeca8bd08795107badb776d9ab71eb19e45ef8d710
parentf72588a4267b2211d18328433035b629d24f6f03
ice: move prefetch enable to ice_setup_rx_ctx

The ice_write_rxq_ctx() function is responsible for programming the Rx
Queue context into hardware. It receives the configuration in unpacked form
via the ice_rlan_ctx structure.

This function unconditionally modifies the context to set the prefetch
enable bit. This was done by commit c31a5c25bb19 ("ice: Always set prefena
when configuring an Rx queue"). Setting this bit makes sense, since
prefetching descriptors is almost always the preferred behavior.

However, the ice_write_rxq_ctx() function is not the place that actually
defines the queue context. We initialize the Rx Queue context in
ice_setup_rx_ctx(). It is surprising to have the Rx queue context changed
by a function who's responsibility is to program the given context to
hardware.

Following the principle of least surprise, move the setting of the prefetch
enable bit out of ice_write_rxq_ctx() and into the ice_setup_rx_ctx().

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241210-packing-pack-fields-and-ice-implementation-v10-9-ee56a47479ac@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/ice/ice_base.c
drivers/net/ethernet/intel/ice/ice_common.c