DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: Pavel Fedin <p.fedin@samsung.com>, dev@dpdk.org
Cc: nakajima.yoshihiro@lab.ntt.co.jp, mst@redhat.com
Subject: Re: [dpdk-dev] [PATCH v1 2/2] virtio: Extend virtio-net PMD to support container environment
Date: Wed, 6 Jan 2016 12:57:07 +0900	[thread overview]
Message-ID: <568C9093.9020706@igel.co.jp> (raw)
In-Reply-To: <004a01d14166$f52be7e0$df83b7a0$@samsung.com>

On 2015/12/28 20:57, Pavel Fedin wrote:
>  Hello!
>
>> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
>> index 47f722a..d4ede73 100644
>> --- a/drivers/net/virtio/virtio_pci.h
>> +++ b/drivers/net/virtio/virtio_pci.h
>> @@ -165,6 +165,9 @@ struct virtqueue;
>>
>>  struct virtio_hw {
>>  	struct virtqueue *cvq;
>> +#ifdef RTE_LIBRTE_VIRTIO_HOST_MODE
>> +	void        *qsession;
>> +#endif
>>  	uint32_t    io_base;
>>  	uint32_t    guest_features;
>>  	uint32_t    max_tx_queues;
>> @@ -226,6 +229,26 @@ outl_p(unsigned int data, unsigned int port)
>>  }
>>  #endif
>>
>> +#ifdef RTE_LIBRTE_VIRTIO_HOST_MODE
>> +
>> +uint32_t virtio_ioport_read(struct virtio_hw *, uint64_t, char type);
>> +void virtio_ioport_write(struct virtio_hw *, uint64_t, uint64_t, char type);
>> +
>> +#define VIRTIO_READ_REG_1(hw, reg) \
>> +	virtio_ioport_read(hw, reg, 'b')
>> +#define VIRTIO_WRITE_REG_1(hw, reg, value) \
>> +	virtio_ioport_write(hw, reg, value, 'b')
>> +#define VIRTIO_READ_REG_2(hw, reg) \
>> +	virtio_ioport_read(hw, reg, 'w')
>> +#define VIRTIO_WRITE_REG_2(hw, reg, value) \
>> +	virtio_ioport_write(hw, reg, value, 'w')
>> +#define VIRTIO_READ_REG_4(hw, reg) \
>> +	virtio_ioport_read(hw, reg, 'l')
>> +#define VIRTIO_WRITE_REG_4(hw, reg, value) \
>> +	virtio_ioport_write(hw, reg, value, 'l')
>> +
>> +#else /* RTE_LIBRTE_VIRTIO_HOST_MODE */
>> +
>  I have a concern against such compile-time switches. What if we want the same code to work for both 'real' virtio and socket-based?
> Shouldn't we introduce some function pointers here to be able to switch them at runtime?

Hi Pavel,

Thanks for commenting.
In that case, you will run QEMU, then create containers in the guest.
Do you have an use case for this usage?

Anyway, such a feature depends on how to allocate share memory.
So far, this patch allow you to run both virtio-net 'real' and 'virtual'
PMDs on guest, but it will be changed to remove contiguous memory
restriction.
Could you please see an other thread that we talk about the restriction
in? (I will add you to CC.)

Thanks,
Tetsuya

  reply	other threads:[~2016-01-06  3:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 10:57 [dpdk-dev] [RFC PATCH 0/2] Virtio-net PMD Extension to work on host Tetsuya Mukawa
2015-11-19 10:57 ` [dpdk-dev] [RFC PATCH 1/2] EAL: Add new EAL "--shm" option Tetsuya Mukawa
2015-12-16  8:37   ` [dpdk-dev] [PATCH v1 0/2] Virtio-net PMD Extension to work on host Tetsuya Mukawa
2015-12-16  8:37     ` [dpdk-dev] [PATCH v1 1/2] EAL: Add new EAL "--contig-mem" option Tetsuya Mukawa
2015-12-16  8:37     ` [dpdk-dev] [PATCH v1 2/2] virtio: Extend virtio-net PMD to support container environment Tetsuya Mukawa
2015-12-28 11:57       ` Pavel Fedin
2016-01-06  3:57         ` Tetsuya Mukawa [this message]
2016-01-06  5:56           ` Tan, Jianfeng
2016-01-06  7:27             ` Tetsuya Mukawa
2015-12-24 14:05     ` [dpdk-dev] [PATCH v1 0/2] Virtio-net PMD Extension to work on host Tan, Jianfeng
2015-12-28 11:06       ` Tetsuya Mukawa
2016-01-06  3:57         ` Tetsuya Mukawa
2016-01-06  5:42           ` Tan, Jianfeng
2016-01-06  7:35             ` Tetsuya Mukawa
2016-01-11  5:31               ` Tan, Jianfeng
2015-11-19 10:57 ` [dpdk-dev] [RFC PATCH 2/2] virtio: Extend virtio-net PMD to support container environment Tetsuya Mukawa
2015-11-19 18:16 ` [dpdk-dev] [RFC PATCH 0/2] Virtio-net PMD Extension to work on host Rich Lane
2015-11-20  2:00   ` Xie, Huawei
2015-11-20  2:35     ` Tetsuya Mukawa
2015-11-20  2:53       ` Tetsuya Mukawa
2015-12-28  5:15 ` Qiu, Michael
2015-12-28 11:06   ` Tetsuya Mukawa

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=568C9093.9020706@igel.co.jp \
    --to=mukawa@igel.co.jp \
    --cc=dev@dpdk.org \
    --cc=mst@redhat.com \
    --cc=nakajima.yoshihiro@lab.ntt.co.jp \
    --cc=p.fedin@samsung.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).