mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Bloch <mbloch@nvidia.com>
To: Joe Damato <joe@dama.to>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: edumazet@google.com, horms@kernel.org,
	linux-kernel@vger.kernel.org, daniel.machon@microchip.com,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/5] net/mlx4: factor csum flags into mlx4_en_csum_flags()
Date: Thu, 26 Nov 2026 05:40:12 +0200	[thread overview]
Message-ID: <80ce3f0d-67d5-4453-8c3d-01f89ff64911@nvidia.com> (raw)
In-Reply-To: <20261125180021.1804204-3-joe@dama.to>



On 25/11/2026 20:00, Joe Damato wrote:
> Extract the code which converts skb csum fields to WQE fields into a
> helper. This helper will be used by a follow-up series implementing
> software USO, to reduce code duplication.
> 
> Signed-off-by: Joe Damato <joe@dama.to>
> Reviewed-by: Daniel Machon <daniel.machon@microchip.com>

Thanks for the patch,

Reviewed-by: Mark Bloch <mbloch@nvidia.com>

> ---
>  drivers/net/ethernet/mellanox/mlx4/en_tx.c | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 29eda78b9977..1fb265a30a30 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -860,6 +860,16 @@ static bool mlx4_en_build_dma_wqe(struct mlx4_en_priv *priv,
>  	return false;
>  }
>  
> +static __be32 mlx4_en_csum_flags(const struct sk_buff *skb)
> +{
> +	if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL))
> +		return 0;
> +	if (skb->encapsulation)
> +		return cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
> +
> +	return cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | MLX4_WQE_CTRL_TCP_UDP_CSUM);
> +}
> +
>  static bool mlx4_en_prep_vlan(const struct sk_buff *skb,
>  			      union mlx4_wqe_qpn_vlan *qpn_vlan)
>  {
> @@ -890,12 +900,12 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
>  	struct mlx4_wqe_data_seg *data;
>  	struct mlx4_en_tx_info *tx_info;
>  	u32 __maybe_unused ring_cons;
> +	__be32 op_own, csum_flags;
>  	int tx_ind;
>  	int nr_txbb;
>  	int desc_size;
>  	int real_size;
>  	u32 index, bf_index;
> -	__be32 op_own;
>  	int lso_header_size;
>  	void *fragptr = NULL;
>  	bool bounce = false;
> @@ -990,12 +1000,10 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
>  	/* Prepare ctrl segment apart opcode+ownership, which depends on
>  	 * whether LSO is used */
>  	tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
> -	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
> -		if (!skb->encapsulation)
> -			tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM |
> -								 MLX4_WQE_CTRL_TCP_UDP_CSUM);
> -		else
> -			tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
> +
> +	csum_flags = mlx4_en_csum_flags(skb);
> +	if (csum_flags) {
> +		tx_desc->ctrl.srcrb_flags |= csum_flags;
>  		ring->tx_csum++;
>  	}
>  


  reply	other threads:[~2026-11-26  3:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 18:00 [PATCH net-next v3 0/5] net/mlx4: TX helpers and deferred doorbell fix Joe Damato
2026-11-25 18:00 ` [PATCH net-next v3 1/5] net/mlx4: factor VLAN parsing into mlx4_en_prep_vlan() Joe Damato
2026-11-26  3:39   ` Mark Bloch
2026-11-25 18:00 ` [PATCH net-next v3 2/5] net/mlx4: factor csum flags into mlx4_en_csum_flags() Joe Damato
2026-11-26  3:40   ` Mark Bloch [this message]
2026-11-25 18:00 ` [PATCH net-next v3 3/5] net/mlx4: factor HW loopback DMAC into mlx4_en_set_loopback_dmac() Joe Damato
2026-11-26  3:40   ` Mark Bloch
2026-11-25 18:00 ` [PATCH net-next v3 4/5] net/mlx4: track whether a TX doorbell is pending Joe Damato
2026-11-26  3:40   ` Mark Bloch
2026-11-25 18:00 ` [PATCH net-next v3 5/5] net/mlx4: flush pending doorbell when dropping a TX skb Joe Damato
2026-11-26  3:41   ` Mark Bloch
2026-11-25 18:03 ` [PATCH net-next v3 0/5] net/mlx4: TX helpers and deferred doorbell fix netdev-bot+sinfo
2026-11-25 18:31   ` Joe Damato

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=80ce3f0d-67d5-4453-8c3d-01f89ff64911@nvidia.com \
    --to=mbloch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=joe@dama.to \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tariqt@nvidia.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

all inboxes | Powered by JetHome®