From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5F0867EA7 for ; Fri, 24 Oct 2014 10:29:57 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 24 Oct 2014 01:32:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,779,1406617200"; d="scan'208";a="610497270" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 24 Oct 2014 01:38:23 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9O8cL62031075; Fri, 24 Oct 2014 16:38:21 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9O8cJrm026595; Fri, 24 Oct 2014 16:38:21 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9O8cJ9t026591; Fri, 24 Oct 2014 16:38:19 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Fri, 24 Oct 2014 16:38:18 +0800 Message-Id: <1414139898-26562-1-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 Subject: [dpdk-dev] [PATCH] vhost: Check descriptor number for vector Rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2014 08:29:58 -0000 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 --- 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 '\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