netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jeroen de Borst <jeroendb@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	jesse.brandeburg@intel.com
Subject: Re: [PATCH net-next v4 2/2] gve: Handle alternate miss completions
Date: Thu, 17 Nov 2022 13:12:20 +0200	[thread overview]
Message-ID: <Y3YXFHi6O1Fv2hfO@unreal> (raw)
In-Reply-To: <20221116181725.2207544-3-jeroendb@google.com>

On Wed, Nov 16, 2022 at 10:17:25AM -0800, Jeroen de Borst wrote:
> The virtual NIC has 2 ways of indicating a miss-path
> completion. This handles the alternate.
> 
> Signed-off-by: Jeroen de Borst <jeroendb@google.com>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
>  drivers/net/ethernet/google/gve/gve_adminq.h   |  4 +++-
>  drivers/net/ethernet/google/gve/gve_desc_dqo.h |  5 +++++
>  drivers/net/ethernet/google/gve/gve_tx_dqo.c   | 18 ++++++++++++------
>  3 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/google/gve/gve_adminq.h b/drivers/net/ethernet/google/gve/gve_adminq.h
> index b9ee8be73f96..cf29662e6ad1 100644
> --- a/drivers/net/ethernet/google/gve/gve_adminq.h
> +++ b/drivers/net/ethernet/google/gve/gve_adminq.h
> @@ -154,6 +154,7 @@ enum gve_driver_capbility {
>  	gve_driver_capability_gqi_rda = 1,
>  	gve_driver_capability_dqo_qpl = 2, /* reserved for future use */
>  	gve_driver_capability_dqo_rda = 3,
> +	gve_driver_capability_alt_miss_compl = 4,
>  };
>  
>  #define GVE_CAP1(a) BIT((int)a)
> @@ -164,7 +165,8 @@ enum gve_driver_capbility {
>  #define GVE_DRIVER_CAPABILITY_FLAGS1 \
>  	(GVE_CAP1(gve_driver_capability_gqi_qpl) | \
>  	 GVE_CAP1(gve_driver_capability_gqi_rda) | \
> -	 GVE_CAP1(gve_driver_capability_dqo_rda))
> +	 GVE_CAP1(gve_driver_capability_dqo_rda) | \
> +	 GVE_CAP1(gve_driver_capability_alt_miss_compl))
>  
>  #define GVE_DRIVER_CAPABILITY_FLAGS2 0x0
>  #define GVE_DRIVER_CAPABILITY_FLAGS3 0x0
> diff --git a/drivers/net/ethernet/google/gve/gve_desc_dqo.h b/drivers/net/ethernet/google/gve/gve_desc_dqo.h
> index e8fe9adef7f2..f79cd0591110 100644
> --- a/drivers/net/ethernet/google/gve/gve_desc_dqo.h
> +++ b/drivers/net/ethernet/google/gve/gve_desc_dqo.h
> @@ -176,6 +176,11 @@ static_assert(sizeof(struct gve_tx_compl_desc) == 8);
>  #define GVE_COMPL_TYPE_DQO_MISS 0x1 /* Miss path completion */
>  #define GVE_COMPL_TYPE_DQO_REINJECTION 0x3 /* Re-injection completion */
>  
> +/* The most significant bit in the completion tag can change the completion
> + * type from packet completion to miss path completion.
> + */
> +#define GVE_ALT_MISS_COMPL_BIT BIT(15)
> +
>  /* Descriptor to post buffers to HW on buffer queue. */
>  struct gve_rx_desc_dqo {
>  	__le16 buf_id; /* ID returned in Rx completion descriptor */
> diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
> index 588d64819ed5..762915c6063b 100644
> --- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c
> +++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
> @@ -953,12 +953,18 @@ int gve_clean_tx_done_dqo(struct gve_priv *priv, struct gve_tx_ring *tx,
>  			atomic_set_release(&tx->dqo_compl.hw_tx_head, tx_head);
>  		} else if (type == GVE_COMPL_TYPE_DQO_PKT) {
>  			u16 compl_tag = le16_to_cpu(compl_desc->completion_tag);
> -
> -			gve_handle_packet_completion(priv, tx, !!napi,
> -						     compl_tag,
> -						     &pkt_compl_bytes,
> -						     &pkt_compl_pkts,
> -						     /*is_reinjection=*/false);
> +			if (compl_tag & GVE_ALT_MISS_COMPL_BIT) {
> +				compl_tag &= ~GVE_ALT_MISS_COMPL_BIT;
> +				gve_handle_miss_completion(priv, tx, compl_tag,
> +							   &miss_compl_bytes,
> +							   &miss_compl_pkts);
> +			} else {
> +				gve_handle_packet_completion(priv, tx, !!napi,
> +							     compl_tag,
> +							     &pkt_compl_bytes,
> +							     &pkt_compl_pkts,
> +							     /*is_reinjection=*/false);

Please don't add commented code in the function calls.

Thanks

> +			}
>  		} else if (type == GVE_COMPL_TYPE_DQO_MISS) {
>  			u16 compl_tag = le16_to_cpu(compl_desc->completion_tag);
>  
> -- 
> 2.38.1.431.g37b22c650d-goog
> 

  reply	other threads:[~2022-11-17 11:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 18:17 [PATCH net-next v4 0/2] Handle alternate miss-completions Jeroen de Borst
2022-11-16 18:17 ` [PATCH net-next v4 1/2] gve: Adding a new AdminQ command to verify driver Jeroen de Borst
2022-11-16 18:17 ` [PATCH net-next v4 2/2] gve: Handle alternate miss completions Jeroen de Borst
2022-11-17 11:12   ` Leon Romanovsky [this message]
2022-11-17 11:10 ` [PATCH net-next v4 0/2] Handle alternate miss-completions Leon Romanovsky

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=Y3YXFHi6O1Fv2hfO@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jeroendb@google.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).