Subject: Re: [Intel-wired-lan] [PATCH net-next 04/15] idpf: add core init and interrupt request

From: Simon Horman <[email-masked]>
Date: Fri, 31 Mar 2023 17:39:41 +0200

On Wed, Mar 29, 2023 at 07:03:53AM -0700, Pavan Kumar Linga wrote:
> As the mailbox is setup, add the necessary send and receive
> mailbox message framework to support the virtchnl communication
> between the driver and device Control Plane (CP).
> 
> Add the core initialization. To start with, driver confirms the
> virtchnl version with the CP. Once that is done, it requests
> and gets the required capabilities and resources needed such as
> max vectors, queues etc.
> 
> Based on the vector information received in 'VIRTCHNL2_OP_GET_CAPS',
> request the stack to allocate the required vectors. Finally add
> the interrupt handling mechanism for the mailbox queue and enable
> the interrupt.
> 
> Note: Checkpatch issues a warning about IDPF_FOREACH_VPORT_VC_STATE and
> IDPF_GEN_STRING being complex macros and should be enclosed in parentheses
> but it's not the case. They are never used as a statement and instead only
> used to define the enum and array.
> 
> Co-developed-by: Alan Brady <[email-masked]>
> Signed-off-by: Alan Brady <[email-masked]>
> Co-developed-by: Emil Tantilov <[email-masked]>
> Signed-off-by: Emil Tantilov <[email-masked]>
> Co-developed-by: Joshua Hay <[email-masked]>
> Signed-off-by: Joshua Hay <[email-masked]>
> Co-developed-by: Madhu Chittim <[email-masked]>
> Signed-off-by: Madhu Chittim <[email-masked]>
> Co-developed-by: Phani Burra <[email-masked]>
> Signed-off-by: Phani Burra <[email-masked]>
> Co-developed-by: Shailendra Bhatnagar <[email-masked]>
> Signed-off-by: Shailendra Bhatnagar <[email-masked]>
> Signed-off-by: Pavan Kumar Linga <[email-masked]>
> Reviewed-by: Sridhar Samudrala <[email-masked]>

More spelling nits from my side.

...

> diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/intel/idpf/idpf.h

...

> +/* Stack to maintain vector indexes used for 'vector distribution' algorithm */
> +struct idpf_vector_lifo {
> +	/* Vector stack maintains all the relative vector indexes at the
> +	 * *adapter* level. This stack is divided into 2 parts, first one is
> +	 * called as 'default pool' and other one is called 'free pool'.
> +	 * Vector distribution algorithm gives priority to default vports in
> +	 * a way that at least IDPF_MIN_Q_VEC vectors are allocated per
> +	 * default vport and the relative vector indexes for those are
> +	 * maintained in default pool. Free pool contains all the unallocated
> +	 * vector indexes which can be allocated on-demand basis.
> +	 * Mailbox vector index is maitained in the default pool of the stack

s/maitained/maintained/

> +	 */

...

> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

...

> +/**
> + * idpf_recv_get_caps_msg - Receive virtchnl get capabilities message
> + * @adapter: Driver specific private structure
> + *
> + * Receive virtchnl get capabilities message.  Returns 0 on succes, negative on

s/succes/success/

...

> +/**
> + * idpf_vc_core_deinit - Device deinit routine
> + * @adapter: Driver specific private structue

s/structue/structure/

...