Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264534

Re: [RFC PATCH 2/2] net: mvneta: Add naive RSS support

From Gregory CLEMENT <gregory.clement@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 2/2] net: mvneta: Add naive RSS support
Date 2015-11-06 22:00 +0100
Message-ID <qrWh4-13l-31@gated-at.bofh.it> (permalink)
References <qrU5z-875-9@gated-at.bofh.it> <qrU5A-875-13@gated-at.bofh.it> <qrUIj-9d-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Marcin,
 
[...]

>> +static int  mvneta_config_rss(struct mvneta_port *pp)
>> +{
>> +       int cpu;
>> +       u32 val;
>> +
>> +       netif_tx_stop_all_queues(pp->dev);
>> +
>> +       /* Mask all ethernet port interrupts */
>> +       mvreg_write(pp, MVNETA_INTR_NEW_MASK, 0);
>
> Shouldn't the interrupts be masked on each online cpu? There is percpu
> unmask function (mvneta_percpu_unmask_interrupt), so maybe ther should
> be also mvneta_percpu_mask_interrupt. With this masking should look
> like below:
>
>      for_each_online_cpu(cpu)
>                smp_call_function_single(cpu, mvneta_percpu_unmask_interrupt,
>                                         pp, true);

Indeed you are right, however I am a bit surprised to not had had issue
cause by this. I will fix it.

>
>> +       mvreg_write(pp, MVNETA_INTR_OLD_MASK, 0);
>> +       mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0);
>> +
>> +       /* We have to synchronise on the napi of each CPU */
>> +       for_each_online_cpu(cpu) {
>> +               struct mvneta_pcpu_port *pcpu_port =
>> +                       per_cpu_ptr(pp->ports, cpu);
>> +
>> +               napi_synchronize(&pcpu_port->napi);
>> +               napi_disable(&pcpu_port->napi);
>> +       }
>> +
>> +       pp->rxq_def = pp->indir[0];
>> +
>> +       /* update unicast mapping */
>> +       mvneta_set_rx_mode(pp->dev);
>> +
>> +       /* Update val of portCfg register accordingly with all RxQueue types */
>> +       val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def);
>> +       mvreg_write(pp, MVNETA_PORT_CONFIG, val);
>> +
>> +       /* Update the elected CPU matching the new rxq_def */
>> +       mvneta_percpu_elect(pp);
>> +
>> +       /* We have to synchronise on the napi of each CPU */
>> +       for_each_online_cpu(cpu) {
>> +               struct mvneta_pcpu_port *pcpu_port =
>> +                       per_cpu_ptr(pp->ports, cpu);
>> +
>> +               napi_enable(&pcpu_port->napi);
>> +       }
>> +
>
> rxq_def changed, but txq vs CPU mapping remained as in the beginning -
> is it intentional?

txq vs CPU mapping is change in the mvneta_percpu_elect() function.

Thanks for this prompt review

Gregory

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/2] net: mvneta: Introduce RSS support Gregory CLEMENT <gregory.clement@free-electrons.com> - 2015-11-06 19:40 +0100
  [RFC PATCH 2/2] net: mvneta: Add naive RSS support Gregory CLEMENT <gregory.clement@free-electrons.com> - 2015-11-06 19:40 +0100
    Re: [RFC PATCH 2/2] net: mvneta: Add naive RSS support Marcin Wojtas <mw@semihalf.com> - 2015-11-06 20:20 +0100
      Re: [RFC PATCH 2/2] net: mvneta: Add naive RSS support Gregory CLEMENT <gregory.clement@free-electrons.com> - 2015-11-06 22:00 +0100
  [RFC PATCH 1/2] net: mvneta: Associate RX queues with each CPU Gregory CLEMENT <gregory.clement@free-electrons.com> - 2015-11-06 19:40 +0100
  Re: [RFC PATCH 0/2] net: mvneta: Introduce RSS support Marcin Wojtas <mw@semihalf.com> - 2015-11-06 20:40 +0100
    Re: [RFC PATCH 0/2] net: mvneta: Introduce RSS support Gregory CLEMENT <gregory.clement@free-electrons.com> - 2015-11-09 19:20 +0100

csiph-web