Re: [Intel-wired-lan] [iwl-next v2 05/15] ice: allocate devlink for subfunction

2024-05-13 Thread Kalesh Anakkur Purayil
On Mon, May 13, 2024 at 2:03 PM Michal Swiatkowski
 wrote:
>
> From: Piotr Raczynski 
>
> Make devlink allocation function generic to use it for PF and for SF.
>
> Add function for SF devlink port creation. It will be used in next
> patch.
>
> Create header file for subfunction device. Define subfunction device
> structure there as it is needed for devlink allocation and port
> creation.
>
> Signed-off-by: Piotr Raczynski 
> Signed-off-by: Michal Swiatkowski 
> ---
>  .../net/ethernet/intel/ice/devlink/devlink.c  | 33 
>  .../net/ethernet/intel/ice/devlink/devlink.h  |  1 +
>  .../ethernet/intel/ice/devlink/devlink_port.c | 50 +++
>  .../ethernet/intel/ice/devlink/devlink_port.h |  3 ++
>  drivers/net/ethernet/intel/ice/ice_sf_eth.h   | 21 
>  5 files changed, 108 insertions(+)
>  create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.h
>
> diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c 
> b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> index 3fb3a7e828a4..c1fe3726f6c0 100644
> --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
> +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> @@ -10,6 +10,7 @@
>  #include "ice_eswitch.h"
>  #include "ice_fw_update.h"
>  #include "ice_dcb_lib.h"
> +#include "ice_sf_eth.h"
>
>  /* context for devlink info version reporting */
>  struct ice_info_ctx {
> @@ -1282,6 +1283,8 @@ static const struct devlink_ops ice_devlink_ops = {
> .port_new = ice_devlink_port_new,
>  };
>
> +static const struct devlink_ops ice_sf_devlink_ops;
> +
>  static int
>  ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
> struct devlink_param_gset_ctx *ctx)
> @@ -1419,6 +1422,7 @@ static void ice_devlink_free(void *devlink_ptr)
>   * Allocate a devlink instance for this device and return the private area as
>   * the PF structure. The devlink memory is kept track of through devres by
>   * adding an action to remove it when unwinding.
> + *
>   */
>  struct ice_pf *ice_allocate_pf(struct device *dev)
>  {
> @@ -1435,6 +1439,35 @@ struct ice_pf *ice_allocate_pf(struct device *dev)
> return devlink_priv(devlink);
>  }
>
> +/**
> + * ice_allocate_sf - Allocate devlink and return SF structure pointer
> + * @dev: the device to allocate for
> + * @pf: pointer to the PF structure
> + *
> + * Allocate a devlink instance for SF.
> + *
> + * Return: void pointer to allocated memory
> + */
> +struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf *pf)
> +{
> +   struct devlink *devlink;
> +   int err;
> +
> +   devlink = devlink_alloc_ns(&ice_sf_devlink_ops,
> +  sizeof(struct ice_sf_priv),
> +  devlink_net(priv_to_devlink(pf)), dev);
> +   if (!devlink)
> +   return NULL;
> +
> +   err = devl_nested_devlink_set(priv_to_devlink(pf), devlink);
> +   if (err) {
> +   devlink_free(devlink);
> +   return ERR_PTR(err);
> +   }
> +
> +   return devlink_priv(devlink);
> +}
> +
>  /**
>   * ice_devlink_register - Register devlink interface for this PF
>   * @pf: the PF to register the devlink for.
> diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.h 
> b/drivers/net/ethernet/intel/ice/devlink/devlink.h
> index d291c0e2e17b..1af3b0763fbb 100644
> --- a/drivers/net/ethernet/intel/ice/devlink/devlink.h
> +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.h
> @@ -5,6 +5,7 @@
>  #define _ICE_DEVLINK_H_
>
>  struct ice_pf *ice_allocate_pf(struct device *dev);
> +struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf *pf);
>
>  void ice_devlink_register(struct ice_pf *pf);
>  void ice_devlink_unregister(struct ice_pf *pf);
> diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c 
> b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c
> index 812b306e9048..1355ea042f1d 100644
> --- a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c
> +++ b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c
> @@ -432,6 +432,56 @@ void ice_devlink_destroy_vf_port(struct ice_vf *vf)
> devl_port_unregister(&vf->devlink_port);
>  }
>
> +/**
> + * ice_devlink_create_sf_dev_port - Register virtual port for a subfunction
> + * @sf_dev: the subfunction device to create a devlink port for
> + *
> + * Register virtual flavour devlink port for the subfunction auxiliary device
> + * created after activating a dynamically added devlink port.
> + *
> + * Return: zero on success or an error code on failure.
> + */
> +int ice_devlink_create_sf_dev_port(struct ice_sf_dev *sf_dev)
> +{
> +   struct devlink_port_attrs attrs = {};
> +   struct devlink_port *devlink_port;
> +   struct ice_dynamic_port *dyn_port;
[Kalesh] Try to maintain RCT order for variable declaration.
> +   struct devlink *devlink;
> +   struct ice_vsi *vsi;
> +   struct device *dev;
> +   struct ice_pf *pf;
> +   int err;
> +
> + 

Re: [Intel-wired-lan] [iwl-next v2 05/15] ice: allocate devlink for subfunction

2024-05-13 Thread Kalesh Anakkur Purayil
On Mon, May 13, 2024 at 3:54 PM Michal Swiatkowski
 wrote:
>
> On Mon, May 13, 2024 at 02:55:48PM +0530, Kalesh Anakkur Purayil wrote:
> > On Mon, May 13, 2024 at 2:03 PM Michal Swiatkowski
> >  wrote:
> > >
> > > From: Piotr Raczynski 
> > >
> > > Make devlink allocation function generic to use it for PF and for SF.
> > >
> > > Add function for SF devlink port creation. It will be used in next
> > > patch.
> > >
> > > Create header file for subfunction device. Define subfunction device
> > > structure there as it is needed for devlink allocation and port
> > > creation.
> > >
> > > Signed-off-by: Piotr Raczynski 
> > > Signed-off-by: Michal Swiatkowski 
> > > ---
> > >  .../net/ethernet/intel/ice/devlink/devlink.c  | 33 
> > >  .../net/ethernet/intel/ice/devlink/devlink.h  |  1 +
> > >  .../ethernet/intel/ice/devlink/devlink_port.c | 50 +++
> > >  .../ethernet/intel/ice/devlink/devlink_port.h |  3 ++
> > >  drivers/net/ethernet/intel/ice/ice_sf_eth.h   | 21 
> > >  5 files changed, 108 insertions(+)
> > >  create mode 100644 drivers/net/ethernet/intel/ice/ice_sf_eth.h
> > >
> > > diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c 
> > > b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> > > index 3fb3a7e828a4..c1fe3726f6c0 100644
> > > --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
> > > +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> > > @@ -10,6 +10,7 @@
> > >  #include "ice_eswitch.h"
> > >  #include "ice_fw_update.h"
> > >  #include "ice_dcb_lib.h"
> > > +#include "ice_sf_eth.h"
> > >
> > >  /* context for devlink info version reporting */
> > >  struct ice_info_ctx {
> > > @@ -1282,6 +1283,8 @@ static const struct devlink_ops ice_devlink_ops = {
> > > .port_new = ice_devlink_port_new,
> > >  };
> > >
> > > +static const struct devlink_ops ice_sf_devlink_ops;
> > > +
> > >  static int
> > >  ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
> > > struct devlink_param_gset_ctx *ctx)
> > > @@ -1419,6 +1422,7 @@ static void ice_devlink_free(void *devlink_ptr)
> > >   * Allocate a devlink instance for this device and return the private 
> > > area as
> > >   * the PF structure. The devlink memory is kept track of through devres 
> > > by
> > >   * adding an action to remove it when unwinding.
> > > + *
> > >   */
> > >  struct ice_pf *ice_allocate_pf(struct device *dev)
> > >  {
> > > @@ -1435,6 +1439,35 @@ struct ice_pf *ice_allocate_pf(struct device *dev)
> > > return devlink_priv(devlink);
> > >  }
> > >
> > > +/**
> > > + * ice_allocate_sf - Allocate devlink and return SF structure pointer
> > > + * @dev: the device to allocate for
> > > + * @pf: pointer to the PF structure
> > > + *
> > > + * Allocate a devlink instance for SF.
> > > + *
> > > + * Return: void pointer to allocated memory
> > > + */
> > > +struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf 
> > > *pf)
> > > +{
> > > +   struct devlink *devlink;
> > > +   int err;
> > > +
> > > +   devlink = devlink_alloc_ns(&ice_sf_devlink_ops,
> > > +  sizeof(struct ice_sf_priv),
> > > +  devlink_net(priv_to_devlink(pf)), dev);
> > > +   if (!devlink)
> > > +   return NULL;
> > > +
> > > +   err = devl_nested_devlink_set(priv_to_devlink(pf), devlink);
> > > +   if (err) {
> > > +   devlink_free(devlink);
> > > +   return ERR_PTR(err);
> > > +   }
> > > +
> > > +   return devlink_priv(devlink);
> > > +}
> > > +
> > >  /**
> > >   * ice_devlink_register - Register devlink interface for this PF
> > >   * @pf: the PF to register the devlink for.
> > > diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.h 
> > > b/drivers/net/ethernet/intel/ice/devlink/devlink.h
> > > index d291c0e2e17b..1af3b0763fbb 100644
> > > --- a/drivers/net/ethernet/intel/ice/devlink/devlink.h
> > > +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.h
> > > @@ -5,

Re: [Intel-wired-lan] [PATCH iwl-net] ice: Add netif_device_attach/detach into PF reset flow

2024-08-13 Thread Kalesh Anakkur Purayil
Hi David,

One question in line.

On Mon, Aug 12, 2024 at 3:52 PM Dawid Osuchowski
 wrote:
>
> Ethtool callbacks can be executed while reset is in progress and try to
> access deleted resources, e.g. getting coalesce settings can result in a
> NULL pointer dereference seen below.
>
> Once the driver is fully initialized, trigger reset:
> # echo 1 > /sys/class/net//device/reset
> when reset is in progress try to get coalesce settings using ethtool:
> # ethtool -c 
>
> Calling netif_device_detach() before reset makes the net core not call
> the driver when ethtool command is issued, the attempt to execute an
> ethtool command during reset will result in the following message:
>
> netlink error: No such device
>
> instead of NULL pointer dereference. Once reset is done and
> ice_rebuild() is executing, the netif_device_attach() is called to allow
> for ethtool operations to occur again in a safe manner.
>
> [  +0.000105] BUG: kernel NULL pointer dereference, address: 0020
> [  +0.27] #PF: supervisor read access in kernel mode
> [  +0.11] #PF: error_code(0x) - not-present page
> [  +0.11] PGD 0 P4D 0
> [  +0.08] Oops: Oops:  [#1] PREEMPT SMP PTI
> [  +0.12] CPU: 11 PID: 19713 Comm: ethtool Tainted: G S 
> 6.10.0-rc7+ #7
> [  +0.15] Hardware name: Supermicro Super Server/X10SRi-F, BIOS 2.0 
> 12/17/2015
> [  +0.13] RIP: 0010:ice_get_q_coalesce+0x2e/0xa0 [ice]
> [  +0.90] Code: 00 55 53 48 89 fb 48 89 f7 48 83 ec 08 0f b7 8b 86 04 00 
> 00 0f b7 83 82 04 00 00 39 d1 7e 30 48 8b 4b 18 48 63 ea 48 8b 0c e9 <48> 8b 
> 71 20 48 81 c6 a0 01 00 00 39 c2 7c 32 e8 ee fe ff ff 85 c0
> [  +0.29] RSP: 0018:bab1e9bcf6a8 EFLAGS: 00010206
> [  +0.12] RAX: 000c RBX: 94512305b028 RCX: 
> 
> [  +0.12] RDX:  RSI: 9451c3f2e588 RDI: 
> 9451c3f2e588
> [  +0.12] RBP:  R08:  R09: 
> 
> [  +0.13] R10: 9451c3f2e580 R11: 001f R12: 
> 945121fa9000
> [  +0.12] R13: bab1e9bcf760 R14: 0013 R15: 
> 9e65dd40
> [  +0.12] FS:  7faee5fbe740() GS:94546fd8() 
> knlGS:
> [  +0.14] CS:  0010 DS:  ES:  CR0: 80050033
> [  +0.11] CR2: 0020 CR3: 000106c2e005 CR4: 
> 001706f0
> [  +0.12] Call Trace:
> [  +0.09]  
> [  +0.07]  ? __die+0x23/0x70
> [  +0.12]  ? page_fault_oops+0x173/0x510
> [  +0.11]  ? ice_get_q_coalesce+0x2e/0xa0 [ice]
> [  +0.71]  ? search_module_extables+0x19/0x60
> [  +0.13]  ? search_bpf_extables+0x5f/0x80
> [  +0.12]  ? exc_page_fault+0x7e/0x180
> [  +0.13]  ? asm_exc_page_fault+0x26/0x30
> [  +0.14]  ? ice_get_q_coalesce+0x2e/0xa0 [ice]
> [  +0.70]  ice_get_coalesce+0x17/0x30 [ice]
> [  +0.70]  coalesce_prepare_data+0x61/0x80
> [  +0.12]  ethnl_default_doit+0xde/0x340
> [  +0.12]  genl_family_rcv_msg_doit+0xf2/0x150
> [  +0.13]  genl_rcv_msg+0x1b3/0x2c0
> [  +0.09]  ? __pfx_ethnl_default_doit+0x10/0x10
> [  +0.11]  ? __pfx_genl_rcv_msg+0x10/0x10
> [  +0.10]  netlink_rcv_skb+0x5b/0x110
> [  +0.13]  genl_rcv+0x28/0x40
> [  +0.07]  netlink_unicast+0x19c/0x290
> [  +0.12]  netlink_sendmsg+0x222/0x490
> [  +0.11]  __sys_sendto+0x1df/0x1f0
> [  +0.13]  __x64_sys_sendto+0x24/0x30
> [  +0.000340]  do_syscall_64+0x82/0x160
> [  +0.000309]  ? __mod_memcg_lruvec_state+0xa6/0x150
> [  +0.000309]  ? __lruvec_stat_mod_folio+0x68/0xa0
> [  +0.000311]  ? folio_add_file_rmap_ptes+0x86/0xb0
> [  +0.000309]  ? next_uptodate_folio+0x89/0x290
> [  +0.000309]  ? filemap_map_pages+0x521/0x5f0
> [  +0.000302]  ? do_fault+0x26e/0x470
> [  +0.000293]  ? __handle_mm_fault+0x7dc/0x1060
> [  +0.000295]  ? __count_memcg_events+0x58/0xf0
> [  +0.000289]  ? count_memcg_events.constprop.0+0x1a/0x30
> [  +0.000292]  ? handle_mm_fault+0xae/0x320
> [  +0.000284]  ? do_user_addr_fault+0x33a/0x6a0
> [  +0.000280]  ? exc_page_fault+0x7e/0x180
> [  +0.000289]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> [  +0.000271] RIP: 0033:0x7faee60d8e27
>
> Fixes: 67fe64d78c43 ("ice: Implement getting and setting ethtool coalesce")
> Suggested-by: Jakub Kicinski 
> Signed-off-by: Dawid Osuchowski 
> Reviewed-by: Igor Bagnucki 
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c 
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index eaa73cc200f4..16b4920741ff 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -608,6 +608,8 @@ ice_prepare_for_reset(struct ice_pf *pf, enum 
> ice_reset_req reset_type)
> memset(&vsi->mqprio_qopt, 0, 
> sizeof(vsi->mqprio_qopt));
> }
> }
> +   if (vsi->netdev)
> +   netif_device_detach(vsi->netdev);

Re: [Intel-wired-lan] [PATCH iwl-next v2 14/15] ice: cleanup inconsistent code

2023-12-13 Thread Kalesh Anakkur Purayil
On Wed, Dec 6, 2023 at 6:32 AM Jesse Brandeburg 
wrote:

> It was found while doing further testing of the previous commit
> fbf32a9bab91 ("ice: field get conversion") that one of the FIELD_GET
> conversions should really be a FIELD_PREP. The previous code was styled
> as a match to the FIELD_GET conversion, which always worked because the
> shift value was 0.  The code makes way more sense as a FIELD_PREP and
> was in fact the only FIELD_GET with two constant arguments in this
> series.
>
> Didn't squash this patch to make it easier to call out the
> (non-impactful) bug.
>
> Signed-off-by: Jesse Brandeburg 
> ---
>  drivers/net/ethernet/intel/ice/ice_dcb.c | 2 +-
>  drivers/net/ethernet/intel/ice/ice_lib.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c
> b/drivers/net/ethernet/intel/ice/ice_dcb.c
> index 7f3e00c187b4..74418c445cc4 100644
> --- a/drivers/net/ethernet/intel/ice/ice_dcb.c
> +++ b/drivers/net/ethernet/intel/ice/ice_dcb.c
> @@ -967,7 +967,7 @@ void ice_get_dcb_cfg_from_mib_change(struct
> ice_port_info *pi,
>
> mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;
>
> -   change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M,  mib->type);
> +   change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M, mib->type);
>
[Kalesh]: I did not get what exactly changed here? Is that you just removed
one extra space before mib->type?

> if (change_type == ICE_AQ_LLDP_MIB_REMOTE)
> dcbx_cfg = &pi->qos_cfg.remote_dcbx_cfg;
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c
> b/drivers/net/ethernet/intel/ice/ice_lib.c
> index 8cdd53412748..d1c1e53fe15c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -974,8 +974,8 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw,
> struct ice_vsi_ctx *ctxt)
> /* Traffic from VSI can be sent to LAN */
> ctxt->info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;
> /* allow all untagged/tagged packets by default on Tx */
> -   ctxt->info.inner_vlan_flags =
> FIELD_GET(ICE_AQ_VSI_INNER_VLAN_TX_MODE_M,
> -
>  ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL);
> +   ctxt->info.inner_vlan_flags =
> FIELD_PREP(ICE_AQ_VSI_INNER_VLAN_TX_MODE_M,
> +
> ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL);
> /* SVM - by default bits 3 and 4 in inner_vlan_flags are 0's which
>  * results in legacy behavior (show VLAN, DEI, and UP) in
> descriptor.
>  *
> --
> 2.39.3
>
>
>

-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature
___
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan


Re: [Intel-wired-lan] [PATCH iwl-next v2 14/15] ice: cleanup inconsistent code

2023-12-14 Thread Kalesh Anakkur Purayil
On Wed, Dec 13, 2023 at 11:57 PM Jesse Brandeburg <
jesse.brandeb...@intel.com> wrote:

> Please don't use HTML email, your reply was likely dropped by most lists
> that filter HTML.
>
Sure, I will check.

>
> On 12/12/2023 8:06 PM, Kalesh Anakkur Purayil wrote:
> > -   change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M,  mib->type);
> > +   change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M, mib->type);
> >
> > [Kalesh]: I did not get what exactly changed here? Is that you just
> > removed one extra space before mib->type?
>
> Yes, there was a whitespace change missed in the GET series. I had
> caught it only here. If you feel I need to I can resend to add a comment
> to the commit message that this was added here.
>
No need. I am good here. Thank you.


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature
___
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan


Re: [Intel-wired-lan] [PATCH iwl-next 1/7] i40e: Remove flags field from i40e_veb

2024-03-26 Thread Kalesh Anakkur Purayil
On Mon, Mar 18, 2024 at 8:01 PM Ivan Vecera  wrote:
>
> The field is initialized always to zero and it is never read.
> Remove it.
>
> Signed-off-by: Ivan Vecera 
> ---
LGTM
Reviewed-by: Kalesh AP 

>  drivers/net/ethernet/intel/i40e/i40e.h |  3 +--
>  drivers/net/ethernet/intel/i40e/i40e_debugfs.c |  2 +-
>  drivers/net/ethernet/intel/i40e/i40e_main.c| 13 +
>  3 files changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e.h 
> b/drivers/net/ethernet/intel/i40e/i40e.h
> index 2fbabcdb5bb5..5248e78f7849 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e.h
> @@ -788,7 +788,6 @@ struct i40e_veb {
> u16 stats_idx;  /* index of VEB parent */
> u8  enabled_tc;
> u16 bridge_mode;/* Bridge Mode (VEB/VEPA) */
> -   u16 flags;
> u16 bw_limit;
> u8  bw_max_quanta;
> bool is_abs_credits;
> @@ -1213,7 +1212,7 @@ void i40e_vsi_stop_rings(struct i40e_vsi *vsi);
>  void i40e_vsi_stop_rings_no_wait(struct  i40e_vsi *vsi);
>  int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi);
>  int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count);
> -struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags, u16 
> uplink_seid,
> +struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 uplink_seid,
> u16 downlink_seid, u8 enabled_tc);
>  void i40e_veb_release(struct i40e_veb *veb);
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c 
> b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> index f9ba45f596c9..6147c5f128e8 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> @@ -867,7 +867,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
> goto command_write_done;
> }
>
> -   veb = i40e_veb_setup(pf, 0, uplink_seid, vsi_seid, 
> enabled_tc);
> +   veb = i40e_veb_setup(pf, uplink_seid, vsi_seid, enabled_tc);
> if (veb)
> dev_info(&pf->pdev->dev, "added relay %d\n", 
> veb->seid);
> else
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c 
> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 663b2237eb4e..2f1604ae78c7 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -13138,7 +13138,7 @@ static int i40e_ndo_bridge_setlink(struct net_device 
> *dev,
>
> /* Insert a new HW bridge */
> if (!veb) {
> -   veb = i40e_veb_setup(pf, 0, vsi->uplink_seid, 
> vsi->seid,
> +   veb = i40e_veb_setup(pf, vsi->uplink_seid, vsi->seid,
>  vsi->tc_config.enabled_tc);
> if (veb) {
> veb->bridge_mode = mode;
> @@ -14394,10 +14394,10 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, 
> u8 type,
> }
>
> if (vsi->uplink_seid == pf->mac_seid)
> -   veb = i40e_veb_setup(pf, 0, pf->mac_seid, vsi->seid,
> +   veb = i40e_veb_setup(pf, pf->mac_seid, vsi->seid,
>  vsi->tc_config.enabled_tc);
> else if ((vsi->flags & I40E_VSI_FLAG_VEB_OWNER) == 0)
> -   veb = i40e_veb_setup(pf, 0, vsi->uplink_seid, 
> vsi->seid,
> +   veb = i40e_veb_setup(pf, vsi->uplink_seid, vsi->seid,
>  vsi->tc_config.enabled_tc);
> if (veb) {
> if (vsi->seid != pf->vsi[pf->lan_vsi]->seid) {
> @@ -14791,7 +14791,6 @@ static int i40e_add_veb(struct i40e_veb *veb, struct 
> i40e_vsi *vsi)
>  /**
>   * i40e_veb_setup - Set up a VEB
>   * @pf: board private structure
> - * @flags: VEB setup flags
>   * @uplink_seid: the switch element to link to
>   * @vsi_seid: the initial VSI seid
>   * @enabled_tc: Enabled TC bit-map
> @@ -14804,9 +14803,8 @@ static int i40e_add_veb(struct i40e_veb *veb, struct 
> i40e_vsi *vsi)
>   * Returns pointer to the successfully allocated VEB sw struct on
>   * success, otherwise returns NULL on failure.
>   **/
> -struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
> -   u16 uplink_seid, u16 vsi_seid,
> -   u8 enabled_tc)
> +struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 uplink_seid,
> +   u16 vsi_seid, u8 enabled_tc)
>  {
> struct i40e_vsi *vsi = NULL;
> struct i40e_veb *veb;
> @@ -14837,7 +14835,6 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, 
> u16 flags,
> if (veb_idx < 0)
> goto err_alloc;
> veb = pf->veb[veb_idx];
> -   veb->flags = flags;
> veb->uplink_seid = uplink_se

Re: [Intel-wired-lan] [PATCH iwl-next v2 3/7] i40e: Refactor argument of i40e_detect_recover_hung()

2024-03-28 Thread Kalesh Anakkur Purayil
On Wed, Mar 27, 2024 at 1:28 PM Ivan Vecera  wrote:
>
> Commit 07d44190a389 ("i40e/i40evf: Detect and recover hung queue
> scenario") changes i40e_detect_recover_hung() argument type from
> i40e_pf* to i40e_vsi* to be shareable by both i40e and i40evf.
> Because the i40evf does not exist anymore and the function is
> exclusively used by i40e we can revert this change.
>
> Reviewed-by: Michal Schmidt 
> Signed-off-by: Ivan Vecera 

Reviewed-by: Kalesh AP 
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c |  2 +-
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 10 ++
>  drivers/net/ethernet/intel/i40e/i40e_txrx.h |  2 +-
>  3 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c 
> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 7fed7fb69d4e..1ba28893f49e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -11274,7 +11274,7 @@ static void i40e_service_task(struct work_struct 
> *work)
> return;
>
> if (!test_bit(__I40E_RECOVERY_MODE, pf->state)) {
> -   i40e_detect_recover_hung(pf->vsi[pf->lan_vsi]);
> +   i40e_detect_recover_hung(pf);
> i40e_sync_filters_subtask(pf);
> i40e_reset_subtask(pf);
> i40e_handle_mdd_event(pf);
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c 
> b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index 1a12b732818e..e35a08de16b2 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -860,13 +860,15 @@ u32 i40e_get_tx_pending(struct i40e_ring *ring, bool 
> in_sw)
>
>  /**
>   * i40e_detect_recover_hung - Function to detect and recover hung_queues
> - * @vsi:  pointer to vsi struct with tx queues
> + * @pf: pointer to PF struct
>   *
> - * VSI has netdev and netdev has TX queues. This function is to check each of
> - * those TX queues if they are hung, trigger recovery by issuing SW 
> interrupt.
> + * LAN VSI has netdev and netdev has TX queues. This function is to check
> + * each of those TX queues if they are hung, trigger recovery by issuing
> + * SW interrupt.
>   **/
> -void i40e_detect_recover_hung(struct i40e_vsi *vsi)
> +void i40e_detect_recover_hung(struct i40e_pf *pf)
>  {
> +   struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
> struct i40e_ring *tx_ring = NULL;
> struct net_device *netdev;
> unsigned int i;
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h 
> b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
> index 2cdc7de6301c..7c26c9a2bf65 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h
> @@ -470,7 +470,7 @@ void i40e_free_rx_resources(struct i40e_ring *rx_ring);
>  int i40e_napi_poll(struct napi_struct *napi, int budget);
>  void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector);
>  u32 i40e_get_tx_pending(struct i40e_ring *ring, bool in_sw);
> -void i40e_detect_recover_hung(struct i40e_vsi *vsi);
> +void i40e_detect_recover_hung(struct i40e_pf *pf);
>  int __i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size);
>  bool __i40e_chk_linearize(struct sk_buff *skb);
>  int i40e_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
> --
> 2.43.0
>
>


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH net-next v4 3/3] ice: fold ice_ptp_read_time into ice_ptp_gettimex64

2024-03-29 Thread Kalesh Anakkur Purayil
On Tue, Mar 26, 2024 at 6:07 AM Michal Schmidt  wrote:
>
> This is a cleanup. It is unnecessary to have this function just to call
> another function.
>
> Reviewed-by: Przemek Kitszel 
> Signed-off-by: Michal Schmidt 

Reviewed-by: Kalesh AP 
> ---
>  drivers/net/ethernet/intel/ice/ice_ptp.c | 25 +++-
>  1 file changed, 3 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c 
> b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 0875f37add78..0f17fc1181d2 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -1166,26 +1166,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf 
> *pf)
> ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx);
>  }
>
> -/**
> - * ice_ptp_read_time - Read the time from the device
> - * @pf: Board private structure
> - * @ts: timespec structure to hold the current time value
> - * @sts: Optional parameter for holding a pair of system timestamps from
> - *   the system clock. Will be ignored if NULL is given.
> - *
> - * This function reads the source clock registers and stores them in a 
> timespec.
> - * However, since the registers are 64 bits of nanoseconds, we must convert 
> the
> - * result to a timespec before we can return.
> - */
> -static void
> -ice_ptp_read_time(struct ice_pf *pf, struct timespec64 *ts,
> - struct ptp_system_timestamp *sts)
> -{
> -   u64 time_ns = ice_ptp_read_src_clk_reg(pf, sts);
> -
> -   *ts = ns_to_timespec64(time_ns);
> -}
> -
>  /**
>   * ice_ptp_write_init - Set PHC time to provided value
>   * @pf: Board private structure
> @@ -1926,9 +1906,10 @@ ice_ptp_gettimex64(struct ptp_clock_info *info, struct 
> timespec64 *ts,
>struct ptp_system_timestamp *sts)
>  {
> struct ice_pf *pf = ptp_info_to_pf(info);
> +   u64 time_ns;
>
> -   ice_ptp_read_time(pf, ts, sts);
> -
> +   time_ns = ice_ptp_read_src_clk_reg(pf, sts);
> +   *ts = ns_to_timespec64(time_ns);
> return 0;
>  }
>
> --
> 2.43.2
>
>


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [iwl-net v1] ice: block SF port creation in legacy mode

2024-10-04 Thread Kalesh Anakkur Purayil
On Fri, Oct 4, 2024 at 12:25 PM Michal Swiatkowski
 wrote:
>
> There is no support for SF in legacy mode. Reflect it in the code.
>
> Reviewed-by: Przemek Kitszel 
> Fixes: eda69d654c7e ("ice: add basic devlink subfunctions support")
> Signed-off-by: Michal Swiatkowski 

LGTM,
Reviewed-by: Kalesh AP 

-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH iwl-next v9 3/7] ixgbe: Add link management support for E610 device

2024-10-17 Thread Kalesh Anakkur Purayil
On Thu, Oct 3, 2024 at 7:49 PM Piotr Kwapulinski
 wrote:
>
> Add low level link management support for E610 device. Link management
> operations are handled via the Admin Command Interface. Add the following
> link management operations:
> - get link capabilities
> - set up link
> - get media type
> - get link status, link status events
> - link power management
>
> Co-developed-by: Stefan Wegrzyn 
> Signed-off-by: Stefan Wegrzyn 
> Co-developed-by: Jedrzej Jagielski 
> Signed-off-by: Jedrzej Jagielski 
> Reviewed-by: Jan Glaza 
> Signed-off-by: Piotr Kwapulinski 
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 1091 +
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h |   32 +
>  .../ethernet/intel/ixgbe/ixgbe_type_e610.h|1 +
>  3 files changed, 1124 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c 
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> index 3bc88df..c0c740f 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> @@ -1033,3 +1033,1094 @@ void ixgbe_copy_phy_caps_to_cfg(struct 
> ixgbe_aci_cmd_get_phy_caps_data *caps,
> cfg->module_compliance_enforcement =
> caps->module_compliance_enforcement;
>  }
> +
> +/**
> + * ixgbe_aci_set_phy_cfg - set PHY configuration
> + * @hw: pointer to the HW struct
> + * @cfg: structure with PHY configuration data to be set
> + *
> + * Set the various PHY configuration parameters supported on the Port
> + * using ACI command (0x0601).
> + * One or more of the Set PHY config parameters may be ignored in an MFP
> + * mode as the PF may not have the privilege to set some of the PHY Config
> + * parameters.
> + *
> + * Return: the exit code of the operation.
> + */
> +int ixgbe_aci_set_phy_cfg(struct ixgbe_hw *hw,
> + struct ixgbe_aci_cmd_set_phy_cfg_data *cfg)
> +{
> +   struct ixgbe_aci_desc desc;
> +   int err;
> +
> +   if (!cfg)
> +   return -EINVAL;
> +
> +   /* Ensure that only valid bits of cfg->caps can be turned on. */
> +   cfg->caps &= IXGBE_ACI_PHY_ENA_VALID_MASK;
> +
> +   ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_phy_cfg);
> +   desc.params.set_phy.lport_num = hw->bus.func;
> +   desc.flags |= IXGBE_ACI_FLAG_RD;
> +
> +   err = ixgbe_aci_send_cmd(hw, &desc, cfg, sizeof(*cfg));
> +
[Kalesh] There is no need of an empty line here
> +   if (!err)
> +   hw->phy.curr_user_phy_cfg = *cfg;
> +
> +   return err;
> +}
> +
> +/**
> + * ixgbe_aci_set_link_restart_an - set up link and restart AN
> + * @hw: pointer to the HW struct
> + * @ena_link: if true: enable link, if false: disable link
> + *
> + * Function sets up the link and restarts the Auto-Negotiation over the link.
> + *
> + * Return: the exit code of the operation.
> + */
> +int ixgbe_aci_set_link_restart_an(struct ixgbe_hw *hw, bool ena_link)
> +{
> +   struct ixgbe_aci_cmd_restart_an *cmd;
> +   struct ixgbe_aci_desc desc;
> +
> +   cmd = &desc.params.restart_an;
> +
> +   ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_restart_an);
> +
> +   cmd->cmd_flags = IXGBE_ACI_RESTART_AN_LINK_RESTART;
> +   cmd->lport_num = hw->bus.func;
> +   if (ena_link)
> +   cmd->cmd_flags |= IXGBE_ACI_RESTART_AN_LINK_ENABLE;
> +   else
> +   cmd->cmd_flags &= ~IXGBE_ACI_RESTART_AN_LINK_ENABLE;
> +
> +   return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);
> +}
> +
> +/**
> + * ixgbe_is_media_cage_present - check if media cage is present
> + * @hw: pointer to the HW struct
> + *
> + * Identify presence of media cage using the ACI command (0x06E0).
> + *
> + * Return: true if media cage is present, else false. If no cage, then
> + * media type is backplane or BASE-T.
> + */
> +static bool ixgbe_is_media_cage_present(struct ixgbe_hw *hw)
> +{
> +   struct ixgbe_aci_cmd_get_link_topo *cmd;
> +   struct ixgbe_aci_desc desc;
> +
> +   cmd = &desc.params.get_link_topo;
> +
> +   ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_get_link_topo);
> +
> +   cmd->addr.topo_params.node_type_ctx =
> +   FIELD_PREP(IXGBE_ACI_LINK_TOPO_NODE_CTX_M,
> +  IXGBE_ACI_LINK_TOPO_NODE_CTX_PORT);
> +
> +   /* Set node type. */
> +   cmd->addr.topo_params.node_type_ctx |=
> +   FIELD_PREP(IXGBE_ACI_LINK_TOPO_NODE_TYPE_M,
> +  IXGBE_ACI_LINK_TOPO_NODE_TYPE_CAGE);
> +
> +   /* Node type cage can be used to determine if cage is present. If AQC
> +* returns error (ENOENT), then no cage present. If no cage present 
> then
> +* connection type is backplane or BASE-T.
> +*/
> +   return ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL);
> +}
> +
> +/**
> + * ixgbe_get_media_type_from_phy_type - Gets media type based on phy type
> + * @hw: pointer to the HW struct
> + *
> + * Try to identify the media type based on

Re: [Intel-wired-lan] [PATCH iwl-next v9 2/7] ixgbe: Add support for E610 device capabilities detection

2024-10-17 Thread Kalesh Anakkur Purayil
On Thu, Oct 3, 2024 at 7:48 PM Piotr Kwapulinski
 wrote:
>
> Add low level support for E610 device capabilities detection. The
> capabilities are discovered via the Admin Command Interface. Discover the
> following capabilities:
> - function caps: vmdq, dcb, rss, rx/tx qs, msix, nvm, orom, reset
> - device caps: vsi, fdir, 1588
> - phy caps
>
> Co-developed-by: Stefan Wegrzyn 
> Signed-off-by: Stefan Wegrzyn 
> Co-developed-by: Jedrzej Jagielski 
> Signed-off-by: Jedrzej Jagielski 
> Reviewed-by: Jan Sokolowski 
> Signed-off-by: Piotr Kwapulinski 

Hi Piotr,

Some minor cosmetic comments in line.

> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 540 ++
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h |  12 +
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   8 +
>  3 files changed, 560 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c 
> b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> index 28bd7da..3bc88df 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> @@ -493,3 +493,543 @@ void ixgbe_release_res(struct ixgbe_hw *hw, enum 
> ixgbe_aci_res_ids res)
> total_delay++;
> }
>  }
> +
> +/**
> + * ixgbe_parse_e610_caps - Parse common device/function capabilities
> + * @hw: pointer to the HW struct
> + * @caps: pointer to common capabilities structure
> + * @elem: the capability element to parse
> + * @prefix: message prefix for tracing capabilities
> + *
> + * Given a capability element, extract relevant details into the common
> + * capability structure.
> + *
> + * Return: true if the capability matches one of the common capability ids,
> + * false otherwise.
> + */
> +static bool ixgbe_parse_e610_caps(struct ixgbe_hw *hw,
> + struct ixgbe_hw_caps *caps,
> + struct ixgbe_aci_cmd_list_caps_elem *elem,
> + const char *prefix)
> +{
> +   u32 logical_id = elem->logical_id;
> +   u32 phys_id = elem->phys_id;
> +   u32 number = elem->number;
> +   u16 cap = elem->cap;
> +
> +   switch (cap) {
> +   case IXGBE_ACI_CAPS_VALID_FUNCTIONS:
> +   caps->valid_functions = number;
> +   break;
> +   case IXGBE_ACI_CAPS_SRIOV:
> +   caps->sr_iov_1_1 = (number == 1);
> +   break;
> +   case IXGBE_ACI_CAPS_VMDQ:
> +   caps->vmdq = (number == 1);
> +   break;
> +   case IXGBE_ACI_CAPS_DCB:
> +   caps->dcb = (number == 1);
> +   caps->active_tc_bitmap = logical_id;
> +   caps->maxtc = phys_id;
> +   break;
> +   case IXGBE_ACI_CAPS_RSS:
> +   caps->rss_table_size = number;
> +   caps->rss_table_entry_width = logical_id;
> +   break;
> +   case IXGBE_ACI_CAPS_RXQS:
> +   caps->num_rxq = number;
> +   caps->rxq_first_id = phys_id;
> +   break;
> +   case IXGBE_ACI_CAPS_TXQS:
> +   caps->num_txq = number;
> +   caps->txq_first_id = phys_id;
> +   break;
> +   case IXGBE_ACI_CAPS_MSIX:
> +   caps->num_msix_vectors = number;
> +   caps->msix_vector_first_id = phys_id;
> +   break;
> +   case IXGBE_ACI_CAPS_NVM_VER:
> +   break;
> +   case IXGBE_ACI_CAPS_MAX_MTU:
> +   caps->max_mtu = number;
> +   break;
> +   case IXGBE_ACI_CAPS_PCIE_RESET_AVOIDANCE:
> +   caps->pcie_reset_avoidance = (number > 0);
> +   break;
> +   case IXGBE_ACI_CAPS_POST_UPDATE_RESET_RESTRICT:
> +   caps->reset_restrict_support = (number == 1);
> +   break;
> +   case IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG0:
> +   case IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG1:
> +   case IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG2:
> +   case IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG3:
> +   {
> +   u8 index = cap - IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG0;
> +
> +   caps->ext_topo_dev_img_ver_high[index] = number;
> +   caps->ext_topo_dev_img_ver_low[index] = logical_id;
> +   caps->ext_topo_dev_img_part_num[index] =
> +   FIELD_GET(IXGBE_EXT_TOPO_DEV_IMG_PART_NUM_M, phys_id);
> +   caps->ext_topo_dev_img_load_en[index] =
> +   (phys_id & IXGBE_EXT_TOPO_DEV_IMG_LOAD_EN) != 0;
> +   caps->ext_topo_dev_img_prog_en[index] =
> +   (phys_id & IXGBE_EXT_TOPO_DEV_IMG_PROG_EN) != 0;
> +   break;
> +   }
> +   default:
> +   /* Not one of the recognized common capabilities */
> +   return false;
> +   }
> +
> +   return true;
> +}
> +
> +/**
> + * ixgbe_parse_valid_functions_cap - Parse IXGBE_ACI_CAPS_VALID_FUNCTIONS 
> caps
> + * @hw: pointer to the HW struct
> + * @dev_p: pointer t

Re: [Intel-wired-lan] [PATCH iwl-next 2/4] ice: split ice_init_hw() out from ice_init_dev()

2024-10-02 Thread Kalesh Anakkur Purayil
On Wed, Oct 2, 2024 at 5:23 PM Przemek Kitszel
 wrote:
>
> Split ice_init_hw() call out from ice_init_dev(). Such move enables
> pulling the former to be even earlier on call path, what would enable
> moving ice_adapter init to be between the two (in subsequent commit).
> Such move enables ice_adapter to know about number of PFs.
>
> Do the same for ice_deinit_hw(), so the init and deinit calls could
> be easily mirrored.
> Next commit will rename unrelated goto labels to unroll prefix.
>
> Reviewed-by: Marcin Szycik 
> Signed-off-by: Przemek Kitszel 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH iwl-next 3/4] ice: minor: rename goto labels from err to unroll

2024-10-02 Thread Kalesh Anakkur Purayil
On Wed, Oct 2, 2024 at 5:23 PM Przemek Kitszel
 wrote:
>
> Clean up goto labels after previous commit, to conform to single naming
> scheme in ice_probe() and ice_init_dev().
>
> Reviewed-by: Marcin Szycik 
> Signed-off-by: Przemek Kitszel 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH iwl-next 4/4] ice: ice_probe: init ice_adapter after HW init

2024-10-02 Thread Kalesh Anakkur Purayil
On Wed, Oct 2, 2024 at 5:23 PM Przemek Kitszel
 wrote:
>
> Move ice_adapter initialization to be after HW init, so it could use HW
> capabilities, like number of PFs. This is needed for devlink-resource
> based RSS LUT size management for PF/VF (not in this series).
>
> Reviewed-by: Marcin Szycik 
> Signed-off-by: Przemek Kitszel 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh A P


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [RFC net-next 5/9] i40e: Remove unused i40e_get_cur_guaranteed_fd_count

2024-12-22 Thread Kalesh Anakkur Purayil
On Sun, Dec 22, 2024 at 12:13 AM  wrote:
>
> From: "Dr. David Alan Gilbert" 
>
> The last use of i40e_get_cur_guaranteed_fd_count() was removed in 2015 by
> commit 04294e38a451 ("i40e: FD filters flush policy changes")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [RFC net-next 2/9] i40e: Remove unused i40e_blink_phy_link_led

2024-12-22 Thread Kalesh Anakkur Purayil
On Sun, Dec 22, 2024 at 12:16 AM  wrote:
>
> From: "Dr. David Alan Gilbert" 
>
> i40e_blink_phy_link_led() was added in 2016 by
> commit fd077cd3399b ("i40e: Add functions to blink led on 10GBaseT PHY")
>
> but hasn't been used.
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [RFC net-next 7/9] i40e: Remove unused i40e_commit_partition_bw_setting

2024-12-22 Thread Kalesh Anakkur Purayil
On Sun, Dec 22, 2024 at 12:15 AM  wrote:
>
> From: "Dr. David Alan Gilbert" 
>
> i40e_commit_partition_bw_setting() was added in 2017 by
> commit 4fc8c6763957 ("i40e: genericize the partition bandwidth control")
> but hasn't been used.
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [RFC net-next 9/9] i40e: Remove unused i40e_dcb_hw_get_num_tc

2024-12-22 Thread Kalesh Anakkur Purayil
On Sun, Dec 22, 2024 at 12:15 AM  wrote:
>
> From: "Dr. David Alan Gilbert" 
>
> The last useof i40e_dcb_hw_get_num_tc() was removed in 2022 by
> commit fe20371578ef ("Revert "i40e: Fix reset bw limit when DCB enabled
> with 1 TC"")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert 

LGTM,
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH net-next v3 4/6] bnxt: use napi's irq affinity

2025-01-04 Thread Kalesh Anakkur Purayil
On Sat, Jan 4, 2025 at 6:13 AM Ahmed Zaki  wrote:
>
> Delete the driver CPU affinity info and use the core's napi config
> instead.
>
> Signed-off-by: Ahmed Zaki 
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.h |  2 --
>  2 files changed, 4 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c 
> b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index cc3ca3440b0a..fcf230fde1ec 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -11193,14 +11193,8 @@ static void bnxt_free_irq(struct bnxt *bp)
> int map_idx = bnxt_cp_num_to_irq_num(bp, i);
>
> irq = &bp->irq_tbl[map_idx];
> -   if (irq->requested) {
> -   if (irq->have_cpumask) {
> -   irq_update_affinity_hint(irq->vector, NULL);
> -   free_cpumask_var(irq->cpu_mask);
> -   irq->have_cpumask = 0;
> -   }
> +   if (irq->requested)
> free_irq(irq->vector, bp->bnapi[i]);
> -   }
>
> irq->requested = 0;
> }
> @@ -11229,21 +11223,6 @@ static int bnxt_request_irq(struct bnxt *bp)
>
> netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
> irq->requested = 1;
> -
> -   if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
> -   int numa_node = dev_to_node(&bp->pdev->dev);
> -
> -   irq->have_cpumask = 1;
> -   cpumask_set_cpu(cpumask_local_spread(i, numa_node),
> -   irq->cpu_mask);
> -   rc = irq_update_affinity_hint(irq->vector, 
> irq->cpu_mask);
> -   if (rc) {
> -   netdev_warn(bp->dev,
> -   "Update affinity hint failed, IRQ 
> = %d\n",
> -   irq->vector);
> -   break;
> -   }
> -   }
> }
> return rc;
>  }
> @@ -13292,6 +13271,7 @@ static int bnxt_set_features(struct net_device *dev, 
> netdev_features_t features)
> bp->flags = old_flags;
> }
> }
> +
This change looks unrelated, please remove.
> return rc;
>  }
>
> @@ -16172,6 +16152,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const 
> struct pci_device_id *ent)
> dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> NETDEV_XDP_ACT_RX_SG;
>
> +   netif_enable_irq_affinity(dev);
> +
>  #ifdef CONFIG_BNXT_SRIOV
> init_waitqueue_head(&bp->sriov_cfg_wait);
>  #endif
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h 
> b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> index 094c9e95b463..7be2f90d0c05 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> @@ -1228,9 +1228,7 @@ struct bnxt_irq {
> irq_handler_t   handler;
> unsigned intvector;
> u8  requested:1;
> -   u8  have_cpumask:1;
> charname[IFNAMSIZ + BNXT_IRQ_NAME_EXTRA];
> -   cpumask_var_t   cpu_mask;
>  };
>
>  #define HWRM_RING_ALLOC_TX 0x1
> --
> 2.43.0
>
>


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Intel-wired-lan] [PATCH iwl-next v5 01/15] devlink: add value check to devlink_info_version_put()

2025-03-03 Thread Kalesh Anakkur Purayil
On Fri, Feb 21, 2025 at 5:37 PM Jedrzej Jagielski
 wrote:
>
> Prevent from proceeding if there's nothing to print.
>
> Suggested-by: Przemek Kitszel 
> Reviewed-by: Jiri Pirko 
> Signed-off-by: Jedrzej Jagielski 
Reviewed-by: Kalesh AP 


-- 
Regards,
Kalesh AP


smime.p7s
Description: S/MIME Cryptographic Signature