diff mbox series

examples/l3fwd: change mq-mode on single queue devices

Message ID 20210510165319.9153-1-heinrich.kuhn@netronome.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers show
Series examples/l3fwd: change mq-mode on single queue devices | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/checkpatch warning coding style issues

Commit Message

Heinrich Kuhn May 10, 2021, 4:53 p.m. UTC
From: "Chaoyong.He" <chaoyong.he@corigine.com>

Set the Rx multi-queue mode to NONE when configuring a port that is
associated with hardware that only supports a single Rx queue.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 examples/l3fwd/main.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Bruce Richardson May 12, 2021, 4:32 p.m. UTC | #1
On Mon, May 10, 2021 at 06:53:19PM +0200, Heinrich Kuhn wrote:
> From: "Chaoyong.He" <chaoyong.he@corigine.com>
> 
> Set the Rx multi-queue mode to NONE when configuring a port that is
> associated with hardware that only supports a single Rx queue.
> 
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
> ---
>  examples/l3fwd/main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index bb49e5faf..87b638ac0 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -953,6 +953,10 @@ l3fwd_poll_resource_setup(void)
>  
>  		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
>  			dev_info.flow_type_rss_offloads;
> +
> +		if (dev_info.max_rx_queues == 1)
> +			local_port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> +

While it makes sense to do this when the port only supports a single queue,
would it not also make sense to do this when the requested queues are 1
too?

Adding some lookup library maintainers on CC - I assume that the RSS value
is not actually used for lookup anywhere in l3fwd.

/Bruce
Medvedkin, Vladimir May 12, 2021, 6:43 p.m. UTC | #2
Hi Bruce,

On 12/05/2021 19:32, Bruce Richardson wrote:
> On Mon, May 10, 2021 at 06:53:19PM +0200, Heinrich Kuhn wrote:
>> From: "Chaoyong.He" <chaoyong.he@corigine.com>
>>
>> Set the Rx multi-queue mode to NONE when configuring a port that is
>> associated with hardware that only supports a single Rx queue.
>>
>> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
>> Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
>> Signed-off-by: Simon Horman <simon.horman@netronome.com>
>> ---
>>   examples/l3fwd/main.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
>> index bb49e5faf..87b638ac0 100644
>> --- a/examples/l3fwd/main.c
>> +++ b/examples/l3fwd/main.c
>> @@ -953,6 +953,10 @@ l3fwd_poll_resource_setup(void)
>>   
>>   		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
>>   			dev_info.flow_type_rss_offloads;
>> +
>> +		if (dev_info.max_rx_queues == 1)
>> +			local_port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
>> +
> 
> While it makes sense to do this when the port only supports a single queue,
> would it not also make sense to do this when the requested queues are 1
> too?
> 
> Adding some lookup library maintainers on CC - I assume that the RSS value
> is not actually used for lookup anywhere in l3fwd.
> 

As far as I can see the rss hash value is not used anywhere in l3fwd. In 
LPM/FIB this is not required at all, in EM CRC or Jenkins hash is used.

> /Bruce
>
Bruce Richardson May 13, 2021, 9:59 a.m. UTC | #3
On Wed, May 12, 2021 at 09:43:57PM +0300, Medvedkin, Vladimir wrote:
> Hi Bruce,
> 
> On 12/05/2021 19:32, Bruce Richardson wrote:
> > On Mon, May 10, 2021 at 06:53:19PM +0200, Heinrich Kuhn wrote:
> > > From: "Chaoyong.He" <chaoyong.he@corigine.com>
> > > 
> > > Set the Rx multi-queue mode to NONE when configuring a port that is
> > > associated with hardware that only supports a single Rx queue.
> > > 
> > > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> > > Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
> > > Signed-off-by: Simon Horman <simon.horman@netronome.com>
> > > ---
> > >   examples/l3fwd/main.c | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> > > index bb49e5faf..87b638ac0 100644
> > > --- a/examples/l3fwd/main.c
> > > +++ b/examples/l3fwd/main.c
> > > @@ -953,6 +953,10 @@ l3fwd_poll_resource_setup(void)
> > >   		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
> > >   			dev_info.flow_type_rss_offloads;
> > > +
> > > +		if (dev_info.max_rx_queues == 1)
> > > +			local_port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> > > +
> > 
> > While it makes sense to do this when the port only supports a single queue,
> > would it not also make sense to do this when the requested queues are 1
> > too?
> > 
> > Adding some lookup library maintainers on CC - I assume that the RSS value
> > is not actually used for lookup anywhere in l3fwd.
> > 
> 
> As far as I can see the rss hash value is not used anywhere in l3fwd. In
> LPM/FIB this is not required at all, in EM CRC or Jenkins hash is used.
>
That's what I thought from looking at the code too. Since this is not
really a bug fix, I think it can be pushed till 21.08.

With or without the change I suggest above:
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
diff mbox series

Patch

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index bb49e5faf..87b638ac0 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -953,6 +953,10 @@  l3fwd_poll_resource_setup(void)
 
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
+
+		if (dev_info.max_rx_queues == 1)
+			local_port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
+
 		if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
 				port_conf.rx_adv_conf.rss_conf.rss_hf) {
 			printf("Port %u modified RSS hash function based on hardware support,"