[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zh5qbxbOwMXrTnO4@nanopsycho>
Date: Tue, 16 Apr 2024 14:09:19 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: maciej.fijalkowski@...el.com, mateusz.polchlopek@...el.com,
nex.sw.ncis.osdt.itp.upstreaming@...el.com, netdev@...r.kernel.org,
jiri@...dia.com, michal.kubiak@...el.com,
intel-wired-lan@...ts.osuosl.org, pio.raczynski@...il.com,
sridhar.samudrala@...el.com, jacob.e.keller@...el.com,
wojciech.drewek@...el.com,
Piotr Raczynski <piotr.raczynski@...el.com>,
przemyslaw.kitszel@...el.com
Subject: Re: [Intel-wired-lan] [iwl-next v3 3/7] ice: add basic devlink
subfunctions support
Tue, Apr 16, 2024 at 08:16:17AM CEST, michal.swiatkowski@...ux.intel.com wrote:
>On Tue, Apr 16, 2024 at 07:14:43AM +0200, Michal Swiatkowski wrote:
>> On Mon, Apr 15, 2024 at 11:10:50AM +0200, Jiri Pirko wrote:
>> > Mon, Apr 15, 2024 at 10:39:39AM CEST, michal.swiatkowski@...ux.intel.com wrote:
>> > >On Fri, Apr 12, 2024 at 09:12:18AM +0200, Jiri Pirko wrote:
>> > >> Fri, Apr 12, 2024 at 08:30:49AM CEST, michal.swiatkowski@...ux.intel.com wrote:
>> > >> >From: Piotr Raczynski <piotr.raczynski@...el.com>
>> >
>> > [...]
>> >
>> > >> >+static int
>> > >> >+ice_devlink_port_fn_state_get(struct devlink_port *port,
>> > >> >+ enum devlink_port_fn_state *state,
>> > >> >+ enum devlink_port_fn_opstate *opstate,
>> > >> >+ struct netlink_ext_ack *extack)
>> > >> >+{
>> > >> >+ struct ice_dynamic_port *dyn_port;
>> > >> >+
>> > >> >+ dyn_port = ice_devlink_port_to_dyn(port);
>> > >> >+
>> > >> >+ if (dyn_port->active) {
>> > >> >+ *state = DEVLINK_PORT_FN_STATE_ACTIVE;
>> > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_ATTACHED;
>> > >>
>> > >> Interesting. This means that you don't distinguish between admin state
>> > >> and operational state. Meaning, when user does activate, you atomically
>> > >> achive the hw attachment and it is ready to go before activation cmd
>> > >> returns, correct? I'm just making sure I understand the code.
>> > >>
>> > >
>> > >I am setting the dyn_port->active after the activation heppens, so it is
>> > >true, when active is set it is ready to go.
>> > >
>> > >Do you mean that dyn_port->active should be set even before the activation is
>> > >finished? I mean when user only call devlink to active the port?
>> >
>> > The devlink instance lock is taken the whole time, isn't it?
>> >
>>
>> I don't take PF devlink lock here. Only subfunction devlink lock is
>> taken during the initialization of subfunction.
>>
>
>Did you mean that the devlink lock is taken for DEVLINK_CMD_PORT_SET/GET
>command? In this case, I think so, it is for the whole time of the
>command execution.
Yes.
>
>Sorry I probably missed the point.
Np.
>
>> > >
>> > >>
>> > >> >+ } else {
>> > >> >+ *state = DEVLINK_PORT_FN_STATE_INACTIVE;
>> > >> >+ *opstate = DEVLINK_PORT_FN_OPSTATE_DETACHED;
>> > >> >+ }
>> > >> >+
>> > >> >+ return 0;
>> > >> >+}
>> > >> >+
>> >
>> > [...]
Powered by blists - more mailing lists