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,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Jonathan Lemon <bsd@fb.com>, Tariq Toukan <tariqt@mellanox.com>,
	Shay Agroskin <shayag@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next V2 03/13] net/mlx5e: XDP, Enhance RQ indication for XDP redirect flush
Date: Tue, 23 Apr 2019 12:14:50 -0700	[thread overview]
Message-ID: <20190423191500.16632-4-saeedm@mellanox.com> (raw)
In-Reply-To: <20190423191500.16632-1-saeedm@mellanox.com>

From: Tariq Toukan <tariqt@mellanox.com>

The XDP redirect flush indication belongs to the receive queue,
not to its XDP send queue.

For this, use a new bit on rq->flags.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Shay Agroskin <shayag@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h     | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 8b37264ba107..a3700c57b073 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -428,7 +428,6 @@ struct mlx5e_xdpsq {
 	/* dirtied @completion */
 	u32                        xdpi_fifo_cc;
 	u16                        cc;
-	bool                       redirect_flush;
 
 	/* dirtied @xmit */
 	u32                        xdpi_fifo_pc ____cacheline_aligned_in_smp;
@@ -532,6 +531,7 @@ typedef void (*mlx5e_fp_dealloc_wqe)(struct mlx5e_rq*, u16);
 
 enum mlx5e_rq_flag {
 	MLX5E_RQ_FLAG_XDP_XMIT,
+	MLX5E_RQ_FLAG_XDP_REDIRECT,
 };
 
 struct mlx5e_rq_frag_info {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
index 03b2a9f9c589..9e7ed599ae0a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
@@ -85,7 +85,7 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
 		if (unlikely(err))
 			goto xdp_abort;
 		__set_bit(MLX5E_RQ_FLAG_XDP_XMIT, rq->flags);
-		rq->xdpsq.redirect_flush = true;
+		__set_bit(MLX5E_RQ_FLAG_XDP_REDIRECT, rq->flags);
 		mlx5e_page_dma_unmap(rq, di);
 		rq->stats->xdp_redirect++;
 		return true;
@@ -419,9 +419,9 @@ void mlx5e_xdp_rx_poll_complete(struct mlx5e_rq *rq)
 
 	mlx5e_xmit_xdp_doorbell(xdpsq);
 
-	if (xdpsq->redirect_flush) {
+	if (test_bit(MLX5E_RQ_FLAG_XDP_REDIRECT, rq->flags)) {
 		xdp_do_flush_map();
-		xdpsq->redirect_flush = false;
+		__clear_bit(MLX5E_RQ_FLAG_XDP_REDIRECT, rq->flags);
 	}
 }
 
-- 
2.20.1


  parent reply	other threads:[~2019-04-23 19:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 19:14 [pull request][net-next V2 00/13] Mellanox, mlx5 RX and XDP improvements Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 01/13] net/mlx5e: RX, Support multiple outstanding UMR posts Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 02/13] net/mlx5e: XDP, Fix shifted flag index in RQ bitmap Saeed Mahameed
2019-04-23 19:14 ` Saeed Mahameed [this message]
2019-04-23 19:14 ` [net-next V2 04/13] net/mlx5e: XDP, Add TX MPWQE session counter Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 05/13] net/mlx5e: XDP, Inline small packets into the TX MPWQE in XDP xmit flow Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 06/13] net/mlx5e: Remove unused parameter Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 07/13] net/mlx5e: Report mlx5e_xdp_set errors Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 08/13] net/mlx5e: Move parameter calculation functions to en/params.c Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 09/13] net/mlx5e: Add an underflow warning comment Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 10/13] net/mlx5e: Remove unused parameter Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 11/13] net/mlx5e: Take HW interrupt trigger into a function Saeed Mahameed
2019-04-23 19:14 ` [net-next V2 12/13] net/mlx5e: Remove unused rx_page_reuse stat Saeed Mahameed
2019-04-23 19:15 ` [net-next V2 13/13] net/mlx5e: Use #define for the WQE wait timeout constant Saeed Mahameed
2019-04-23 23:25 ` [pull request][net-next V2 00/13] Mellanox, mlx5 RX and XDP improvements Jakub Kicinski
2019-04-24  0:08   ` David Miller

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=20190423191500.16632-4-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=brouer@redhat.com \
    --cc=bsd@fb.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shayag@mellanox.com \
    --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 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).