DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: Check descriptor number for vector Rx
@ 2014-10-24  8:38 Ouyang Changchun
  2014-10-24  9:27 ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Ouyang Changchun @ 2014-10-24  8:38 UTC (permalink / raw)
  To: dev

For zero copy, it need check whether RX descriptor num meets the 
least requirement when using vector PMD Rx function, and give user 
more hints if it fails to meet the least requirement.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 examples/vhost/main.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 291128e..87ab854 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -131,6 +131,10 @@
 #define RTE_TEST_RX_DESC_DEFAULT_ZCP 32   /* legacy: 32, DPDK virt FE: 128. */
 #define RTE_TEST_TX_DESC_DEFAULT_ZCP 64   /* legacy: 64, DPDK virt FE: 64.  */
 
+#ifdef RTE_IXGBE_INC_VECTOR
+#define VPMD_RX_BURST         32
+#endif
+
 /* Get first 4 bytes in mbuf headroom. */
 #define MBUF_HEADROOM_UINT32(mbuf) (*(uint32_t *)((uint8_t *)(mbuf) \
 		+ sizeof(struct rte_mbuf)))
@@ -792,6 +796,19 @@ us_vhost_parse_args(int argc, char **argv)
 		return -1;
 	}
 
+#ifdef RTE_IXGBE_INC_VECTOR
+	if ((zero_copy == 1) && (num_rx_descriptor <= VPMD_RX_BURST)) {
+		RTE_LOG(INFO, VHOST_PORT,
+			"The RX desc num: %d is too small for PMD to work\n"
+			"properly, please enlarge it to bigger than %d if\n"
+			"possible by the option: '--rx-desc-num <number>'\n"
+			"One alternative is disabling RTE_IXGBE_INC_VECTOR\n"
+			"in config file and rebuild the libraries.\n",
+			num_rx_descriptor, VPMD_RX_BURST);
+		return -1;
+	}
+#endif
+
 	return 0;
 }
 
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-30  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-24  8:38 [dpdk-dev] [PATCH] vhost: Check descriptor number for vector Rx Ouyang Changchun
2014-10-24  9:27 ` Thomas Monjalon
2014-10-25  0:48   ` Ouyang, Changchun
2014-10-27  8:46     ` Thomas Monjalon
2014-10-27 13:55       ` Ouyang, Changchun
2014-10-29 23:37         ` Xie, Huawei
2014-10-30  0:58           ` Ouyang, Changchun

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).