Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
On Tue, Oct 29, 2019 at 4:20 AM Noa Levy wrote: > > > > > -Original Message- > > From: William Tu [mailto:u9012...@gmail.com] > > Sent: Monday, October 28, 2019 10:46 PM > > To: Noa Levy > > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > > Dibbiny ; Ameer Mahagneh > > ; Eli Britstein > > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > > > Hi Noa, > > > > Thanks for your reply. > > > > > > > > Hi Noa, > > > > > > > > > > > > I have a couple more questions. I'm still at the learning stage > > > > > > of this new feature, thanks in advance for your patience. > > > > > > > > > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > > > > > dpdkvdpa netdev works with 3 components: > > > > > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > > > > > representor of "vdpa device". > > > > > > > > > > > > What NIC card support this feature? > > > > > > I don't have real vdpa device, can I use Intel X540 VF feature? > > > > > > > > > > > > > > > > This feature will have two modes, SW and HW. > > > > > The SW mode doesn't depend on a real vdpa device and allows you to > > > > > use this feature even if you don't have a NIC that support it. > > > Although you need to use representors, so you need your NIC to support > > it. > > > > > The HW mode will be implemented in the future and will use a real > > > > > vdpa device. It will be better to use the HW mode if you have a > > > > > NIC that support > > > > it. > > > > > > > > > > For now, we only support the SW mode, when vdpa will have support > > > > > in dpdk, we will add the HW mode to OVS. > > > > > > > > > > > > > > > > > > > In order to add a new vDPA port, add a new port to existing > > > > > > > bridge with type dpdkvdpa and vDPA options: > > > > > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > > > > > >options:vdpa-socket-path= > > > > > > >options:vdpa-accelerator-devargs= > > > > > > >options:dpdk-devargs=,representor=[id] > > > > > > > > > > > > > > On this command OVS will create a new netdev: > > > > > > > 1. Register vhost-user-client device. > > > > > > > 2. Open and configure VF dpdk port. > > > > > > > 3. Open and configure representor dpdk port. > > > > > > > > > > > > > > The new netdev will use netdev_rxq_recv() function in order to > > > > > > > receive packets from VF and push to vhost-user and receive > > > > > > > packets from vhost-user and push to VF. > > > > > > > > > > > > > > Signed-off-by: Noa Ezra > > > > > > > Reviewed-by: Oz Shlomo > > > > > > > --- > > > > > > > Documentation/automake.mk | 1 + > > > > > > > Documentation/topics/dpdk/index.rst | 1 + > > > > > > > Documentation/topics/dpdk/vdpa.rst | 90 > > > > > > > > > NEWS| 1 + > > > > > > > lib/netdev-dpdk.c | 162 > > > > > > > > > > > > > vswitchd/vswitch.xml| 25 ++ > > > > > > > 6 files changed, 280 insertions(+) create mode 100644 > > > > > > > Documentation/topics/dpdk/vdpa.rst > > > > > > > > > > > > > > diff --git a/Documentation/automake.mk > > > > > b/Documentation/automake.mk > > > > > > > index cd68f3b..ee574bc 100644 > > > > > > > --- a/Documentation/automake.mk > > > > > > > +++ b/Documentation/automake.mk > > > > > > > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > > > > > > > Documentation/topics/dpdk/ring.rst \ > > > > > > > Documentation/topics/dpdk/vdev.rst \ > > > > > > > Documentation/topics/dpdk/vhost-user.rst \ > > > > > > > + Doc
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
> -Original Message- > From: William Tu [mailto:u9012...@gmail.com] > Sent: Monday, October 28, 2019 10:46 PM > To: Noa Levy > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > Dibbiny ; Ameer Mahagneh > ; Eli Britstein > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > Hi Noa, > > Thanks for your reply. > > > > > > Hi Noa, > > > > > > > > > > I have a couple more questions. I'm still at the learning stage > > > > > of this new feature, thanks in advance for your patience. > > > > > > > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > > > > dpdkvdpa netdev works with 3 components: > > > > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > > > > representor of "vdpa device". > > > > > > > > > > What NIC card support this feature? > > > > > I don't have real vdpa device, can I use Intel X540 VF feature? > > > > > > > > > > > > > This feature will have two modes, SW and HW. > > > > The SW mode doesn't depend on a real vdpa device and allows you to > > > > use this feature even if you don't have a NIC that support it. > > Although you need to use representors, so you need your NIC to support > it. > > > > The HW mode will be implemented in the future and will use a real > > > > vdpa device. It will be better to use the HW mode if you have a > > > > NIC that support > > > it. > > > > > > > > For now, we only support the SW mode, when vdpa will have support > > > > in dpdk, we will add the HW mode to OVS. > > > > > > > > > > > > > > > > In order to add a new vDPA port, add a new port to existing > > > > > > bridge with type dpdkvdpa and vDPA options: > > > > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > > > > >options:vdpa-socket-path= > > > > > >options:vdpa-accelerator-devargs= > > > > > >options:dpdk-devargs=,representor=[id] > > > > > > > > > > > > On this command OVS will create a new netdev: > > > > > > 1. Register vhost-user-client device. > > > > > > 2. Open and configure VF dpdk port. > > > > > > 3. Open and configure representor dpdk port. > > > > > > > > > > > > The new netdev will use netdev_rxq_recv() function in order to > > > > > > receive packets from VF and push to vhost-user and receive > > > > > > packets from vhost-user and push to VF. > > > > > > > > > > > > Signed-off-by: Noa Ezra > > > > > > Reviewed-by: Oz Shlomo > > > > > > --- > > > > > > Documentation/automake.mk | 1 + > > > > > > Documentation/topics/dpdk/index.rst | 1 + > > > > > > Documentation/topics/dpdk/vdpa.rst | 90 > > > > > > > NEWS| 1 + > > > > > > lib/netdev-dpdk.c | 162 > > > > > > > > > > > vswitchd/vswitch.xml| 25 ++ > > > > > > 6 files changed, 280 insertions(+) create mode 100644 > > > > > > Documentation/topics/dpdk/vdpa.rst > > > > > > > > > > > > diff --git a/Documentation/automake.mk > > > > b/Documentation/automake.mk > > > > > > index cd68f3b..ee574bc 100644 > > > > > > --- a/Documentation/automake.mk > > > > > > +++ b/Documentation/automake.mk > > > > > > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > > > > > > Documentation/topics/dpdk/ring.rst \ > > > > > > Documentation/topics/dpdk/vdev.rst \ > > > > > > Documentation/topics/dpdk/vhost-user.rst \ > > > > > > + Documentation/topics/dpdk/vdpa.rst \ > > > > > > Documentation/topics/fuzzing/index.rst \ > > > > > > Documentation/topics/fuzzing/what-is-fuzzing.rst \ > > > > > > > > > > > > Documentation/topics/fuzzing/ovs-fuzzing-infrastructure.rst \ > > > > > > diff --git a/Documentation/topics/dpdk/index.rst > > > > > > b/Documentation/topics/dpdk/index
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
Hi Noa, Thanks for your reply. > > > > Hi Noa, > > > > > > > > I have a couple more questions. I'm still at the learning stage of > > > > this new feature, thanks in advance for your patience. > > > > > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > > > dpdkvdpa netdev works with 3 components: > > > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > > > representor of "vdpa device". > > > > > > > > What NIC card support this feature? > > > > I don't have real vdpa device, can I use Intel X540 VF feature? > > > > > > > > > > This feature will have two modes, SW and HW. > > > The SW mode doesn't depend on a real vdpa device and allows you to use > > > this feature even if you don't have a NIC that support it. > Although you need to use representors, so you need your NIC to support it. > > > The HW mode will be implemented in the future and will use a real vdpa > > > device. It will be better to use the HW mode if you have a NIC that > > > support > > it. > > > > > > For now, we only support the SW mode, when vdpa will have support in > > > dpdk, we will add the HW mode to OVS. > > > > > > > > > > > > > In order to add a new vDPA port, add a new port to existing bridge > > > > > with type dpdkvdpa and vDPA options: > > > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > > > >options:vdpa-socket-path= > > > > >options:vdpa-accelerator-devargs= > > > > >options:dpdk-devargs=,representor=[id] > > > > > > > > > > On this command OVS will create a new netdev: > > > > > 1. Register vhost-user-client device. > > > > > 2. Open and configure VF dpdk port. > > > > > 3. Open and configure representor dpdk port. > > > > > > > > > > The new netdev will use netdev_rxq_recv() function in order to > > > > > receive packets from VF and push to vhost-user and receive packets > > > > > from vhost-user and push to VF. > > > > > > > > > > Signed-off-by: Noa Ezra > > > > > Reviewed-by: Oz Shlomo > > > > > --- > > > > > Documentation/automake.mk | 1 + > > > > > Documentation/topics/dpdk/index.rst | 1 + > > > > > Documentation/topics/dpdk/vdpa.rst | 90 > > > > > NEWS| 1 + > > > > > lib/netdev-dpdk.c | 162 > > > > > > > > > vswitchd/vswitch.xml| 25 ++ > > > > > 6 files changed, 280 insertions(+) create mode 100644 > > > > > Documentation/topics/dpdk/vdpa.rst > > > > > > > > > > diff --git a/Documentation/automake.mk > > > b/Documentation/automake.mk > > > > > index cd68f3b..ee574bc 100644 > > > > > --- a/Documentation/automake.mk > > > > > +++ b/Documentation/automake.mk > > > > > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > > > > > Documentation/topics/dpdk/ring.rst \ > > > > > Documentation/topics/dpdk/vdev.rst \ > > > > > Documentation/topics/dpdk/vhost-user.rst \ > > > > > + Documentation/topics/dpdk/vdpa.rst \ > > > > > Documentation/topics/fuzzing/index.rst \ > > > > > Documentation/topics/fuzzing/what-is-fuzzing.rst \ > > > > > Documentation/topics/fuzzing/ovs-fuzzing-infrastructure.rst \ > > > > > diff --git a/Documentation/topics/dpdk/index.rst > > > > > b/Documentation/topics/dpdk/index.rst > > > > > index cf24a7b..c1d4ea7 100644 > > > > > --- a/Documentation/topics/dpdk/index.rst > > > > > +++ b/Documentation/topics/dpdk/index.rst > > > > > @@ -41,3 +41,4 @@ The DPDK Datapath > > > > > /topics/dpdk/pdump > > > > > /topics/dpdk/jumbo-frames > > > > > /topics/dpdk/memory > > > > > + /topics/dpdk/vdpa > > > > > diff --git a/Documentation/topics/dpdk/vdpa.rst > > > > > b/Documentation/topics/dpdk/vdpa.rst > > > > > new file mode 100644 > > > > > +2357,23 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq, struct > > > > dp_packet_batch *batch, > > > > > return 0; > > > > > } > > > > > > > > > > +static int > > > > > +netdev_dpdk_vdpa_rxq_recv(struct netdev_rxq *rxq, > > > > > + struct dp_packet_batch *batch, > > > > > + int *qfill) { > > > > > +struct netdev_dpdk *dev = netdev_dpdk_cast(rxq->netdev); > > > > > +int fwd_rx; > > > > > +int ret; > > > > > + > > > > > +fwd_rx = netdev_dpdk_vdpa_rxq_recv_impl(dev->relay, > > > > > + rxq->queue_id); > > > > I'm still not clear about the above function. > > > > So netdev_dpdk_vdpa_recv_impl() > > > > netdev_dpdk_vdpa_forward_traffic(), with a queue pair as parameter > > > > ... > > > > rte_eth_rx_burst(qpair->port_id_rx...) > > > > ... > > > > rte_eth_tx_burst(qpair->port_id_tx...) > > > > > > > > So looks like forwarding between vf to vhostuser and vice versa is > > > > done in this function. > > > > > > > > > +ret = netdev_dpdk_rxq_recv(rxq, batch, qfill); > > > > > > > > Then why do we call netdev_dpdk_rxq_recv() above again? > > > > Are packets received above the same packets as
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
> -Original Message- > From: Noa Levy > Sent: Sunday, October 27, 2019 1:26 PM > To: 'William Tu' > Cc: 'ovs-dev@openvswitch.org' ; Oz Shlomo > ; Majd Dibbiny ; Ameer > Mahagneh ; Eli Britstein > Subject: RE: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > > > > -Original Message- > > From: Noa Levy > > Sent: Sunday, October 27, 2019 11:24 AM > > To: William Tu > > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > > Dibbiny ; Ameer Mahagneh > ; Eli > > Britstein > > Subject: RE: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa > > port > > > > > > > -Original Message- > > > From: William Tu [mailto:u9012...@gmail.com] > > > Sent: Thursday, October 24, 2019 2:00 AM > > > To: Noa Levy > > > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > > > Dibbiny ; Ameer Mahagneh > > ; Eli > > > Britstein > > > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa > > > port > > > > > > Hi Noa, > > > > > > I have a couple more questions. I'm still at the learning stage of > > > this new feature, thanks in advance for your patience. > > > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > > dpdkvdpa netdev works with 3 components: > > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > > representor of "vdpa device". > > > > > > What NIC card support this feature? > > > I don't have real vdpa device, can I use Intel X540 VF feature? > > > > > > > This feature will have two modes, SW and HW. > > The SW mode doesn't depend on a real vdpa device and allows you to use > > this feature even if you don't have a NIC that support it. Although you need to use representors, so you need your NIC to support it. > > The HW mode will be implemented in the future and will use a real vdpa > > device. It will be better to use the HW mode if you have a NIC that support > it. > > > > For now, we only support the SW mode, when vdpa will have support in > > dpdk, we will add the HW mode to OVS. > > > > > > > > > > In order to add a new vDPA port, add a new port to existing bridge > > > > with type dpdkvdpa and vDPA options: > > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > > >options:vdpa-socket-path= > > > >options:vdpa-accelerator-devargs= > > > >options:dpdk-devargs=,representor=[id] > > > > > > > > On this command OVS will create a new netdev: > > > > 1. Register vhost-user-client device. > > > > 2. Open and configure VF dpdk port. > > > > 3. Open and configure representor dpdk port. > > > > > > > > The new netdev will use netdev_rxq_recv() function in order to > > > > receive packets from VF and push to vhost-user and receive packets > > > > from vhost-user and push to VF. > > > > > > > > Signed-off-by: Noa Ezra > > > > Reviewed-by: Oz Shlomo > > > > --- > > > > Documentation/automake.mk | 1 + > > > > Documentation/topics/dpdk/index.rst | 1 + > > > > Documentation/topics/dpdk/vdpa.rst | 90 > > > > NEWS| 1 + > > > > lib/netdev-dpdk.c | 162 > > > > > > > vswitchd/vswitch.xml| 25 ++ > > > > 6 files changed, 280 insertions(+) create mode 100644 > > > > Documentation/topics/dpdk/vdpa.rst > > > > > > > > diff --git a/Documentation/automake.mk > > b/Documentation/automake.mk > > > > index cd68f3b..ee574bc 100644 > > > > --- a/Documentation/automake.mk > > > > +++ b/Documentation/automake.mk > > > > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > > > > Documentation/topics/dpdk/ring.rst \ > > > > Documentation/topics/dpdk/vdev.rst \ > > > > Documentation/topics/dpdk/vhost-user.rst \ > > > > + Documentation/topics/dpdk/vdpa.rst \ > > > > Documentation/topics/fuzzing/index.rst \ > > > > Documentation/topics/fuzzing/what-is-fuzzing.rst \ > > > > Documentation/topics/fuzzing/ovs-fuzzing-infrastructure.rst \ > > > > diff --git a/Documentation/topics/dpdk/index.rst > > > > b/Documentation/topics/dpd
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
> -Original Message- > From: Noa Levy > Sent: Sunday, October 27, 2019 11:24 AM > To: William Tu > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > Dibbiny ; Ameer Mahagneh > ; Eli Britstein > Subject: RE: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > > > -Original Message- > > From: William Tu [mailto:u9012...@gmail.com] > > Sent: Thursday, October 24, 2019 2:00 AM > > To: Noa Levy > > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > > Dibbiny ; Ameer Mahagneh > ; Eli > > Britstein > > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa > > port > > > > Hi Noa, > > > > I have a couple more questions. I'm still at the learning stage of > > this new feature, thanks in advance for your patience. > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > dpdkvdpa netdev works with 3 components: > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > representor of "vdpa device". > > > > What NIC card support this feature? > > I don't have real vdpa device, can I use Intel X540 VF feature? > > > > This feature will have two modes, SW and HW. > The SW mode doesn't depend on a real vdpa device and allows you to use > this feature even if you don't have a NIC that support it. > The HW mode will be implemented in the future and will use a real vdpa > device. It will be better to use the HW mode if you have a NIC that support > it. > > For now, we only support the SW mode, when vdpa will have support in > dpdk, we will add the HW mode to OVS. > > > > > > > In order to add a new vDPA port, add a new port to existing bridge > > > with type dpdkvdpa and vDPA options: > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > >options:vdpa-socket-path= > > >options:vdpa-accelerator-devargs= > > >options:dpdk-devargs=,representor=[id] > > > > > > On this command OVS will create a new netdev: > > > 1. Register vhost-user-client device. > > > 2. Open and configure VF dpdk port. > > > 3. Open and configure representor dpdk port. > > > > > > The new netdev will use netdev_rxq_recv() function in order to > > > receive packets from VF and push to vhost-user and receive packets > > > from vhost-user and push to VF. > > > > > > Signed-off-by: Noa Ezra > > > Reviewed-by: Oz Shlomo > > > --- > > > Documentation/automake.mk | 1 + > > > Documentation/topics/dpdk/index.rst | 1 + > > > Documentation/topics/dpdk/vdpa.rst | 90 > > > NEWS| 1 + > > > lib/netdev-dpdk.c | 162 > > > > > vswitchd/vswitch.xml| 25 ++ > > > 6 files changed, 280 insertions(+) > > > create mode 100644 Documentation/topics/dpdk/vdpa.rst > > > > > > diff --git a/Documentation/automake.mk > b/Documentation/automake.mk > > > index cd68f3b..ee574bc 100644 > > > --- a/Documentation/automake.mk > > > +++ b/Documentation/automake.mk > > > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > > > Documentation/topics/dpdk/ring.rst \ > > > Documentation/topics/dpdk/vdev.rst \ > > > Documentation/topics/dpdk/vhost-user.rst \ > > > + Documentation/topics/dpdk/vdpa.rst \ > > > Documentation/topics/fuzzing/index.rst \ > > > Documentation/topics/fuzzing/what-is-fuzzing.rst \ > > > Documentation/topics/fuzzing/ovs-fuzzing-infrastructure.rst \ diff > > > --git a/Documentation/topics/dpdk/index.rst > > > b/Documentation/topics/dpdk/index.rst > > > index cf24a7b..c1d4ea7 100644 > > > --- a/Documentation/topics/dpdk/index.rst > > > +++ b/Documentation/topics/dpdk/index.rst > > > @@ -41,3 +41,4 @@ The DPDK Datapath > > > /topics/dpdk/pdump > > > /topics/dpdk/jumbo-frames > > > /topics/dpdk/memory > > > + /topics/dpdk/vdpa > > > diff --git a/Documentation/topics/dpdk/vdpa.rst > > > b/Documentation/topics/dpdk/vdpa.rst > > > new file mode 100644 > > > index 000..34c5300 > > > --- /dev/null > > > +++ b/Documentation/topics/dpdk/vdpa.rst > > > @@ -0,0 +1,90 @@ > > > +.. > > > + Copyright (c) 2019 Mellanox Technologies, Ltd. > > > + > > > + Licensed under the Apache License, Version 2.0 (the "License"); >
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
Hi Noa, I have a couple more questions. I'm still at the learning stage of this new feature, thanks in advance for your patience. On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > dpdkvdpa netdev works with 3 components: > vhost-user socket, vdpa device: real vdpa device or a VF and > representor of "vdpa device". What NIC card support this feature? I don't have real vdpa device, can I use Intel X540 VF feature? > > In order to add a new vDPA port, add a new port to existing bridge > with type dpdkvdpa and vDPA options: > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa >options:vdpa-socket-path= >options:vdpa-accelerator-devargs= >options:dpdk-devargs=,representor=[id] > > On this command OVS will create a new netdev: > 1. Register vhost-user-client device. > 2. Open and configure VF dpdk port. > 3. Open and configure representor dpdk port. > > The new netdev will use netdev_rxq_recv() function in order to receive > packets from VF and push to vhost-user and receive packets from > vhost-user and push to VF. > > Signed-off-by: Noa Ezra > Reviewed-by: Oz Shlomo > --- > Documentation/automake.mk | 1 + > Documentation/topics/dpdk/index.rst | 1 + > Documentation/topics/dpdk/vdpa.rst | 90 > NEWS| 1 + > lib/netdev-dpdk.c | 162 > > vswitchd/vswitch.xml| 25 ++ > 6 files changed, 280 insertions(+) > create mode 100644 Documentation/topics/dpdk/vdpa.rst > > diff --git a/Documentation/automake.mk b/Documentation/automake.mk > index cd68f3b..ee574bc 100644 > --- a/Documentation/automake.mk > +++ b/Documentation/automake.mk > @@ -43,6 +43,7 @@ DOC_SOURCE = \ > Documentation/topics/dpdk/ring.rst \ > Documentation/topics/dpdk/vdev.rst \ > Documentation/topics/dpdk/vhost-user.rst \ > + Documentation/topics/dpdk/vdpa.rst \ > Documentation/topics/fuzzing/index.rst \ > Documentation/topics/fuzzing/what-is-fuzzing.rst \ > Documentation/topics/fuzzing/ovs-fuzzing-infrastructure.rst \ > diff --git a/Documentation/topics/dpdk/index.rst > b/Documentation/topics/dpdk/index.rst > index cf24a7b..c1d4ea7 100644 > --- a/Documentation/topics/dpdk/index.rst > +++ b/Documentation/topics/dpdk/index.rst > @@ -41,3 +41,4 @@ The DPDK Datapath > /topics/dpdk/pdump > /topics/dpdk/jumbo-frames > /topics/dpdk/memory > + /topics/dpdk/vdpa > diff --git a/Documentation/topics/dpdk/vdpa.rst > b/Documentation/topics/dpdk/vdpa.rst > new file mode 100644 > index 000..34c5300 > --- /dev/null > +++ b/Documentation/topics/dpdk/vdpa.rst > @@ -0,0 +1,90 @@ > +.. > + Copyright (c) 2019 Mellanox Technologies, Ltd. > + > + Licensed under the Apache License, Version 2.0 (the "License"); > + you may not use this file except in compliance with the License. > + You may obtain a copy of the License at: > + > + http://www.apache.org/licenses/LICENSE-2.0 > + > + Unless required by applicable law or agreed to in writing, software > + distributed under the License is distributed on an "AS IS" BASIS, > WITHOUT > + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See > the > + License for the specific language governing permissions and limitations > + under the License. > + > + Convention for heading levels in Open vSwitch documentation: > + > + === Heading 0 (reserved for the title in a document) > + --- Heading 1 > + ~~~ Heading 2 > + +++ Heading 3 > + ''' Heading 4 > + > + Avoid deeper levels because they do not render well. > + > + > +=== > +DPDK VDPA Ports > +=== > + > +In user space there are two main approaches to communicate with a guest (VM), > +using virtIO ports (e.g. netdev type=dpdkvhoshuser/dpdkvhostuserclient) or > +SR-IOV using phy ports (e.g. netdev type = dpdk). > +Phy ports allow working with port representor which is attached to the OVS > and > +a matching VF is given with pass-through to the guest. > +HW rules can process packets from up-link and direct them to the VF without > +going through SW (OVS) and therefore using phy ports gives the best > +performance. > +However, SR-IOV architecture requires that the guest will use a driver which > is > +specific to the underlying HW. Specific HW driver has two main drawbacks: > +1. Breaks virtualization in some sense (guest aware of the HW), can also > limit > +the type of images supported. > +2. Less natural support for live migration. > + > +Using virtIO port solves both problems, but reduces performance and causes > +losing of some functionality, for example, for some HW offload, working > +directly with virtIO cannot be supported. > + > +We created a new netdev type- dpdkvdpa. dpdkvdpa port solves this conflict. > +The new netdev is basically very similar to regular dpdk netdev but it
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
On Tue, Oct 22, 2019 at 12:17 AM Noa Ezra wrote: > > Hi, > Please see the answer below. > > Thanks, > Noa. > > > -Original Message- > > From: William Tu [mailto:u9012...@gmail.com] > > Sent: Friday, October 18, 2019 12:34 AM > > To: Noa Ezra > > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > > Dibbiny ; Ameer Mahagneh > > ; Eli Britstein > > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > > > Hi Noa, > > > > Thanks for the patch. I'm new to this and have a question below. > > > > > dpdkvdpa netdev works with 3 components: > > > vhost-user socket, vdpa device: real vdpa device or a VF and > > > representor of "vdpa device". > > > > > > In order to add a new vDPA port, add a new port to existing bridge > > > with type dpdkvdpa and vDPA options: > > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > > >options:vdpa-socket-path= > > >options:vdpa-accelerator-devargs= > > >options:dpdk-devargs=,representor=[id] > > > > > > On this command OVS will create a new netdev: > > > 1. Register vhost-user-client device. > > > 2. Open and configure VF dpdk port. > > > 3. Open and configure representor dpdk port. > > > > > > The new netdev will use netdev_rxq_recv() function in order to receive > > > packets from VF and push to vhost-user and receive packets from > > > vhost-user and push to VF. > > > > So does OVS in this case is able to apply OpenFlow rules on packets? > > > > When netdev_dpdk_vdpa_rxq_recv() is invoked, does the batch of packets > > go into OVS's parse, lookup, action pipeline? Or all packets go directly > > into > > VM if (VF -> VM) and vice versa? > > > > Is > > fwd_rx = netdev_dpdk_vdpa_rxq_recv_impl(dev->relay, rxq->queue_id); > > forward packets from vhost-user to VF and ret = > > netdev_dpdk_rxq_recv(rxq, batch, qfill); forward packets from vhost-user to > > VM? > > I hope that I understand your question correctly, the > netdev_dpdk_vdpa_rxq_recv forwards packets from VM to VF and vice versa. > There is no change in the processing of the packet between VF and up-link and > no change in the packet's header. > The new netdev only translate between SR-IOV (phy) VF to virtIO VM. > Hi Noa, Thank you for your reply. So does the netdev_dpdk_rxq_recv below also forwards packets? netdev_dpdk_rxq_recv(rxq, batch, qfill); Am I able to modify packet content by accessing batch->packets[i]? Regards, William ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port
Hi, Please see the answer below. Thanks, Noa. > -Original Message- > From: William Tu [mailto:u9012...@gmail.com] > Sent: Friday, October 18, 2019 12:34 AM > To: Noa Ezra > Cc: ovs-dev@openvswitch.org; Oz Shlomo ; Majd > Dibbiny ; Ameer Mahagneh > ; Eli Britstein > Subject: Re: [ovs-dev] [PATCH ovs v3 2/2] netdev-dpdk: Add dpdkvdpa port > > On Thu, Oct 17, 2019 at 02:16:56PM +0300, Noa Ezra wrote: > > Hi Noa, > > Thanks for the patch. I'm new to this and have a question below. > > > dpdkvdpa netdev works with 3 components: > > vhost-user socket, vdpa device: real vdpa device or a VF and > > representor of "vdpa device". > > > > In order to add a new vDPA port, add a new port to existing bridge > > with type dpdkvdpa and vDPA options: > > ovs-vsctl add-port br0 vdpa0 -- set Interface vdpa0 type=dpdkvdpa > >options:vdpa-socket-path= > >options:vdpa-accelerator-devargs= > >options:dpdk-devargs=,representor=[id] > > > > On this command OVS will create a new netdev: > > 1. Register vhost-user-client device. > > 2. Open and configure VF dpdk port. > > 3. Open and configure representor dpdk port. > > > > The new netdev will use netdev_rxq_recv() function in order to receive > > packets from VF and push to vhost-user and receive packets from > > vhost-user and push to VF. > > So does OVS in this case is able to apply OpenFlow rules on packets? > > When netdev_dpdk_vdpa_rxq_recv() is invoked, does the batch of packets > go into OVS's parse, lookup, action pipeline? Or all packets go directly into > VM if (VF -> VM) and vice versa? > > Is > fwd_rx = netdev_dpdk_vdpa_rxq_recv_impl(dev->relay, rxq->queue_id); > forward packets from vhost-user to VF and ret = > netdev_dpdk_rxq_recv(rxq, batch, qfill); forward packets from vhost-user to > VM? I hope that I understand your question correctly, the netdev_dpdk_vdpa_rxq_recv forwards packets from VM to VF and vice versa. There is no change in the processing of the packet between VF and up-link and no change in the packet's header. The new netdev only translate between SR-IOV (phy) VF to virtIO VM. > Thanks > William ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev