From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Ouyang Changchun
<changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] vhost: Check descriptor number for vector Rx
Date: Fri, 24 Oct 2014 11:27:31 +0200 [thread overview]
Message-ID: <1684003.hLxV2SOth0@xps13> (raw)
In-Reply-To: <1414139898-26562-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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 <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;
> }
I feel there is a design problem here.
An application shouldn't have to care about the underlying driver.
--
Thomas
next prev parent reply other threads:[~2014-10-24 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 8:38 [PATCH] vhost: Check descriptor number for vector Rx Ouyang Changchun
[not found] ` <1414139898-26562-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-24 9:27 ` Thomas Monjalon [this message]
2014-10-25 0:48 ` Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F96251187D03F-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-27 8:46 ` Thomas Monjalon
2014-10-27 13:55 ` Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F96251187DBC7-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-29 23:37 ` Xie, Huawei
[not found] ` <C37D651A908B024F974696C65296B57B0F2D86AF-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-30 0:58 ` Ouyang, Changchun
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=1684003.hLxV2SOth0@xps13 \
--to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.