netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Maxim Mikityanskiy <maximmi@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 13/15] net/mlx5e: Remove MLX5E_XDP_TX_DS_COUNT
Date: Fri, 18 Mar 2022 13:52:46 -0700	[thread overview]
Message-ID: <20220318205248.33367-14-saeed@kernel.org> (raw)
In-Reply-To: <20220318205248.33367-1-saeed@kernel.org>

From: Maxim Mikityanskiy <maximmi@nvidia.com>

After introducing multi-buffer XDP_TX, the MLX5E_XDP_TX_DS_COUNT define
became misleading. It's no longer the DS count of an XDP_TX WQE, this
WQE can be longer because of fragments.

As this define is only used at one place in mlx5e_open_xdpsq(), it's
also not very useful anymore. This commit removes the define and puts
the calculation of ds_count for prefilled single-fragment WQEs inline.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h  | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
index 4868fa1b82d1..287e17911251 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
@@ -38,7 +38,6 @@
 #include "en/txrx.h"
 
 #define MLX5E_XDP_MIN_INLINE (ETH_HLEN + VLAN_HLEN)
-#define MLX5E_XDP_TX_DS_COUNT (MLX5E_TX_WQE_EMPTY_DS_COUNT + 1 /* SG DS */)
 
 #define MLX5E_XDP_INLINE_WQE_MAX_DS_CNT 16
 #define MLX5E_XDP_INLINE_WQE_SZ_THRSD \
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 3256d2c375c3..2f1dedc721d1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1681,7 +1681,7 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
 	mlx5e_set_xmit_fp(sq, param->is_mpw);
 
 	if (!param->is_mpw && !test_bit(MLX5E_SQ_STATE_XDP_MULTIBUF, &sq->state)) {
-		unsigned int ds_cnt = MLX5E_XDP_TX_DS_COUNT;
+		unsigned int ds_cnt = MLX5E_TX_WQE_EMPTY_DS_COUNT + 1;
 		unsigned int inline_hdr_sz = 0;
 		int i;
 
-- 
2.35.1


  parent reply	other threads:[~2022-03-18 20:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 20:52 [pull request][net-next 00/15] mlx5 updates 2022-03-18 Saeed Mahameed
2022-03-18 20:52 ` [net-next 01/15] net/mlx5e: Prepare non-linear legacy RQ for XDP multi buffer support Saeed Mahameed
2022-03-19 15:10   ` patchwork-bot+netdevbpf
2022-03-18 20:52 ` [net-next 02/15] net/mlx5e: Use fragments of the same size in non-linear legacy RQ with XDP Saeed Mahameed
2022-03-18 20:52 ` [net-next 03/15] net/mlx5e: Use page-sized fragments with XDP multi buffer Saeed Mahameed
2022-03-18 20:52 ` [net-next 04/15] net/mlx5e: Add XDP multi buffer support to the non-linear legacy RQ Saeed Mahameed
2022-03-18 20:52 ` [net-next 05/15] net/mlx5e: Store DMA address inside struct page Saeed Mahameed
2022-03-18 20:52 ` [net-next 06/15] net/mlx5e: Move mlx5e_xdpi_fifo_push out of xmit_xdp_frame Saeed Mahameed
2022-03-18 20:52 ` [net-next 07/15] net/mlx5e: Remove assignment of inline_hdr.sz on XDP TX Saeed Mahameed
2022-03-18 20:52 ` [net-next 08/15] net/mlx5e: Don't prefill WQEs in XDP SQ in the multi buffer mode Saeed Mahameed
2022-03-18 20:52 ` [net-next 09/15] net/mlx5e: Implement sending multi buffer XDP frames Saeed Mahameed
2022-03-18 20:52 ` [net-next 10/15] net/mlx5e: Unindent the else-block in mlx5e_xmit_xdp_buff Saeed Mahameed
2022-03-18 20:52 ` [net-next 11/15] net/mlx5e: Support multi buffer XDP_TX Saeed Mahameed
2022-03-18 20:52 ` [net-next 12/15] net/mlx5e: Permit XDP with non-linear legacy RQ Saeed Mahameed
2022-03-18 20:52 ` Saeed Mahameed [this message]
2022-03-18 20:52 ` [net-next 14/15] net/mlx5e: Statify function mlx5_cmd_trigger_completions Saeed Mahameed
2022-03-18 20:52 ` [net-next 15/15] net/mlx5e: HTB, remove unused function declaration 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=20220318205248.33367-14-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@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;
as well as URLs for NNTP newsgroup(s).