[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-02-01 Thread Tetsuya Mukawa
On 2016/01/29 18:13, Yuanhan Liu wrote: > On Fri, Jan 29, 2016 at 04:57:23PM +0800, Yuanhan Liu wrote: >> On Thu, Jan 21, 2016 at 08:07:58PM +0900, Tetsuya Mukawa wrote: >>> +static int >>> +virt_read_pci_cfg(struct virtio_hw *hw, void *buf, size_t len, off_t >>> offset) >>> +{ >>> +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-29 Thread Yuanhan Liu
On Fri, Jan 29, 2016 at 04:57:23PM +0800, Yuanhan Liu wrote: > On Thu, Jan 21, 2016 at 08:07:58PM +0900, Tetsuya Mukawa wrote: > > +static int > > +virt_read_pci_cfg(struct virtio_hw *hw, void *buf, size_t len, off_t > > offset) > > +{ > > + qtest_read_pci_cfg(hw, "virtio-net", buf, len,

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-29 Thread Yuanhan Liu
On Thu, Jan 21, 2016 at 08:07:58PM +0900, Tetsuya Mukawa wrote: > +static int > +virt_read_pci_cfg(struct virtio_hw *hw, void *buf, size_t len, off_t offset) > +{ > + qtest_read_pci_cfg(hw, "virtio-net", buf, len, offset); > + return 0; > +} > + > +static void * >

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-29 Thread Xie, Huawei
On 1/28/2016 10:44 AM, Tetsuya Mukawa wrote: > On 2016/01/27 19:03, Xie, Huawei wrote: >> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >>> + /* Set BAR region */ >>> + for (i = 0; i < NB_BAR; i++) { >>> + switch (dev->bar[i].type) { >>> + case QTEST_PCI_BAR_IO: >>> +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/28 18:48, Xie, Huawei wrote: > On 1/28/2016 10:47 AM, Tetsuya Mukawa wrote: >> On 2016/01/28 0:58, Xie, Huawei wrote: >>> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >>> [snip] + +static int +qtest_raw_recv(int fd, char *buf, size_t count) +{ + size_t len =

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/28 15:15, Xie, Huawei wrote: > On 1/28/2016 10:48 AM, Tetsuya Mukawa wrote: >> I measured it, and seems it takes 0.35 seconds in my environment. >> This will be done only once when the port is initialized. Probably it's >> not so heady. > There are 256 x 32 loop of pci scan. That is too

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/28 1:45, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> +qtest_find_pci_device(struct qtest_session *s, uint16_t bus, uint8_t device) >> +{ >> +struct qtest_pci_device *dev; >> +uint32_t val; >> + >> +val = qtest_pci_inl(s, bus, device, 0, 0); >> +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/28 0:58, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > [snip] >> + >> +static int >> +qtest_raw_recv(int fd, char *buf, size_t count) >> +{ >> +size_t len = count; >> +size_t total_len = 0; >> +int ret = 0; >> + >> +while (len > 0) { >> +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/27 19:03, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> +/* Set BAR region */ >> +for (i = 0; i < NB_BAR; i++) { >> +switch (dev->bar[i].type) { >> +case QTEST_PCI_BAR_IO: >> +case QTEST_PCI_BAR_MEMORY_UNDER_1MB: >> +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Tetsuya Mukawa
On 2016/01/27 18:39, Xie, Huawei wrote: > On 1/26/2016 10:58 AM, Tetsuya Mukawa wrote: >> On 2016/01/25 19:15, Xie, Huawei wrote: >> >> BTW, my container implementation needed a QEMU patch in the case of >> vhost-user. >> But the patch has been merged in upstream QEMU, so we don't have this >>

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-28 Thread Xie, Huawei
On 1/28/2016 10:48 AM, Tetsuya Mukawa wrote: > I measured it, and seems it takes 0.35 seconds in my environment. > This will be done only once when the port is initialized. Probably it's > not so heady. There are 256 x 32 loop of pci scan. That is too long if we dynamically start/tear down the

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-27 Thread Xie, Huawei
On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > +qtest_find_pci_device(struct qtest_session *s, uint16_t bus, uint8_t device) > +{ > + struct qtest_pci_device *dev; > + uint32_t val; > + > + val = qtest_pci_inl(s, bus, device, 0, 0); > + TAILQ_FOREACH(dev, >head, next) { > +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-27 Thread Xie, Huawei
On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > + /* Set BAR region */ > + for (i = 0; i < NB_BAR; i++) { > + switch (dev->bar[i].type) { > + case QTEST_PCI_BAR_IO: > + case QTEST_PCI_BAR_MEMORY_UNDER_1MB: > + case QTEST_PCI_BAR_MEMORY_32: > +

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-27 Thread Xie, Huawei
On 1/26/2016 10:58 AM, Tetsuya Mukawa wrote: > On 2016/01/25 19:15, Xie, Huawei wrote: >> On 1/22/2016 6:38 PM, Tetsuya Mukawa wrote: >>> On 2016/01/22 17:14, Xie, Huawei wrote: On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > virtio: Extend virtio-net PMD to support container environment

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-26 Thread Tetsuya Mukawa
On 2016/01/25 19:29, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> +#define PCI_CONFIG_ADDR(_bus, _device, _function, _offset) ( \ >> +(1 << 31) | ((_bus) & 0xff) << 16 | ((_device) & 0x1f) << 11 | \ >> +((_function) & 0xf) << 8 | ((_offset) & 0xfc)) > (_function) &

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-26 Thread Tetsuya Mukawa
On 2016/01/25 19:17, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> +static void >> +qtest_handle_one_message(struct qtest_session *s, char *buf) >> +{ >> +int ret; >> + >> +if (strncmp(buf, interrupt_message, strlen(interrupt_message)) == 0) { >> +if

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-26 Thread Tetsuya Mukawa
On 2016/01/25 19:15, Xie, Huawei wrote: > On 1/22/2016 6:38 PM, Tetsuya Mukawa wrote: >> On 2016/01/22 17:14, Xie, Huawei wrote: >>> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: virtio: Extend virtio-net PMD to support container environment The patch adds a new virtio-net PMD

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-25 Thread Xie, Huawei
On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > +#define PCI_CONFIG_ADDR(_bus, _device, _function, _offset) ( \ > + (1 << 31) | ((_bus) & 0xff) << 16 | ((_device) & 0x1f) << 11 | \ > + ((_function) & 0xf) << 8 | ((_offset) & 0xfc)) (_function) & 0x7 ?

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-25 Thread Xie, Huawei
On 1/22/2016 6:38 PM, Tetsuya Mukawa wrote: > On 2016/01/22 17:14, Xie, Huawei wrote: >> On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >>> virtio: Extend virtio-net PMD to support container environment >>> >>> The patch adds a new virtio-net PMD configuration that allows the PMD to >>> work on host

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-22 Thread Tetsuya Mukawa
On 2016/01/22 17:14, Xie, Huawei wrote: > On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: >> virtio: Extend virtio-net PMD to support container environment >> >> The patch adds a new virtio-net PMD configuration that allows the PMD to >> work on host as if the PMD is in VM. >> Here is new

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-22 Thread Xie, Huawei
On 1/21/2016 7:09 PM, Tetsuya Mukawa wrote: > virtio: Extend virtio-net PMD to support container environment > > The patch adds a new virtio-net PMD configuration that allows the PMD to > work on host as if the PMD is in VM. > Here is new configuration for virtio-net PMD. > -

[dpdk-dev] [RFC PATCH 5/5] virtio: Extend virtio-net PMD to support container environment

2016-01-21 Thread Tetsuya Mukawa
virtio: Extend virtio-net PMD to support container environment The patch adds a new virtio-net PMD configuration that allows the PMD to work on host as if the PMD is in VM. Here is new configuration for virtio-net PMD. - CONFIG_RTE_LIBRTE_VIRTIO_HOST_MODE To use this mode, EAL needs physically