DPDK patches and discussions
 help / color / mirror / Atom feed
From: Elad Persiko <eladpe@mellanox.com>
To: dev@dpdk.org
Cc: Elad Persiko <eladpe@mellanox.com>
Subject: [dpdk-dev] [PATCH 1/5] net/mlx5: last WQE no room inline
Date: Sun,  8 Jan 2017 15:41:59 +0000	[thread overview]
Message-ID: <1483890123-4854-1-git-send-email-eladpe@mellanox.com> (raw)

Prior to this patch, when sending a packet and the following
conditions were reached:
	1. last working queue element is used.
	2. inline was requested by the user
	3. no room for inline packet.
then the inline request was ignored and the packet was sent
by pointer completely.

This patch handles this scenario. In this case the last
work queue element is turned to be a null work queue element and
the packet is being sent after the wrap around.

Signed-off-by: Elad Persiko <eladpe@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_txq.c  |  8 ++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index e0ee2f2..be38aed 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -481,6 +481,17 @@
 				pkt_inline_sz += copy_b;
 				/* Sanity check. */
 				assert(addr <= addr_end);
+			} else {
+				wqe->ctrl = (rte_v128u32_t){
+					htonl(txq->wqe_ci << 8),
+					htonl(txq->qp_num_8s | 1),
+					0,
+					0,
+					};
+				length = 0;
+				buf = *(pkts--);
+				ds = 1;
+				goto next_pkt_part;
 			}
 			/*
 			 * 2 DWORDs consumed by the WQE header + ETH segment +
@@ -577,6 +588,7 @@
 			0,
 			0,
 		};
+next_pkt_part:
 		wqe->eseg = (rte_v128u32_t){
 			0,
 			cs_flags,
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 949035b..951e50a 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -314,8 +314,12 @@
 		/* CQ to be associated with the receive queue. */
 		.recv_cq = tmpl.cq,
 		.cap = {
-			/* Max number of outstanding WRs. */
-			.max_send_wr = ((priv->device_attr.max_qp_wr < desc) ?
+			/*
+			 * Max number of outstanding WRs.
+			 * "+1" for null WQE place holder.
+			 */
+			.max_send_wr = ((priv->device_attr.max_qp_wr <
+					(desc + 1)) ?
 					priv->device_attr.max_qp_wr :
 					desc),
 			/*
-- 
1.8.3.1

             reply	other threads:[~2017-01-08 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 15:41 Elad Persiko [this message]
2017-01-08 15:42 ` [dpdk-dev] [PATCH 2/5] net/mlx5: remove unessecary goto label Elad Persiko
2017-01-09 12:29   ` Ferruh Yigit
2017-01-08 15:42 ` [dpdk-dev] [PATCH 3/5] net/mlx5: support TSO in control plane Elad Persiko
2017-01-08 15:42 ` [dpdk-dev] [PATCH 4/5] net/mlx5: implement TSO data path Elad Persiko
2017-01-08 15:42 ` [dpdk-dev] [PATCH 5/5] doc: add tso capabilities feature for mlx5 Elad Persiko
2017-01-23 12:27 ` [dpdk-dev] [PATCH 1/5] net/mlx5: last WQE no room inline Ferruh Yigit
2017-02-08 11:02   ` Ferruh Yigit

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=1483890123-4854-1-git-send-email-eladpe@mellanox.com \
    --to=eladpe@mellanox.com \
    --cc=dev@dpdk.org \
    /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).