[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b678660-7ee7-44d0-91a7-14985d2c469e@nvidia.com>
Date: Thu, 18 Apr 2024 11:12:47 +0300
From: Shay Drori <shayd@...dia.com>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
<intel-wired-lan@...ts.osuosl.org>
CC: <netdev@...r.kernel.org>, <jacob.e.keller@...el.com>,
<michal.kubiak@...el.com>, <maciej.fijalkowski@...el.com>,
<sridhar.samudrala@...el.com>, <przemyslaw.kitszel@...el.com>,
<wojciech.drewek@...el.com>, <pio.raczynski@...il.com>, <jiri@...dia.com>,
<mateusz.polchlopek@...el.com>
Subject: Re: [iwl-next v4 8/8] ice: allow to activate and deactivate
subfunction
resend as plain test
On 18/04/2024 10:53, Shay Drori wrote:
> On 17/04/2024 17:20, Michal Swiatkowski wrote:
>> +/**
>> + * ice_devlink_port_fn_state_get - devlink handler for port state get
>> + * @port: pointer to devlink port
>> + * @state: admin configured state of the port
>> + * @opstate: current port operational state
>> + * @extack: extack for reporting error messages
>> + *
>> + * Gets port state.
>> + *
>> + * Return: zero on success or an error code on failure.
>> + */
>> +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;
>
>
> DEVLINK_PORT_FN_OPSTATE_ATTACHED means the SF is up/bind[1].
> ice is using auxiliary bus for SFs, which means user can unbind it
> via the auxiliary sysfs (/sys/bus/auxiliary/drivers/ice_sf/unbind).
> In this case[2], you need to return:
> *state = DEVLINK_PORT_FN_STATE_ACTIVE;
> *opstate = DEVLINK_PORT_FN_OPSTATE_DETACHED;
>
>
> [1]
> Documentation from include/uapi/linux/devlink.h:
>
> * @DEVLINK_PORT_FN_OPSTATE_ATTACHED: Driver is attached to the function.
> <...>
> * @DEVLINK_PORT_FN_OPSTATE_DETACHED: Driver is detached from the function.
>
>> + } else {
>> + *state = DEVLINK_PORT_FN_STATE_INACTIVE;
>> + *opstate = DEVLINK_PORT_FN_OPSTATE_DETACHED;
>> + }
>> +
>> + return 0;
>> +}
>> +
Powered by blists - more mailing lists