All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@mellanox.com>,
	Boris Pismenny <borisp@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 8/8] net/mlx5e: kTLS, Add resiliency to zero-size record frags in TX resync flow
Date: Wed, 29 Apr 2020 15:54:49 -0700	[thread overview]
Message-ID: <20200429225449.60664-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20200429225449.60664-1-saeedm@mellanox.com>

From: Tariq Toukan <tariqt@mellanox.com>

SKBs of TLS records might have empty zero-sized frags.
Posting a DUMP WQE for such frag would result an error completion.
Add in-driver resiliency and skip such frags.

Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index 52a56622034a..a04fa23e1a53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -232,9 +232,14 @@ tx_sync_info_get(struct mlx5e_ktls_offload_context_tx *priv_tx,
 	remaining = info->sync_len;
 	while (remaining > 0) {
 		skb_frag_t *frag = &record->frags[i];
+		unsigned int fsz;
+
+		fsz = skb_frag_size(frag);
+		if (unlikely(!fsz))
+			continue;
 
 		get_page(skb_frag_page(frag));
-		remaining -= skb_frag_size(frag);
+		remaining -= fsz;
 		info->frags[i++] = *frag;
 	}
 	/* reduce the part which will be sent with the original SKB */
-- 
2.25.4


  parent reply	other threads:[~2020-04-29 22:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 22:54 [pull request][net 0/8] Mellanox, mlx5 fixes 2020-04-29 Saeed Mahameed
2020-04-29 22:54 ` [net 1/8] net/mlx5: E-switch, Fix error unwinding flow for steering init failure Saeed Mahameed
2020-04-29 22:54 ` [net 2/8] net/mlx5: E-switch, Fix printing wrong error value Saeed Mahameed
2020-04-29 22:54 ` [net 3/8] net/mlx5: E-switch, Fix mutex init order Saeed Mahameed
2020-04-29 22:54 ` [net 4/8] net/mlx5: DR, On creation set CQ's arm_db member to right value Saeed Mahameed
2020-04-29 22:54 ` [net 5/8] net/mlx5: Fix forced completion access non initialized command entry Saeed Mahameed
2020-04-29 22:54 ` [net 6/8] net/mlx5: Fix command entry leak in Internal Error State Saeed Mahameed
2020-04-29 22:54 ` [net 7/8] net/mlx5e: Fix q counters on uplink representors Saeed Mahameed
2020-04-29 22:54 ` Saeed Mahameed [this message]
2020-04-30  0:12   ` [net 8/8] net/mlx5e: kTLS, Add resiliency to zero-size record frags in TX resync flow Jakub Kicinski
2020-04-30  8:22     ` Tariq Toukan
2020-04-30 15:37       ` Saeed Mahameed

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=20200429225449.60664-9-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.