linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lucero Palau, Alejandro" <alejandro.lucero-palau@amd.com>
To: Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>
Cc: "Lucero Palau, Alejandro" <alejandro.lucero-palau@amd.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-net-drivers (AMD-Xilinx)" <linux-net-drivers@amd.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"habetsm.xilinx@gmail.com" <habetsm.xilinx@gmail.com>,
	"ecree.xilinx@gmail.com" <ecree.xilinx@gmail.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"jiri@nvidia.com" <jiri@nvidia.com>
Subject: Re: [PATCH v4 net-next 1/8] sfc: add devlink support for ef100
Date: Thu, 2 Feb 2023 06:41:45 +0000	[thread overview]
Message-ID: <84ac0002-5686-8158-1c17-f2724afda725@amd.com> (raw)
In-Reply-To: 20230201110148.0ddd3a0b@kernel.org



On 2/1/23 19:01, Jakub Kicinski wrote:
> On Wed, 1 Feb 2023 10:07:33 +0100 Jiri Pirko wrote:
>>> This is due to the recommended/required devlink lock/unlock during
>>> driver initialization/removal.
>>>
>>> I think it is better to keep the lock/unlock inside the specific driver
>>> devlink code, and the functions naming reflects a time window when
>>> devlink related/dependent processing is being done.
>>>
>>> I'm not against changing this, maybe adding the lock/unlock suffix would
>>> be preferable?:
>>>
>>> int efx_probe_devlink_and_lock(struct efx_nic *efx);
>>> void efx_probe_devlink_unlock(struct efx_nic *efx);
>>> void efx_fini_devlink_lock(struct efx_nic *efx);
>>> void efx_fini_devlink_and_unlock(struct efx_nic *efx);
>> Sounds better. Thanks!
> FWIW I'd just take the devl lock in the main driver code.
> devlink should be viewed as a layer between bus and driver rather
> than as another subsystem the driver registers with. Otherwise reloads
> and port creation get awkward.
>
> But the above sounds okay, too.

That is what I have tried to do with these extra functions invoked from 
the main driver code.

The problem is one part of the protection needs to be done inside the 
driver's devlink code (if we want to avoid different calls for 
allocating then registering or unregistering then releasing), so it 
looked awkward to me the other protection part being directly in main 
driver code. So, I think the extra functions are worth for avoiding 
confusion.






  reply	other threads:[~2023-02-02  6:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 14:58 [PATCH v4 net-next 0/8] sfc: devlink support for ef100 alejandro.lucero-palau
2023-01-31 14:58 ` [PATCH v4 net-next 1/8] sfc: add " alejandro.lucero-palau
2023-01-31 16:00   ` Jiri Pirko
2023-02-01  8:49     ` Lucero Palau, Alejandro
2023-02-01  9:07       ` Jiri Pirko
2023-02-01 19:01         ` Jakub Kicinski
2023-02-02  6:41           ` Lucero Palau, Alejandro [this message]
2023-02-02  9:24           ` Martin Habets
2023-02-02 17:43             ` Jakub Kicinski
2023-01-31 14:58 ` [PATCH v4 net-next 2/8] sfc: add devlink info " alejandro.lucero-palau
2023-01-31 16:03   ` Jiri Pirko
2023-02-01  9:09     ` Lucero Palau, Alejandro
2023-02-01 12:03       ` Jiri Pirko
2023-01-31 14:58 ` [PATCH v4 net-next 3/8] sfc: enumerate mports in ef100 alejandro.lucero-palau
2023-02-01 11:12   ` kernel test robot
2023-01-31 14:58 ` [PATCH v4 net-next 4/8] sfc: add mport lookup based on driver's mport data alejandro.lucero-palau
2023-01-31 14:58 ` [PATCH v4 net-next 5/8] sfc: add devlink port support for ef100 alejandro.lucero-palau
2023-01-31 16:12   ` Jiri Pirko
2023-02-01  9:03     ` Lucero Palau, Alejandro
2023-02-01  9:08       ` Jiri Pirko
2023-02-01 14:57   ` kernel test robot
2023-01-31 14:58 ` [PATCH v4 net-next 6/8] sfc: obtain device mac address based on firmware handle " alejandro.lucero-palau
2023-01-31 14:58 ` [PATCH v4 net-next 7/8] sfc: add support for devlink port_function_hw_addr_get in ef100 alejandro.lucero-palau
2023-02-01 19:15   ` kernel test robot
2023-01-31 14:58 ` [PATCH v4 net-next 8/8] sfc: add support for devlink port_function_hw_addr_set " alejandro.lucero-palau

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=84ac0002-5686-8158-1c17-f2724afda725@amd.com \
    --to=alejandro.lucero-palau@amd.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).