From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by dpdk.org (Postfix) with ESMTP id 5833A7E7E for ; Fri, 24 Oct 2014 11:19:22 +0200 (CEST) Received: by mail-qa0-f43.google.com with SMTP id j7so599410qaq.30 for ; Fri, 24 Oct 2014 02:27:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=niOgbKz7iFBLUlvr7J8dG5ViihYYewCcriaLadtcr/s=; b=g0LHptgG9Vz3nNZzm1QSRqwRBshnyRuPCKB1/6F8lSM24nfcigcrqACELuvELaGSFJ VaC8Rqy1Rve7xKu27oSs6zR0/wz3Tg6ImQCnydoTuWoNuJO7cLxku10syrGJZ2NN6eDf fcEM8AX+zp38yYHlcC+Gry5iKPm2C2YaiSapB5glMj67iJK3VWEwPtKnunBDsfpD+gMz CKdIdI0frUt+RlhzvUmlS00G2SKE4jY+TBVzHewq1OR5FkgIfjZCqfJrOi/zBzwhCz6A 80FFzzLNIdopqg0E4W711h9y6IuA4bJoTov9+VyjJumM6Gb0/msGe4iruqb+rDK69Hju 50IA== X-Gm-Message-State: ALoCoQl2fEg4D3aXrc77mKPtPUSXIoNmD0DGwk/1vyrk5nryQ8t0WEbeeYqRR4cyooHiAYQjDNpW X-Received: by 10.194.236.200 with SMTP id uw8mr3560528wjc.50.1414142869982; Fri, 24 Oct 2014 02:27:49 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id ga7sm1360780wic.5.2014.10.24.02.27.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Oct 2014 02:27:49 -0700 (PDT) From: Thomas Monjalon To: Ouyang Changchun Date: Fri, 24 Oct 2014 11:27:31 +0200 Message-ID: <1684003.hLxV2SOth0@xps13> Organization: 6WIND User-Agent: KMail/4.14.2 (Linux/3.16.4-1-ARCH; KDE/4.14.2; x86_64; ; ) In-Reply-To: <1414139898-26562-1-git-send-email-changchun.ouyang@intel.com> References: <1414139898-26562-1-git-send-email-changchun.ouyang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [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 09:19:22 -0000 Hi Changchun, 2014-10-24 16:38, Ouyang Changchun: > 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. [...] > --- 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; > } I feel there is a design problem here. An application shouldn't have to care about the underlying driver. -- Thomas