mbox series

[ovs-dev,0/6] Add support for DPDK meter HW offload

Message ID 20221216155054.986464-1-simon.horman@corigine.com
Headers show
Series Add support for DPDK meter HW offload | expand

Message

Simon Horman Dec. 16, 2022, 3:50 p.m. UTC
Hi,

this series adds support for DPDK meter HW offload

* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
* Patch 3/6: Implement netdev provider API for HW offload of DPDK meters
* Patch 4/6: Add more DPDK meter algorithms
* Patch 4/6: Add support for meter action ti DPDK HW offload
* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API

Peng Zhang (6):
  netdev-offload: Add DPDK meter offload API
  dpif-netdev: Offloading meter with DPDK
  netdev-offload-dpdk: Implement meter offload API for DPDK
  netdev-dpdk: add meter algorithms
  netdev-dpdk-offload: Add support for meter action
  ci: add the opts about ALLOW_EXPERIMENTAL_API

 .ci/linux-build.sh                   |   4 +
 .github/workflows/build-and-test.yml |  31 ++++
 Documentation/howto/dpdk.rst         |   5 +-
 lib/dpif-netdev.c                    | 102 +++++++++++
 lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
 lib/netdev-dpdk.h                    |  41 +++++
 lib/netdev-offload-dpdk.c            | 101 +++++++++++
 lib/netdev-offload-provider.h        |  30 ++++
 lib/netdev-offload.c                 |  59 +++++++
 lib/netdev-offload.h                 |   9 +
 10 files changed, 623 insertions(+), 2 deletions(-)

Comments

Eli Britstein Dec. 26, 2022, 10:04 a.m. UTC | #1
Dpif-netdev should not implement internal HW offload details. If need to "apply on all ports", it needs to be done in offload layer.
However, in arch level, there is a problem with the proposed series. It will create a meter object per port, while in SW it is one object, that can be shared between multiple flows, on different ports.

>-----Original Message-----
>From: Simon Horman <simon.horman@corigine.com>
>Sent: Friday, 16 December 2022 17:51
>To: dev@openvswitch.org
>Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong He
><chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng Zhang
><peng.zhang@corigine.com>; Simon Horman <simon.horman@corigine.com>
>Subject: [PATCH 0/6] Add support for DPDK meter HW offload
>
>External email: Use caution opening links or attachments
>
>
>Hi,
>
>this series adds support for DPDK meter HW offload
>
>* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
>* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
>* Patch 3/6: Implement netdev provider API for HW offload of DPDK meters
>* Patch 4/6: Add more DPDK meter algorithms
>* Patch 4/6: Add support for meter action ti DPDK HW offload
>* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
>
>Peng Zhang (6):
>  netdev-offload: Add DPDK meter offload API
>  dpif-netdev: Offloading meter with DPDK
>  netdev-offload-dpdk: Implement meter offload API for DPDK
>  netdev-dpdk: add meter algorithms
>  netdev-dpdk-offload: Add support for meter action
>  ci: add the opts about ALLOW_EXPERIMENTAL_API
>
> .ci/linux-build.sh                   |   4 +
> .github/workflows/build-and-test.yml |  31 ++++
> Documentation/howto/dpdk.rst         |   5 +-
> lib/dpif-netdev.c                    | 102 +++++++++++
> lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
> lib/netdev-dpdk.h                    |  41 +++++
> lib/netdev-offload-dpdk.c            | 101 +++++++++++
> lib/netdev-offload-provider.h        |  30 ++++
> lib/netdev-offload.c                 |  59 +++++++
> lib/netdev-offload.h                 |   9 +
> 10 files changed, 623 insertions(+), 2 deletions(-)
>
>--
>2.30.2
Nole Zhang Jan. 6, 2023, 9:28 a.m. UTC | #2
> -----Original Message-----
> From: Eli Britstein <elibr@nvidia.com>
> Sent: 2022年12月26日 18:04
> To: Simon Horman <simon.horman@corigine.com>; dev@openvswitch.org
> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> drivers <oss-drivers@corigine.com>; Nole Zhang <peng.zhang@corigine.com>
> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> 
> Dpif-netdev should not implement internal HW offload details. If need to
> "apply on all ports", it needs to be done in offload layer.
> However, in arch level, there is a problem with the proposed series. It will
> create a meter object per port, while in SW it is one object, that can be
> shared between multiple flows, on different ports.

In dpif-netdev, it doesn't relate with implement internal HW offload details,
I just try to add the meter to the PMD if the PMD support the meter offload.

No, it will create a meter object per PMD not per port, so the meter can share
 the same NIC different vf,  different NIC can't share  the meter, it is same
with ovs-tc meter offload
> 
> >-----Original Message-----
> >From: Simon Horman <simon.horman@corigine.com>
> >Sent: Friday, 16 December 2022 17:51
> >To: dev@openvswitch.org
> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> ><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong He
> ><chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng Zhang
> ><peng.zhang@corigine.com>; Simon Horman
> <simon.horman@corigine.com>
> >Subject: [PATCH 0/6] Add support for DPDK meter HW offload
> >
> >External email: Use caution opening links or attachments
> >
> >
> >Hi,
> >
> >this series adds support for DPDK meter HW offload
> >
> >* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
> >* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
> >* Patch 3/6: Implement netdev provider API for HW offload of DPDK
> >meters
> >* Patch 4/6: Add more DPDK meter algorithms
> >* Patch 4/6: Add support for meter action ti DPDK HW offload
> >* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
> >
> >Peng Zhang (6):
> >  netdev-offload: Add DPDK meter offload API
> >  dpif-netdev: Offloading meter with DPDK
> >  netdev-offload-dpdk: Implement meter offload API for DPDK
> >  netdev-dpdk: add meter algorithms
> >  netdev-dpdk-offload: Add support for meter action
> >  ci: add the opts about ALLOW_EXPERIMENTAL_API
> >
> > .ci/linux-build.sh                   |   4 +
> > .github/workflows/build-and-test.yml |  31 ++++
> > Documentation/howto/dpdk.rst         |   5 +-
> > lib/dpif-netdev.c                    | 102 +++++++++++
> > lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
> > lib/netdev-dpdk.h                    |  41 +++++
> > lib/netdev-offload-dpdk.c            | 101 +++++++++++
> > lib/netdev-offload-provider.h        |  30 ++++
> > lib/netdev-offload.c                 |  59 +++++++
> > lib/netdev-offload.h                 |   9 +
> > 10 files changed, 623 insertions(+), 2 deletions(-)
> >
> >--
> >2.30.2
Eli Britstein Jan. 8, 2023, 7:26 a.m. UTC | #3
>-----Original Message-----
>From: Nole Zhang <peng.zhang@corigine.com>
>Sent: Friday, 6 January 2023 11:28
>To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
>Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
>drivers <oss-drivers@corigine.com>; Nole Zhang <peng.zhang@corigine.com>
>Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>
>External email: Use caution opening links or attachments
>
>
>> -----Original Message-----
>> From: Eli Britstein <elibr@nvidia.com>
>> Sent: 2022年12月26日 18:04
>> To: Simon Horman <simon.horman@corigine.com>; dev@openvswitch.org
>> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
>> drivers <oss-drivers@corigine.com>; Nole Zhang
>> <peng.zhang@corigine.com>
>> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>>
>> Dpif-netdev should not implement internal HW offload details. If need
>> to "apply on all ports", it needs to be done in offload layer.
>> However, in arch level, there is a problem with the proposed series.
>> It will create a meter object per port, while in SW it is one object,
>> that can be shared between multiple flows, on different ports.
>
>In dpif-netdev, it doesn't relate with implement internal HW offload details, I
>just try to add the meter to the PMD if the PMD support the meter offload.
[Eli Britstein] your loops over ports, not over PMDs. See in [1], for example in dpif_netdev_offload_meter_set():
+    HMAP_FOR_EACH (port, node, &dp->ports) {
+        dev = port->netdev;
Am I wrong?

Other than that, there is already a convenient API to traverse ports for offload - netdev_ports_traverse().
>
>No, it will create a meter object per PMD not per port, so the meter can share
>the same NIC different vf,  different NIC can't share  the meter, it is same with
>ovs-tc meter offload
[Eli Britstein] no, it will create an object per port, as this is your code.
To create a shared object for all the VFs in the same NIC, need to use the "proxy" port. Such work has started in [2].

[1] http://patchwork.ozlabs.org/project/openvswitch/patch/20221216155054.986464-3-simon.horman@corigine.com/
[2] http://patchwork.ozlabs.org/project/openvswitch/patch/20220720121823.2497727-4-ivan.malov@oktetlabs.ru/

>>
>> >-----Original Message-----
>> >From: Simon Horman <simon.horman@corigine.com>
>> >Sent: Friday, 16 December 2022 17:51
>> >To: dev@openvswitch.org
>> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> ><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong He
>> ><chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng Zhang
>> ><peng.zhang@corigine.com>; Simon Horman
>> <simon.horman@corigine.com>
>> >Subject: [PATCH 0/6] Add support for DPDK meter HW offload
>> >
>> >External email: Use caution opening links or attachments
>> >
>> >
>> >Hi,
>> >
>> >this series adds support for DPDK meter HW offload
>> >
>> >* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
>> >* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
>> >* Patch 3/6: Implement netdev provider API for HW offload of DPDK
>> >meters
>> >* Patch 4/6: Add more DPDK meter algorithms
>> >* Patch 4/6: Add support for meter action ti DPDK HW offload
>> >* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
>> >
>> >Peng Zhang (6):
>> >  netdev-offload: Add DPDK meter offload API
>> >  dpif-netdev: Offloading meter with DPDK
>> >  netdev-offload-dpdk: Implement meter offload API for DPDK
>> >  netdev-dpdk: add meter algorithms
>> >  netdev-dpdk-offload: Add support for meter action
>> >  ci: add the opts about ALLOW_EXPERIMENTAL_API
>> >
>> > .ci/linux-build.sh                   |   4 +
>> > .github/workflows/build-and-test.yml |  31 ++++
>> > Documentation/howto/dpdk.rst         |   5 +-
>> > lib/dpif-netdev.c                    | 102 +++++++++++
>> > lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
>> > lib/netdev-dpdk.h                    |  41 +++++
>> > lib/netdev-offload-dpdk.c            | 101 +++++++++++
>> > lib/netdev-offload-provider.h        |  30 ++++
>> > lib/netdev-offload.c                 |  59 +++++++
>> > lib/netdev-offload.h                 |   9 +
>> > 10 files changed, 623 insertions(+), 2 deletions(-)
>> >
>> >--
>> >2.30.2
Nole Zhang Jan. 9, 2023, 9:22 a.m. UTC | #4
> -----Original Message-----
> From: Eli Britstein <elibr@nvidia.com>
> Sent: 2023年1月8日 15:27
> To: Nole Zhang <peng.zhang@corigine.com>; dev@openvswitch.org
> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> drivers <oss-drivers@corigine.com>
> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> 
> 
> 
> >-----Original Message-----
> >From: Nole Zhang <peng.zhang@corigine.com>
> >Sent: Friday, 6 January 2023 11:28
> >To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> ><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> >drivers <oss-drivers@corigine.com>; Nole Zhang
> ><peng.zhang@corigine.com>
> >Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >
> >External email: Use caution opening links or attachments
> >
> >
> >> -----Original Message-----
> >> From: Eli Britstein <elibr@nvidia.com>
> >> Sent: 2022年12月26日 18:04
> >> To: Simon Horman <simon.horman@corigine.com>;
> dev@openvswitch.org
> >> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> >> drivers <oss-drivers@corigine.com>; Nole Zhang
> >> <peng.zhang@corigine.com>
> >> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >>
> >> Dpif-netdev should not implement internal HW offload details. If need
> >> to "apply on all ports", it needs to be done in offload layer.
> >> However, in arch level, there is a problem with the proposed series.
> >> It will create a meter object per port, while in SW it is one object,
> >> that can be shared between multiple flows, on different ports.
> >
> >In dpif-netdev, it doesn't relate with implement internal HW offload
> >details, I just try to add the meter to the PMD if the PMD support the meter
> offload.
> [Eli Britstein] your loops over ports, not over PMDs. See in [1], for example in
> dpif_netdev_offload_meter_set():
> +    HMAP_FOR_EACH (port, node, &dp->ports) {
> +        dev = port->netdev;
> Am I wrong?

Thanks for your notice, yes, as ovs code, it will add the meter in different port.

As our design,  for different port, if the different port has the same PMD with
the same meter id, it will just  add the meter successfully once in the dpdk and
it can achieve sharing the same NIC different vf.

If I add the judge for the PMD, for different PMD, just add the meter once, do
you think it is ok?

> 
> Other than that, there is already a convenient API to traverse ports for
> offload - netdev_ports_traverse().

Ok, thanks, I will investigate it.

> >
> >No, it will create a meter object per PMD not per port, so the meter
> >can share the same NIC different vf,  different NIC can't share  the
> >meter, it is same with ovs-tc meter offload
> [Eli Britstein] no, it will create an object per port, as this is your code.
> To create a shared object for all the VFs in the same NIC, need to use the
> "proxy" port. Such work has started in [2].
> 
> [1]
> http://patchwork.ozlabs.org/project/openvswitch/patch/20221216155054.9
> 86464-3-simon.horman@corigine.com/
> [2]
> http://patchwork.ozlabs.org/project/openvswitch/patch/20220720121823.2
> 497727-4-ivan.malov@oktetlabs.ru/

Ok, thanks for your notice, I will investigate it, but the commit seems cant be accepted.
> 
> >>
> >> >-----Original Message-----
> >> >From: Simon Horman <simon.horman@corigine.com>
> >> >Sent: Friday, 16 December 2022 17:51
> >> >To: dev@openvswitch.org
> >> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> ><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong He
> >> ><chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng Zhang
> >> ><peng.zhang@corigine.com>; Simon Horman
> >> <simon.horman@corigine.com>
> >> >Subject: [PATCH 0/6] Add support for DPDK meter HW offload
> >> >
> >> >External email: Use caution opening links or attachments
> >> >
> >> >
> >> >Hi,
> >> >
> >> >this series adds support for DPDK meter HW offload
> >> >
> >> >* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
> >> >* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
> >> >* Patch 3/6: Implement netdev provider API for HW offload of DPDK
> >> >meters
> >> >* Patch 4/6: Add more DPDK meter algorithms
> >> >* Patch 4/6: Add support for meter action ti DPDK HW offload
> >> >* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
> >> >
> >> >Peng Zhang (6):
> >> >  netdev-offload: Add DPDK meter offload API
> >> >  dpif-netdev: Offloading meter with DPDK
> >> >  netdev-offload-dpdk: Implement meter offload API for DPDK
> >> >  netdev-dpdk: add meter algorithms
> >> >  netdev-dpdk-offload: Add support for meter action
> >> >  ci: add the opts about ALLOW_EXPERIMENTAL_API
> >> >
> >> > .ci/linux-build.sh                   |   4 +
> >> > .github/workflows/build-and-test.yml |  31 ++++
> >> > Documentation/howto/dpdk.rst         |   5 +-
> >> > lib/dpif-netdev.c                    | 102 +++++++++++
> >> > lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
> >> > lib/netdev-dpdk.h                    |  41 +++++
> >> > lib/netdev-offload-dpdk.c            | 101 +++++++++++
> >> > lib/netdev-offload-provider.h        |  30 ++++
> >> > lib/netdev-offload.c                 |  59 +++++++
> >> > lib/netdev-offload.h                 |   9 +
> >> > 10 files changed, 623 insertions(+), 2 deletions(-)
> >> >
> >> >--
> >> >2.30.2
Eli Britstein Jan. 9, 2023, 9:31 a.m. UTC | #5
>-----Original Message-----
>From: Nole Zhang <peng.zhang@corigine.com>
>Sent: Monday, 9 January 2023 11:23
>To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
>Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
>drivers <oss-drivers@corigine.com>
>Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>
>External email: Use caution opening links or attachments
>
>
>> -----Original Message-----
>> From: Eli Britstein <elibr@nvidia.com>
>> Sent: 2023年1月8日 15:27
>> To: Nole Zhang <peng.zhang@corigine.com>; dev@openvswitch.org
>> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
>> drivers <oss-drivers@corigine.com>
>> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>>
>>
>>
>> >-----Original Message-----
>> >From: Nole Zhang <peng.zhang@corigine.com>
>> >Sent: Friday, 6 January 2023 11:28
>> >To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
>> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> ><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
>> >drivers <oss-drivers@corigine.com>; Nole Zhang
>> ><peng.zhang@corigine.com>
>> >Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>> >
>> >External email: Use caution opening links or attachments
>> >
>> >
>> >> -----Original Message-----
>> >> From: Eli Britstein <elibr@nvidia.com>
>> >> Sent: 2022年12月26日 18:04
>> >> To: Simon Horman <simon.horman@corigine.com>;
>> dev@openvswitch.org
>> >> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> >> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>;
>oss-
>> >> drivers <oss-drivers@corigine.com>; Nole Zhang
>> >> <peng.zhang@corigine.com>
>> >> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
>> >>
>> >> Dpif-netdev should not implement internal HW offload details. If
>> >> need to "apply on all ports", it needs to be done in offload layer.
>> >> However, in arch level, there is a problem with the proposed series.
>> >> It will create a meter object per port, while in SW it is one
>> >> object, that can be shared between multiple flows, on different ports.
>> >
>> >In dpif-netdev, it doesn't relate with implement internal HW offload
>> >details, I just try to add the meter to the PMD if the PMD support
>> >the meter
>> offload.
>> [Eli Britstein] your loops over ports, not over PMDs. See in [1], for
>> example in
>> dpif_netdev_offload_meter_set():
>> +    HMAP_FOR_EACH (port, node, &dp->ports) {
>> +        dev = port->netdev;
>> Am I wrong?
>
>Thanks for your notice, yes, as ovs code, it will add the meter in different port.
>
>As our design,  for different port, if the different port has the same PMD with
>the same meter id, it will just  add the meter successfully once in the dpdk and
>it can achieve sharing the same NIC different vf.
>
>If I add the judge for the PMD, for different PMD, just add the meter once, do
>you think it is ok?
No. Even if you improve the code to create "once". Suppose the PF is port 0, and 2 VF representors are ports 1,2.
If the meter is created on port 1, using it with ports 0,2 is illegal from DPDK generic point of view. It might be supported depending on specific PMD support.
What will happen if port 1 is detached from OVS for example?
I think it has to be on the "proxy" port, see below.
>
>>
>> Other than that, there is already a convenient API to traverse ports
>> for offload - netdev_ports_traverse().
>
>Ok, thanks, I will investigate it.
>
>> >
>> >No, it will create a meter object per PMD not per port, so the meter
>> >can share the same NIC different vf,  different NIC can't share  the
>> >meter, it is same with ovs-tc meter offload
>> [Eli Britstein] no, it will create an object per port, as this is your code.
>> To create a shared object for all the VFs in the same NIC, need to use
>> the "proxy" port. Such work has started in [2].
>>
>> [1]
>>
>https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
>>
>work.ozlabs.org%2Fproject%2Fopenvswitch%2Fpatch%2F20221216155054.9&
>dat
>>
>a=05%7C01%7Celibr%40nvidia.com%7C6ecc84b885334be08f7d08daf2230e2a%
>7C43
>>
>083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638088529626823112%7CUn
>known%
>>
>7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwi
>LCJX
>>
>VCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rcM52oDqpL%2F%2BewlX8ZRZSTL
>mJslYBK7SI
>> 4c9BX3ocY8%3D&reserved=0
>> 86464-3-simon.horman@corigine.com/
>> [2]
>>
>https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
>>
>work.ozlabs.org%2Fproject%2Fopenvswitch%2Fpatch%2F20220720121823.2&
>dat
>>
>a=05%7C01%7Celibr%40nvidia.com%7C6ecc84b885334be08f7d08daf2230e2a%
>7C43
>>
>083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638088529626823112%7CUn
>known%
>>
>7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwi
>LCJX
>>
>VCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1ahxjeQoGyaQJHh9mKv91e5
>OH46qUc1VMb
>> 2wiPxOFI%3D&reserved=0
>> 497727-4-ivan.malov@oktetlabs.ru/
>
>Ok, thanks for your notice, I will investigate it, but the commit seems cant be
>accepted.
It can't be accepted as it was incomplete and premature. I think that work must be completed and integrated before introducing meter offloads.

>>
>> >>
>> >> >-----Original Message-----
>> >> >From: Simon Horman <simon.horman@corigine.com>
>> >> >Sent: Friday, 16 December 2022 17:51
>> >> >To: dev@openvswitch.org
>> >> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
>> >> ><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong
>> >> >He <chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng
>> >> >Zhang <peng.zhang@corigine.com>; Simon Horman
>> >> <simon.horman@corigine.com>
>> >> >Subject: [PATCH 0/6] Add support for DPDK meter HW offload
>> >> >
>> >> >External email: Use caution opening links or attachments
>> >> >
>> >> >
>> >> >Hi,
>> >> >
>> >> >this series adds support for DPDK meter HW offload
>> >> >
>> >> >* Patch 1/6: Add netdev provider API for HW offload of DPDK meters
>> >> >* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
>> >> >* Patch 3/6: Implement netdev provider API for HW offload of DPDK
>> >> >meters
>> >> >* Patch 4/6: Add more DPDK meter algorithms
>> >> >* Patch 4/6: Add support for meter action ti DPDK HW offload
>> >> >* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
>> >> >
>> >> >Peng Zhang (6):
>> >> >  netdev-offload: Add DPDK meter offload API
>> >> >  dpif-netdev: Offloading meter with DPDK
>> >> >  netdev-offload-dpdk: Implement meter offload API for DPDK
>> >> >  netdev-dpdk: add meter algorithms
>> >> >  netdev-dpdk-offload: Add support for meter action
>> >> >  ci: add the opts about ALLOW_EXPERIMENTAL_API
>> >> >
>> >> > .ci/linux-build.sh                   |   4 +
>> >> > .github/workflows/build-and-test.yml |  31 ++++
>> >> > Documentation/howto/dpdk.rst         |   5 +-
>> >> > lib/dpif-netdev.c                    | 102 +++++++++++
>> >> > lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
>> >> > lib/netdev-dpdk.h                    |  41 +++++
>> >> > lib/netdev-offload-dpdk.c            | 101 +++++++++++
>> >> > lib/netdev-offload-provider.h        |  30 ++++
>> >> > lib/netdev-offload.c                 |  59 +++++++
>> >> > lib/netdev-offload.h                 |   9 +
>> >> > 10 files changed, 623 insertions(+), 2 deletions(-)
>> >> >
>> >> >--
>> >> >2.30.2
Nole Zhang Jan. 10, 2023, 7:40 a.m. UTC | #6
> -----Original Message-----
> From: Eli Britstein <elibr@nvidia.com>
> Sent: 2023年1月9日 17:32
> To: Nole Zhang <peng.zhang@corigine.com>; dev@openvswitch.org
> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> drivers <oss-drivers@corigine.com>
> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> 
> 
> 
> >-----Original Message-----
> >From: Nole Zhang <peng.zhang@corigine.com>
> >Sent: Monday, 9 January 2023 11:23
> >To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> ><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> >drivers <oss-drivers@corigine.com>
> >Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >
> >External email: Use caution opening links or attachments
> >
> >
> >> -----Original Message-----
> >> From: Eli Britstein <elibr@nvidia.com>
> >> Sent: 2023年1月8日 15:27
> >> To: Nole Zhang <peng.zhang@corigine.com>; dev@openvswitch.org
> >> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>; oss-
> >> drivers <oss-drivers@corigine.com>
> >> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >>
> >>
> >>
> >> >-----Original Message-----
> >> >From: Nole Zhang <peng.zhang@corigine.com>
> >> >Sent: Friday, 6 January 2023 11:28
> >> >To: Eli Britstein <elibr@nvidia.com>; dev@openvswitch.org
> >> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> ><i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>;
> oss-
> >> >drivers <oss-drivers@corigine.com>; Nole Zhang
> >> ><peng.zhang@corigine.com>
> >> >Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >> >
> >> >External email: Use caution opening links or attachments
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Eli Britstein <elibr@nvidia.com>
> >> >> Sent: 2022年12月26日 18:04
> >> >> To: Simon Horman <simon.horman@corigine.com>;
> >> dev@openvswitch.org
> >> >> Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> >> <i.maximets@ovn.org>; Chaoyong He <chaoyong.he@corigine.com>;
> >oss-
> >> >> drivers <oss-drivers@corigine.com>; Nole Zhang
> >> >> <peng.zhang@corigine.com>
> >> >> Subject: RE: [PATCH 0/6] Add support for DPDK meter HW offload
> >> >>
> >> >> Dpif-netdev should not implement internal HW offload details. If
> >> >> need to "apply on all ports", it needs to be done in offload layer.
> >> >> However, in arch level, there is a problem with the proposed series.
> >> >> It will create a meter object per port, while in SW it is one
> >> >> object, that can be shared between multiple flows, on different ports.
> >> >
> >> >In dpif-netdev, it doesn't relate with implement internal HW offload
> >> >details, I just try to add the meter to the PMD if the PMD support
> >> >the meter
> >> offload.
> >> [Eli Britstein] your loops over ports, not over PMDs. See in [1], for
> >> example in
> >> dpif_netdev_offload_meter_set():
> >> +    HMAP_FOR_EACH (port, node, &dp->ports) {
> >> +        dev = port->netdev;
> >> Am I wrong?
> >
> >Thanks for your notice, yes, as ovs code, it will add the meter in different
> port.
> >
> >As our design,  for different port, if the different port has the same
> >PMD with the same meter id, it will just  add the meter successfully
> >once in the dpdk and it can achieve sharing the same NIC different vf.
> >
> >If I add the judge for the PMD, for different PMD, just add the meter
> >once, do you think it is ok?
> No. Even if you improve the code to create "once". Suppose the PF is port 0,
> and 2 VF representors are ports 1,2.
> If the meter is created on port 1, using it with ports 0,2 is illegal from DPDK
> generic point of view. It might be supported depending on specific PMD
> support.
> What will happen if port 1 is detached from OVS for example?
> I think it has to be on the "proxy" port, see below.

Thanks for your reply.

Yes, as your said, if I want support meter offload, the best way maybe is the proxy port, but
the commit seems doesn't make a further progress for a long time.

I am also rookie in the public community, in this situation, if I want to upstream this func,
I just wait or what can I do anything?

> >
> >>
> >> Other than that, there is already a convenient API to traverse ports
> >> for offload - netdev_ports_traverse().
> >
> >Ok, thanks, I will investigate it.
> >
> >> >
> >> >No, it will create a meter object per PMD not per port, so the meter
> >> >can share the same NIC different vf,  different NIC can't share  the
> >> >meter, it is same with ovs-tc meter offload
> >> [Eli Britstein] no, it will create an object per port, as this is your code.
> >> To create a shared object for all the VFs in the same NIC, need to
> >> use the "proxy" port. Such work has started in [2].
> >>
> >> [1]
> >>
> >https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatc
> h
> >>
> >work.ozlabs.org%2Fproject%2Fopenvswitch%2Fpatch%2F20221216155054.
> 9&
> >dat
> >>
> >a=05%7C01%7Celibr%40nvidia.com%7C6ecc84b885334be08f7d08daf2230e
> 2a%
> >7C43
> >>
> >083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638088529626823112%7
> CUn
> >known%
> >>
> >7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wi
> >LCJX
> >>
> >VCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rcM52oDqpL%2F%2BewlX8ZRZS
> TL
> >mJslYBK7SI
> >> 4c9BX3ocY8%3D&reserved=0
> >> 86464-3-simon.horman@corigine.com/
> >> [2]
> >>
> >https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatc
> h
> >>
> >work.ozlabs.org%2Fproject%2Fopenvswitch%2Fpatch%2F20220720121823.
> 2&
> >dat
> >>
> >a=05%7C01%7Celibr%40nvidia.com%7C6ecc84b885334be08f7d08daf2230e
> 2a%
> >7C43
> >>
> >083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638088529626823112%7
> CUn
> >known%
> >>
> >7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
> wi
> >LCJX
> >>
> >VCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2B1ahxjeQoGyaQJHh9mKv91e
> 5
> >OH46qUc1VMb
> >> 2wiPxOFI%3D&reserved=0
> >> 497727-4-ivan.malov@oktetlabs.ru/
> >
> >Ok, thanks for your notice, I will investigate it, but the commit seems
> >cant be accepted.
> It can't be accepted as it was incomplete and premature. I think that work
> must be completed and integrated before introducing meter offloads.
> 
> >>
> >> >>
> >> >> >-----Original Message-----
> >> >> >From: Simon Horman <simon.horman@corigine.com>
> >> >> >Sent: Friday, 16 December 2022 17:51
> >> >> >To: dev@openvswitch.org
> >> >> >Cc: Eelco Chaudron <echaudro@redhat.com>; Ilya Maximets
> >> >> ><i.maximets@ovn.org>; Eli Britstein <elibr@nvidia.com>; Chaoyong
> >> >> >He <chaoyong.he@corigine.com>; oss-drivers@corigine.com; Peng
> >> >> >Zhang <peng.zhang@corigine.com>; Simon Horman
> >> >> <simon.horman@corigine.com>
> >> >> >Subject: [PATCH 0/6] Add support for DPDK meter HW offload
> >> >> >
> >> >> >External email: Use caution opening links or attachments
> >> >> >
> >> >> >
> >> >> >Hi,
> >> >> >
> >> >> >this series adds support for DPDK meter HW offload
> >> >> >
> >> >> >* Patch 1/6: Add netdev provider API for HW offload of DPDK
> >> >> >meters
> >> >> >* Patch 2/6: Add DPIF API to offload OpenFlow meters to DPDK
> >> >> >* Patch 3/6: Implement netdev provider API for HW offload of DPDK
> >> >> >meters
> >> >> >* Patch 4/6: Add more DPDK meter algorithms
> >> >> >* Patch 4/6: Add support for meter action ti DPDK HW offload
> >> >> >* Patch 4/6: Add CI builds with ALLOW_EXPERIMENTAL_API
> >> >> >
> >> >> >Peng Zhang (6):
> >> >> >  netdev-offload: Add DPDK meter offload API
> >> >> >  dpif-netdev: Offloading meter with DPDK
> >> >> >  netdev-offload-dpdk: Implement meter offload API for DPDK
> >> >> >  netdev-dpdk: add meter algorithms
> >> >> >  netdev-dpdk-offload: Add support for meter action
> >> >> >  ci: add the opts about ALLOW_EXPERIMENTAL_API
> >> >> >
> >> >> > .ci/linux-build.sh                   |   4 +
> >> >> > .github/workflows/build-and-test.yml |  31 ++++
> >> >> > Documentation/howto/dpdk.rst         |   5 +-
> >> >> > lib/dpif-netdev.c                    | 102 +++++++++++
> >> >> > lib/netdev-dpdk.c                    | 243 +++++++++++++++++++++++++++
> >> >> > lib/netdev-dpdk.h                    |  41 +++++
> >> >> > lib/netdev-offload-dpdk.c            | 101 +++++++++++
> >> >> > lib/netdev-offload-provider.h        |  30 ++++
> >> >> > lib/netdev-offload.c                 |  59 +++++++
> >> >> > lib/netdev-offload.h                 |   9 +
> >> >> > 10 files changed, 623 insertions(+), 2 deletions(-)
> >> >> >
> >> >> >--
> >> >> >2.30.2