Commit f771314d authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Tony Nguyen
Browse files

idpf: compile singleq code only under default-n CONFIG_IDPF_SINGLEQ



Currently, all HW supporting idpf supports the singleq model, but none
of it advertises it by default, as splitq is supported and preferred
for multiple reasons. Still, this almost dead code often times adds
hotpath branches and redundant cacheline accesses.
While it can't currently be removed, add CONFIG_IDPF_SINGLEQ and build
the singleq code only when it's enabled manually. This corresponds to
-10 Kb of object code size and a good bunch of hotpath checks.
idpf_is_queue_model_split() works as a gate and compiles out to `true`
when the config option is disabled.

Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 14f662b4
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -384,17 +384,6 @@ config IGC_LEDS
	  Optional support for controlling the NIC LED's with the netdev
	  LED trigger.

config IDPF
	tristate "Intel(R) Infrastructure Data Path Function Support"
	depends on PCI_MSI
	select DIMLIB
	select PAGE_POOL
	select PAGE_POOL_STATS
	help
	  This driver supports Intel(R) Infrastructure Data Path Function
	  devices.

	  To compile this driver as a module, choose M here. The module
	  will be called idpf.
source "drivers/net/ethernet/intel/idpf/Kconfig"

endif # NET_VENDOR_INTEL
+27 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2024 Intel Corporation

config IDPF
	tristate "Intel(R) Infrastructure Data Path Function Support"
	depends on PCI_MSI
	select DIMLIB
	select PAGE_POOL
	select PAGE_POOL_STATS
	help
	  This driver supports Intel(R) Infrastructure Data Path Function
	  devices.

	  To compile this driver as a module, choose M here. The module
	  will be called idpf.

if IDPF

config IDPF_SINGLEQ
	bool "idpf singleq support"
	help
	  This option enables support for legacy single Rx/Tx queues w/no
	  completion and fill queues. Only enable if you have hardware which
	  wants to work in this mode as it increases the driver size and adds
	  runtme checks on hotpath.

endif # IDPF
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@ idpf-y := \
	idpf_ethtool.o		\
	idpf_lib.o		\
	idpf_main.o		\
	idpf_singleq_txrx.o	\
	idpf_txrx.o		\
	idpf_virtchnl.o 	\
	idpf_vf_dev.o

idpf-$(CONFIG_IDPF_SINGLEQ)	+= idpf_singleq_txrx.o
+2 −1
Original line number Diff line number Diff line
@@ -599,7 +599,8 @@ struct idpf_adapter {
 */
static inline int idpf_is_queue_model_split(u16 q_model)
{
	return q_model == VIRTCHNL2_QUEUE_MODEL_SPLIT;
	return !IS_ENABLED(CONFIG_IDPF_SINGLEQ) ||
	       q_model == VIRTCHNL2_QUEUE_MODEL_SPLIT;
}

#define idpf_is_cap_ena(adapter, field, flag) \
+1 −1
Original line number Diff line number Diff line
@@ -1309,7 +1309,7 @@ static void idpf_vport_calc_numq_per_grp(struct idpf_vport *vport,
static void idpf_rxq_set_descids(const struct idpf_vport *vport,
				 struct idpf_rx_queue *q)
{
	if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) {
	if (idpf_is_queue_model_split(vport->rxq_model)) {
		q->rxdids = VIRTCHNL2_RXDID_2_FLEX_SPLITQ_M;
	} else {
		if (vport->base_rxd)
Loading