Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Jiri Pirko <jiri@resnulli.us>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com,
	przemyslaw.kitszel@intel.com, michal.kubiak@intel.com,
	intel-wired-lan@lists.osuosl.org, pio.raczynski@gmail.com,
	netdev@vger.kernel.org, wojciech.drewek@intel.com,
	Piotr Raczynski <piotr.raczynski@intel.com>
Subject: Re: [Intel-wired-lan] [iwl-next v1 04/15] ice: add basic devlink subfunctions support
Date: Wed, 14 Feb 2024 11:45:28 -0800	[thread overview]
Message-ID: <91f97e78-8b2b-45e4-b687-ee6a19db8644@intel.com> (raw)
In-Reply-To: <ZcsueJ1tr-GdseIt@nanopsycho>



On 2/13/2024 12:55 AM, Jiri Pirko wrote:
> Tue, Feb 13, 2024 at 08:27:13AM CET, michal.swiatkowski@linux.intel.com wrote:
>> From: Piotr Raczynski <piotr.raczynski@intel.com>
>>
>> Implement devlink port handlers responsible for ethernet type devlink
>> subfunctions. Create subfunction devlink port and setup all resources
>> needed for a subfunction netdev to operate. Configure new VSI for each
>> new subfunction, initialize and configure interrupts and Tx/Rx resources.
>> Set correct MAC filters and create new netdev.
>>
>> For now, subfunction is limited to only one Tx/Rx queue pair.
>>
>> Only allocate new subfunction VSI with devlink port new command.
>> This makes sure that real resources are configured only when a new
>> subfunction gets activated. Allocate and free subfunction MSIX
>> interrupt vectors using new API calls with pci_msix_alloc_irq_at
>> and pci_msix_free_irq.
>>
>> Temporarily, before adding auxiliary bus driver for subfunctions,
>> configure subfunction netdev directly for the created devlink
>> port. This will be modified in the next patch to properly that handle
>> devlink port as the port representor.
>>
>> Support both automatic and manual subfunction numbers. If no subfunction
>> number is provided, use xa_alloc to pick a number automatically. This
>> will find the first free index and use that as the number. This reduces
>> burden on users in the simple case where a specific number is not
>> required. It may also be slightly faster to check that a number exists
>> since xarray lookup should be faster than a linear scan of the dyn_ports
>> xarray.
>>
>> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>> Co-developed-by: Jacob Keller <jacob.e.keller@intel.com>
>> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
>> Signed-off-by: Piotr Raczynski <piotr.raczynski@intel.com>
>> Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
>> ---
>> drivers/net/ethernet/intel/ice/Makefile       |   1 +
>> .../intel/ice/devlink/ice_devlink_port.c      | 508 ++++++++++++++++++
>> .../intel/ice/devlink/ice_devlink_port.h      |  30 ++
>> drivers/net/ethernet/intel/ice/ice.h          |   4 +
>> drivers/net/ethernet/intel/ice/ice_devlink.c  |   3 +
>> drivers/net/ethernet/intel/ice/ice_lib.c      |   5 +-
>> drivers/net/ethernet/intel/ice/ice_lib.h      |   2 +
>> drivers/net/ethernet/intel/ice/ice_main.c     |  14 +-
>> drivers/net/ethernet/intel/ice/ice_sf_eth.c   | 138 +++++
>> drivers/net/ethernet/intel/ice/ice_sf_eth.h   |  15 +
>> 10 files changed, 716 insertions(+), 4 deletions(-)
>> create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.c
>> create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.h
>>
>> diff --git a/drivers/net/ethernet/intel/ice/Makefile b/drivers/net/ethernet/intel/ice/Makefile
>> index cd4ab46d72a7..d56a7165df95 100644
>> --- a/drivers/net/ethernet/intel/ice/Makefile
>> +++ b/drivers/net/ethernet/intel/ice/Makefile
>> @@ -31,6 +31,7 @@ ice-y := ice_main.o	\
>> 	 ice_idc.o	\
>> 	 ice_devlink.o	\
>> 	 devlink/ice_devlink_port.o	\
>> +	 ice_sf_eth.o	\
>> 	 ice_ddp.o	\
>> 	 ice_fw_update.o \
>> 	 ice_lag.o	\
>> diff --git a/drivers/net/ethernet/intel/ice/devlink/ice_devlink_port.c b/drivers/net/ethernet/intel/ice/devlink/ice_devlink_port.c
>> index c8c823467fcf..90efceaddb02 100644
>> --- a/drivers/net/ethernet/intel/ice/devlink/ice_devlink_port.c
>> +++ b/drivers/net/ethernet/intel/ice/devlink/ice_devlink_port.c
>> @@ -10,6 +10,8 @@
>> #include "ice_eswitch.h"
>> #include "ice_fw_update.h"
>> #include "ice_dcb_lib.h"
>> +#include "ice_sf_eth.h"
>> +#include "ice_fltr.h"
>>
>> static int ice_active_port_option = -1;
>>
>> @@ -432,3 +434,509 @@ void ice_devlink_destroy_vf_port(struct ice_vf *vf)
>> 	devlink_port_unregister(&vf->devlink_port);
>> }
>>
>> +/**
>> + * ice_activate_dynamic_port - Activate a dynamic port
>> + * @dyn_port: dynamic port instance to activate
>> + * @extack: extack for reporting error messages
>> + *
>> + * Activate the dynamic port based on its flavour.
>> + *
>> + * Return: zero on success or an error code on failure.
>> + */
>> +static int
>> +ice_activate_dynamic_port(struct ice_dynamic_port *dyn_port,
>> +			  struct netlink_ext_ack *extack)
>> +{
>> +	int err;
>> +
>> +	switch (dyn_port->devlink_port.attrs.flavour) {
>> +	case DEVLINK_PORT_FLAVOUR_PCI_SF:
> 
> Pointless switch case.
> 
> It looks like you have odd habbit of checking things that cannot happen
> all over this patch :) See more below...
> 
> 

I remember asking for this kind of split because I have some work for
supporting dynamic creation of Scalable IOV VFs which create a VF port
instead of a SF port. Since it only makes sense in that context, it
makes sense to remove it from this series and add it when its actually
necessary.

That's where the whole "dynamic_port" stuff comes from rather than just
calling it all "sf_port".

  parent reply	other threads:[~2024-02-14 19:45 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13  7:27 [Intel-wired-lan] [iwl-next v1 00/15] ice: support devlink subfunctions Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 01/15] ice: move devlink port code to a separate file Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 02/15] ice: add new VSI type for subfunctions Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 03/15] ice: export ice ndo_ops functions Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 04/15] ice: add basic devlink subfunctions support Michal Swiatkowski
2024-02-13  8:55   ` Jiri Pirko
2024-02-13  9:39     ` Michal Swiatkowski
2024-02-13 11:27       ` Jiri Pirko
2024-02-13 12:02         ` Michal Swiatkowski
2024-02-13 14:57           ` Jiri Pirko
2024-02-14  6:26             ` Michal Swiatkowski
2024-02-14 19:45     ` Jacob Keller [this message]
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 05/15] ice: add subfunctions ethtool ops Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 06/15] ice: add subfunction aux driver support Michal Swiatkowski
2024-02-13  8:57   ` Jiri Pirko
2024-02-13  9:43     ` Michal Swiatkowski
2024-02-13 11:28       ` Jiri Pirko
2024-02-13 12:03         ` Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 07/15] ice: add auxiliary device sfnum attribute Michal Swiatkowski
2024-02-13  8:59   ` Jiri Pirko
2024-02-13  9:53     ` Michal Swiatkowski
2024-02-13 11:29       ` Jiri Pirko
2024-02-13 11:55         ` Michal Swiatkowski
2024-02-13 22:04           ` Jacob Keller
2024-02-14  8:45             ` Jiri Pirko
2024-02-14 19:41               ` Keller, Jacob E
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 08/15] ice: store SF data in VSI struct Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 09/15] ice: store representor ID in bridge port Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 10/15] ice: create port representor for SF Michal Swiatkowski
2024-02-13  9:00   ` Jiri Pirko
2024-02-13  9:55     ` Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 11/15] ice: check if SF is ready in ethtool ops Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 12/15] ice: netdevice ops for SF representor Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 13/15] ice: support subfunction devlink Tx topology Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 14/15] ice: basic support for VLAN in subfunctions Michal Swiatkowski
2024-02-13  7:27 ` [Intel-wired-lan] [iwl-next v1 15/15] ice: move ice_devlink.[ch] to devlink folder 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=91f97e78-8b2b-45e4-b687-ee6a19db8644@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jiri@resnulli.us \
    --cc=maciej.fijalkowski@intel.com \
    --cc=michal.kubiak@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pio.raczynski@gmail.com \
    --cc=piotr.raczynski@intel.com \
    --cc=przemyslaw.kitszel@intel.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