From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
jacob.e.keller@intel.com, michal.kubiak@intel.com,
maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com,
przemyslaw.kitszel@intel.com, wojciech.drewek@intel.com,
pio.raczynski@gmail.com, jiri@nvidia.com,
mateusz.polchlopek@intel.com, shayd@nvidia.com
Subject: Re: [iwl-next v1 11/14] ice: netdevice ops for SF representor
Date: Fri, 10 May 2024 09:25:33 +0200 [thread overview]
Message-ID: <Zj3L7SMM01cRpNu8@mev-dev> (raw)
In-Reply-To: <ZjywxuhjwvIlWXt2@nanopsycho.orion>
On Thu, May 09, 2024 at 01:17:26PM +0200, Jiri Pirko wrote:
> Subject does not have verb. Please add it.
>
> Otherwise, the patch looks ok.
Thanks, will add sth like "implement".
>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>
>
>
> Tue, May 07, 2024 at 01:45:12PM CEST, michal.swiatkowski@linux.intel.com wrote:
> >Subfunction port representor needs the basic netdevice ops to work
> >correctly. Create them.
> >
> >Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
> >Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> >---
> > drivers/net/ethernet/intel/ice/ice_repr.c | 57 +++++++++++++++++------
> > 1 file changed, 43 insertions(+), 14 deletions(-)
> >
> >diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
> >index 3cb3fc5f52ea..ec4f5b8b46e6 100644
> >--- a/drivers/net/ethernet/intel/ice/ice_repr.c
> >+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> >@@ -59,12 +59,13 @@ static void
> > ice_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
> > {
> > struct ice_netdev_priv *np = netdev_priv(netdev);
> >+ struct ice_repr *repr = np->repr;
> > struct ice_eth_stats *eth_stats;
> > struct ice_vsi *vsi;
> >
> >- if (ice_is_vf_disabled(np->repr->vf))
> >+ if (repr->ops.ready(repr))
> > return;
> >- vsi = np->repr->src_vsi;
> >+ vsi = repr->src_vsi;
> >
> > ice_update_vsi_stats(vsi);
> > eth_stats = &vsi->eth_stats;
> >@@ -93,7 +94,7 @@ struct ice_repr *ice_netdev_to_repr(const struct net_device *netdev)
> > }
> >
> > /**
> >- * ice_repr_open - Enable port representor's network interface
> >+ * ice_repr_vf_open - Enable port representor's network interface
> > * @netdev: network interface device structure
> > *
> > * The open entry point is called when a port representor's network
> >@@ -102,7 +103,7 @@ struct ice_repr *ice_netdev_to_repr(const struct net_device *netdev)
> > *
> > * Returns 0 on success
> > */
> >-static int ice_repr_open(struct net_device *netdev)
> >+static int ice_repr_vf_open(struct net_device *netdev)
> > {
> > struct ice_repr *repr = ice_netdev_to_repr(netdev);
> > struct ice_vf *vf;
> >@@ -118,8 +119,16 @@ static int ice_repr_open(struct net_device *netdev)
> > return 0;
> > }
> >
> >+static int ice_repr_sf_open(struct net_device *netdev)
> >+{
> >+ netif_carrier_on(netdev);
> >+ netif_tx_start_all_queues(netdev);
> >+
> >+ return 0;
> >+}
> >+
> > /**
> >- * ice_repr_stop - Disable port representor's network interface
> >+ * ice_repr_vf_stop - Disable port representor's network interface
> > * @netdev: network interface device structure
> > *
> > * The stop entry point is called when a port representor's network
> >@@ -128,7 +137,7 @@ static int ice_repr_open(struct net_device *netdev)
> > *
> > * Returns 0 on success
> > */
> >-static int ice_repr_stop(struct net_device *netdev)
> >+static int ice_repr_vf_stop(struct net_device *netdev)
> > {
> > struct ice_repr *repr = ice_netdev_to_repr(netdev);
> > struct ice_vf *vf;
> >@@ -144,6 +153,14 @@ static int ice_repr_stop(struct net_device *netdev)
> > return 0;
> > }
> >
> >+static int ice_repr_sf_stop(struct net_device *netdev)
> >+{
> >+ netif_carrier_off(netdev);
> >+ netif_tx_stop_all_queues(netdev);
> >+
> >+ return 0;
> >+}
> >+
> > /**
> > * ice_repr_sp_stats64 - get slow path stats for port representor
> > * @dev: network interface device structure
> >@@ -245,10 +262,20 @@ ice_repr_setup_tc(struct net_device *netdev, enum tc_setup_type type,
> > }
> > }
> >
> >-static const struct net_device_ops ice_repr_netdev_ops = {
> >+static const struct net_device_ops ice_repr_vf_netdev_ops = {
> >+ .ndo_get_stats64 = ice_repr_get_stats64,
> >+ .ndo_open = ice_repr_vf_open,
> >+ .ndo_stop = ice_repr_vf_stop,
> >+ .ndo_start_xmit = ice_eswitch_port_start_xmit,
> >+ .ndo_setup_tc = ice_repr_setup_tc,
> >+ .ndo_has_offload_stats = ice_repr_ndo_has_offload_stats,
> >+ .ndo_get_offload_stats = ice_repr_ndo_get_offload_stats,
> >+};
> >+
> >+static const struct net_device_ops ice_repr_sf_netdev_ops = {
> > .ndo_get_stats64 = ice_repr_get_stats64,
> >- .ndo_open = ice_repr_open,
> >- .ndo_stop = ice_repr_stop,
> >+ .ndo_open = ice_repr_sf_open,
> >+ .ndo_stop = ice_repr_sf_stop,
> > .ndo_start_xmit = ice_eswitch_port_start_xmit,
> > .ndo_setup_tc = ice_repr_setup_tc,
> > .ndo_has_offload_stats = ice_repr_ndo_has_offload_stats,
> >@@ -261,18 +288,20 @@ static const struct net_device_ops ice_repr_netdev_ops = {
> > */
> > bool ice_is_port_repr_netdev(const struct net_device *netdev)
> > {
> >- return netdev && (netdev->netdev_ops == &ice_repr_netdev_ops);
> >+ return netdev && (netdev->netdev_ops == &ice_repr_vf_netdev_ops ||
> >+ netdev->netdev_ops == &ice_repr_sf_netdev_ops);
> > }
> >
> > /**
> > * ice_repr_reg_netdev - register port representor netdev
> > * @netdev: pointer to port representor netdev
> >+ * @ops: new ops for netdev
> > */
> > static int
> >-ice_repr_reg_netdev(struct net_device *netdev)
> >+ice_repr_reg_netdev(struct net_device *netdev, const struct net_device_ops *ops)
> > {
> > eth_hw_addr_random(netdev);
> >- netdev->netdev_ops = &ice_repr_netdev_ops;
> >+ netdev->netdev_ops = ops;
> > ice_set_ethtool_repr_ops(netdev);
> >
> > netdev->hw_features |= NETIF_F_HW_TC;
> >@@ -386,7 +415,7 @@ static int ice_repr_add_vf(struct ice_repr *repr)
> > return err;
> >
> > SET_NETDEV_DEVLINK_PORT(repr->netdev, &vf->devlink_port);
> >- err = ice_repr_reg_netdev(repr->netdev);
> >+ err = ice_repr_reg_netdev(repr->netdev, &ice_repr_vf_netdev_ops);
> > if (err)
> > goto err_netdev;
> >
> >@@ -439,7 +468,7 @@ static int ice_repr_add_sf(struct ice_repr *repr)
> > return err;
> >
> > SET_NETDEV_DEVLINK_PORT(repr->netdev, &sf->devlink_port);
> >- err = ice_repr_reg_netdev(repr->netdev);
> >+ err = ice_repr_reg_netdev(repr->netdev, &ice_repr_sf_netdev_ops);
> > if (err)
> > goto err_netdev;
> >
> >--
> >2.42.0
> >
> >
next prev parent reply other threads:[~2024-05-10 7:26 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 11:45 [iwl-next v1 00/14] ice: support devlink subfunction Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 01/14] ice: add new VSI type for subfunctions Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 02/14] ice: export ice ndo_ops functions Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 03/14] ice: add basic devlink subfunctions support Michal Swiatkowski
2024-05-09 11:06 ` Jiri Pirko
2024-05-10 7:13 ` Michal Swiatkowski
2024-05-10 11:05 ` Jiri Pirko
2024-05-10 12:25 ` Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 04/14] ice: treat subfunction VSI the same as PF VSI Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 05/14] ice: allocate devlink for subfunction Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 06/14] ice: base subfunction aux driver Michal Swiatkowski
2024-05-09 11:13 ` Jiri Pirko
2024-05-10 7:20 ` Michal Swiatkowski
2024-05-10 11:06 ` Jiri Pirko
2024-05-07 11:45 ` [iwl-next v1 07/14] ice: implement netdev for subfunction Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 08/14] ice: create port representor for SF Michal Swiatkowski
2024-05-09 11:16 ` Jiri Pirko
2024-05-10 7:31 ` Michal Swiatkowski
2024-05-10 11:07 ` Jiri Pirko
2024-05-10 12:25 ` [Intel-wired-lan] " Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 09/14] ice: don't set target VSI for subfunction Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 10/14] ice: check if SF is ready in ethtool ops Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 11/14] ice: netdevice ops for SF representor Michal Swiatkowski
2024-05-09 11:17 ` Jiri Pirko
2024-05-10 7:25 ` Michal Swiatkowski [this message]
2024-05-07 11:45 ` [iwl-next v1 12/14] ice: support subfunction devlink Tx topology Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 13/14] ice: basic support for VLAN in subfunctions Michal Swiatkowski
2024-05-07 11:45 ` [iwl-next v1 14/14] ice: allow to activate and deactivate subfunction Michal Swiatkowski
2024-05-09 11:36 ` Jiri Pirko
2024-05-10 7:33 ` Michal Swiatkowski
2024-05-10 11:08 ` Jiri Pirko
2024-05-09 11:18 ` [iwl-next v1 00/14] ice: support devlink subfunction Jiri Pirko
2024-05-10 7:24 ` Michal Swiatkowski
2024-05-10 11:09 ` Jiri Pirko
2024-05-10 12:26 ` [Intel-wired-lan] " Michal Swiatkowski
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=Zj3L7SMM01cRpNu8@mev-dev \
--to=michal.swiatkowski@linux.intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jiri@nvidia.com \
--cc=jiri@resnulli.us \
--cc=maciej.fijalkowski@intel.com \
--cc=mateusz.polchlopek@intel.com \
--cc=michal.kubiak@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pio.raczynski@gmail.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=shayd@nvidia.com \
--cc=sridhar.samudrala@intel.com \
--cc=wojciech.drewek@intel.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).