From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "ann.zhuangyanying@huawei.com" <ann.zhuangyanying@huawei.com>,
"Liu, Yuanhan" <yuanhan.liu@intel.com>
Subject: Re: [dpdk-dev] [RFC PATCH] vhost: Add VHOST PMD
Date: Mon, 31 Aug 2015 15:29:12 +0900 [thread overview]
Message-ID: <55E3F438.7050103@igel.co.jp> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F962511CEC949@shsmsx102.ccr.corp.intel.com>
On 2015/08/31 14:14, Ouyang, Changchun wrote:
>
> +struct pmd_internal {
> + TAILQ_ENTRY(pmd_internal) next;
> + char *dev_name;
> + char *iface_name;
> + unsigned nb_rx_queues;
> + unsigned nb_tx_queues;
> + rte_atomic16_t xfer;
> +
> + struct vhost_queue
> rx_vhost_queues[RTE_PMD_RING_MAX_RX_RINGS];
> + struct vhost_queue
> tx_vhost_queues[RTE_PMD_RING_MAX_TX_RINGS];
> +};
> Need consider how the vhost multiple queues implements here.
> You can refer to the patch set I sent before.
Hi Ouyang,
I appreciate your comments.
I will refer to your patch and fix it.
>> +
>> +TAILQ_HEAD(pmd_internal_head, pmd_internal); static struct
>> +pmd_internal_head internals_list =
>> + TAILQ_HEAD_INITIALIZER(internals_list);
>> +
>> +static pthread_mutex_t internal_list_lock = PTHREAD_MUTEX_INITIALIZER;
>> +
>> +static struct rte_eth_link pmd_link = {
>> + .link_speed = 10000,
>> + .link_duplex = ETH_LINK_FULL_DUPLEX,
>> + .link_status = 0
>> +};
>> +
>> +static uint16_t
>> +eth_vhost_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) {
>> + struct vhost_queue *r = q;
>> + uint16_t nb_rx;
>> +
>> + if (unlikely(r->internal == NULL))
>> + return 0;
>> +
>> + if (unlikely(rte_atomic16_read(&r->internal->xfer) == 0))
>> + return 0;
>> +
>> + rte_atomic16_set(&r->rx_executing, 1);
>> +
>> + if (unlikely(rte_atomic16_read(&r->internal->xfer) == 0))
>> + goto out;
>> +
>> + nb_rx = (uint16_t)rte_vhost_dequeue_burst(r->device,
>> + VIRTIO_TXQ, r->mb_pool, bufs, nb_bufs);
> Logically correct here,
> But it would be better to have more clear description why need use VIRTIO_TXQ for vhost_rx function.
> It increases readability. :-)
Sure, I will add comments here, also TX function.
>
> +static void *vhost_driver_session(void *param __rte_unused) {
> + static struct virtio_net_device_ops *vhost_ops = NULL;
> + vhost_ops = rte_zmalloc(NULL, sizeof(*vhost_ops), 0);
> + if (vhost_ops == NULL)
> + rte_panic("Can't allocate memory\n");
> +
> + /* set vhost arguments */
> + vhost_ops->new_device = new_device;
> + vhost_ops->destroy_device = destroy_device;
> + if (rte_vhost_driver_callback_register(vhost_ops) < 0)
> + rte_panic("Can't register callbacks\n");
> +
> + /* start event handling */
> + rte_vhost_driver_session_start();
> It should be called after rte_vhost_driver_register,
> But rte_vhost_driver_session_start is called when dev_init,
> Error here?
In the case of vhost-cuse, it seems we should call register() before
calling start().
Thanks for your checking. I will fix it in next patch.
Regards,
Tetsuya
next prev parent reply other threads:[~2015-08-31 6:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 3:21 [dpdk-dev] [RFC PATCH] " Tetsuya Mukawa
2015-08-28 3:21 ` [dpdk-dev] [RFC PATCH] vhost: " Tetsuya Mukawa
2015-08-28 18:18 ` Stephen Hemminger
2015-08-31 2:23 ` Tetsuya Mukawa
2015-08-31 5:14 ` Ouyang, Changchun
2015-08-31 6:29 ` Tetsuya Mukawa [this message]
2015-09-15 16:27 ` Loftus, Ciara
2015-09-16 3:06 ` Tetsuya Mukawa
2015-09-17 13:56 ` Loftus, Ciara
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=55E3F438.7050103@igel.co.jp \
--to=mukawa@igel.co.jp \
--cc=ann.zhuangyanying@huawei.com \
--cc=changchun.ouyang@intel.com \
--cc=dev@dpdk.org \
--cc=yuanhan.liu@intel.com \
/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 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).