[ovs-dev] [PATCH] python: Send non-zero flag for a SSL socket

2022-08-07 Thread Miro Tomaska
Python std library SSLSocket.send does not allow non-zero value for the 
optional flag.

pyOpenSSL was recently switched for the Python standard library ssl module
commit 68543dd523bd00f53fa7b91777b962ccb22ce679 (python: Replace pyOpenSSL with 
ssl).
Python SSLsocket.send() does not allow non-zero optional flag and it will 
explicitly
raise an exception for that. pyOpenSSL did not nothing with this flag but kept
it to be compatible with socket API.
https://github.com/pyca/pyopenssl/blob/main/src/OpenSSL/SSL.py#L1844

In addition, expect for ImportError is not necessary anymore as ssl is part of
the Python standard library. This type of exception should not happen.

Signed-off-by: Miro Tomaska 
Reported-at: https://bugzilla.redhat.com/2115035
---
 python/ovs/poller.py  | 5 +
 python/ovs/socket_util.py | 7 ++-
 python/ovs/stream.py  | 9 ++---
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/python/ovs/poller.py b/python/ovs/poller.py
index 157719c3a..0723ed1f6 100644
--- a/python/ovs/poller.py
+++ b/python/ovs/poller.py
@@ -17,6 +17,7 @@ import os
 
 import select
 import socket
+import ssl
 import sys
 
 import ovs.timeval
@@ -25,10 +26,6 @@ import ovs.vlog
 if sys.platform == "win32":
 import ovs.winutils as winutils
 
-try:
-import ssl
-except ImportError:
-ssl = None
 
 try:
 from eventlet import patcher as eventlet_patcher
diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py
index 651012bf0..5f2201bbb 100644
--- a/python/ovs/socket_util.py
+++ b/python/ovs/socket_util.py
@@ -17,6 +17,7 @@ import os
 import os.path
 import random
 import socket
+import ssl
 import sys
 
 import ovs.fatal_signal
@@ -178,7 +179,11 @@ def check_connection_completion(sock):
 if revents & ovs.poller.POLLERR or revents & ovs.poller.POLLHUP:
 try:
 # The following should raise an exception.
-sock.send("\0".encode(), socket.MSG_DONTWAIT)
+if isinstance(sock, ssl.SSLSocket):
+# a SSL wrapped socket does not allow non-zero optional 
flag
+sock.send("\0".encode())
+else:
+sock.send("\0".encode(), socket.MSG_DONTWAIT)
 
 # (Here's where we end up if it didn't.)
 # XXX rate-limit
diff --git a/python/ovs/stream.py b/python/ovs/stream.py
index ac5b0fd0c..14a3c4946 100644
--- a/python/ovs/stream.py
+++ b/python/ovs/stream.py
@@ -15,16 +15,13 @@
 import errno
 import os
 import socket
+import ssl
 import sys
 
 import ovs.poller
 import ovs.socket_util
 import ovs.vlog
 
-try:
-import ssl
-except ImportError:
-ssl = None
 
 if sys.platform == 'win32':
 import ovs.winutils as winutils
@@ -860,6 +857,4 @@ class SSLStream(Stream):
 return super(SSLStream, self).close()
 
 
-if ssl:
-# Register SSL only if the OpenSSL module is available
-Stream.register_method("ssl", SSLStream)
+Stream.register_method("ssl", SSLStream)
-- 
2.35.3

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] run CI for every commit when merging several commits, not for the latest.

2022-08-07 Thread Igor Zhukov
Great!
I see it works: https://github.com/ovn-org/ovn/commits/main 

> On Fri, Aug 5, 2022 at 1:05 AM Igor Zhukov  wrote:
> 
>> From: Igor Zhukov 
>>
>> Docs: 
>> https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
>>
>> Test: https://github.com/fsb4000/ovn/actions and https://imgur.com/a/mUBQWSO
>>
>> Signed-off-by: Igor Zhukov 
> 
> Thanks. I applied this patch to the main branch.
> 
> Numan
> 
>> ---
>> .github/workflows/ovn-kubernetes.yml | 2 +-
>> .github/workflows/test.yml | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/.github/workflows/ovn-kubernetes.yml 
>> b/.github/workflows/ovn-kubernetes.yml
>> index 03f35d7a3..32eb2350b 100644
>> --- a/.github/workflows/ovn-kubernetes.yml
>> +++ b/.github/workflows/ovn-kubernetes.yml
>> @@ -9,7 +9,7 @@ on:
>> - cron: '0 0 * * 0'
>>
>> concurrency:
>> - group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
>> github.ref }}
>> + group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
>> github.run_id }}
>> cancel-in-progress: true
>>
>> env:
>> diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
>> index 3b7283229..76a7ce090 100644
>> --- a/.github/workflows/test.yml
>> +++ b/.github/workflows/test.yml
>> @@ -8,7 +8,7 @@ on:
>> - cron: '0 0 * * 0'
>>
>> concurrency:
>> - group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
>> github.ref }}
>> + group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
>> github.run_id }}
>> cancel-in-progress: true
>>
>> jobs:
>> --
>> 2.30.2
>>
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] controller: physical: fix regression for container ports

2022-08-07 Thread Numan Siddique
On Fri, Jul 29, 2022 at 12:04 AM Ihar Hrachyshka  wrote:
>
> Oops, sorry about that. This should be backported to 22.06.
>
> Acked-By: Ihar Hrachyshka 
> On Thu, Jul 28, 2022 at 9:55 AM Lorenzo Bianconi
>  wrote:
> >
> > After commit 'd07e5f99d ("Introduce match_outport_dp_and_port_keys
> > in physical.c")' it is not longer possible to ping a parent port from
> > container one.
> >
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2105901
> > Fixes: d07e5f99d ("Introduce match_outport_dp_and_port_keys in physical.c")
> > Signed-off-by: Lorenzo Bianconi 
> > ---
> >  controller/physical.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/controller/physical.c b/controller/physical.c
> > index 816a557e7..a92534a03 100644
> > --- a/controller/physical.c
> > +++ b/controller/physical.c
> > @@ -929,7 +929,7 @@ put_local_common_flows(uint32_t dp_key,
> >   * unnecessary.
> >   */
> >  ofpbuf_clear(ofpacts_p);
> > -match_outport_dp_and_port_keys(, dp_key, port_key);
> > +match_outport_dp_and_port_keys(, dp_key, 
> > parent_pb->tunnel_key);
> >  match_set_reg_masked(, MFF_LOG_FLAGS - MFF_REG0,
> >   MLF_NESTED_CONTAINER, MLF_NESTED_CONTAINER);
> >
> > --
> > 2.37.1
> >
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn]OVN-CI: ovn unit tests run in parallel jobs.

2022-08-07 Thread Numan Siddique
On Fri, Aug 5, 2022 at 9:18 PM Dumitru Ceara  wrote:
>
> On 8/4/22 17:32, Mohammad Heib wrote:
> > Ovn unit tests supported matrix size has been increased
> > after adding support to monitor_all and northd_parallelization
> > options recently, and that increased the execution time of the ovn-ci jobs.
> >
> > This patch aims to reduce the execution time of those jobs by splitting
> > them into smaller jobs that runs in parallel and each one will execute
> > a subset of unit test.
> >
> > Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2114862
> > Signed-off-by: Mohammad Heib 
> > ---
>
> Looks good to me!
>
> And the ovsrobot run only took 26 minutes:
> https://github.com/ovsrobot/ovn/actions/runs/2797911234
>
> vs the last run on the main branch that took 48 minutes:
> https://github.com/ovn-org/ovn/actions/runs/2792485947
>
> Acked-by: Dumitru Ceara 

Thanks.  I applied the patch to the main branch.

Numan

>
> Thanks,
> Dumitru
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] pinctrl: fix bug of monitor status in health check

2022-08-07 Thread Numan Siddique
On Mon, Aug 1, 2022 at 11:06 PM wangchuanlei  wrote:
>
> when vm of backend do not send reply packet,
> monitor state should change from waiting to offline,
>  this patch is to fix it!
>
> Signed-off-by: wangchuanlei 

This patch breaks the service monitor functionality for UDP.

For UDP protocol, the service monitor's state is set to ONLINE when
the wait time elapses and ovn-controller doesn't receive any
 ICMP4_DST_UNREACH packet.

But this patch changes the behavior and it will never set the state to
ONLINE for UDP.
Please see this - https://github.com/ovn-org/ovn/blob/main/ovn-sb.xml#L4546
<>
For UDP service, ovn-controller sends a UDP packet to
the service and doesn't expect any reply. If it receives an ICMP
reply, then it considers the service to be offline.
<>

Thanks
Numan


> ---
>  controller/pinctrl.c | 9 ++---
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 38e8590af..8226ad868 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -7526,13 +7526,8 @@ svc_monitors_run(struct rconn *swconn,
>
>  case SVC_MON_S_WAITING:
>  if (current_time > svc_mon->wait_time) {
> -if (svc_mon->protocol ==  SVC_MON_PROTO_TCP) {
> -svc_mon->n_failures++;
> -svc_mon->state = SVC_MON_S_OFFLINE;
> -} else {
> -svc_mon->n_success++;
> -svc_mon->state = SVC_MON_S_ONLINE;
> -}
> +svc_mon->n_failures++;
> +svc_mon->state = SVC_MON_S_OFFLINE;
>  svc_mon->next_send_time = current_time + svc_mon->interval;
>  next_run_time = svc_mon->next_send_time;
>  } else {
> --
> 2.27.0
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] run CI for every commit when merging several commits, not for the latest.

2022-08-07 Thread Numan Siddique
On Fri, Aug 5, 2022 at 1:05 AM Igor Zhukov  wrote:
>
> From: Igor Zhukov 
>
> Docs: 
> https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
>
> Test: https://github.com/fsb4000/ovn/actions and https://imgur.com/a/mUBQWSO
>
> Signed-off-by: Igor Zhukov 

Thanks.  I applied this patch to the main branch.

Numan

> ---
>  .github/workflows/ovn-kubernetes.yml | 2 +-
>  .github/workflows/test.yml   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/.github/workflows/ovn-kubernetes.yml 
> b/.github/workflows/ovn-kubernetes.yml
> index 03f35d7a3..32eb2350b 100644
> --- a/.github/workflows/ovn-kubernetes.yml
> +++ b/.github/workflows/ovn-kubernetes.yml
> @@ -9,7 +9,7 @@ on:
>- cron: '0 0 * * 0'
>
>  concurrency:
> -  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
> github.ref }}
> +  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
> github.run_id }}
>cancel-in-progress: true
>
>  env:
> diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
> index 3b7283229..76a7ce090 100644
> --- a/.github/workflows/test.yml
> +++ b/.github/workflows/test.yml
> @@ -8,7 +8,7 @@ on:
>  - cron: '0 0 * * 0'
>
>  concurrency:
> -  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
> github.ref }}
> +  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
> github.run_id }}
>cancel-in-progress: true
>
>  jobs:
> --
> 2.30.2
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] tests: enable and fix vif-provider test scenario

2022-08-07 Thread Numan Siddique
On Thu, Jul 28, 2022 at 4:44 PM Frode Nordahl
 wrote:
>
> Hello, Ihar,
>
> On Thu, Jul 28, 2022 at 1:28 AM Ihar Hrachyshka  wrote:
> >
> > Signed-off-by: Ihar Hrachyshka 
> > ---
> >  controller/test-vif-plug.c | 2 +-
> >  tests/ovn-vif-plug.at  | 2 +-
> >  tests/testsuite.at | 1 +
> >  3 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/controller/test-vif-plug.c b/controller/test-vif-plug.c
> > index 01ff37d8f..d7094199a 100644
> > --- a/controller/test-vif-plug.c
> > +++ b/controller/test-vif-plug.c
> > @@ -36,7 +36,7 @@ test_vif_plug(struct ovs_cmdl_context *ctx OVS_UNUSED)
> >  ovs_assert(
> >  sset_contains(
> >  vif_plug_get_maintained_iface_options(vif_plug_class),
> > -"plug-dummy-option"));
> > +"vif-plug-dummy-option"));
> >
> >  struct vif_plug_port_ctx_in ctx_in = {
> >  .op_type = PLUG_OP_CREATE,
> > diff --git a/tests/ovn-vif-plug.at b/tests/ovn-vif-plug.at
> > index 86b0b4b84..d4c225e90 100644
> > --- a/tests/ovn-vif-plug.at
> > +++ b/tests/ovn-vif-plug.at
> > @@ -4,5 +4,5 @@
> >  AT_BANNER([OVN unit tests - vif-plug])
> >
> >  AT_SETUP([unit test -- plugging infrastructure tests])
> > -AT_CHECK([ovstest test-plug run], [0], [])
> > +AT_CHECK([ovstest test-vif-plug run], [0], [])
> >  AT_CLEANUP
> > diff --git a/tests/testsuite.at b/tests/testsuite.at
> > index 479e786bd..d3f00e1bf 100644
> > --- a/tests/testsuite.at
> > +++ b/tests/testsuite.at
> > @@ -39,3 +39,4 @@ m4_include([tests/ovn-controller-vtep.at])
> >  m4_include([tests/ovn-ic.at])
> >  m4_include([tests/checkpatch.at])
> >  m4_include([tests/ovn-ipsec.at])
> > +m4_include([tests/ovn-vif-plug.at])
> > --
> > 2.34.1
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
> Looks like the unit tests were never enabled, thank you for catching that!
>
> I would reword the subject/commit message to use the words "unit test"
> instead of test scenario, as when you say test scenario I think about
> the functional test named "ovn-controller - VIF plugging" located in
> tests/ovn.at:31396-31515.
>
> With a updated commit message:
> Acked-by: Frode Nordahl 

Thanks.   I changed the commit message and applied the patch to main
and back ported till  branch-21.12.

Numan

>
> --
> Frode Nordahl
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] northd: add support to make l3dgw ports fully distributed

2022-08-07 Thread Numan Siddique
On Wed, Jul 20, 2022 at 12:15 AM Vladislav Odintsov  wrote:
>
> This is used when traffic from HW VTEP goes to
> routable networks and logical switch to which VTEP
> logical port is attached also needs to support
> distributed routing features such as NAT and others.
>
> Signed-off-by: Vladislav Odintsov 

Thanks for the patch.

IMO,  the option "is_distributed" is very confusing.  By default, all
the logical routers (and router ports) are distributed in OVN unless
the logical router is a gateway router or if the router port has a
gateway chassis set.  And the default value of "is_distributed" is
false,
which makes it even more confusing.

I'd suggest renaming the option to something more relevant - which
indicates that this option is applicable only for gateway ports and
if the user/CMS wants to allow admission on all chassis.

But before that, my question is why does the CMS need to set the
gateway chassis for the router ports ? Can't it just not set it ?

Thanks
Numan

> ---
>  northd/northd.c |  8 +++-
>  ovn-nb.xml  | 10 ++
>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/northd/northd.c b/northd/northd.c
> index d31cb1688..0be45e22a 100644
> --- a/northd/northd.c
> +++ b/northd/northd.c
> @@ -1674,6 +1674,12 @@ is_cr_port(const struct ovn_port *op)
>  return op->l3dgw_port;
>  }
>
> +static bool
> +is_distributed(const struct ovn_port *op)
> +{
> +return smap_get_bool(>nbrp->options, "distributed", false);
> +}
> +
>  static void
>  destroy_routable_addresses(struct ovn_port_routable_addresses *ra)
>  {
> @@ -10920,7 +10926,7 @@ build_adm_ctrl_flows_for_lrouter_port(
>  ds_clear(match);
>  ds_put_format(match, "eth.dst == %s && inport == %s",
>op->lrp_networks.ea_s, op->json_key);
> -if (is_l3dgw_port(op)) {
> +if (is_l3dgw_port(op) && !is_distributed(op)) {
>  /* Traffic with eth.dst = l3dgw_port->lrp_networks.ea_s
>   * should only be received on the gateway chassis. */
>  ds_put_format(match, " && is_chassis_resident(%s)",
> diff --git a/ovn-nb.xml b/ovn-nb.xml
> index e26afd83c..d4b454791 100644
> --- a/ovn-nb.xml
> +++ b/ovn-nb.xml
> @@ -2976,6 +2976,16 @@
> option.
>  
>
> +
> +  
> +If true, indicates, that flow for current LRP in
> +lr_in_admission must be installed on all chassis, even if it has
> +associated chassisredirect port.
> +Usable when traffic from HW VTEP goes to routable networks and 
> logical
> +switch to which VTEP logical port is attached also needs to support
> +distributed routing features such as NAT, Load Balancing and others.
> +Empty value (default) means false.
> +  
>  
>
>  
> --
> 2.26.3
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 2/2] release-process: Add 2023 calendar.

2022-08-07 Thread Numan Siddique
On Thu, Jul 28, 2022 at 12:28 AM Mark Michelson  wrote:
>
> This also removes the 2021 calendar since that has come and gone.
>
> Signed-off-by: Mark Michelson 

Acked-by: Numan Siddique 

Numan

> ---
>  Documentation/internals/release-process.rst | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/internals/release-process.rst 
> b/Documentation/internals/release-process.rst
> index e423c55d4..628ae9e8f 100644
> --- a/Documentation/internals/release-process.rst
> +++ b/Documentation/internals/release-process.rst
> @@ -134,34 +134,34 @@ approximate:
>  Release Calendar
>  
>
> -The 2021 timetable is shown below. Note that these dates are not set in 
> stone.
> +The 2022 timetable is shown below. Note that these dates are not set in 
> stone.
>  If extenuating circumstances arise, a release may be delayed from its target
>  date.
>
>  +-+-+-+-+
>  | Release | Soft Freeze | Branch Creation | Release |
>  +-+-+-+-+
> -| 21.03.0 | Feb 5   | Feb 19  | Mar 5   |
> +| 22.03.0 | Feb 4   | Feb 18  | Mar 4   |
>  +-+-+-+-+
> -| 21.06.0 | May 7   | May 21  | Jun 4   |
> +| 22.06.0 | May 6   | May 20  | Jun 3   |
>  +-+-+-+-+
> -| 21.09.0 | Aug 6   | Aug 20  | Sep 3   |
> +| 22.09.0 | Aug 5   | Aug 19  | Sep 2   |
>  +-+-+-+-+
> -| 21.12.0 | Nov 5   | Nov 19  | Dec 3   |
> +| 22.12.0 | Nov 4   | Nov 18  | Dec 2   |
>  +-+-+-+-+
>
> -Below is the 2022 timetable
> +Below is the 2023 timetable
>
>  +-+-+-+-+
>  | Release | Soft Freeze | Branch Creation | Release |
>  +-+-+-+-+
> -| 22.03.0 | Feb 4   | Feb 18  | Mar 4   |
> +| 23.03.0 | Feb 3   | Feb 17  | Mar 3   |
>  +-+-+-+-+
> -| 22.06.0 | May 6   | May 20  | Jun 3   |
> +| 23.06.0 | May 5   | May 19  | Jun 2   |
>  +-+-+-+-+
> -| 22.09.0 | Aug 5   | Aug 19  | Sep 2   |
> +| 23.09.0 | Aug 4   | Aug 18  | Sep 1   |
>  +-+-+-+-+
> -| 22.12.0 | Nov 4   | Nov 18  | Dec 2   |
> +| 23.12.0 | Nov 3   | Nov 17  | Dec 1   |
>  +-+-+-+-+
>
>  Contact
> --
> 2.37.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn 1/2] release-process: Change master to main.

2022-08-07 Thread Numan Siddique
On Thu, Jul 28, 2022 at 12:28 AM Mark Michelson  wrote:
>
> The document makes reference to the "master" branch throughout, but it
> has been renamed "main" for some time now.
>
> Signed-off-by: Mark Michelson 

Acked-by: Numan Siddique 

Numan

> ---
>  Documentation/internals/release-process.rst | 22 ++---
>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/internals/release-process.rst 
> b/Documentation/internals/release-process.rst
> index 9db6e7494..e423c55d4 100644
> --- a/Documentation/internals/release-process.rst
> +++ b/Documentation/internals/release-process.rst
> @@ -34,33 +34,33 @@ contributors, obtained through public discussion on, 
> e.g., ovs-dev or the
>  Release Strategy
>  
>
> -OVN feature development takes place on the "master" branch. Ordinarily, new
> -features are rebased against master and applied directly.  For features that
> +OVN feature development takes place on the "main" branch. Ordinarily, new
> +features are rebased against main and applied directly.  For features that
>  take significant development, sometimes it is more appropriate to merge a
> -separate branch into master; please discuss this on ovs-dev in advance.
> +separate branch into main; please discuss this on ovs-dev in advance.
>
>  The process of making a release has the following stages.  See `Release
>  Scheduling`_ for the timing of each stage:
>
> -1. "Soft freeze" of the master branch.
> +1. "Soft freeze" of the main branch.
>
> During the freeze, we ask committers to refrain from applying patches that
> add new features unless those patches were already being publicly 
> discussed
> and reviewed before the freeze began.  Bug fixes are welcome at any time.
> Please propose and discuss exceptions on ovs-dev.
>
> -2. Fork a release branch from master, named for the expected release number,
> +2. Fork a release branch from main, named for the expected release number,
> e.g. "branch-2019.10" for the branch that will yield OVN 2019.10.x.
>
> Release branches are intended for testing and stabilization.  At this 
> stage
> and in later stages, they should receive only bug fixes, not new features.
> Bug fixes applied to release branches should be backports of corresponding
> -   bug fixes to the master branch, except for bugs present only on release
> +   bug fixes to the main branch, except for bugs present only on release
> branches (which are rare in practice).
>
> At this stage, sometimes there can be exceptions to the rule that a 
> release
> branch receives only bug fixes.  Like bug fixes, new features on release
> -   branches should be backports of the corresponding commits on the master
> +   branches should be backports of the corresponding commits on the main
> branch.  Features to be added to release branches should be limited in 
> scope
> and risk and discussed on ovs-dev before creating the branch.
>
> @@ -97,10 +97,10 @@ one year of critical bug fixes and security fixes.
>  Release Numbering
>  -
>
> -The version number on master should normally end in .90.  This indicates that
> +The version number on main should normally end in .90.  This indicates that
>  the OVN version is "almost" the next version to branch.
>
> -Forking master into branch-x.y requires two commits to master.  The first is
> +Forking main into branch-x.y requires two commits to main.  The first is
>  titled "Prepare for x.y.0" and increments the version number to x.y.  This is
>  the initial commit on branch-x.y.  The second is titled "Prepare for 
> post-x.y.0
>  (x.y.90)" and increments the version number to x.y.90.
> @@ -124,9 +124,9 @@ approximate:
>  
> +---+-+--+
>  | T | Dec 1, Mar 1, ...   | Begin x.y release cycle  
> |
>  
> +---+-+--+
> -| T + 2 | Feb 1, May 1, ...   | "Soft freeze" master for x.y release 
> |
> +| T + 2 | Feb 1, May 1, ...   | "Soft freeze" main for x.y release |
>  
> +---+-+--+
> -| T + 2.5   | Feb 15, May 15, ... | Fork branch-x.y from master  
> |
> +| T + 2.5   | Feb 15, May 15, ... | Fork branch-x.y from main  |
>  
> +---+-+--+
>  | T + 3 | Mar 1, Jun 1, ...   | Release version x.y.0
> |
>  
> +---+-+--+
> --
> 2.37.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v4 9/9] mfex-avx512: Add support for tunnel packets in avx512 mfex.

2022-08-07 Thread Kumar Amber
This patch adds the necessary support to avx512 mfex to
support handling of tunnel packet type.

Signed-off-by: Kumar Amber 
---
 lib/dpif-netdev-avx512.c  |  16 ++--
 lib/dpif-netdev-extract-avx512.c  | 146 +-
 lib/dpif-netdev-private-extract.c |   4 +-
 3 files changed, 117 insertions(+), 49 deletions(-)

diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index 1c3b67b02..d5c61baff 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -185,15 +185,17 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 }
 
 /* Do a batch minfilow extract into keys. */
- /* Do a batch minfilow extract into keys, but only for outer packets. */
 uint32_t mf_mask = 0;
-if (recirc_depth == 0) {
-miniflow_extract_func mfex_func;
-atomic_read_relaxed(>miniflow_extract_opt, _func);
-if (mfex_func) {
-mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd,
+miniflow_extract_func mfex_func;
+atomic_read_relaxed(>miniflow_extract_opt, _func);
+miniflow_extract_func mfex_inner_func;
+atomic_read_relaxed(>miniflow_extract_inner_opt, _inner_func);
+if (md_is_valid && mfex_inner_func) {
+mf_mask = mfex_inner_func(packets, keys, batch_size, in_port, pmd,
+  md_is_valid);
+} else if (!md_is_valid && mfex_func) {
+mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd,
 md_is_valid);
-}
 }
 
 uint32_t iter = lookup_pkts_bitmask;
diff --git a/lib/dpif-netdev-extract-avx512.c b/lib/dpif-netdev-extract-avx512.c
index 833e9bd31..c87480a4e 100644
--- a/lib/dpif-netdev-extract-avx512.c
+++ b/lib/dpif-netdev-extract-avx512.c
@@ -744,7 +744,7 @@ mfex_avx512_process(struct dp_packet_batch *packets,
 uint32_t keys_size OVS_UNUSED,
 odp_port_t in_port,
 void *pmd_handle OVS_UNUSED,
-bool md_is_valid OVS_UNUSED,
+bool md_is_valid,
 const enum MFEX_PROFILES profile_id,
 const uint32_t use_vbmi OVS_UNUSED)
 {
@@ -770,6 +770,11 @@ mfex_avx512_process(struct dp_packet_batch *packets,
 __m128i v_blocks01 = _mm_insert_epi32(v_zeros, odp_to_u32(in_port), 1);
 
 DP_PACKET_BATCH_FOR_EACH (i, packet, packets) {
+/* Handle meta-data init in the loop. */
+if (!md_is_valid) {
+pkt_metadata_init(>md, in_port);
+}
+const struct pkt_metadata *md = >md;
 /* If the packet is smaller than the probe size, skip it. */
 const uint32_t size = dp_packet_size(packet);
 if (size < dp_pkt_min_size) {
@@ -808,7 +813,16 @@ mfex_avx512_process(struct dp_packet_batch *packets,
 use_vbmi);
 
 __m512i v_blk0_strip = _mm512_and_si512(v_blk0, v_strp);
-_mm512_storeu_si512([2], v_blk0_strip);
+/* Handle inner meta-data if valid. */
+if (!md_is_valid) {
+_mm512_storeu_si512([2], v_blk0_strip);
+} else {
+__m512i v_tun = _mm512_loadu_si512(>tunnel);
+_mm512_storeu_si512([0], v_tun);
+_mm512_storeu_si512([11], v_blk0_strip);
+blocks[9] = md->dp_hash |
+((uint64_t) odp_to_u32(md->in_port.odp_port) << 32);
+}
 
 /* Perform "post-processing" per profile, handling details not easily
  * handled in the above generic AVX512 code. Examples include TCP flag
@@ -820,38 +834,44 @@ mfex_avx512_process(struct dp_packet_batch *packets,
 break;
 
 case PROFILE_ETH_VLAN_IPV4_TCP: {
-mfex_vlan_pcp(pkt[14], [i].buf[4]);
-
 uint32_t size_from_ipv4 = size - VLAN_ETH_HEADER_LEN;
 struct ip_header *nh = (void *)[VLAN_ETH_HEADER_LEN];
 if (mfex_ipv4_set_l2_pad_size(packet, nh, size_from_ipv4,
   TCP_HEADER_LEN)) {
 continue;
 }
-
 /* Process TCP flags, and store to blocks. */
 const struct tcp_header *tcp = (void *)[38];
-mfex_handle_tcp_flags(tcp, [7]);
+if (!md_is_valid) {
+mfex_vlan_pcp(pkt[14], [i].buf[4]);
+mfex_handle_tcp_flags(tcp, [7]);
+} else {
+mfex_vlan_pcp(pkt[14], [i].buf[13]);
+mfex_handle_tcp_flags(tcp, [16]);
+mf->map.bits[0] = 0x38a001ff;
+}
+
 dp_packet_update_rss_hash_ipv4_tcp_udp(packet);
 } break;
 
 case PROFILE_ETH_VLAN_IPV4_UDP: {
-mfex_vlan_pcp(pkt[14], [i].buf[4]);
-
 uint32_t size_from_ipv4 = size - VLAN_ETH_HEADER_LEN;
 struct ip_header *nh = (void 

[ovs-dev] [PATCH v4 8/9] mfex-study: Modify study func to select outer and inner mfex funcs.

2022-08-07 Thread Kumar Amber
The Mfex study function is split into outer and inner to allow
for independent selection and studying of packets in outer and inner
flows to different ISA optimized Mfexs.

Signed-off-by: Kumar Amber 
---
 lib/dpif-netdev-extract-study.c | 126 +---
 1 file changed, 83 insertions(+), 43 deletions(-)

diff --git a/lib/dpif-netdev-extract-study.c b/lib/dpif-netdev-extract-study.c
index 71354cc4c..03d97c64e 100644
--- a/lib/dpif-netdev-extract-study.c
+++ b/lib/dpif-netdev-extract-study.c
@@ -30,7 +30,9 @@ static atomic_uint32_t mfex_study_pkts_count = 
MFEX_MAX_PKT_COUNT;
 /* Struct to hold miniflow study stats. */
 struct study_stats {
 uint32_t pkt_count;
+uint32_t pkt_inner_count;
 uint32_t impl_hitcount[MFEX_IMPL_MAX];
+uint32_t impl_inner_hitcount[MFEX_IMPL_MAX];
 };
 
 /* Define per thread data to hold the study stats. */
@@ -67,6 +69,58 @@ mfex_set_study_pkt_cnt(uint32_t pkt_cmp_count, const char 
*name)
 return -EINVAL;
 }
 
+
+static inline void
+mfex_reset_stats(uint32_t *impls_hitcount, uint32_t *pkt_cnt) {
+/* Reset stats so that study function can be called again
+ * for next traffic type and optimal function ptr can be
+ * chosen.
+ */
+memset(impls_hitcount, 0, sizeof(uint32_t) * MFEX_IMPL_MAX);
+*pkt_cnt = 0;
+}
+
+static inline void
+mfex_study_select_best_impls(struct dpif_miniflow_extract_impl *mfex_funcs,
+ uint32_t pkt_cnt, uint32_t *impls_arr,
+ atomic_uintptr_t *pmd_func, char *name)
+{
+
+uint32_t best_func_index = MFEX_IMPL_START_IDX;
+uint32_t max_hits = 0;
+
+for (int i = MFEX_IMPL_START_IDX; i < MFEX_IMPL_MAX; i++) {
+if (impls_arr[i] > max_hits) {
+max_hits = impls_arr[i];
+best_func_index = i;
+}
+}
+
+/* If 50% of the packets hit, enable the function. */
+if (max_hits >= (mfex_study_pkts_count / 2)) {
+atomic_store_relaxed(pmd_func,
+(uintptr_t) mfex_funcs[best_func_index].extract_func);
+VLOG_INFO("MFEX %s study chose impl %s: (hits %u/%u pkts)",
+  name, mfex_funcs[best_func_index].name, max_hits,
+  pkt_cnt);
+} else {
+/* Set the implementation to null for default miniflow. */
+atomic_store_relaxed(pmd_func,
+(uintptr_t) mfex_funcs[MFEX_IMPL_SCALAR].extract_func);
+VLOG_INFO("Not enough packets matched (%u/%u), disabling"
+  " optimized MFEX.", max_hits, pkt_cnt);
+}
+
+/* In debug mode show stats for all the counters. */
+if (VLOG_IS_DBG_ENABLED()) {
+for (int i = MFEX_IMPL_START_IDX; i < MFEX_IMPL_MAX; i++) {
+VLOG_DBG("MFEX study results for implementation %s:"
+ " (hits %u/%u pkts)", mfex_funcs[i].name,
+ impls_arr[i], pkt_cnt);
+}
+}
+}
+
 uint32_t
 mfex_study_traffic(struct dp_packet_batch *packets,
struct netdev_flow_key *keys,
@@ -76,10 +130,12 @@ mfex_study_traffic(struct dp_packet_batch *packets,
 {
 uint32_t hitmask = 0;
 uint32_t mask = 0;
+uint32_t study_cnt_pkts;
 struct dp_netdev_pmd_thread *pmd = pmd_handle;
 struct dpif_miniflow_extract_impl *miniflow_funcs;
 struct study_stats *stats = mfex_study_get_study_stats_ptr();
 miniflow_funcs = dpif_mfex_impl_info_get();
+atomic_read_relaxed(_study_pkts_count, _cnt_pkts);
 
 /* Run traffic optimized miniflow_extract to collect the hitmask
  * to be compared after certain packets have been hit to choose
@@ -93,7 +149,11 @@ mfex_study_traffic(struct dp_packet_batch *packets,
 hitmask = miniflow_funcs[i].extract_func(packets, keys, keys_size,
  in_port, pmd_handle,
  md_is_valid);
-stats->impl_hitcount[i] += count_1bits(hitmask);
+if (!md_is_valid) {
+stats->impl_hitcount[i] += count_1bits(hitmask);
+} else {
+stats->impl_inner_hitcount[i] += count_1bits(hitmask);
+}
 
 /* If traffic is not classified then we dont overwrite the keys
  * array in minfiflow implementations so its safe to create a
@@ -102,54 +162,34 @@ mfex_study_traffic(struct dp_packet_batch *packets,
 mask |= hitmask;
 }
 
-stats->pkt_count += dp_packet_batch_size(packets);
-
 /* Choose the best implementation after a minimum packets have been
  * processed.
  */
-uint32_t study_cnt_pkts;
-atomic_read_relaxed(_study_pkts_count, _cnt_pkts);
-
-if (stats->pkt_count >= study_cnt_pkts) {
-uint32_t best_func_index = MFEX_IMPL_START_IDX;
-uint32_t max_hits = 0;
-for (int i = MFEX_IMPL_START_IDX; i < MFEX_IMPL_MAX; i++) {
-if (stats->impl_hitcount[i] > max_hits) {
-max_hits = stats->impl_hitcount[i];
-   

[ovs-dev] [PATCH v4 7/9] dpif-mfex: Change mfex fn pointer prototype to include md_is_valid.

2022-08-07 Thread Kumar Amber
The md_is_valid parameter is passed from DPIF to MFEX to allow mfex
functions to detect the tunneling and decide the processing of Inner
packets in static predictable branches.

Signed-off-by: Kumar Amber 
---
 lib/dpif-netdev-avx512.c  |  3 ++-
 lib/dpif-netdev-extract-avx512.c  |  9 +
 lib/dpif-netdev-extract-study.c   |  6 --
 lib/dpif-netdev-private-extract.c |  6 --
 lib/dpif-netdev-private-extract.h | 13 -
 5 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index 1db20c1cf..1c3b67b02 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -191,7 +191,8 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 miniflow_extract_func mfex_func;
 atomic_read_relaxed(>miniflow_extract_opt, _func);
 if (mfex_func) {
-mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd);
+mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd,
+md_is_valid);
 }
 }
 
diff --git a/lib/dpif-netdev-extract-avx512.c b/lib/dpif-netdev-extract-avx512.c
index 4afbed97e..833e9bd31 100644
--- a/lib/dpif-netdev-extract-avx512.c
+++ b/lib/dpif-netdev-extract-avx512.c
@@ -744,6 +744,7 @@ mfex_avx512_process(struct dp_packet_batch *packets,
 uint32_t keys_size OVS_UNUSED,
 odp_port_t in_port,
 void *pmd_handle OVS_UNUSED,
+bool md_is_valid OVS_UNUSED,
 const enum MFEX_PROFILES profile_id,
 const uint32_t use_vbmi OVS_UNUSED)
 {
@@ -978,10 +979,10 @@ __attribute__((__target__("avx512vbmi"))) 
  \
 mfex_avx512_vbmi_##name(struct dp_packet_batch *packets,\
 struct netdev_flow_key *keys, uint32_t keys_size,\
 odp_port_t in_port, struct dp_netdev_pmd_thread \
-*pmd_handle)\
+*pmd_handle, bool md_is_valid)  \
 {   \
 return mfex_avx512_process(packets, keys, keys_size, in_port,   \
-   pmd_handle, profile, 1); \
+   pmd_handle, md_is_valid, profile, 1);\
 }
 #else
 #define VBMI_MFEX_FUNC(name, profile)
@@ -992,10 +993,10 @@ uint32_t  
  \
 mfex_avx512_##name(struct dp_packet_batch *packets, \
struct netdev_flow_key *keys, uint32_t keys_size,\
odp_port_t in_port, struct dp_netdev_pmd_thread  \
-   *pmd_handle) \
+   *pmd_handle, bool md_is_valid)   \
 {   \
 return mfex_avx512_process(packets, keys, keys_size, in_port,   \
-   pmd_handle, profile, 0); \
+   pmd_handle, md_is_valid, profile, 0);\
 }
 
 #define DECLARE_MFEX_FUNC(name, profile)\
diff --git a/lib/dpif-netdev-extract-study.c b/lib/dpif-netdev-extract-study.c
index 69077c844..71354cc4c 100644
--- a/lib/dpif-netdev-extract-study.c
+++ b/lib/dpif-netdev-extract-study.c
@@ -71,7 +71,8 @@ uint32_t
 mfex_study_traffic(struct dp_packet_batch *packets,
struct netdev_flow_key *keys,
uint32_t keys_size, odp_port_t in_port,
-   struct dp_netdev_pmd_thread *pmd_handle)
+   struct dp_netdev_pmd_thread *pmd_handle,
+   bool md_is_valid)
 {
 uint32_t hitmask = 0;
 uint32_t mask = 0;
@@ -90,7 +91,8 @@ mfex_study_traffic(struct dp_packet_batch *packets,
 }
 
 hitmask = miniflow_funcs[i].extract_func(packets, keys, keys_size,
- in_port, pmd_handle);
+ in_port, pmd_handle,
+ md_is_valid);
 stats->impl_hitcount[i] += count_1bits(hitmask);
 
 /* If traffic is not classified then we dont overwrite the keys
diff --git a/lib/dpif-netdev-private-extract.c 
b/lib/dpif-netdev-private-extract.c
index 789cba4c5..f67f08f8b 100644
--- a/lib/dpif-netdev-private-extract.c
+++ b/lib/dpif-netdev-private-extract.c
@@ -342,7 +342,8 @@ uint32_t
 dpif_miniflow_extract_autovalidator(struct dp_packet_batch *packets,
 struct netdev_flow_key *keys,
 uint32_t keys_size, odp_port_t in_port,
-struct dp_netdev_pmd_thread *pmd_handle)
+struct 

[ovs-dev] [PATCH v4 6/9] dpif-mfex: Modify set/get mfex commands to include inner.

2022-08-07 Thread Kumar Amber
The set command in MFEX is changed as to allow the user to select
different optimized mfex ISA for processing Inner packets in case
of tunneling.

$ ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 1024 -inner

The get command is modified to indcitate both inner and Outer MFEXs in
use.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 
---
 Documentation/topics/dpdk/bridge.rst | 18 --
 lib/dpif-netdev-private-extract.c| 23 ++-
 lib/dpif-netdev-private-extract.h|  6 +-
 lib/dpif-netdev-private-thread.h |  3 +++
 lib/dpif-netdev.c| 21 ++---
 5 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/Documentation/topics/dpdk/bridge.rst 
b/Documentation/topics/dpdk/bridge.rst
index 354f1ced1..b7ffb4885 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -293,13 +293,15 @@ command also shows whether the CPU supports each 
implementation::
 An implementation can be selected manually by the following command::
 
 $ ovs-appctl dpif-netdev/miniflow-parser-set [-pmd core_id] name \
-  [study_cnt]
+  [study_cnt] [-recirc]
 
-The above command has two optional parameters: ``study_cnt`` and ``core_id``.
-The ``core_id`` sets a particular packet parsing function to a specific
-PMD thread on the core.  The third parameter ``study_cnt``, which is specific
-to ``study`` and ignored by other implementations, means how many packets
-are needed to choose the best implementation.
+The above command has three optional parameters: ``study_cnt``, ``core_id``
+and ``-inner``. The ``core_id`` sets a particular packet parsing function
+to a specific PMD thread on the core.  The third parameter ``study_cnt``,
+which is specific to ``study`` and ignored by other implementations, means
+how many packets are needed to choose the best implementation. The fourth
+parameter ``-recirc`` acts like flag which indicates to MFEX to use optimized
+MFEX inner for processing tunneled inner packets.
 
 Also user can select the ``study`` implementation which studies the traffic for
 a specific number of packets by applying all available implementations of
@@ -322,6 +324,10 @@ following command::
 
 $ ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 scalar
 
+``study`` can be selected with packet count and explicit PMD selection along
+with the ``recirc`` by following command::
+
+$ ovs-appctl dpif-netdev/miniflow-parser-set -pmd 3 study 1024 -recirc
 
 Actions Implementations (Experimental)
 --
diff --git a/lib/dpif-netdev-private-extract.c 
b/lib/dpif-netdev-private-extract.c
index 0e6fdbf31..789cba4c5 100644
--- a/lib/dpif-netdev-private-extract.c
+++ b/lib/dpif-netdev-private-extract.c
@@ -33,6 +33,8 @@ VLOG_DEFINE_THIS_MODULE(dpif_netdev_extract);
 
 /* Variable to hold the default MFEX implementation. */
 static ATOMIC(miniflow_extract_func) default_mfex_func;
+/* Variable to hold the default MFEX inner implementation. */
+static ATOMIC(miniflow_extract_func) default_mfex_inner_func;
 
 #if (__x86_64__ && HAVE_AVX512F && HAVE_LD_AVX512_GOOD && HAVE_AVX512BW \
  && __SSE4_2__)
@@ -233,16 +235,31 @@ dp_mfex_impl_get_default(void)
 return return_func;
 }
 
+miniflow_extract_func
+dp_mfex_inner_impl_get_default(void)
+{
+miniflow_extract_func return_func;
+atomic_uintptr_t *mfex_func = (void *)_mfex_inner_func;
+
+atomic_read_relaxed(mfex_func, (uintptr_t *) _func);
+
+return return_func;
+}
+
 int
-dp_mfex_impl_set_default_by_name(const char *name)
+dp_mfex_impl_set_default_by_name(const char *name, bool mfex_inner)
 {
 miniflow_extract_func new_default;
 atomic_uintptr_t *mfex_func = (void *)_mfex_func;
+atomic_uintptr_t *mfex_inner_func = (void *)_mfex_inner_func;
 
 int err = dp_mfex_impl_get_by_name(name, _default);
 
 if (!err) {
 atomic_store_relaxed(mfex_func, (uintptr_t) new_default);
+if (mfex_inner) {
+atomic_store_relaxed(mfex_inner_func, (uintptr_t) new_default);
+}
 }
 
 return err;
@@ -270,6 +287,10 @@ dp_mfex_impl_get(struct ds *reply, struct 
dp_netdev_pmd_thread **pmd_list,
 if (pmd->miniflow_extract_opt == mfex_impls[i].extract_func) {
 ds_put_format(reply, "%u,", pmd->core_id);
 }
+if (pmd->miniflow_extract_inner_opt ==
+mfex_impls[i].extract_func) {
+ds_put_format(reply, "%u,", pmd->core_id);
+}
 }
 
 ds_chomp(reply, ',');
diff --git a/lib/dpif-netdev-private-extract.h 
b/lib/dpif-netdev-private-extract.h
index ff233c35b..1a2490762 100644
--- a/lib/dpif-netdev-private-extract.h
+++ b/lib/dpif-netdev-private-extract.h
@@ -159,8 +159,12 @@ dp_mfex_impl_get_by_name(const char *name, 
miniflow_extract_func *out_func);
  * overridden at runtime. */
 miniflow_extract_func 

[ovs-dev] [PATCH v4 5/9] dpif-netdev: Add function pointer for dpif re-circulate.

2022-08-07 Thread Kumar Amber
The patch adds and re-uses the dpif set command to set the
function pointers to be used to switch between different inner
dpifs.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 

---
v3:
- Add description  to the dpif recirc function.
- Fix use of return value to fall back to scalar dpif.
---
---
 lib/dpif-netdev-private-dpif.c   | 57 +++-
 lib/dpif-netdev-private-dpif.h   | 18 ++
 lib/dpif-netdev-private-thread.h |  3 ++
 lib/dpif-netdev.c| 19 +--
 4 files changed, 87 insertions(+), 10 deletions(-)

diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
index 7019b0931..51fe219ba 100644
--- a/lib/dpif-netdev-private-dpif.c
+++ b/lib/dpif-netdev-private-dpif.c
@@ -28,6 +28,8 @@
 #include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(dpif_netdev_impl);
+#define DPIF_NETDEV_IMPL_AVX512_CHECK (__x86_64__ && HAVE_AVX512F \
+&& HAVE_LD_AVX512_GOOD && __SSE4_2__)
 
 DEFINE_EXTERN_PER_THREAD_DATA(recirc_depth, 0);
 
@@ -53,18 +55,21 @@ dp_netdev_input_avx512_probe(void)
 static struct dpif_netdev_impl_info_t dpif_impls[] = {
 /* The default scalar C code implementation. */
 [DPIF_NETDEV_IMPL_SCALAR] = { .input_func = dp_netdev_input,
+  .recirc_func = dp_netdev_recirculate,
   .probe = NULL,
   .name = "dpif_scalar", },
 
 #if (__x86_64__ && HAVE_AVX512F && HAVE_LD_AVX512_GOOD && __SSE4_2__)
 /* Only available on x86_64 bit builds with SSE 4.2 used for OVS core. */
 [DPIF_NETDEV_IMPL_AVX512] = { .input_func = dp_netdev_input_avx512,
+  .recirc_func = dp_netdev_input_avx512_recirc,
   .probe = dp_netdev_input_avx512_probe,
   .name = "dpif_avx512", },
 #endif
 };
 
 static dp_netdev_input_func default_dpif_func;
+static dp_netdev_recirc_func default_dpif_recirc_func;
 
 dp_netdev_input_func
 dp_netdev_impl_get_default(void)
@@ -75,7 +80,7 @@ dp_netdev_impl_get_default(void)
 int dpif_idx = DPIF_NETDEV_IMPL_SCALAR;
 
 /* Configure-time overriding to run test suite on all implementations. */
-#if (__x86_64__ && HAVE_AVX512F && HAVE_LD_AVX512_GOOD && __SSE4_2__)
+#if DPIF_NETDEV_IMPL_AVX512_CHECK
 #ifdef DPIF_AVX512_DEFAULT
 dp_netdev_input_func_probe probe;
 
@@ -95,6 +100,35 @@ dp_netdev_impl_get_default(void)
 return default_dpif_func;
 }
 
+dp_netdev_recirc_func
+dp_netdev_recirc_impl_get_default(void)
+{
+/* For the first call, this will be NULL. Compute the compile time default.
+ */
+if (!default_dpif_recirc_func) {
+int dpif_idx = DPIF_NETDEV_IMPL_SCALAR;
+
+/* Configure-time overriding to run test suite on all implementations. */
+#if DPIF_NETDEV_IMPL_AVX512_CHECK
+#ifdef DPIF_AVX512_DEFAULT
+dp_netdev_input_func_probe probe;
+
+/* Check if the compiled default is compatible. */
+probe = dpif_impls[DPIF_NETDEV_IMPL_AVX512].probe;
+if (!probe || !probe()) {
+dpif_idx = DPIF_NETDEV_IMPL_AVX512;
+}
+#endif
+#endif
+
+VLOG_INFO("Default re-circulate DPIF implementation is %s.\n",
+  dpif_impls[dpif_idx].name);
+default_dpif_recirc_func = dpif_impls[dpif_idx].recirc_func;
+}
+
+return default_dpif_recirc_func;
+}
+
 void
 dp_netdev_impl_get(struct ds *reply, struct dp_netdev_pmd_thread **pmd_list,
size_t n)
@@ -130,10 +164,12 @@ dp_netdev_impl_get(struct ds *reply, struct 
dp_netdev_pmd_thread **pmd_list,
  * returns the function pointer to the one requested by "name".
  */
 static int32_t
-dp_netdev_impl_get_by_name(const char *name, dp_netdev_input_func *out_func)
+dp_netdev_impl_get_by_name(const char *name, dp_netdev_input_func *dpif_func,
+   dp_netdev_recirc_func *dpif_recirc_func)
 {
 ovs_assert(name);
-ovs_assert(out_func);
+ovs_assert(dpif_func);
+ovs_assert(dpif_recirc_func);
 
 uint32_t i;
 
@@ -143,11 +179,13 @@ dp_netdev_impl_get_by_name(const char *name, 
dp_netdev_input_func *out_func)
 if (dpif_impls[i].probe) {
 int probe_err = dpif_impls[i].probe();
 if (probe_err) {
-*out_func = NULL;
+*dpif_func = NULL;
+*dpif_recirc_func = NULL;
 return probe_err;
 }
 }
-*out_func = dpif_impls[i].input_func;
+*dpif_func = dpif_impls[i].input_func;
+*dpif_recirc_func = dpif_impls[i].recirc_func;
 return 0;
 }
 }
@@ -158,12 +196,15 @@ dp_netdev_impl_get_by_name(const char *name, 
dp_netdev_input_func *out_func)
 int32_t
 dp_netdev_impl_set_default_by_name(const char *name)
 {
-dp_netdev_input_func new_default;
+dp_netdev_input_func new_dpif_default;
+dp_netdev_recirc_func new_dpif_recirc_default;
 
-int32_t err = dp_netdev_impl_get_by_name(name, _default);
+int32_t err = dp_netdev_impl_get_by_name(name, _dpif_default,
+  

[ovs-dev] [PATCH v4 4/9] dpif-netdev-avx512: Add inner packet handling to dpif.

2022-08-07 Thread Kumar Amber
This patch adds the necessary changes required to support
tunnel packet types in avx512 dpif.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 

---
v4:
- Rebase onto Simple match.
v3:
- Apply in_port optimization suggested by Harry.
---
---
 lib/dpif-netdev-avx512.c | 39 ---
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index a36f4f312..1db20c1cf 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -61,7 +61,7 @@ struct dpif_userdata {
 static inline int32_t ALWAYS_INLINE
 dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
  struct dp_packet_batch *packets,
- bool md_is_valid OVS_UNUSED, odp_port_t in_port)
+ bool md_is_valid, odp_port_t in_port)
 {
 /* Allocate DPIF userdata. */
 if (OVS_UNLIKELY(!pmd->netdev_input_func_userdata)) {
@@ -73,6 +73,7 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 struct netdev_flow_key *keys = ud->keys;
 struct netdev_flow_key **key_ptrs = ud->key_ptrs;
 struct pkt_flow_meta *pkt_meta = ud->pkt_meta;
+const uint32_t recirc_depth = *recirc_depth_get();
 
 /* The AVX512 DPIF implementation handles rules in a way that is optimized
  * for reducing data-movement between HWOL/EMC/SMC and DPCLS. This is
@@ -106,7 +107,8 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 pkt_metadata_prefetch_init(>md);
 }
 
-const bool simple_match_enabled = dp_netdev_simple_match_enabled(pmd,
+const bool simple_match_enabled = !md_is_valid &&
+  dp_netdev_simple_match_enabled(pmd,
  in_port);
 /* Check if EMC or SMC are enabled. */
 struct dfc_cache *cache = >flow_cache;
@@ -183,11 +185,14 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 }
 
 /* Do a batch minfilow extract into keys. */
+ /* Do a batch minfilow extract into keys, but only for outer packets. */
 uint32_t mf_mask = 0;
-miniflow_extract_func mfex_func;
-atomic_read_relaxed(>miniflow_extract_opt, _func);
-if (mfex_func) {
-mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd);
+if (recirc_depth == 0) {
+miniflow_extract_func mfex_func;
+atomic_read_relaxed(>miniflow_extract_opt, _func);
+if (mfex_func) {
+mf_mask = mfex_func(packets, keys, batch_size, in_port, pmd);
+}
 }
 
 uint32_t iter = lookup_pkts_bitmask;
@@ -204,7 +209,9 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 
 /* Get packet pointer from bitmask and packet md. */
 struct dp_packet *packet = packets->packets[i];
-pkt_metadata_init(>md, in_port);
+if (!md_is_valid) {
+pkt_metadata_init(>md, in_port);
+}
 
 struct dp_netdev_flow *f = NULL;
 struct netdev_flow_key *key = [i];
@@ -216,7 +223,7 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 bool mfex_hit = !!(mf_mask & (UINT32_C(1) << i));
 
 /* Check for a partial hardware offload match. */
-if (hwol_enabled) {
+if (hwol_enabled && recirc_depth == 0) {
 if (OVS_UNLIKELY(dp_netdev_hw_flow(pmd, packet, ))) {
 /* Packet restoration failed and it was dropped, do not
  * continue processing. */
@@ -249,7 +256,9 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 pkt_meta[i].tcp_flags = miniflow_get_tcp_flags(>mf);
 
 key->len = netdev_flow_key_size(miniflow_n_values(>mf));
-key->hash = dpif_netdev_packet_get_rss_hash_orig_pkt(packet, >mf);
+key->hash = (md_is_valid == false)
+? dpif_netdev_packet_get_rss_hash_orig_pkt(packet, >mf)
+: dpif_netdev_packet_get_rss_hash(packet, >mf);
 
 if (emc_enabled) {
 f = emc_lookup(>emc_cache, key);
@@ -287,7 +296,13 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
  * dpcls_rules[] array.
  */
 if (dpcls_key_idx > 0) {
-struct dpcls *cls = dp_netdev_pmd_lookup_dpcls(pmd, in_port);
+odp_port_t port_no;
+if (!md_is_valid) {
+port_no = in_port;
+} else {
+port_no = packets->packets[0]->md.in_port.odp_port;
+}
+struct dpcls *cls = dp_netdev_pmd_lookup_dpcls(pmd, port_no);
 if (OVS_UNLIKELY(!cls)) {
 return -1;
 }
@@ -353,7 +368,9 @@ dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
 pmd_perf_update_counter(>perf_stats, PMD_STAT_MASKED_LOOKUP,
 dpcls_key_idx);
 action_stage:
-pmd_perf_update_counter(>perf_stats, PMD_STAT_RECV, batch_size);
+pmd_perf_update_counter(>perf_stats,
+md_is_valid ? 

[ovs-dev] [PATCH v4 3/9] dpif-netdev-avx512: Refactor avx512 dpif and create new APIs.

2022-08-07 Thread Kumar Amber
Create new APIs for the avx512 DPIF, enabling one baseline
common code to be specialized into DPIF implementations for
"outer" processing, and "recirc" processing.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 

---
v4:
- Rebase onto master.
v3:
- Fix comments from Harry.
---
---
 lib/dpif-netdev-avx512.c   | 25 +
 lib/dpif-netdev-private-dpif.c |  6 +++---
 lib/dpif-netdev-private-dpif.h | 14 +++---
 lib/dpif-netdev.c  |  5 ++---
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index 83e7a1394..a36f4f312 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -58,10 +58,10 @@ struct dpif_userdata {
 struct pkt_flow_meta pkt_meta[NETDEV_MAX_BURST];
 };
 
-int32_t
-dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
- struct dp_packet_batch *packets,
- odp_port_t in_port)
+static inline int32_t ALWAYS_INLINE
+dp_netdev_input_avx512__(struct dp_netdev_pmd_thread *pmd,
+ struct dp_packet_batch *packets,
+ bool md_is_valid OVS_UNUSED, odp_port_t in_port)
 {
 /* Allocate DPIF userdata. */
 if (OVS_UNLIKELY(!pmd->netdev_input_func_userdata)) {
@@ -413,5 +413,22 @@ action_stage:
 return 0;
 }
 
+int32_t
+dp_netdev_input_avx512(struct dp_netdev_pmd_thread *pmd,
+   struct dp_packet_batch *packets,
+   odp_port_t in_port)
+{
+int ret = dp_netdev_input_avx512__(pmd, packets, false, in_port);
+return ret;
+}
+
+int32_t
+dp_netdev_input_avx512_recirc(struct dp_netdev_pmd_thread *pmd,
+  struct dp_packet_batch *packets)
+{
+int ret = dp_netdev_input_avx512__(pmd, packets, true, 0);
+return ret;
+}
+
 #endif
 #endif
diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
index f3cc200e5..7019b0931 100644
--- a/lib/dpif-netdev-private-dpif.c
+++ b/lib/dpif-netdev-private-dpif.c
@@ -38,7 +38,7 @@ enum dpif_netdev_impl_info_idx {
 
 #if (__x86_64__ && HAVE_AVX512F && HAVE_LD_AVX512_GOOD && __SSE4_2__)
 static int32_t
-dp_netdev_input_outer_avx512_probe(void)
+dp_netdev_input_avx512_probe(void)
 {
 if (!cpu_has_isa(OVS_CPU_ISA_X86_AVX512F)
 || !cpu_has_isa(OVS_CPU_ISA_X86_BMI2)) {
@@ -58,8 +58,8 @@ static struct dpif_netdev_impl_info_t dpif_impls[] = {
 
 #if (__x86_64__ && HAVE_AVX512F && HAVE_LD_AVX512_GOOD && __SSE4_2__)
 /* Only available on x86_64 bit builds with SSE 4.2 used for OVS core. */
-[DPIF_NETDEV_IMPL_AVX512] = { .input_func = dp_netdev_input_outer_avx512,
-  .probe = dp_netdev_input_outer_avx512_probe,
+[DPIF_NETDEV_IMPL_AVX512] = { .input_func = dp_netdev_input_avx512,
+  .probe = dp_netdev_input_avx512_probe,
   .name = "dpif_avx512", },
 #endif
 };
diff --git a/lib/dpif-netdev-private-dpif.h b/lib/dpif-netdev-private-dpif.h
index b3e75b7a2..46ce4ecf6 100644
--- a/lib/dpif-netdev-private-dpif.h
+++ b/lib/dpif-netdev-private-dpif.h
@@ -86,8 +86,16 @@ dp_netdev_input(struct dp_netdev_pmd_thread *pmd,
 
 /* AVX512 enabled DPIF implementation function. */
 int32_t
-dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
- struct dp_packet_batch *packets,
- odp_port_t in_port);
+dp_netdev_input_avx512(struct dp_netdev_pmd_thread *pmd,
+   struct dp_packet_batch *packets,
+   odp_port_t in_port);
+
+int32_t
+dp_netdev_input_avx512_recirc(struct dp_netdev_pmd_thread *pmd,
+  struct dp_packet_batch *packets);
+
+int32_t
+dp_netdev_recirculate(struct dp_netdev_pmd_thread *,
+  struct dp_packet_batch *);
 
 #endif /* netdev-private.h */
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 92e63599e..a50571dc8 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -545,8 +545,6 @@ static void dp_netdev_execute_actions(struct 
dp_netdev_pmd_thread *pmd,
   const struct flow *flow,
   const struct nlattr *actions,
   size_t actions_len);
-static void dp_netdev_recirculate(struct dp_netdev_pmd_thread *,
-  struct dp_packet_batch *);
 
 static void dp_netdev_disable_upcall(struct dp_netdev *);
 static void dp_netdev_pmd_reload_done(struct dp_netdev_pmd_thread *pmd);
@@ -8492,11 +8490,12 @@ dp_netdev_input(struct dp_netdev_pmd_thread *pmd,
 return 0;
 }
 
-static void
+int32_t
 dp_netdev_recirculate(struct dp_netdev_pmd_thread *pmd,
   struct dp_packet_batch *packets)
 {
 dp_netdev_input__(pmd, packets, true, 0);
+return 0;
 }
 
 struct dp_netdev_execute_aux {
-- 
2.25.1

___
dev mailing list

[ovs-dev] [PATCH v4 2/9] dpif-netdev: Refactor hash function to own header.

2022-08-07 Thread Kumar Amber
The refactor allows us to use hash function accross
multiple files which was earlier restricted to
dpif-netdev.c only.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 

---
v3:
- Fix minor comments from Harry.
---
---
 lib/dpif-netdev-private-dpcls.h | 23 +++
 lib/dpif-netdev.c   | 22 --
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/lib/dpif-netdev-private-dpcls.h b/lib/dpif-netdev-private-dpcls.h
index 2a9279437..1b37ecb16 100644
--- a/lib/dpif-netdev-private-dpcls.h
+++ b/lib/dpif-netdev-private-dpcls.h
@@ -25,6 +25,7 @@
 
 #include "cmap.h"
 #include "openvswitch/thread.h"
+#include "dpif-netdev-private-dpif.h"
 
 #ifdef  __cplusplus
 extern "C" {
@@ -125,6 +126,28 @@ dpif_netdev_packet_get_rss_hash_orig_pkt(struct dp_packet 
*packet,
 return hash;
 }
 
+static inline uint32_t
+dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
+const struct miniflow *mf)
+{
+uint32_t hash, recirc_depth;
+
+if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
+hash = dp_packet_get_rss_hash(packet);
+} else {
+hash = miniflow_hash_5tuple(mf, 0);
+dp_packet_set_rss_hash(packet, hash);
+}
+
+/* The RSS hash must account for the recirculation depth to avoid
+ * collisions in the exact match cache */
+recirc_depth = *recirc_depth_get_unsafe();
+if (OVS_UNLIKELY(recirc_depth)) {
+hash = hash_finish(hash, recirc_depth);
+}
+return hash;
+}
+
 /* Allow other implementations to call dpcls_lookup() for subtable search. */
 bool
 dpcls_lookup(struct dpcls *cls, const struct netdev_flow_key *keys[],
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 4866231a3..92e63599e 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -7806,28 +7806,6 @@ dp_netdev_upcall(struct dp_netdev_pmd_thread *pmd, 
struct dp_packet *packet_,
  actions, wc, put_actions, dp->upcall_aux);
 }
 
-static inline uint32_t
-dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
-const struct miniflow *mf)
-{
-uint32_t hash, recirc_depth;
-
-if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
-hash = dp_packet_get_rss_hash(packet);
-} else {
-hash = miniflow_hash_5tuple(mf, 0);
-dp_packet_set_rss_hash(packet, hash);
-}
-
-/* The RSS hash must account for the recirculation depth to avoid
- * collisions in the exact match cache */
-recirc_depth = *recirc_depth_get_unsafe();
-if (OVS_UNLIKELY(recirc_depth)) {
-hash = hash_finish(hash, recirc_depth);
-}
-return hash;
-}
-
 struct packet_batch_per_flow {
 unsigned int byte_count;
 uint16_t tcp_flags;
-- 
2.25.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v4 1/9] dpif-netdev: Refactor per thread recirc data allocation.

2022-08-07 Thread Kumar Amber
The refactor allows us to use *recirc_depth_get() to obtain
the depth across ovs which was previously limited to only
dpif-netdev.c.

Signed-off-by: Kumar Amber 
Signed-off-by: Cian Ferriter 
Co-authored-by: Cian Ferriter 
Acked-by: Harry van Haaren 
---
 lib/dpif-netdev-private-dpif.c | 2 ++
 lib/dpif-netdev-private-dpif.h | 5 +
 lib/dpif-netdev.c  | 3 ---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
index 5ae119a30..f3cc200e5 100644
--- a/lib/dpif-netdev-private-dpif.c
+++ b/lib/dpif-netdev-private-dpif.c
@@ -29,6 +29,8 @@
 
 VLOG_DEFINE_THIS_MODULE(dpif_netdev_impl);
 
+DEFINE_EXTERN_PER_THREAD_DATA(recirc_depth, 0);
+
 enum dpif_netdev_impl_info_idx {
 DPIF_NETDEV_IMPL_SCALAR,
 DPIF_NETDEV_IMPL_AVX512
diff --git a/lib/dpif-netdev-private-dpif.h b/lib/dpif-netdev-private-dpif.h
index cf331cec7..b3e75b7a2 100644
--- a/lib/dpif-netdev-private-dpif.h
+++ b/lib/dpif-netdev-private-dpif.h
@@ -18,6 +18,11 @@
 #define DPIF_NETDEV_PRIVATE_DPIF_H 1
 
 #include "openvswitch/types.h"
+#include "ovs-thread.h"
+
+#define MAX_RECIRC_DEPTH 6
+/* Use per thread recirc_depth to prevent recirculation loop. */
+DECLARE_EXTERN_PER_THREAD_DATA(uint32_t, recirc_depth);
 
 /* Forward declarations to avoid including files. */
 struct dp_netdev_pmd_thread;
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index a45b46014..4866231a3 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -98,9 +98,6 @@ VLOG_DEFINE_THIS_MODULE(dpif_netdev);
 #define MIN_TO_MSEC  6
 
 #define FLOW_DUMP_MAX_BATCH 50
-/* Use per thread recirc_depth to prevent recirculation loop. */
-#define MAX_RECIRC_DEPTH 6
-DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0)
 
 /* Use instant packet send by default. */
 #define DEFAULT_TX_FLUSH_INTERVAL 0
-- 
2.25.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v4 0/9] DPIF + MFEX Inner Vxlan AVX512

2022-08-07 Thread Kumar Amber
This Series of Patchsets introduce the Optimizations for
supporting Vxlan tunneled packets in DPIF and MFEX. Along with
the optimization various refactoring of scalar
path is done to be used accross without duplication.

Over the Tests we have observed a gain of approximate 20~25%
gain in performance over the scalar path.

Kumar Amber (9):
  dpif-netdev: Refactor per thread recirc data allocation.
  dpif-netdev: Refactor hash function to own header.
  dpif-netdev-avx512: Refactor avx512 dpif and create new APIs.
  dpif-netdev-avx512: Add inner packet handling to dpif.
  dpif-netdev: Add function pointer for dpif re-circulate.
  dpif-mfex: Modify set/get mfex commands to include inner.
  dpif-mfex: Change mfex fn pointer prototype to include md_is_valid.
  mfex-study: Modify study func to select outer and inner mfex funcs.
  mfex-avx512: Add support for tunnel packets in avx512 mfex.

 Documentation/topics/dpdk/bridge.rst |  18 ++--
 lib/dpif-netdev-avx512.c |  61 ---
 lib/dpif-netdev-extract-avx512.c | 153 +++
 lib/dpif-netdev-extract-study.c  | 132 +++
 lib/dpif-netdev-private-dpcls.h  |  23 
 lib/dpif-netdev-private-dpif.c   |  65 ++--
 lib/dpif-netdev-private-dpif.h   |  37 ++-
 lib/dpif-netdev-private-extract.c|  33 +-
 lib/dpif-netdev-private-extract.h|  19 ++--
 lib/dpif-netdev-private-thread.h |   6 ++
 lib/dpif-netdev.c|  70 ++--
 11 files changed, 453 insertions(+), 164 deletions(-)

-- 
2.25.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [ovs-dev v2 1/4] ofproto-dpif-upcall: fix push_dp_ops

2022-08-07 Thread Peng He
Hello,
can anyone have a look at those patches?

0-day Robot  于2022年6月4日周六 23:38写道:

> Bleep bloop.  Greetings Peng He, I am a robot and I have tried out your
> patch.
> Thanks for your contribution.
>
> I encountered some error that I wasn't expecting.  See the details below.
>
>
> checkpatch:
> ERROR: Author Peng He  needs to sign off.
> WARNING: Unexpected sign-offs from developers who are not authors or
> co-authors or committers: Peng He 
> Lines checked: 59, Warnings: 1, Errors: 1
>
>
> Please check this out.  If you feel there has been an error, please email
> acon...@redhat.com
>
> Thanks,
> 0-day Robot
>


-- 
hepeng
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev