All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Vadai <amirv@mellanox.com>
To: David Miller <davem@davemloft.net>
Cc: Amir Vadai <amirv@mellanox.com>, netdev <netdev@vger.kernel.org>,
	Or Gerlitz <ogerlitz@mellanox.com>, Tal Alon <talal@mellanox.com>,
	Achiad Shochat <achiad@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH net-next V3 02/11] net/mlx5_core: Add EQ renaming mechanism
Date: Tue, 12 May 2015 14:55:18 +0300	[thread overview]
Message-ID: <CAPcc5Pijfg+799kG=gA-3w9RhsVnuOeRWYrX5qFh=SB6CABxGg@mail.gmail.com> (raw)
In-Reply-To: <20150511.134008.7539040783838247.davem@davemloft.net>

On Mon, May 11, 2015 at 8:40 PM, David Miller <davem@davemloft.net> wrote:
> From: Amir Vadai <amirv@mellanox.com>
> Date: Sun, 10 May 2015 12:38:57 +0300
>
>> +int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name)
>> +{
>> +     struct mlx5_priv *priv = &dev->priv;
>> +     struct mlx5_eq_table *table = &priv->eq_table;
>> +     struct mlx5_eq *eq;
>> +     int err = -ENOENT;
>> +
>> +     spin_lock(&table->lock);
>> +     list_for_each_entry(eq, &table->comp_eqs_list, list) {
>> +             if (eq->index == eq_ix) {
>> +                     snprintf(priv->irq_info[eq_ix].name, MLX5_MAX_IRQ_NAME,
>> +                              "%s-%d", name, eq_ix);
>> +                     err = 0;
>> +                     break;
>> +             }
>> +     }
>> +     spin_unlock(&table->lock);
>> +
>> +     return err;
>> +}
>
> You have to be very careful with this.
>
> If you change these names after the request_irq() call(s), the new name string
> will not propagate to /proc/interrupts output etc.
>
> Looking at your later patches, this seems to be invoked very late in
> mlx5e_open_locked(), so I am concerned.
It is true. We call request_irq() when driver is loaded (and we don't
know yet if the ports types are Infiniband or Ethernet). Only later
on, we rename the name when interface is up and we know its name.

But, empirically /proc/interrupts is propagated with the new name
(according to latest net-next). Also, in the code, I don't see why
shouldn't it be updated. When calling request_irq(), name is not
copied, but irq_desc->action->name is pointing to it. This same
pointer is being used by show_interrupts() when /proc/interrupts is
queried.
So don't see why when modifying the string pointed by it, it wouldn't
shown on /proc/interrupts.

What did I miss?

Thanks,
Amir

  reply	other threads:[~2015-05-12 11:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10  9:38 [PATCH net-next V3 00/11] net/mlx5: ConnectX-4 100G Ethernet driver Amir Vadai
2015-05-10  9:38 ` [PATCH net-next V3 01/11] net/mlx5_core: Set irq affinity hints Amir Vadai
2015-05-10  9:38 ` [PATCH net-next V3 02/11] net/mlx5_core: Add EQ renaming mechanism Amir Vadai
2015-05-11 17:40   ` David Miller
2015-05-12 11:55     ` Amir Vadai [this message]
2015-05-14 15:19       ` Or Gerlitz
2015-05-10  9:38 ` [PATCH net-next V3 03/11] net/mlx5_core: HW data structs/types definitions cleanup Amir Vadai
2015-05-10  9:38 ` [PATCH net-next V3 04/11] net/mlx5_core: New device capabilities handling Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 05/11] net/mlx5_core: Implement access functions of ptys register fields Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 06/11] net/mlx5_core: Implement get/set port status Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 07/11] net/mlx5_core: Modify CQ moderation parameters Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 08/11] net/mlx5_core: Set/Query port MTU commands Amir Vadai
2015-05-10 16:32   ` Sergei Shtylyov
2015-05-12  8:19     ` Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 09/11] net/mlx5: Ethernet Datapath files Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 10/11] net/mlx5: Ethernet resource handling files Amir Vadai
2015-05-10  9:39 ` [PATCH net-next V3 11/11] net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality Amir Vadai

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='CAPcc5Pijfg+799kG=gA-3w9RhsVnuOeRWYrX5qFh=SB6CABxGg@mail.gmail.com' \
    --to=amirv@mellanox.com \
    --cc=achiad@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=talal@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.