public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Shradha Shah <sshah@solarflare•com>, David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org, linux-net-drivers@solarflare•com
Subject: Re: [PATCH net-next 4/4] sfc: set and clear interrupt affinity hints
Date: Wed, 28 Oct 2015 21:15:57 +0300	[thread overview]
Message-ID: <563110DD.8040606@cogentembedded.com> (raw)
In-Reply-To: <5630E36B.2030501@solarflare.com>

Hello.

On 10/28/2015 06:02 PM, Shradha Shah wrote:

> From: Bert Kenward <bkenward@solarflare•com>
>
> Use cpumask_local_spread to provide interrupt affinity hints
> for each queue. This will spread interrupts across NUMA local
> CPUs first, extending to remote nodes if needed.
>
> Signed-off-by: Shradha Shah <sshah@solarflare•com>
> ---
>   drivers/net/ethernet/sfc/efx.c | 35 +++++++++++++++++++++++++++++++++++
>   1 file changed, 35 insertions(+)
>
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 84f9e90..93c4c0e 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -1489,6 +1489,30 @@ static int efx_probe_interrupts(struct efx_nic *efx)
>   	return 0;
>   }
>
> +#if defined(CONFIG_SMP)
> +static void efx_set_interrupt_affinity(struct efx_nic *efx)
> +{
> +	struct efx_channel *channel;
> +	unsigned int cpu;
> +
> +	efx_for_each_channel(channel, efx) {
> +		cpu = cpumask_local_spread(channel->channel,
> +					   pcibus_to_node(efx->pci_dev->bus));
> +
> +		irq_set_affinity_hint(channel->irq, cpumask_of(cpu));
> +		channel->irq_mem_node = cpu_to_mem(cpu);
> +	}
> +}
> +
> +static void efx_clear_interrupt_affinity(struct efx_nic *efx)
> +{
> +	struct efx_channel *channel;
> +
> +	efx_for_each_channel(channel, efx)
> +		irq_set_affinity_hint(channel->irq, NULL);
> +}
> +#endif /* CONFIG_SMP */
> +
>   static int efx_soft_enable_interrupts(struct efx_nic *efx)
>   {
>   	struct efx_channel *channel, *end_channel;
> @@ -2932,6 +2956,9 @@ static void efx_pci_remove_main(struct efx_nic *efx)
>   	cancel_work_sync(&efx->reset_work);
>
>   	efx_disable_interrupts(efx);
> +#if defined(CONFIG_SMP)
> +	efx_clear_interrupt_affinity(efx);
> +#endif

    Please just define empty function for !SMP case instead of the ugly 
#ifdef'fery in the functiojn bodies.

[...]

MBR, Sergei

      reply	other threads:[~2015-10-28 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 15:00 [PATCH net-next 0/4] sfc: NUMA support Shradha Shah
2015-10-28 15:01 ` [PATCH net-next 1/4] sfc: use __GFP_NOWARN when allocating RX pages from atomic context Shradha Shah
2015-10-28 15:01 ` [PATCH net-next 2/4] sfc: allocate rx pages on the same node as the interrupt Shradha Shah
2015-10-28 15:59   ` Eric Dumazet
2015-11-02 13:17     ` Daniel Pieczko (dpieczko)
2015-10-28 15:01 ` [PATCH net-next 3/4] sfc: Use cpu_to_mem() to support memoryless nodes Shradha Shah
2015-10-28 15:02 ` [PATCH net-next 4/4] sfc: set and clear interrupt affinity hints Shradha Shah
2015-10-28 18:15   ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563110DD.8040606@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-net-drivers@solarflare$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sshah@solarflare$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox