Re: [Intel-wired-lan] [PATCH RFC iwl-next 07/12] idpf: compile singleq code only under default-n CONFIG_IDPF_SINGLEQ

From: Alexander Lobakin
Date: Thu May 16 2024 - 06:42:06 EST


From: Tantilov, Emil S <emil.s.tantilov@xxxxxxxxx>
Date: Mon, 13 May 2024 19:01:30 -0700

> On 5/10/2024 8:26 AM, Alexander Lobakin wrote:
>> Currently, there's no HW supporting idpf in the singleq model. Still,
>> this dead code is supported by the driver and often times add hotpath
> The driver supports the HW in single queue mode (not the other way
> around), so I would like to point out that all current HW on which idpf
> can load supports this model.

But no hardware currently wants to work in this mode.

>
>> 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.
> Compiling singleq out does introduce an issue for the users that would
> end up without a netdev if the driver is loaded on a setup where the

There will be a message in dmesg saying that the support is not compiled in.

> Control Plane is configured for singlq mode. In that scenario the user

Any real world examples where the CP requests singleq mode?

> will have to recompile the driver/kernel in order to load the driver
> successfully.

All distros will have it enabled as usually.

>
>>
>> Signed-off-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>
>> ---
>>   drivers/net/ethernet/intel/Kconfig            | 13 +---------
>>   drivers/net/ethernet/intel/idpf/Kconfig       | 26 +++++++++++++++++++
>>   drivers/net/ethernet/intel/idpf/Makefile      |  3 ++-
>>   drivers/net/ethernet/intel/idpf/idpf.h        |  3 ++-
>>   drivers/net/ethernet/intel/idpf/idpf_txrx.c   |  2 +-
>>   .../net/ethernet/intel/idpf/idpf_virtchnl.c   | 15 ++++++++---
>>   6 files changed, 43 insertions(+), 19 deletions(-)
>>   create mode 100644 drivers/net/ethernet/intel/idpf/Kconfig
>>
>> diff --git a/drivers/net/ethernet/intel/Kconfig
>> b/drivers/net/ethernet/intel/Kconfig
>> index e0287fbd501d..0375c7448a57 100644
>> --- a/drivers/net/ethernet/intel/Kconfig
>> +++ b/drivers/net/ethernet/intel/Kconfig
>> @@ -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
>> diff --git a/drivers/net/ethernet/intel/idpf/Kconfig
>> b/drivers/net/ethernet/intel/idpf/Kconfig
>> new file mode 100644
>> index 000000000000..bee83a40f218
>> --- /dev/null
>> +++ b/drivers/net/ethernet/intel/idpf/Kconfig
>> @@ -0,0 +1,26 @@
>> +# 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 such hardware
> This description is not accurate - all HW supports single queue. The
> configuration is done by the Control Plane. Furthermore, without access
> to the Control Plane config, there is no way for the user to know what
> mode is enabled.

I can rephrase to "if your hardware is configured to work in singleq mode".

Anyway, during both the internal review and this one, no one still gave
me a real world example where the HW wants singleq mode.
When the idpf made it into the kernel, singleq didn't work, which was
proven by several patches from me which fixed critical issues.
If it's not tested and no HW wants this when splitq is available, why
decrease perf by dead code?

>
> Thanks,
> Emil

Thanks,
Olek