[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZiEZ3c-aJ_i6vQ9F@nanopsycho>
Date: Thu, 18 Apr 2024 15:02:21 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: intel-wired-lan@...ts.osuosl.org, 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 6/8] ice: base subfunction aux driver
Wed, Apr 17, 2024 at 04:20:26PM CEST, michal.swiatkowski@...ux.intel.com wrote:
>From: Piotr Raczynski <piotr.raczynski@...el.com>
[...]
>+static int ice_sf_dev_probe(struct auxiliary_device *adev,
>+ const struct auxiliary_device_id *id)
>+{
>+ struct ice_sf_dev *sf_dev = ice_adev_to_sf_dev(adev);
>+ struct ice_dynamic_port *dyn_port = sf_dev->dyn_port;
>+ struct ice_vsi_cfg_params params = {};
>+ struct ice_vsi *vsi = dyn_port->vsi;
>+ struct ice_pf *pf = dyn_port->pf;
>+ struct device *dev = &adev->dev;
>+ struct ice_sf_priv *priv;
>+ struct devlink *devlink;
>+ int err;
>+
>+ params.type = ICE_VSI_SF;
>+ params.pi = pf->hw.port_info;
>+ params.flags = ICE_VSI_FLAG_INIT;
>+
>+ priv = ice_allocate_sf(&adev->dev);
>+ if (!priv) {
>+ dev_err(dev, "Subfunction devlink alloc failed");
>+ return -ENOMEM;
>+ }
>+
>+ priv->dev = sf_dev;
>+ sf_dev->priv = priv;
>+ devlink = priv_to_devlink(priv);
>+
>+ devlink_register(devlink);
Do register at the very end. Btw, currently the error path seems to be
broken, leaving devlink instance allocated and registered.
>+ devl_lock(devlink);
>+
>+ err = ice_vsi_cfg(vsi, ¶ms);
>+ if (err) {
>+ dev_err(dev, "Subfunction vsi config failed");
>+ goto err_devlink_unlock;
>+ }
>+
>+ err = ice_devlink_create_sf_dev_port(sf_dev);
>+ if (err) {
>+ dev_err(dev, "Cannot add ice virtual devlink port for subfunction");
>+ goto err_vsi_decfg;
>+ }
>+
>+ err = ice_fltr_add_mac_and_broadcast(vsi, vsi->netdev->dev_addr,
>+ ICE_FWD_TO_VSI);
>+ if (err) {
>+ dev_err(dev, "can't add MAC filters %pM for VSI %d\n",
>+ vsi->netdev->dev_addr, vsi->idx);
>+ goto err_devlink_destroy;
>+ }
>+
>+ ice_napi_add(vsi);
>+ devl_unlock(devlink);
>+
>+ return 0;
>+
>+err_devlink_destroy:
>+ ice_devlink_destroy_sf_dev_port(sf_dev);
>+err_vsi_decfg:
>+ ice_vsi_decfg(vsi);
>+err_devlink_unlock:
>+ devl_unlock(devlink);
>+ return err;
[...]
Powered by blists - more mailing lists