netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	Tal Alon <talal@mellanox.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [PATCH net-next V1 1/4] net/mlx5e: Restore the skb data pointer after xmit is finished
Date: Thu, 17 Dec 2015 14:35:32 +0200	[thread overview]
Message-ID: <1450355735-30846-2-git-send-email-saeedm@mellanox.com> (raw)
In-Reply-To: <1450355735-30846-1-git-send-email-saeedm@mellanox.com>

From: Eran Ben Elisha <eranbe@mellanox.com>

Restore the skb data pointer after coping the data to the HW, so the skb
can be cloned with correct headers for future use (e.g timestamping).

Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index 1341b1d..0fcfe64 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -165,6 +165,7 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
 	struct mlx5_wqe_eth_seg  *eseg = &wqe->eth;
 	struct mlx5_wqe_data_seg *dseg;
 
+	unsigned char *skb_data_orig = skb->data;
 	u8  opcode = MLX5_OPCODE_SEND;
 	dma_addr_t dma_addr = 0;
 	bool bf = false;
@@ -263,6 +264,7 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb)
 	cseg->opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | opcode);
 	cseg->qpn_ds           = cpu_to_be32((sq->sqn << 8) | ds_cnt);
 
+	skb_push(skb, skb->data - skb_data_orig);
 	sq->skb[pi] = skb;
 
 	MLX5E_TX_SKB_CB(skb)->num_wqebbs = DIV_ROUND_UP(ds_cnt,
-- 
1.7.1

  reply	other threads:[~2015-12-17 12:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 12:35 [PATCH net-next V1 0/4] Introduce mlx5 ethernet timestamping Saeed Mahameed
2015-12-17 12:35 ` Saeed Mahameed [this message]
2015-12-17 20:21   ` [PATCH net-next V1 1/4] net/mlx5e: Restore the skb data pointer after xmit is finished David Miller
2015-12-20 13:02     ` Saeed Mahameed
2015-12-17 12:35 ` [PATCH net-next V1 2/4] net/mlx5_core: Add support for reading hardware timestamp Saeed Mahameed
2015-12-17 12:35 ` [PATCH net-next V1 3/4] net/mlx5e: Add HW timestamping (TS) support Saeed Mahameed
2015-12-17 20:11   ` Richard Cochran
2015-12-20 13:08     ` Saeed Mahameed
2015-12-20 19:18       ` Richard Cochran
2015-12-17 20:18   ` Richard Cochran
2015-12-17 12:35 ` [PATCH net-next V1 4/4] net/mlx5e: Add PTP Hardware Clock (PHC) support Saeed Mahameed
2015-12-17 20:20   ` Richard Cochran
2015-12-20 13:02     ` 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=1450355735-30846-2-git-send-email-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=richardcochran@gmail.com \
    --cc=talal@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 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).