From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: Check descriptor number for vector Rx Date: Fri, 24 Oct 2014 11:27:31 +0200 Message-ID: <1684003.hLxV2SOth0@xps13> References: <1414139898-26562-1-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Ouyang Changchun Return-path: In-Reply-To: <1414139898-26562-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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