[ovs-dev] 2020 Is Horrible, But Scientists Never Stopped - 2 Min Health Ritual

2020-10-30 Thread Resurge Revive


Having trouble viewing this email? Please follow this link to see the messaged 
emailed to you. 








(Unsubscribe Instructions Here)

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


[ovs-dev] High school student discovers concept that redefines science

2020-10-30 Thread Hollywood Diet
Having trouble viewing this email? Please follow this link to see the messaged 
emailed to you. 

Product Image 
Product Image 






(Unsubscribe Instructions Here)

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


[ovs-dev] Recomendaciones para evitar errores

2020-10-30 Thread Curso de redacción para profesionistas
Viernes 06 de Noviembre | Horario de 10:00 a 17:00 hrs.  |  (hora del centro de 
México) 

- Curso de redacción para profesionistas - 

¿De qué hablaremos?

Proporcionar a los participantes guías para una correcta redacción de textos 
que sean claros, concisos y entendibles
para el ámbito profesional.

¿Qué aprenderás?:

- El participante revisará y aplicará recomendaciones para una redacción clara.
- El participante será capaz de redactar un texto coherente y haciendo uso 
correcto de conectores.
- El participante revisará los errores de redacción más comunes y conocerá 
recomendaciones para evitarlos.
- El participante conocerá las características de la redacción profesional.
- El participante identificará los elementos para la redacción de documentos y 
textos ejecutivos.
- El participante elaborará y enviará textos ejecutivos online. 

Solicita información respondiendo a este correo con la palabra Redacción, junto 
con los siguientes datos:

Nombre:
Correo electrónico:
Número telefónico:
Correo Alterno:

Para información inmediata llamar al:
(+52) 55 15 54 66 30 - (+52) 55 30 16 70 85
O puede enviarnos un mensaje vía Whatsapp 

Innova Learn México - innovalearn. mx - Mérida, Yucatán, México


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


Re: [ovs-dev] [PATCH net] net: openvswitch: silence suspicious RCU usage warning

2020-10-30 Thread Jakub Kicinski
On Thu, 29 Oct 2020 15:53:21 +0100 Eelco Chaudron wrote:
> Silence suspicious RCU usage warning in ovs_flow_tbl_masks_cache_resize()
> by replacing rcu_dereference() with rcu_dereference_ovsl().
> 
> In addition, when creating a new datapath, make sure it's configured under
> the ovs_lock.
> 
> Fixes: 9bf24f594c6a ("net: openvswitch: make masks cache size configurable")
> Reported-by: syzbot+9a8f8bfcc56e85780...@syzkaller.appspotmail.com
> Signed-off-by: Eelco Chaudron 
> ---
>  net/openvswitch/datapath.c   |8 
>  net/openvswitch/flow_table.c |2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> index 832f898edb6a..020f8539fede 100644
> --- a/net/openvswitch/datapath.c
> +++ b/net/openvswitch/datapath.c
> @@ -1695,6 +1695,9 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
> genl_info *info)
>   if (err)
>   goto err_destroy_ports;
>  
> + /* So far only local changes have been made, now need the lock. */
> + ovs_lock();

Should we move the lock below assignments to param?

Looks a little strange to protect stack variables with a global lock.

>   /* Set up our datapath device. */
>   parms.name = nla_data(a[OVS_DP_ATTR_NAME]);
>   parms.type = OVS_VPORT_TYPE_INTERNAL;
> @@ -1707,9 +1710,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
> genl_info *info)
>   if (err)
>   goto err_destroy_meters;
>  
> - /* So far only local changes have been made, now need the lock. */
> - ovs_lock();
> -
>   vport = new_vport();
>   if (IS_ERR(vport)) {
>   err = PTR_ERR(vport);
> @@ -1725,7 +1725,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
> genl_info *info)
>   ovs_dp_reset_user_features(skb, info);
>   }
>  
> - ovs_unlock();
>   goto err_destroy_meters;
>   }
>  
> @@ -1742,6 +1741,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct 
> genl_info *info)
>   return 0;
>  
>  err_destroy_meters:

Let's update the name of the label.

> + ovs_unlock();
>   ovs_meters_exit(dp);
>  err_destroy_ports:
>   kfree(dp->ports);
> diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
> index f3486a37361a..c89c8da99f1a 100644
> --- a/net/openvswitch/flow_table.c
> +++ b/net/openvswitch/flow_table.c
> @@ -390,7 +390,7 @@ static struct mask_cache *tbl_mask_cache_alloc(u32 size)
>  }
>  int ovs_flow_tbl_masks_cache_resize(struct flow_table *table, u32 size)
>  {
> - struct mask_cache *mc = rcu_dereference(table->mask_cache);
> + struct mask_cache *mc = rcu_dereference_ovsl(table->mask_cache);
>   struct mask_cache *new;
>  
>   if (size == mc->cache_size)
> 

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


Re: [ovs-dev] [PATCH v2 11/11] dpif-netdev/dpcls-avx512: enable 16 miniflow block processing

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Harry van Haaren, 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:
WARNING: Line is 80 characters long (recommended limit is 79)
#88 FILE: lib/dpif-netdev-lookup-avx512-gather.c:101:
uint32_t c = _mm512_mask_cmpeq_epi64_mask(lane_mask_gt8, v_data, v_key);

ERROR: Improper whitespace around control block
#97 FILE: lib/dpif-netdev-lookup-avx512-gather.c:110:
#define DUMP_ZMM(name, zmm) do { } while(0)

ERROR: Improper whitespace around control block
#106 FILE: lib/dpif-netdev-lookup-avx512-gather.c:119:
} while(0)

ERROR: C99 style comment
#114 FILE: lib/dpif-netdev-lookup-avx512-gather.c:127:
avx512_blocks_gather(__m512i v_u0, // reg of u64 of all u0 bits

ERROR: C99 style comment
#115 FILE: lib/dpif-netdev-lookup-avx512-gather.c:128:
 __m512i v_u1, // reg of u64 of all u1 bits

ERROR: C99 style comment
#116 FILE: lib/dpif-netdev-lookup-avx512-gather.c:129:
 const uint64_t *pkt_blocks, // ptr pkt blocks to load

ERROR: C99 style comment
#117 FILE: lib/dpif-netdev-lookup-avx512-gather.c:130:
 const void *tbl_blocks, // ptr to blocks in tbl to & with

ERROR: C99 style comment
#118 FILE: lib/dpif-netdev-lookup-avx512-gather.c:131:
 const void *tbl_mf_masks, // ptr to subtable mf masks

ERROR: C99 style comment
#119 FILE: lib/dpif-netdev-lookup-avx512-gather.c:132:
 __mmask64 u1_bcast_mask,  // mask of lanes to use u1

ERROR: C99 style comment
#120 FILE: lib/dpif-netdev-lookup-avx512-gather.c:133:
 const uint64_t pkt_mf_u0_pop, // num bits in u0 of pkt

ERROR: C99 style comment
#121 FILE: lib/dpif-netdev-lookup-avx512-gather.c:134:
 __mmask64 zero_mask, // maskz as pkt not have mf bit set

ERROR: C99 style comment
#122 FILE: lib/dpif-netdev-lookup-avx512-gather.c:135:
 __mmask64 u64_lanes_mask) // total lane count to use

WARNING: Line is 80 characters long (recommended limit is 79)
#130 FILE: lib/dpif-netdev-lookup-avx512-gather.c:143:
__m512i v_pkt_bits = _mm512_mask_blend_epi64(u1_bcast_mask, v_u0, v_u1);

WARNING: Line is 88 characters long (recommended limit is 79)
ERROR: C99 style comment
#201 FILE: lib/dpif-netdev-lookup-avx512-gather.c:208:
//printf("tbl u0 %x, u1 %x, bit count total %d\n", tbl_u0, tbl_u1, 
bit_count_total);

WARNING: Line is 81 characters long (recommended limit is 79)
#256 FILE: lib/dpif-netdev-lookup-avx512-gather.c:236:
const uint64_t zero_mask_wip = (u1_to_zero << bit_count_u0) | 
u0_to_zero;

WARNING: Line is 80 characters long (recommended limit is 79)
ERROR: C99 style comment
#284 FILE: lib/dpif-netdev-lookup-avx512-gather.c:264:
_blocks[0],// TODO: how?

Lines checked: 355, Warnings: 5, Errors: 13


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 09/11] dpif-netdev: add command to switch dpif implementation

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Harry van Haaren, 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: C99 style comment
#324 FILE: lib/dpif-netdev.c:1002:
//void *new_dpif_func = NULL; //dpif_netdev_impl_get(dpif_name);

Lines checked: 426, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 08/11] dpif-avx512: add ISA implementation of dpif

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Harry van Haaren, 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:
WARNING: Line is 89 characters long (recommended limit is 79)
WARNING: Line lacks whitespace around operator
#111 FILE: lib/dpif-netdev-avx512.c:52:
OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct netdev_flow_key 
keys_impl[NETDEV_MAX_BURST+1];

WARNING: Line is 87 characters long (recommended limit is 79)
#112 FILE: lib/dpif-netdev-avx512.c:53:
OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct netdev_flow_key 
*key_ptrs[NETDEV_MAX_BURST];

WARNING: Line is 84 characters long (recommended limit is 79)
#113 FILE: lib/dpif-netdev-avx512.c:54:
OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct pkt_flow_meta 
pkt_meta[NETDEV_MAX_BURST];

WARNING: Line is 86 characters long (recommended limit is 79)
WARNING: Line lacks whitespace around operator
#119 FILE: lib/dpif-netdev-avx512.c:60:
struct netdev_flow_key *keys = (void *)(((char *)keys_impl) + 
(64-blocks_offset));

ERROR: C99 style comment
#163 FILE: lib/dpif-netdev-avx512.c:104:
   // TODO: remove this EMC hit from the dpcls lookup bitmask

WARNING: Line is 80 characters long (recommended limit is 79)
#177 FILE: lib/dpif-netdev-avx512.c:118:
int any_miss = !dpcls_lookup(cls, (const struct netdev_flow_key **)key_ptrs,

WARNING: Line is 80 characters long (recommended limit is 79)
#189 FILE: lib/dpif-netdev-avx512.c:130:
pmd_perf_update_counter(>perf_stats, PMD_STAT_MASKED_LOOKUP, wild_hit);

ERROR: Improper whitespace around control block
#202 FILE: lib/dpif-netdev-avx512.c:143:
for(uint32_t j = 0; j < NETDEV_MAX_BURST; j += 8) {

ERROR: Improper whitespace around control block
#230 FILE: lib/dpif-netdev-avx512.c:171:
for(int i = 0; i < action_batch.count; i++) {

ERROR: C99 style comment
#306 FILE: lib/dpif-netdev-private-dpif.h:27:
// TODO make this register/selectable just like DPCLS

ERROR: C99 style comment
#521 FILE: lib/dpif-netdev.c:8385:
//memset(rules, 0, cnt * sizeof *rules);

Lines checked: 527, Warnings: 8, Errors: 5


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 05/11] dpif-netdev: refactor to multiple header files

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Harry van Haaren, 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: Improper whitespace around control block
#215 FILE: lib/dpif-netdev-private-dfc.h:111:
#define EMC_FOR_EACH_POS_WITH_HASH(EMC, CURRENT_ENTRY, HASH) \

ERROR: Improper whitespace around control block
#331 FILE: lib/dpif-netdev-private-dfc.h:227:
EMC_FOR_EACH_POS_WITH_HASH(cache, current_entry, key->hash) {

ERROR: Improper whitespace around control block
#449 FILE: lib/dpif-netdev-private-dpcls.h:95:
#define NETDEV_FLOW_KEY_FOR_EACH_IN_FLOWMAP(VALUE, KEY, FLOWMAP)   \

ERROR: Inappropriate bracing around statement
#450 FILE: lib/dpif-netdev-private-dpcls.h:96:
MINIFLOW_FOR_EACH_IN_FLOWMAP (VALUE, &(KEY)->mf, FLOWMAP)

WARNING: Line has trailing whitespace
#994 FILE: lib/dpif-netdev-private.h:48:
 *  

Lines checked: 1549, Warnings: 1, Errors: 4


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 02/11] dpdk: cache result of CPU ISA checks

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Harry van Haaren, 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: Inappropriate bracing around statement
#50 FILE: lib/dpdk.c:635:
if (has_isa)\

ERROR: Inappropriate bracing around statement
#53 FILE: lib/dpdk.c:638:
if (isa_check_##RTE_CPUFLAG & ISA_AVAILABLE_BIT)\

Lines checked: 60, Warnings: 0, Errors: 2


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 08/11] dpif-avx512: add ISA implementation of dpif

2020-10-30 Thread Harry van Haaren
This commit adds the AVX512 implementation of DPIF functionality,
specifically the dp_netdev_input_outer_avx512 function. This function
only handles outer (no re-circulations), and is optimized to use the
AVX512 ISA for packet batching and other DPIF work.

Sparse is not able to handle the AVX512 intrinsics, causing compile
time failures, so it is disabled for this file.

Signed-off-by: Harry van Haaren 

---

v2:
- Add BMI flag for _blsr_u64() instruction
- Add sparse avoidance to fix compilation with --enable-sparse
---
 lib/automake.mk  |   5 +-
 lib/dpif-netdev-avx512.c | 187 +++
 lib/dpif-netdev-private-dpcls.h  |  16 +++
 lib/dpif-netdev-private-dpif.h   |  33 ++
 lib/dpif-netdev-private-thread.h |   9 +-
 lib/dpif-netdev-private.h|  25 +
 lib/dpif-netdev.c|  60 +-
 7 files changed, 302 insertions(+), 33 deletions(-)
 create mode 100644 lib/dpif-netdev-avx512.c
 create mode 100644 lib/dpif-netdev-private-dpif.h

diff --git a/lib/automake.mk b/lib/automake.mk
index eccfaf3e3..650207940 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -33,11 +33,13 @@ lib_libopenvswitchavx512_la_CFLAGS = \
-mavx512f \
-mavx512bw \
-mavx512dq \
+   -mbmi \
-mbmi2 \
-fPIC \
$(AM_CFLAGS)
 lib_libopenvswitchavx512_la_SOURCES = \
-   lib/dpif-netdev-lookup-avx512-gather.c
+   lib/dpif-netdev-lookup-avx512-gather.c \
+   lib/dpif-netdev-avx512.c
 lib_libopenvswitchavx512_la_LDFLAGS = \
-static
 endif
@@ -113,6 +115,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev.h \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-dpif.h \
lib/dpif-netdev-private-flow.h \
lib/dpif-netdev-private-hwol.h \
lib/dpif-netdev-private-thread.h \
diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
new file mode 100644
index 0..552b50952
--- /dev/null
+++ b/lib/dpif-netdev-avx512.c
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2020 Intel.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef __x86_64__
+/* Sparse cannot handle the AVX512 instructions */
+#if !defined(__CHECKER__)
+
+#include 
+
+#include "dpif-netdev.h"
+#include "dpif-netdev-perf.h"
+
+#include "dpif-netdev-private.h"
+#include "dpif-netdev-private-dpcls.h"
+#include "dpif-netdev-private-flow.h"
+#include "dpif-netdev-private-thread.h"
+
+#include "dp-packet.h"
+#include "netdev.h"
+
+#include "immintrin.h"
+
+
+/* Structure to contain per-packet metadata that must be attributed to the
+ * dp netdev flow. This is unfortunate to have to track per packet, however
+ * its a bit difficult awkward to maintain them in a performant way. This
+ * structure helps to keep two variables on a single cache line per packet.
+ */
+struct pkt_flow_meta {
+uint16_t bytes;
+uint16_t tcp_flags;
+};
+
+int32_t
+dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
+ struct dp_packet_batch *packets,
+ odp_port_t in_port)
+{
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct netdev_flow_key 
keys_impl[NETDEV_MAX_BURST+1];
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct netdev_flow_key 
*key_ptrs[NETDEV_MAX_BURST];
+OVS_ALIGNED_VAR(CACHE_LINE_SIZE)struct pkt_flow_meta 
pkt_meta[NETDEV_MAX_BURST];
+
+/* Temporary pointers to the above stack allocated arrays due to the
+ * dpcls_lookup() function signature taking pointers, not linear flow_keys.
+ */
+ssize_t blocks_offset = offsetof(struct netdev_flow_key, buf);
+struct netdev_flow_key *keys = (void *)(((char *)keys_impl) + 
(64-blocks_offset));
+for (int i = 0; i < NETDEV_MAX_BURST; i++) {
+ key_ptrs[i] = [i];
+}
+
+/* Stores the computed output: a rule pointer for each packet */
+struct dpcls_rule *rules[NETDEV_MAX_BURST];
+for (uint32_t i = 0; i < NETDEV_MAX_BURST; i += 8) {
+_mm512_storeu_si512([i], _mm512_setzero_si512());
+}
+
+/* Prefetch each packet's metadata */
+const size_t batch_size = dp_packet_batch_size(packets);
+for (int i = 0; i < batch_size; i++) {
+struct dp_packet *packet = packets->packets[i];
+OVS_PREFETCH(dp_packet_data(packet));
+pkt_metadata_prefetch_init(>md);
+}
+
+/* Check if EMC or SMC are enabled */
+struct dfc_cache *cache = >flow_cache;
+const 

[ovs-dev] [PATCH v2 11/11] dpif-netdev/dpcls-avx512: enable 16 miniflow block processing

2020-10-30 Thread Harry van Haaren
This commit implements larger subtable searches in avx512. A limitation
of the previous implementation was that up to 8 blocks of miniflow
data could be matched on (so a subtable with 8 blocks was handled
in avx, but 9 blocks or more would fall back to scalar/generic).
This limitation is removed in this patch, where up to 16 blocks
of subtable can be matched on.

>From an implementation perspective, the key to enabling 16 blocks
over 8 blocks was to do bitmask calculation up front, and then use
the pre-calculated bitmasks for 2x passes of the "blocks gather"
routine. The bitmasks need to be shifted for k-mask usage in the
upper (8-15) block range, but it is relatively trivial. This also
helps in case expanding to 24 blocks is desired in future.

The implementation of the 2nd iteration to handle > 8 blocks is
behind a conditional branch which checks the total number of bits.
This helps the specialized versions of the function that have a
miniflow fingerprint of less-than-or-equal 8 blocks, as the code
can be statically stripped out of those functions. Specialized
functions that do require more than 8 blocks will have the branch
removed and unconditionally execute the 2nd gather routine.

Lastly, the _any() flavour will have the conditional branch, and
the branch predictor may mispredict a bit, but per burst will
likely get most packets correct (particularly towards the middle
and end of a burst).

The code has been run with unit tests under autovalidation and
passes all cases, and unit test coverage has been checked to
ensure the 16 block code paths are executing.

Signed-off-by: Harry van Haaren 

---

To automatically test and get coverage reports, use
./configure ... --enable-coverage --enable-autovalidator
and then execute the make check-lcov target.
---
 lib/dpif-netdev-lookup-avx512-gather.c | 224 +++--
 1 file changed, 170 insertions(+), 54 deletions(-)

diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 8fc1cdfa5..44ed03871 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -34,7 +34,16 @@
  * AVX512 code at a time.
  */
 #define NUM_U64_IN_ZMM_REG (8)
-#define BLOCKS_CACHE_SIZE (NETDEV_MAX_BURST * NUM_U64_IN_ZMM_REG)
+
+/* This implementation of AVX512 gather allows up to 16 blocks of MF data to be
+ * present in the blocks_cache, hence the *2 in the blocks count here.
+ */
+#define MF_BLOCKS_PER_PACKET (NUM_U64_IN_ZMM_REG * 2)
+
+/* Multiply by two is here to enable lookup in subtables that have up to and
+ * including 16 blocks.
+ */
+#define BLOCKS_CACHE_SIZE (NETDEV_MAX_BURST * MF_BLOCKS_PER_PACKET)
 
 
 VLOG_DEFINE_THIS_MODULE(dpif_lookup_avx512_gather);
@@ -74,17 +83,104 @@ netdev_rule_matches_key(const struct dpcls_rule *rule,
 /* Always load a full cache line from blocks_cache. Other loads must be
  * trimmed to the amount of data required for mf_bits_total blocks.
  */
-__m512i v_blocks = _mm512_loadu_si512(_cache[0]);
-__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask, [0]);
-__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask, [0]);
+uint32_t res_mask;
+{
+__m512i v_blocks = _mm512_loadu_si512(_cache[0]);
+__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask, [0]);
+__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask, [0]);
+__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
+res_mask = _mm512_mask_cmpeq_epi64_mask(lane_mask, v_data, v_key);
+}
 
-__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
-uint32_t res_mask = _mm512_mask_cmpeq_epi64_mask(lane_mask, v_data, v_key);
+if (mf_bits_total > 8) {
+uint32_t lane_mask_gt8 = lane_mask >> 8;
+__m512i v_blocks = _mm512_loadu_si512(_cache[8]);
+__m512i v_mask   = _mm512_maskz_loadu_epi64(lane_mask_gt8, [8]);
+__m512i v_key= _mm512_maskz_loadu_epi64(lane_mask_gt8, [8]);
+__m512i v_data = _mm512_and_si512(v_blocks, v_mask);
+uint32_t c = _mm512_mask_cmpeq_epi64_mask(lane_mask_gt8, v_data, 
v_key);
+res_mask |= (c << 8);
+}
 
 /* returns 1 assuming result of SIMD compare is all blocks. */
 return res_mask == lane_mask;
 }
 
+#if 1
+#define DUMP_ZMM(name, zmm) do { } while(0)
+#else
+#define DUMP_ZMM(name, zmm) \
+do {\
+uint64_t _tmp[8];   \
+_mm512_storeu_si512(_tmp, zmm); \
+printf("%s: %lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx\n", name,\
+_tmp[0], _tmp[1], _tmp[2], _tmp[3], \
+_tmp[4], _tmp[5], _tmp[6], _tmp[7]);\
+} while(0)
+#endif
+
+/* Takes u0 and u1 inputs, and gathers the next 8 blocks to be stored
+ * contigously into the blocks cache. Note that the pointers and 

[ovs-dev] [PATCH v2 09/11] dpif-netdev: add command to switch dpif implementation

2020-10-30 Thread Harry van Haaren
This commit adds a new command to allow the user to switch
the active DPIF implementation at runtime. A probe function
is executed before switching the DPIF implementation, to ensure
the CPU is capable of running the ISA required. For example, the
below code will switch to the AVX512 enabled DPIF assuming
that the runtime CPU is capable of running AVX512 instructions:

 $ ovs-appctl dpif-netdev/dpif-set dpif_avx512

A new configuration flag is added to allow selection of the
default DPIF. This is useful for running the unit-tests against
the available DPIF implementations, without modifying each unit test.

The design of the testing & validation for ISA optimized DPIF
implementations is based around the work already upstream for DPCLS.
Note however that a DPCLS lookup has no state or side-effects, allowing
the auto-validator implementation to perform multiple lookups and
provide consistent statistic counters.

The DPIF component does have state, so running two implementations in
parallel and comparing output is not a valid testing method, as there
are changes in DPIF statistic counters (side effects). As a result, the
DPIF is tested directly against the unit-tests.

Signed-off-by: Harry van Haaren 
---
 acinclude.m4 |  16 +
 configure.ac |   1 +
 lib/automake.mk  |   1 +
 lib/dpif-netdev-avx512.c |  12 
 lib/dpif-netdev-private-dpif.c   | 103 +++
 lib/dpif-netdev-private-dpif.h   |  32 +-
 lib/dpif-netdev-private-thread.h |   9 +--
 lib/dpif-netdev.c|  89 --
 8 files changed, 250 insertions(+), 13 deletions(-)
 create mode 100644 lib/dpif-netdev-private-dpif.c

diff --git a/acinclude.m4 b/acinclude.m4
index 1460289ca..f39c26dab 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -30,6 +30,22 @@ AC_DEFUN([OVS_CHECK_DPCLS_AUTOVALIDATOR], [
   fi
 ])
 
+dnl Set OVS DPIF default implementation at configure time for running the unit
+dnl tests on the whole codebase without modifying tests per DPIF impl
+AC_DEFUN([OVS_CHECK_DPIF_AVX512_DEFAULT], [
+  AC_ARG_ENABLE([dpif-default-avx512],
+[AC_HELP_STRING([--enable-dpif-default-avx512], [Enable DPIF 
AVX512 implementation as default.])],
+[dpifavx512=yes],[dpifavx512=no])
+  AC_MSG_CHECKING([whether DPIF AVX512 is default implementation])
+  if test "$dpifavx512" != yes; then
+AC_MSG_RESULT([no])
+  else
+OVS_CFLAGS="$OVS_CFLAGS -DDPIF_AVX512_DEFAULT"
+AC_MSG_RESULT([yes])
+  fi
+])
+
+
 dnl OVS_ENABLE_WERROR
 AC_DEFUN([OVS_ENABLE_WERROR],
   [AC_ARG_ENABLE(
diff --git a/configure.ac b/configure.ac
index 8d37af9db..8ab032277 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,6 +184,7 @@ OVS_ENABLE_WERROR
 OVS_ENABLE_SPARSE
 OVS_CTAGS_IDENTIFIERS
 OVS_CHECK_DPCLS_AUTOVALIDATOR
+OVS_CHECK_DPIF_AVX512_DEFAULT
 OVS_CHECK_BINUTILS_AVX512
 
 AC_ARG_VAR(KARCH, [Kernel Architecture String])
diff --git a/lib/automake.mk b/lib/automake.mk
index 650207940..2a41f7ab5 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -115,6 +115,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev.h \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-dpif.c \
lib/dpif-netdev-private-dpif.h \
lib/dpif-netdev-private-flow.h \
lib/dpif-netdev-private-hwol.h \
diff --git a/lib/dpif-netdev-avx512.c b/lib/dpif-netdev-avx512.c
index 552b50952..7612a5328 100644
--- a/lib/dpif-netdev-avx512.c
+++ b/lib/dpif-netdev-avx512.c
@@ -44,6 +44,18 @@ struct pkt_flow_meta {
 uint16_t tcp_flags;
 };
 
+int32_t
+dp_netdev_input_outer_avx512_probe(void)
+{
+int avx512f_available = dpdk_get_cpu_has_isa("x86_64", "avx512f");
+int bmi2_available = dpdk_get_cpu_has_isa("x86_64", "bmi2");
+printf("here: avx512f %d, bmi2 %d\n", avx512f_available, bmi2_available);
+if (!avx512f_available || !bmi2_available) {
+return 0;
+}
+return 1;
+}
+
 int32_t
 dp_netdev_input_outer_avx512(struct dp_netdev_pmd_thread *pmd,
  struct dp_packet_batch *packets,
diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
new file mode 100644
index 0..74c20ce8e
--- /dev/null
+++ b/lib/dpif-netdev-private-dpif.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2020 Intel Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include 
+#include 

[ovs-dev] [PATCH v2 10/11] dpif-netdev/dpcls: refactor function names to dpcls

2020-10-30 Thread Harry van Haaren
This commit refactors the function names from netdev_*
namespace to the dpcls_* namespace, as they are only used
by dpcls code. With the name change, it becomes more obvious
that the functions belong to dpcls functionality, and in the
dpif-netdev-private-dpcls.h header file.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private-dpcls.h |  6 ++
 lib/dpif-netdev.c   | 21 ++---
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/lib/dpif-netdev-private-dpcls.h b/lib/dpif-netdev-private-dpcls.h
index 5bc579bba..e66cae3f4 100644
--- a/lib/dpif-netdev-private-dpcls.h
+++ b/lib/dpif-netdev-private-dpcls.h
@@ -97,10 +97,8 @@ struct dpcls_subtable {
 
 /* Generates a mask for each bit set in the subtable's miniflow. */
 void
-netdev_flow_key_gen_masks(const struct netdev_flow_key *tbl,
-  uint64_t *mf_masks,
-  const uint32_t mf_bits_u0,
-  const uint32_t mf_bits_u1);
+dpcls_flow_key_gen_masks(const struct netdev_flow_key *tbl, uint64_t *mf_masks,
+ const uint32_t mf_bits_u0, const uint32_t mf_bits_u1);
 
 /* Matches a dpcls rule against the incoming packet in 'target' */
 bool dpcls_rule_matches_key(const struct dpcls_rule *rule,
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 6f2bd304e..2ca792018 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -8282,7 +8282,7 @@ dpcls_create_subtable(struct dpcls *cls, const struct 
netdev_flow_key *mask)
 subtable->mf_bits_set_unit0 = unit0;
 subtable->mf_bits_set_unit1 = unit1;
 subtable->mf_masks = xmalloc(sizeof(uint64_t) * (unit0 + unit1));
-netdev_flow_key_gen_masks(mask, subtable->mf_masks, unit0, unit1);
+dpcls_flow_key_gen_masks(mask, subtable->mf_masks, unit0, unit1);
 
 /* Get the preferred subtable search function for this (u0,u1) subtable.
  * The function is guaranteed to always return a valid implementation, and
@@ -8381,11 +8381,10 @@ dpcls_remove(struct dpcls *cls, struct dpcls_rule *rule)
 }
 }
 
-/* Inner loop for mask generation of a unit, see netdev_flow_key_gen_masks. */
+/* Inner loop for mask generation of a unit, see dpcls_flow_key_gen_masks. */
 static inline void
-netdev_flow_key_gen_mask_unit(uint64_t iter,
-  const uint64_t count,
-  uint64_t *mf_masks)
+dpcls_flow_key_gen_mask_unit(uint64_t iter, const uint64_t count,
+ uint64_t *mf_masks)
 {
 int i;
 for (i = 0; i < count; i++) {
@@ -8406,16 +8405,16 @@ netdev_flow_key_gen_mask_unit(uint64_t iter,
  * @param mf_bits_unit0 Number of bits set in unit0 of the miniflow
  */
 void
-netdev_flow_key_gen_masks(const struct netdev_flow_key *tbl,
-  uint64_t *mf_masks,
-  const uint32_t mf_bits_u0,
-  const uint32_t mf_bits_u1)
+dpcls_flow_key_gen_masks(const struct netdev_flow_key *tbl,
+ uint64_t *mf_masks,
+ const uint32_t mf_bits_u0,
+ const uint32_t mf_bits_u1)
 {
 uint64_t iter_u0 = tbl->mf.map.bits[0];
 uint64_t iter_u1 = tbl->mf.map.bits[1];
 
-netdev_flow_key_gen_mask_unit(iter_u0, mf_bits_u0, _masks[0]);
-netdev_flow_key_gen_mask_unit(iter_u1, mf_bits_u1, _masks[mf_bits_u0]);
+dpcls_flow_key_gen_mask_unit(iter_u0, mf_bits_u0, _masks[0]);
+dpcls_flow_key_gen_mask_unit(iter_u1, mf_bits_u1, _masks[mf_bits_u0]);
 }
 
 /* Returns true if 'target' satisfies 'key' in 'mask', that is, if each 1-bit
-- 
2.25.1

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


[ovs-dev] [PATCH v2 04/11] dpif-netdev: move netdev flow struct to header

2020-10-30 Thread Harry van Haaren
This commit moves the dp_netdev_flow struct from dpif-netdev.c
to the dpif-netdev-private.h file. No code changes are made.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private.h | 96 +++
 lib/dpif-netdev.c | 94 --
 2 files changed, 96 insertions(+), 94 deletions(-)

diff --git a/lib/dpif-netdev-private.h b/lib/dpif-netdev-private.h
index 4fda1220b..848637c9c 100644
--- a/lib/dpif-netdev-private.h
+++ b/lib/dpif-netdev-private.h
@@ -105,6 +105,102 @@ netdev_flow_key_gen_masks(const struct netdev_flow_key 
*tbl,
 bool dpcls_rule_matches_key(const struct dpcls_rule *rule,
 const struct netdev_flow_key *target);
 
+
+
+/* Contained by struct dp_netdev_flow's 'stats' member.  */
+struct dp_netdev_flow_stats {
+atomic_llong used; /* Last used time, in monotonic msecs. */
+atomic_ullong packet_count;/* Number of packets matched. */
+atomic_ullong byte_count;  /* Number of bytes matched. */
+atomic_uint16_t tcp_flags; /* Bitwise-OR of seen tcp_flags values. */
+};
+
+/* Contained by struct dp_netdev_flow's 'last_attrs' member.  */
+struct dp_netdev_flow_attrs {
+atomic_bool offloaded; /* True if flow is offloaded to HW. */
+ATOMIC(const char *) dp_layer; /* DP layer the flow is handled in. */
+};
+
+/* A flow in 'dp_netdev_pmd_thread's 'flow_table'.
+ *
+ *
+ * Thread-safety
+ * =
+ *
+ * Except near the beginning or ending of its lifespan, rule 'rule' belongs to
+ * its pmd thread's classifier.  The text below calls this classifier 'cls'.
+ *
+ * Motivation
+ * --
+ *
+ * The thread safety rules described here for "struct dp_netdev_flow" are
+ * motivated by two goals:
+ *
+ *- Prevent threads that read members of "struct dp_netdev_flow" from
+ *  reading bad data due to changes by some thread concurrently modifying
+ *  those members.
+ *
+ *- Prevent two threads making changes to members of a given "struct
+ *  dp_netdev_flow" from interfering with each other.
+ *
+ *
+ * Rules
+ * -
+ *
+ * A flow 'flow' may be accessed without a risk of being freed during an RCU
+ * grace period.  Code that needs to hold onto a flow for a while
+ * should try incrementing 'flow->ref_cnt' with dp_netdev_flow_ref().
+ *
+ * 'flow->ref_cnt' protects 'flow' from being freed.  It doesn't protect the
+ * flow from being deleted from 'cls' and it doesn't protect members of 'flow'
+ * from modification.
+ *
+ * Some members, marked 'const', are immutable.  Accessing other members
+ * requires synchronization, as noted in more detail below.
+ */
+struct dp_netdev_flow {
+const struct flow flow;  /* Unmasked flow that created this entry. */
+/* Hash table index by unmasked flow. */
+const struct cmap_node node; /* In owning dp_netdev_pmd_thread's */
+ /* 'flow_table'. */
+const struct cmap_node mark_node; /* In owning flow_mark's mark_to_flow */
+const ovs_u128 ufid; /* Unique flow identifier. */
+const ovs_u128 mega_ufid;/* Unique mega flow identifier. */
+const unsigned pmd_id;   /* The 'core_id' of pmd thread owning this */
+ /* flow. */
+
+/* Number of references.
+ * The classifier owns one reference.
+ * Any thread trying to keep a rule from being freed should hold its own
+ * reference. */
+struct ovs_refcount ref_cnt;
+
+bool dead;
+uint32_t mark;   /* Unique flow mark assigned to a flow */
+
+/* Statistics. */
+struct dp_netdev_flow_stats stats;
+
+/* Statistics and attributes received from the netdev offload provider. */
+atomic_int netdev_flow_get_result;
+struct dp_netdev_flow_stats last_stats;
+struct dp_netdev_flow_attrs last_attrs;
+
+/* Actions. */
+OVSRCU_TYPE(struct dp_netdev_actions *) actions;
+
+/* While processing a group of input packets, the datapath uses the next
+ * member to store a pointer to the output batch for the flow.  It is
+ * reset after the batch has been sent out (See dp_netdev_queue_batches(),
+ * packet_batch_per_flow_init() and packet_batch_per_flow_execute()). */
+struct packet_batch_per_flow *batch;
+
+/* Packet classification. */
+char *dp_extra_info; /* String to return in a flow dump/get. */
+struct dpcls_rule cr;/* In owning dp_netdev's 'cls'. */
+/* 'cr' must be the last member. */
+};
+
 #ifdef  __cplusplus
 }
 #endif
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 0d003..5fc877359 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -484,100 +484,6 @@ struct dp_netdev_port {
 char *rxq_affinity_list;/* Requested affinity of rx queues. */
 };
 
-/* Contained by struct dp_netdev_flow's 'stats' member.  */
-struct dp_netdev_flow_stats {
-atomic_llong used; /* Last used time, in monotonic msecs. */
-  

[ovs-dev] [PATCH v2 05/11] dpif-netdev: refactor to multiple header files

2020-10-30 Thread Harry van Haaren
Split the very large file dpif-netdev.c and the datastructures
it contains into multiple header files. Each header file is
responsible for the datastructures of that component.

This logical split allows better reuse and modularity of the code,
and reduces the very large file dpif-netdev.c to be more managable.

Due to dependencies between components, it is not possible to
move component in smaller granularities than this patch.

Signed-off-by: Harry van Haaren 

---

To explain the dependencies better, eg:

DPCLS has no deps (from dpif-netdev.c file)
FLOW depends on DPCLS (struct dpcls_rule)
DFC depends on DPCLS (netdev_flow_key) and FLOW (netdev_flow_key)
THREAD depends on DFC (struct dfc_cache)

DFC_PROC depends on THREAD (struct pmd_thread)

DPCLS lookup.h/c require only DPCLS
DPCLS implementations require only dpif-netdev-lookup.h.
- This change was made in 2.12 release with function pointers
- This commit only refactors the name to "private-dpcls.h"

v2:
- fix copyright header typos
- fix compliation issues around static/inline when moved to header file
---
 lib/automake.mk|   4 +
 lib/dpif-netdev-lookup-autovalidator.c |   1 -
 lib/dpif-netdev-lookup-avx512-gather.c |   1 -
 lib/dpif-netdev-lookup-generic.c   |   1 -
 lib/dpif-netdev-lookup.h   |   2 +-
 lib/dpif-netdev-private-dfc.h  | 244 +++
 lib/dpif-netdev-private-dpcls.h| 113 +++
 lib/dpif-netdev-private-flow.h | 154 ++
 lib/dpif-netdev-private-thread.h   | 206 +
 lib/dpif-netdev-private.h  | 196 +---
 lib/dpif-netdev.c  | 401 +
 11 files changed, 736 insertions(+), 587 deletions(-)
 create mode 100644 lib/dpif-netdev-private-dfc.h
 create mode 100644 lib/dpif-netdev-private-dpcls.h
 create mode 100644 lib/dpif-netdev-private-flow.h
 create mode 100644 lib/dpif-netdev-private-thread.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 380a67228..22a281fcc 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -111,6 +111,10 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev-lookup-generic.c \
lib/dpif-netdev.c \
lib/dpif-netdev.h \
+   lib/dpif-netdev-private-dfc.h \
+   lib/dpif-netdev-private-dpcls.h \
+   lib/dpif-netdev-private-flow.h \
+   lib/dpif-netdev-private-thread.h \
lib/dpif-netdev-private.h \
lib/dpif-netdev-perf.c \
lib/dpif-netdev-perf.h \
diff --git a/lib/dpif-netdev-lookup-autovalidator.c 
b/lib/dpif-netdev-lookup-autovalidator.c
index 97b59fdd0..475e1ab1e 100644
--- a/lib/dpif-netdev-lookup-autovalidator.c
+++ b/lib/dpif-netdev-lookup-autovalidator.c
@@ -17,7 +17,6 @@
 #include 
 #include "dpif-netdev.h"
 #include "dpif-netdev-lookup.h"
-#include "dpif-netdev-private.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(dpif_lookup_autovalidator);
diff --git a/lib/dpif-netdev-lookup-avx512-gather.c 
b/lib/dpif-netdev-lookup-avx512-gather.c
index 5e3634249..8fc1cdfa5 100644
--- a/lib/dpif-netdev-lookup-avx512-gather.c
+++ b/lib/dpif-netdev-lookup-avx512-gather.c
@@ -21,7 +21,6 @@
 
 #include "dpif-netdev.h"
 #include "dpif-netdev-lookup.h"
-#include "dpif-netdev-private.h"
 #include "cmap.h"
 #include "flow.h"
 #include "pvector.h"
diff --git a/lib/dpif-netdev-lookup-generic.c b/lib/dpif-netdev-lookup-generic.c
index b1a0cfc36..e3b6be4b6 100644
--- a/lib/dpif-netdev-lookup-generic.c
+++ b/lib/dpif-netdev-lookup-generic.c
@@ -17,7 +17,6 @@
 
 #include 
 #include "dpif-netdev.h"
-#include "dpif-netdev-private.h"
 #include "dpif-netdev-lookup.h"
 
 #include "bitmap.h"
diff --git a/lib/dpif-netdev-lookup.h b/lib/dpif-netdev-lookup.h
index bd72aa29b..59f51faa0 100644
--- a/lib/dpif-netdev-lookup.h
+++ b/lib/dpif-netdev-lookup.h
@@ -19,7 +19,7 @@
 
 #include 
 #include "dpif-netdev.h"
-#include "dpif-netdev-private.h"
+#include "dpif-netdev-private-dpcls.h"
 
 /* Function to perform a probe for the subtable bit fingerprint.
  * Returns NULL if not valid, or a valid function pointer to call for this
diff --git a/lib/dpif-netdev-private-dfc.h b/lib/dpif-netdev-private-dfc.h
new file mode 100644
index 0..8f6a4899e
--- /dev/null
+++ b/lib/dpif-netdev-private-dfc.h
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
+ * Copyright (c) 2019, 2020 Intel Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef 

[ovs-dev] [PATCH v2 03/11] dpif-netdev: move pmd_try_optimize function in file

2020-10-30 Thread Harry van Haaren
This commit moves the pmd_try_optimize function to a more
appropriate location in the file - currently it sits in the
DPCLS section, which is not its correct home.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev.c | 146 +++---
 1 file changed, 73 insertions(+), 73 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index fa72e8f7c..0d003 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -6064,6 +6064,79 @@ reload:
 return NULL;
 }
 
+static inline void
+dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd,
+   struct polled_queue *poll_list, int poll_cnt)
+{
+struct dpcls *cls;
+uint64_t tot_idle = 0, tot_proc = 0;
+unsigned int pmd_load = 0;
+
+if (pmd->ctx.now > pmd->rxq_next_cycle_store) {
+uint64_t curr_tsc;
+struct pmd_auto_lb *pmd_alb = >dp->pmd_alb;
+if (pmd_alb->is_enabled && !pmd->isolated
+&& (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] >=
+   pmd->prev_stats[PMD_CYCLES_ITER_IDLE])
+&& (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_BUSY] >=
+pmd->prev_stats[PMD_CYCLES_ITER_BUSY]))
+{
+tot_idle = pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] -
+   pmd->prev_stats[PMD_CYCLES_ITER_IDLE];
+tot_proc = pmd->perf_stats.counters.n[PMD_CYCLES_ITER_BUSY] -
+   pmd->prev_stats[PMD_CYCLES_ITER_BUSY];
+
+if (tot_proc) {
+pmd_load = ((tot_proc * 100) / (tot_idle + tot_proc));
+}
+
+if (pmd_load >= ALB_PMD_LOAD_THRESHOLD) {
+atomic_count_inc(>pmd_overloaded);
+} else {
+atomic_count_set(>pmd_overloaded, 0);
+}
+}
+
+pmd->prev_stats[PMD_CYCLES_ITER_IDLE] =
+pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE];
+pmd->prev_stats[PMD_CYCLES_ITER_BUSY] =
+pmd->perf_stats.counters.n[PMD_CYCLES_ITER_BUSY];
+
+/* Get the cycles that were used to process each queue and store. */
+for (unsigned i = 0; i < poll_cnt; i++) {
+uint64_t rxq_cyc_curr = dp_netdev_rxq_get_cycles(poll_list[i].rxq,
+RXQ_CYCLES_PROC_CURR);
+dp_netdev_rxq_set_intrvl_cycles(poll_list[i].rxq, rxq_cyc_curr);
+dp_netdev_rxq_set_cycles(poll_list[i].rxq, RXQ_CYCLES_PROC_CURR,
+ 0);
+}
+curr_tsc = cycles_counter_update(>perf_stats);
+if (pmd->intrvl_tsc_prev) {
+/* There is a prev timestamp, store a new intrvl cycle count. */
+atomic_store_relaxed(>intrvl_cycles,
+ curr_tsc - pmd->intrvl_tsc_prev);
+}
+pmd->intrvl_tsc_prev = curr_tsc;
+/* Start new measuring interval */
+pmd->rxq_next_cycle_store = pmd->ctx.now + PMD_RXQ_INTERVAL_LEN;
+}
+
+if (pmd->ctx.now > pmd->next_optimization) {
+/* Try to obtain the flow lock to block out revalidator threads.
+ * If not possible, just try next time. */
+if (!ovs_mutex_trylock(>flow_mutex)) {
+/* Optimize each classifier */
+CMAP_FOR_EACH (cls, node, >classifiers) {
+dpcls_sort_subtable_vector(cls);
+}
+ovs_mutex_unlock(>flow_mutex);
+/* Start new measuring interval */
+pmd->next_optimization = pmd->ctx.now
+ + DPCLS_OPTIMIZATION_INTERVAL;
+}
+}
+}
+
 static void
 dp_netdev_disable_upcall(struct dp_netdev *dp)
 OVS_ACQUIRES(dp->upcall_rwlock)
@@ -8712,79 +8785,6 @@ dpcls_sort_subtable_vector(struct dpcls *cls)
 pvector_publish(pvec);
 }
 
-static inline void
-dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd,
-   struct polled_queue *poll_list, int poll_cnt)
-{
-struct dpcls *cls;
-uint64_t tot_idle = 0, tot_proc = 0;
-unsigned int pmd_load = 0;
-
-if (pmd->ctx.now > pmd->rxq_next_cycle_store) {
-uint64_t curr_tsc;
-struct pmd_auto_lb *pmd_alb = >dp->pmd_alb;
-if (pmd_alb->is_enabled && !pmd->isolated
-&& (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] >=
-   pmd->prev_stats[PMD_CYCLES_ITER_IDLE])
-&& (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_BUSY] >=
-pmd->prev_stats[PMD_CYCLES_ITER_BUSY]))
-{
-tot_idle = pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] -
-   pmd->prev_stats[PMD_CYCLES_ITER_IDLE];
-tot_proc = pmd->perf_stats.counters.n[PMD_CYCLES_ITER_BUSY] -
-   pmd->prev_stats[PMD_CYCLES_ITER_BUSY];
-
-if (tot_proc) {
-

[ovs-dev] [PATCH v2 00/11] DPIF Function Pointer Refactor + AVX512 impl

2020-10-30 Thread Harry van Haaren
v2 updates:
- Includes DPIF command switching at runtime
- Includes AVX512 DPIF implementation
- Includes some partially related changes (can be split out of set?)
--- netdev output action optimization
--- avx512 dpcls 16-block support optimization

Hi OVS Community,

This patchset is a v2 for making the DPIF component of
the userspace datapath more flexible. The same approach as has
been previously used for DPCLS is used here, where a function
pointer allows selection of an implementation at runtime.

The flexibility from the above changes enables ISA optimized
implementations of the DPIF component of the datapath. As these
ISA optimized implementations also require access to EMC/SMC/HWOL
features, these have been split out to seperate header files.

The file splitting also improves maintainability, as dpif_netdev.c
has ~9000 LOC, and very hard to modify due to many structs defined
locally in the .c file, ruling out re-usability in other .c files.

Questions welcomed! Regards, -Harry


Harry van Haaren (11):
  dpif-netdev: optimize dp output action
  dpdk: cache result of CPU ISA checks
  dpif-netdev: move pmd_try_optimize function in file
  dpif-netdev: move netdev flow struct to header
  dpif-netdev: refactor to multiple header files
  dpif-netdev: split hwol out to own header file
  dpif-netdev: add function pointer for netdev input
  dpif-avx512: add ISA implementation of dpif
  dpif-netdev: add command to switch dpif implementation
  dpif-netdev/dpcls: refactor function names to dpcls
  dpif-netdev/dpcls-avx512: enable 16 miniflow block processing

 acinclude.m4   |  16 +
 configure.ac   |   1 +
 lib/automake.mk|  11 +-
 lib/dpdk.c |  24 +-
 lib/dpif-netdev-avx512.c   | 199 ++
 lib/dpif-netdev-lookup-autovalidator.c |   1 -
 lib/dpif-netdev-lookup-avx512-gather.c | 225 +--
 lib/dpif-netdev-lookup-generic.c   |   1 -
 lib/dpif-netdev-lookup.h   |   2 +-
 lib/dpif-netdev-private-dfc.h  | 244 +++
 lib/dpif-netdev-private-dpcls.h| 127 
 lib/dpif-netdev-private-dpif.c | 103 +++
 lib/dpif-netdev-private-dpif.h |  61 ++
 lib/dpif-netdev-private-flow.h | 154 +
 lib/dpif-netdev-private-hwol.h |  63 ++
 lib/dpif-netdev-private-thread.h   | 214 ++
 lib/dpif-netdev-private.h  | 123 +---
 lib/dpif-netdev.c  | 872 +++--
 18 files changed, 1643 insertions(+), 798 deletions(-)
 create mode 100644 lib/dpif-netdev-avx512.c
 create mode 100644 lib/dpif-netdev-private-dfc.h
 create mode 100644 lib/dpif-netdev-private-dpcls.h
 create mode 100644 lib/dpif-netdev-private-dpif.c
 create mode 100644 lib/dpif-netdev-private-dpif.h
 create mode 100644 lib/dpif-netdev-private-flow.h
 create mode 100644 lib/dpif-netdev-private-hwol.h
 create mode 100644 lib/dpif-netdev-private-thread.h

-- 
2.25.1

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


[ovs-dev] [PATCH v2 07/11] dpif-netdev: add function pointer for netdev input

2020-10-30 Thread Harry van Haaren
This commit adds a function pointer to the pmd thread data structure,
giving the pmd thread flexibility in its dpif-input function choice.
This allows choosing of the implementation based on ISA capabilities
of the runtime CPU, leading to optimizations and higher performance.

Signed-off-by: Harry van Haaren 
---
 lib/dpif-netdev-private-thread.h | 10 ++
 lib/dpif-netdev.c|  7 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netdev-private-thread.h b/lib/dpif-netdev-private-thread.h
index a5b3ae360..44267afe4 100644
--- a/lib/dpif-netdev-private-thread.h
+++ b/lib/dpif-netdev-private-thread.h
@@ -47,6 +47,13 @@ struct dp_netdev_pmd_thread_ctx {
 uint32_t emc_insert_min;
 };
 
+/* Foward declaration for typedef */
+struct dp_netdev_pmd_thread;
+
+typedef void (*dp_netdev_input_func)(struct dp_netdev_pmd_thread *pmd,
+ struct dp_packet_batch *packets,
+ odp_port_t port_no);
+
 /* PMD: Poll modes drivers.  PMD accesses devices via polling to eliminate
  * the performance overhead of interrupt processing.  Therefore netdev can
  * not implement rx-wait for these devices.  dpif-netdev needs to poll
@@ -101,6 +108,9 @@ struct dp_netdev_pmd_thread {
 /* Current context of the PMD thread. */
 struct dp_netdev_pmd_thread_ctx ctx;
 
+/* Function pointer to call for dp_netdev_input() functionality */
+dp_netdev_input_func netdev_input_func;
+
 struct seq *reload_seq;
 uint64_t last_reload_seq;
 
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 4e1debf54..1173aa60b 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4185,8 +4185,9 @@ dp_netdev_process_rxq_port(struct dp_netdev_pmd_thread 
*pmd,
 }
 }
 }
+
 /* Process packet batch. */
-dp_netdev_input(pmd, , port_no);
+pmd->netdev_input_func(pmd, , port_no);
 
 /* Assign processing cycles to rx queue. */
 cycles = cycle_timer_stop(>perf_stats, );
@@ -6043,6 +6044,10 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread 
*pmd, struct dp_netdev *dp,
 hmap_init(>tnl_port_cache);
 hmap_init(>send_port_cache);
 cmap_init(>tx_bonds);
+
+/* Initialize the DPIF function pointer to the default scalar version */
+pmd->netdev_input_func = dp_netdev_input;
+
 /* init the 'flow_cache' since there is no
  * actual thread created for NON_PMD_CORE_ID. */
 if (core_id == NON_PMD_CORE_ID) {
-- 
2.25.1

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


[ovs-dev] [PATCH v2 06/11] dpif-netdev: split hwol out to own header file

2020-10-30 Thread Harry van Haaren
This commit moves the datapath lookup functions required for
hardware offload to a seperate file. This allows other DPIF
implementations to access the lookup functions, encouraging
code reuse.

Signed-off-by: Harry van Haaren 

---

v2: Fixed copyright header
---
 lib/automake.mk|  1 +
 lib/dpif-netdev-private-hwol.h | 63 ++
 lib/dpif-netdev.c  | 39 ++---
 3 files changed, 67 insertions(+), 36 deletions(-)
 create mode 100644 lib/dpif-netdev-private-hwol.h

diff --git a/lib/automake.mk b/lib/automake.mk
index 22a281fcc..eccfaf3e3 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -114,6 +114,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/dpif-netdev-private-dfc.h \
lib/dpif-netdev-private-dpcls.h \
lib/dpif-netdev-private-flow.h \
+   lib/dpif-netdev-private-hwol.h \
lib/dpif-netdev-private-thread.h \
lib/dpif-netdev-private.h \
lib/dpif-netdev-perf.c \
diff --git a/lib/dpif-netdev-private-hwol.h b/lib/dpif-netdev-private-hwol.h
new file mode 100644
index 0..447010ab8
--- /dev/null
+++ b/lib/dpif-netdev-private-hwol.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
+ * Copyright (c) 2020 Intel Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DPIF_NETDEV_PRIVATE_HWOL_H
+#define DPIF_NETDEV_PRIVATE_HWOL_H 1
+
+#include "dpif-netdev-private-flow.h"
+
+#define MAX_FLOW_MARK   (UINT32_MAX - 1)
+#define INVALID_FLOW_MARK   0
+/* Zero flow mark is used to indicate the HW to remove the mark. A packet
+ * marked with zero mark is received in SW without a mark at all, so it
+ * cannot be used as a valid mark.
+ */
+
+struct megaflow_to_mark_data {
+const struct cmap_node node;
+ovs_u128 mega_ufid;
+uint32_t mark;
+};
+
+struct flow_mark {
+struct cmap megaflow_to_mark;
+struct cmap mark_to_flow;
+struct id_pool *pool;
+};
+
+/* allocated in dpif-netdev.c */
+extern struct flow_mark flow_mark;
+
+static inline struct dp_netdev_flow *
+mark_to_flow_find(const struct dp_netdev_pmd_thread *pmd,
+  const uint32_t mark)
+{
+struct dp_netdev_flow *flow;
+
+CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),
+ _mark.mark_to_flow) {
+if (flow->mark == mark && flow->pmd_id == pmd->core_id &&
+flow->dead == false) {
+return flow;
+}
+}
+
+return NULL;
+}
+
+
+#endif /* dpif-netdev-private-hwol.h */
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index e682ed4b4..4e1debf54 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -84,6 +84,8 @@
 #include "util.h"
 #include "uuid.h"
 
+#include "dpif-netdev-private-hwol.h"
+
 VLOG_DEFINE_THIS_MODULE(dpif_netdev);
 
 /* Auto Load Balancing Defaults */
@@ -1949,26 +1951,8 @@ dp_netdev_pmd_find_dpcls(struct dp_netdev_pmd_thread 
*pmd,
 return cls;
 }
 
-#define MAX_FLOW_MARK   (UINT32_MAX - 1)
-#define INVALID_FLOW_MARK   0
-/* Zero flow mark is used to indicate the HW to remove the mark. A packet
- * marked with zero mark is received in SW without a mark at all, so it
- * cannot be used as a valid mark.
- */
-
-struct megaflow_to_mark_data {
-const struct cmap_node node;
-ovs_u128 mega_ufid;
-uint32_t mark;
-};
-
-struct flow_mark {
-struct cmap megaflow_to_mark;
-struct cmap mark_to_flow;
-struct id_pool *pool;
-};
 
-static struct flow_mark flow_mark = {
+struct flow_mark flow_mark = {
 .megaflow_to_mark = CMAP_INITIALIZER,
 .mark_to_flow = CMAP_INITIALIZER,
 };
@@ -2137,23 +2121,6 @@ flow_mark_flush(struct dp_netdev_pmd_thread *pmd)
 }
 }
 
-static struct dp_netdev_flow *
-mark_to_flow_find(const struct dp_netdev_pmd_thread *pmd,
-  const uint32_t mark)
-{
-struct dp_netdev_flow *flow;
-
-CMAP_FOR_EACH_WITH_HASH (flow, mark_node, hash_int(mark, 0),
- _mark.mark_to_flow) {
-if (flow->mark == mark && flow->pmd_id == pmd->core_id &&
-flow->dead == false) {
-return flow;
-}
-}
-
-return NULL;
-}
-
 static struct dp_flow_offload_item *
 dp_netdev_alloc_flow_offload(struct dp_netdev_pmd_thread *pmd,
  struct dp_netdev_flow *flow,
-- 
2.25.1

___
dev mailing list
d...@openvswitch.org

[ovs-dev] [PATCH v2 02/11] dpdk: cache result of CPU ISA checks

2020-10-30 Thread Harry van Haaren
As a small optimization, this patch caches the result of a CPU ISA
check from DPDK. Particularly in the case of running the DPCLS
autovalidator (which repeatedly probes subtables) this reduces
the amount of CPU ISA lookups from the DPDK level.

By caching them at the OVS/dpdk.c level, the ISA checks remain
runtime for the CPU where they are executed, but subsequent checks
for the same ISA feature become much cheaper.

Signed-off-by: Harry van Haaren 

---

In theory it is also possible to do the caching of the supported
ISA at the usage site (aka, the DPCLS subtable search implementation)
however that would cause a lot of code-duplication. By caching in
the lower level, we get almost all the benefit with no code duplication.
---
 lib/dpdk.c | 24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/lib/dpdk.c b/lib/dpdk.c
index 2f235a742..02629f44f 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -614,13 +614,29 @@ print_dpdk_version(void)
 puts(rte_version());
 }
 
+/* Avoid calling rte_cpu_get_flag_enabled() excessively, by caching the
+ * result of the call for each CPU flag in a static variable. To avoid
+ * allocating large numbers of static variables, use a uint8 as a bitfield.
+ * Note the macro must only return if the ISA check done and is available.
+ */
+#define ISA_CHECK_DONE_BIT (1 << 0)
+#define ISA_AVAILABLE_BIT  (1 << 1)
+
 #define CHECK_CPU_FEATURE(feature, name_str, RTE_CPUFLAG)   \
 do {\
 if (strncmp(feature, name_str, strlen(name_str)) == 0) {\
-int has_isa = rte_cpu_get_flag_enabled(RTE_CPUFLAG);\
-VLOG_DBG("CPU flag %s, available %s\n", name_str,   \
-  has_isa ? "yes" : "no");  \
-return true;\
+static uint8_t isa_check_##RTE_CPUFLAG; \
+int check = isa_check_##RTE_CPUFLAG & ISA_CHECK_DONE_BIT;   \
+if (OVS_UNLIKELY(!check)) { \
+int has_isa = rte_cpu_get_flag_enabled(RTE_CPUFLAG);\
+VLOG_DBG("CPU flag %s, available %s\n", \
+ name_str, has_isa ? "yes" : "no"); \
+isa_check_##RTE_CPUFLAG = ISA_CHECK_DONE_BIT;   \
+if (has_isa)\
+isa_check_##RTE_CPUFLAG |= ISA_AVAILABLE_BIT;   \
+}   \
+if (isa_check_##RTE_CPUFLAG & ISA_AVAILABLE_BIT)\
+return true;\
 }   \
 } while (0)
 
-- 
2.25.1

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


[ovs-dev] [PATCH v2 01/11] dpif-netdev: optimize dp output action

2020-10-30 Thread Harry van Haaren
This commit optimizes the output action, by enabling the compiler to
optimize the code better through reducing code complexity.

The core concept of this optimization is that the array-length checks
have already been performed above the copying code, so can be removed.
Removing of the per-packet length checks allows the compiler to auto-vectorize
the stores using SIMD registers.

Signed-off-by: Harry van Haaren 

---

Overall performance increase was about 2.5% in simple phy-to-phy testing.
There are likely other places in OVS where this technique can be applied.
---
 lib/dpif-netdev.c | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 300861ca5..fa72e8f7c 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -7606,12 +7606,25 @@ dp_execute_output_action(struct dp_netdev_pmd_thread 
*pmd,
 pmd->n_output_batches++;
 }
 
-struct dp_packet *packet;
-DP_PACKET_BATCH_FOR_EACH (i, packet, packets_) {
-p->output_pkts_rxqs[dp_packet_batch_size(>output_pkts)] =
-pmd->ctx.last_rxq;
-dp_packet_batch_add(>output_pkts, packet);
+/* The above checks ensure that there is enough space in the output batch.
+ * Using dp_packet_batch_add() has a branch to check if the batch is full.
+ * This branch reduces the compilers ability to optimize efficiently. The
+ * below code implements packet movement between batches without checks,
+ * with the required semantics of output batch perhaps contiaining packets.
+ */
+int batch_size = dp_packet_batch_size(packets_);
+int out_batch_idx = dp_packet_batch_size(>output_pkts);
+struct dp_netdev_rxq *rxq = pmd->ctx.last_rxq;
+struct dp_packet_batch *output_batch = >output_pkts;
+
+for (int i = 0; i < batch_size; i++) {
+struct dp_packet *packet = packets_->packets[i];
+p->output_pkts_rxqs[out_batch_idx] = rxq;
+output_batch->packets[out_batch_idx] = packet;
+out_batch_idx++;
 }
+output_batch->count += batch_size;
+
 return true;
 }
 
-- 
2.25.1

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


[ovs-dev] Excel intermedio - Validación de datos y fórmulas

2020-10-30 Thread Últimos 3 Lugares
Me da mucho gusto saludarte.
 
Es, para mí, un placer poder invitarte a nuestro Curso en Línea "Excel 
Intermedio", que se estará
llevando a cabo los días 7, 14 y 21 de Noviembre con un horario de 10:00 a 
14:00 hrs.(hora del centro de México), con
un total de 12 hrs.
 
Con este curso de Excel Intermedio puedes aprender a construir fórmulas 
utilizando de base las diferentes categorías de funciones 
y herramientas de validación de datos y fórmulas que ofrece Excel combinándolas 
con el uso de gráficos.

Temario:
 
- Fórmulas.
- Auditoría de Fórmulas.
- Organizando Datos.
- Gráficas
 
Para mayor información, responder sobre este correo con la palabra Excel + los 
siguientes datos:

NOMBRE:
TELÉFONO:
EMPRESA:
CORREO ALTERNO: 

Para información inmediata llamar al:
(+52) 55 15 54 66 30 - (+52) 55 30 16 70 85
O puede enviarnos un mensaje vía whatsapp 

Innova Learn México - innovalearn. mx - Mérida, Yucatán, México


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


[ovs-dev] Americans are Rushing to get this Certification to Carry before the laws change... Get Yours Now!

2020-10-30 Thread Certifiedccw Offer
Having trouble viewing this email? Please follow this link to see the messaged 
emailed to you. 

Product Image

Product Image

Product Image

Product Image






(Unsubscribe Instructions Here)
(Unsubscribe Instructions Here)

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


[ovs-dev] Question about supporting the OVS out-of-tree kernel drivers

2020-10-30 Thread Gregory Rose



The question is whether there is any interest in continuing to support
the OVS out-of-tree (OOT) kernel driver or should we deprecate it?  The
latest kernel support for the OOT driver is up to 5.8.x  There seems to 
be little interest that I can tell in using the OOT driver.  The main 
distros all include the kernel built-in OVS driver and those drivers 
generally seem to support all the primary features required by user space.


Most of the energy on this list seems to be directed toward DPDK and OVN
and it doesn't seem to me that either of those require the OOT driver.
If there's no one actually using the OOT driver I suggest we deprecate
it and save time and energy on keeping it up to date.

Opinions, thoughts, comments?

Thanks,

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


Re: [ovs-dev] [PATCH V3 1/4] Enable VXLAN TSO for DPDK datapath

2020-10-30 Thread Flavio Leitner


Hi Yi,

Thanks for the patch and sorry the delay to review it.
See my comments in line.

Thanks,
fbl


On Fri, Aug 07, 2020 at 06:56:45PM +0800, yang_y...@163.com wrote:
> From: Yi Yang 
> 
> Many NICs can support VXLAN TSO which can help
> improve across-compute-node VM-to-VM performance
> in case that MTU is set to 1500.
> 
> This patch allows dpdkvhostuserclient interface
> and veth/tap interface to leverage NICs' offload
> capability to maximize across-compute-node TCP
> performance, with it applied, OVS DPDK can reach
> linespeed for across-compute-node VM-to-VM TCP
> performance.
> 
> Signed-off-by: Yi Yang 
> ---
>  lib/dp-packet.h   |  76 
>  lib/netdev-dpdk.c | 188 
> ++
>  lib/netdev-linux.c|  20 ++
>  lib/netdev-provider.h |   1 +
>  lib/netdev.c  |  69 --
>  5 files changed, 338 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/dp-packet.h b/lib/dp-packet.h
> index 0430cca..79895f2 100644
> --- a/lib/dp-packet.h
> +++ b/lib/dp-packet.h
> @@ -81,6 +81,8 @@ enum dp_packet_offload_mask {
>  DEF_OL_FLAG(DP_PACKET_OL_TX_UDP_CKSUM, PKT_TX_UDP_CKSUM, 0x400),
>  /* Offload SCTP checksum. */
>  DEF_OL_FLAG(DP_PACKET_OL_TX_SCTP_CKSUM, PKT_TX_SCTP_CKSUM, 0x800),
> +/* VXLAN TCP Segmentation Offload. */
> +DEF_OL_FLAG(DP_PACKET_OL_TX_TUNNEL_VXLAN, PKT_TX_TUNNEL_VXLAN, 0x1000),
>  /* Adding new field requires adding to DP_PACKET_OL_SUPPORTED_MASK. */
>  };
>  
> @@ -1032,6 +1034,80 @@ dp_packet_hwol_set_tcp_seg(struct dp_packet *b)
>  *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_TCP_SEG;
>  }
>  
> +#ifdef DPDK_NETDEV
> +/* Mark packet 'b' for VXLAN TCP segmentation offloading. */
> +static inline void
> +dp_packet_hwol_set_vxlan_tcp_seg(struct dp_packet *b)
> +{
> +b->mbuf.ol_flags |= DP_PACKET_OL_TX_TUNNEL_VXLAN;
> +b->mbuf.l2_len += sizeof(struct udp_header) +
> +  sizeof(struct vxlanhdr);


What about L3 length?

> +b->mbuf.outer_l2_len = ETH_HEADER_LEN;
> +b->mbuf.outer_l3_len = IP_HEADER_LEN;

What about IPv6?

> +}
> +
> +/* Check if it is a VXLAN packet */
> +static inline bool
> +dp_packet_hwol_is_vxlan_tcp_seg(struct dp_packet *b)
> +{
> +return (b->mbuf.ol_flags & DP_PACKET_OL_TX_TUNNEL_VXLAN);


Please use dp_packet_ol_flags_ptr()

> +}
> +
> +/* Set l2_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l2_len(struct dp_packet *b, int l2_len)
> +{
> +b->mbuf.l2_len = l2_len;
> +}

This function is only called by Linux in the ingress
path before the data processing, so it shouldn't set
any value other than the ones related to the iface
offloading at this point. Also that the data path can
change the packet and there is nothing to update
those lengths.

In the egress path it calls netdev_dpdk_prep_hwol_packet()
to update those fields.


> +
> +/* Set l3_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l3_len(struct dp_packet *b, int l3_len)
> +{
> +b->mbuf.l3_len = l3_len;
> +}

The same comment above is valid here.


> +
> +/* Set l4_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l4_len(struct dp_packet *b, int l4_len)
> +{
> +b->mbuf.l4_len = l4_len;
> +}


And here.


> +#else
> +/* Mark packet 'b' for VXLAN TCP segmentation offloading. */
> +static inline void
> +dp_packet_hwol_set_vxlan_tcp_seg(struct dp_packet *b OVS_UNUSED)
> +{
> +}
> +
> +/* Check if it is a VXLAN packet */
> +static inline bool
> +dp_packet_hwol_is_vxlan_tcp_seg(struct dp_packet *b OVS_UNUSED)
> +{
> +}
> +
> +/* Set l2_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l2_len(struct dp_packet *b OVS_UNUSED,
> +  int l2_len OVS_UNUSED)
> +{
> +}
> +
> +/* Set l3_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l3_len(struct dp_packet *b OVS_UNUSED,
> +  int l3_len OVS_UNUSED)
> +{
> +}
> +
> +/* Set l4_len for the packet 'b' */
> +static inline void
> +dp_packet_hwol_set_l4_len(struct dp_packet *b OVS_UNUSED,
> +  int l4_len OVS_UNUSED)
> +{
> +}
> +#endif /* DPDK_NETDEV */
> +
>  static inline bool
>  dp_packet_ip_checksum_valid(const struct dp_packet *p)
>  {
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 44ebf96..30493ed 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -44,6 +44,7 @@
>  #include 
>  #include 
>  #include 
> +#include 

I think all the headers you need are defined in OVS
and that's the current preference. Please use those
instead.


>  #include "cmap.h"
>  #include "coverage.h"
> @@ -87,6 +88,7 @@ COVERAGE_DEFINE(vhost_notification);
>  
>  #define OVS_CACHE_LINE_SIZE CACHE_LINE_SIZE
>  #define OVS_VPORT_DPDK "ovs_dpdk"
> +#define DPDK_RTE_HDR_OFFSET 1

This is not specific to DPDK, neither to RTE. Perhaps this
could be added to packet header is a more generic way?


>  
>  /*
>   * need to reserve tons of 

Re: [ovs-dev] [PATCH v4 2/2] netdev-dpdk: Add option to configure VF MAC address.

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Gaetan Rivet, 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:
WARNING: Line is 97 characters long (recommended limit is 79)
#52 FILE: Documentation/topics/dpdk/phy.rst:398:
.. _bifurcated-drivers: 
http://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#bifurcated-driver

Lines checked: 242, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v4 1/2] netdev-dpdk: Add ability to set MAC address.

2020-10-30 Thread 0-day Robot
Bleep bloop.  Greetings Gaetan Rivet, 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:
WARNING: Unexpected sign-offs from developers who are not authors or co-authors 
or committers: Gaetan Rivet 
Lines checked: 72, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v3 2/2] netdev-dpdk: Add option to configure VF MAC address.

2020-10-30 Thread Gaëtan Rivet
On 28/10/20 02:58 +0100, Gaëtan Rivet wrote:

[...]

> > > 
> > >> +}
> > >>  }
> > >>  ovs_mutex_unlock(>mutex);
> > >>  
> > >> @@ -1898,6 +1918,7 @@ netdev_dpdk_set_config(struct netdev *netdev, 
> > >> const struct smap *args,
> > >>  {RTE_FC_RX_PAUSE, RTE_FC_FULL}
> > >>  };
> > >>  const char *new_devargs;
> > >> +const char *vf_mac;
> > >>  int err = 0;
> > >>  
> > >>  ovs_mutex_lock(_mutex);
> > >> @@ -1968,6 +1989,36 @@ netdev_dpdk_set_config(struct netdev *netdev, 
> > >> const struct smap *args,
> > >>  goto out;
> > >>  }
> > >>  
> > >> +vf_mac = smap_get(args, "dpdk-vf-mac");
> > >> +if (vf_mac) {
> > >> +struct eth_addr mac;
> > >> +
> > >> +err = EINVAL;
> > >> +
> > >> +if (!dpdk_port_is_representor(dev)) {
> > >> +VLOG_ERR_BUF(errp, "'%s' is trying to set the VF MAC '%s' "
> > >> + "but 'options:dpdk-vf-mac' is only supported 
> > >> for "
> > >> + "VF representors.",
> > >> + netdev_get_name(netdev), vf_mac);
> > > 
> > > Warnings here seems more in line with the other configs that cannot be
> > > applied.
> > 
> > I agree, if it's not a representor we could just issue a warning and 
> > continue.
> > 
> 
> Your phrasing seems to limit the (err -> warn) change to the
> representor filtering part. Should the MAC sanitizing messages below remain
> errors?
> 

I've sent a v4 that followed Kevin's suggestions, let me know if you'd
prefer if I did as I outlined above.

Cheers,
-- 
Gaëtan
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] Hi;

2020-10-30 Thread gabrielthomas9010

I've invited you to fill out the following form:
Untitled form

To fill it out, visit:
https://docs.google.com/forms/d/e/1FAIpQLScuNN46De4NTNDuI_3Rm2L6CNABd5Ra0TyGG6ZxgVbAw2h7Ug/viewform?vc=0c=0w=1flr=0usp=mail_form_link

 Hi,
Hope I am not intruding on your space here.
If you are interested in equity or loan financing,
I would be glad to assist.
We are a private financial firm that acquires well established small and  
lower

middle market businesses with predictable revenue and cash flow;
typically partnering with industry professionals
to operate them.
We also have a Capital Formation Division that assists companies at
all levels of development raise
capital through hedge funds. We charge %1 commission at the successful
closing of any deal.
Additionally, we also fund
secured as well as unsecured lines of credit and term loans.
Would that be something of interest to you and your group?
Please let me know your thoughts.
Sorry if you get this message in your spam box, poor network
connection may be responsible for such.
Best regards.. Gennadiy Medovoy.

Google Forms: Create and analyze surveys.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v4 0/2] netdev-dpdk: support changing VF MAC

2020-10-30 Thread Gaetan Rivet
v4: fix Kevin's and Ilya's comments.

v3: fix Ilya's comments.

v2: fix 0-day bot issues in 2/2.

Hello Ilya,

Following your suggestion, here is a small patch adding the ability to 
configure the
MAC address of DPDK VF representors.  As said off-ML, I've used the options 
column
instead of other_configs, as it allows avoid having the DPDK representor concept
bleed out of netdev-dpdk.

There is only a small compilation fix on your first patch (rte_eth_addr type 
instead of
eth_addr), otherwise it is the same.

Thank you for your help and reading,


Gaetan Rivet (1):
  netdev-dpdk: Add option to configure VF MAC address.

Ilya Maximets (1):
  netdev-dpdk: Add ability to set MAC address.

 Documentation/topics/dpdk/phy.rst | 25 
 NEWS  |  2 +
 lib/netdev-dpdk.c | 99 ++-
 vswitchd/vswitch.xml  | 18 ++
 4 files changed, 141 insertions(+), 3 deletions(-)

-- 
2.28.0

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


[ovs-dev] [PATCH v4 1/2] netdev-dpdk: Add ability to set MAC address.

2020-10-30 Thread Gaetan Rivet
From: Ilya Maximets 

It is possible to set the MAC address of DPDK ports by calling
rte_eth_dev_default_mac_addr_set().  OvS does not actually call
this function for non-internal ports, but the implementation is
exposed to be used in a later commit.

Signed-off-by: Ilya Maximets 
Signed-off-by: Gaetan Rivet 
---
 lib/netdev-dpdk.c | 32 +---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 0b830be78..084f97807 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2910,19 +2910,45 @@ netdev_dpdk_eth_send(struct netdev *netdev, int qid,
 return 0;
 }
 
+static int
+netdev_dpdk_set_etheraddr__(struct netdev_dpdk *dev, const struct eth_addr mac)
+OVS_REQUIRES(dev->mutex)
+{
+int err = 0;
+
+if (dev->type == DPDK_DEV_ETH) {
+struct rte_ether_addr ea;
+
+memcpy(ea.addr_bytes, mac.ea, ETH_ADDR_LEN);
+err = -rte_eth_dev_default_mac_addr_set(dev->port_id, );
+}
+if (!err) {
+dev->hwaddr = mac;
+} else {
+VLOG_WARN("%s: Failed to set requested mac("ETH_ADDR_FMT"): %s",
+  netdev_get_name(>up), ETH_ADDR_ARGS(mac),
+  rte_strerror(err));
+}
+
+return err;
+}
+
 static int
 netdev_dpdk_set_etheraddr(struct netdev *netdev, const struct eth_addr mac)
 {
 struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
+int err = 0;
 
 ovs_mutex_lock(>mutex);
 if (!eth_addr_equals(dev->hwaddr, mac)) {
-dev->hwaddr = mac;
-netdev_change_seq_changed(netdev);
+err = netdev_dpdk_set_etheraddr__(dev, mac);
+if (!err) {
+netdev_change_seq_changed(netdev);
+}
 }
 ovs_mutex_unlock(>mutex);
 
-return 0;
+return err;
 }
 
 static int
-- 
2.28.0

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


[ovs-dev] [PATCH v4 2/2] netdev-dpdk: Add option to configure VF MAC address.

2020-10-30 Thread Gaetan Rivet
In some cloud topologies, using DPDK VF representors in guest requires
configuring a VF before it is assigned to the guest.

A first basic option for such configuration is setting the VF MAC
address. Add a key 'dpdk-vf-mac' to the 'options' column of the Interface
table.

This option can be used as such:

   $ ovs-vsctl add-port br0 dpdk-rep0 -- set Interface dpdk-rep0 type=dpdk \
  options:dpdk-vf-mac=00:11:22:33:44:55

Signed-off-by: Gaetan Rivet 
Suggested-by: Ilya Maximets 
Acked-by: Eli Britstein 
---
 Documentation/topics/dpdk/phy.rst | 25 
 NEWS  |  2 +
 lib/netdev-dpdk.c | 67 +++
 vswitchd/vswitch.xml  | 18 +
 4 files changed, 112 insertions(+)

diff --git a/Documentation/topics/dpdk/phy.rst 
b/Documentation/topics/dpdk/phy.rst
index 55a98e2b0..1415e1b8c 100644
--- a/Documentation/topics/dpdk/phy.rst
+++ b/Documentation/topics/dpdk/phy.rst
@@ -379,6 +379,31 @@ an eth device whose mac address is ``00:11:22:33:44:55``::
 $ ovs-vsctl add-port br0 dpdk-mac -- set Interface dpdk-mac type=dpdk \
options:dpdk-devargs="class=eth,mac=00:11:22:33:44:55"
 
+Representor specific configuration
+~~
+
+In some topologies, a VF must be configured before being assigned to a
+guest (VM) machine.  This configuration is done through VF-specific fields
+in the ``options`` column of the ``Interface`` table.
+
+.. important::
+
+   Some DPDK port use `bifurcated drivers `__,
+   which means that a kernel netdevice remains when Open vSwitch is stopped.
+
+   In such case, any configuration applied to a VF would remain set on the
+   kernel netdevice, and be inherited from it when Open vSwitch is restarted,
+   even if the options described in this section are unset from Open vSwitch.
+
+.. _bifurcated-drivers: 
http://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#bifurcated-driver
+
+- Configure the VF MAC address::
+
+$ ovs-vsctl set Interface dpdk-rep0 options:dpdk-vf-mac=00:11:22:33:44:55
+
+On successful configuration, the requested MAC is shown in the ``mac_in_use``
+column of the ``Interface`` table.
+
 Jumbo Frames
 
 
diff --git a/NEWS b/NEWS
index 8bb5bdc3f..b8cb3e227 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Post-v2.14.0
status of the storage that's backing a database.
- DPDK:
  * Removed support for vhost-user dequeue zero-copy.
+ * New 'options:dpdk-vf-mac' field for DPDK interface of VF ports,
+   that allows configuring the MAC address of a VF representor.
- The environment variable OVS_UNBOUND_CONF, if set, is now used
  as the DNS resolver's (unbound) configuration file.
- Linux datapath:
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 084f97807..d678def4b 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -522,6 +522,9 @@ struct netdev_dpdk {
  * otherwise interrupt mode is used. */
 bool requested_lsc_interrupt_mode;
 bool lsc_interrupt_mode;
+
+/* VF configuration. */
+struct eth_addr requested_hwaddr;
 );
 
 PADDED_MEMBERS(CACHE_LINE_SIZE,
@@ -1692,6 +1695,16 @@ out:
 return ret;
 }
 
+static bool
+dpdk_port_is_representor(struct netdev_dpdk *dev)
+OVS_REQUIRES(dev->mutex)
+{
+struct rte_eth_dev_info dev_info;
+
+rte_eth_dev_info_get(dev->port_id, _info);
+return (*dev_info.dev_flags) & RTE_ETH_DEV_REPRESENTOR;
+}
+
 static int
 netdev_dpdk_get_config(const struct netdev *netdev, struct smap *args)
 {
@@ -1726,6 +1739,11 @@ netdev_dpdk_get_config(const struct netdev *netdev, 
struct smap *args)
 }
 smap_add(args, "lsc_interrupt_mode",
  dev->lsc_interrupt_mode ? "true" : "false");
+
+if (dpdk_port_is_representor(dev)) {
+smap_add_format(args, "dpdk-vf-mac", ETH_ADDR_FMT,
+ETH_ADDR_ARGS(dev->requested_hwaddr));
+}
 }
 ovs_mutex_unlock(>mutex);
 
@@ -1905,6 +1923,7 @@ netdev_dpdk_set_config(struct netdev *netdev, const 
struct smap *args,
 {RTE_FC_RX_PAUSE, RTE_FC_FULL}
 };
 const char *new_devargs;
+const char *vf_mac;
 int err = 0;
 
 ovs_mutex_lock(_mutex);
@@ -1975,6 +1994,28 @@ netdev_dpdk_set_config(struct netdev *netdev, const 
struct smap *args,
 goto out;
 }
 
+vf_mac = smap_get(args, "dpdk-vf-mac");
+if (vf_mac) {
+struct eth_addr mac;
+
+if (!dpdk_port_is_representor(dev)) {
+VLOG_WARN_BUF(errp, "'%s' is trying to set the VF MAC '%s' "
+  "but 'options:dpdk-vf-mac' is only supported for "
+  "VF representors.",
+  netdev_get_name(netdev), vf_mac);
+} else if (!eth_addr_from_string(vf_mac, )) {
+VLOG_WARN_BUF(errp, "interface '%s': cannot parse VF MAC '%s'.",
+  netdev_get_name(netdev), vf_mac);
+} else if 

Re: [ovs-dev] [PATCH dpdk-latest V3 1/1] sparse: Fix __ATOMIC_* redefinition errors

2020-10-30 Thread Stokes, Ian
> On Thu, Oct 22, 2020 at 12:57 PM Eli Britstein  wrote:
> >
> > In sparse commit [1], __ATOMIC_* defines were introduced, which cause
> > redefinition errors. Commits [2],[3] introduced builtin __atomic_*
> > functions that are defined in OVS.
> > Wrap OVS defines with #ifndef to fix it. We assume using either a sparse
> > version before all [1],[2],[3], or a version after them.
> >
> > [1]
> https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=cf8f104749
> f5
> > [2]
> https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=7cdf84691f
> 33
> > [3]
> https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=f42e2afa9e
> d0
> >
> > Tested-at: https://travis-ci.org/github/elibritstein/OVS/builds/737943898
> > Signed-off-by: Eli Britstein 
> > ---
> >  include/sparse/rte_mbuf.h| 2 ++
> >  include/sparse/rte_trace_point.h | 2 ++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/include/sparse/rte_mbuf.h b/include/sparse/rte_mbuf.h
> > index ee461f91e..981cdb441 100644
> > --- a/include/sparse/rte_mbuf.h
> > +++ b/include/sparse/rte_mbuf.h
> > @@ -18,10 +18,12 @@
> >  #endif
> >
> >  /* sparse doesn't know about gcc atomic builtins. */
> > +#ifndef __ATOMIC_ACQ_REL
> >  #define __ATOMIC_ACQ_REL 0
> >  #define __ATOMIC_RELAXED 1
> >  #define __atomic_add_fetch(p, val, memorder) (*(p) = *(p) + (val))
> >  #define __atomic_store_n(p, val, memorder) (*(p) = (val))
> > +#endif
> >
> >  /* Get actual  definitions for us to annotate and build on. */
> >  #include_next 
> > diff --git a/include/sparse/rte_trace_point.h
> b/include/sparse/rte_trace_point.h
> > index c28f1c941..803923275 100644
> > --- a/include/sparse/rte_trace_point.h
> > +++ b/include/sparse/rte_trace_point.h
> > @@ -18,8 +18,10 @@
> >  #endif
> >
> >  /* sparse doesn't know about gcc atomic builtins. */
> > +#ifndef __ATOMIC_ACQUIRE
> >  #define __ATOMIC_ACQUIRE 0
> >  #define __atomic_load_n(p, memorder) *(p)
> > +#endif
> >
> >  /* Get actual  definitions for us to annotate and
> >   * build on. */
> > --
> > 2.28.0.546.g385c171
> >
> 
> LGTM.
> Acked-by: David Marchand 
> 
> 
> --
> David Marchand

Thanks all, I've rebased dpdk-latest on master and pushed this commit.

Regards
Ian

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


Re: [ovs-dev] [PATCH ovn 1/2] ovn-detrace: Only decode br-int OVS interfaces.

2020-10-30 Thread Numan Siddique
On Fri, Oct 30, 2020 at 3:32 PM Dumitru Ceara  wrote:
>
> On 10/30/20 10:26 AM, Dumitru Ceara wrote:
> > On 10/30/20 10:17 AM, Numan Siddique wrote:
> >> On Fri, Oct 23, 2020 at 1:37 PM Dumitru Ceara  wrote:
> >>>
> >>> Do not assume 'ofport' is unique for all OVS interfaces in the system.  
> >>> This
> >>> is true only for interfaces within the same OVS bridge.  Also, only decode
> >>> br-int related interfaces.
> >>>
> >>> Also, fix printing of potential duplicate UUIDs decoded from cookies.
> >>>
> >>> Reported-by: Michael Cambria 
> >>> Reported-at: https://bugzilla.redhat.com/1890803
> >>> Fixes: 8051499a6c1b ("ovn-detrace: Add support for other types of SB 
> >>> cookies.")
> >>> Signed-off-by: Dumitru Ceara 
> >>
> >> Thanks Dumitru.
> >>
> >> The patches LGTM. I applied both the patches in this series to master.
> >>
> >> Numan
> >>
> >
> > Thanks!
> >
>
> Actually, would it also be possible to backport this series to stable
> branches as it's a bug fix?
>
> Patch 1/2 could go down to branch-20.03.
> Patch 2/2 could go down to branch-20.09.

Done.

Thanks
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 1/2] ovn-detrace: Only decode br-int OVS interfaces.

2020-10-30 Thread Dumitru Ceara
On 10/30/20 10:26 AM, Dumitru Ceara wrote:
> On 10/30/20 10:17 AM, Numan Siddique wrote:
>> On Fri, Oct 23, 2020 at 1:37 PM Dumitru Ceara  wrote:
>>>
>>> Do not assume 'ofport' is unique for all OVS interfaces in the system.  This
>>> is true only for interfaces within the same OVS bridge.  Also, only decode
>>> br-int related interfaces.
>>>
>>> Also, fix printing of potential duplicate UUIDs decoded from cookies.
>>>
>>> Reported-by: Michael Cambria 
>>> Reported-at: https://bugzilla.redhat.com/1890803
>>> Fixes: 8051499a6c1b ("ovn-detrace: Add support for other types of SB 
>>> cookies.")
>>> Signed-off-by: Dumitru Ceara 
>>
>> Thanks Dumitru.
>>
>> The patches LGTM. I applied both the patches in this series to master.
>>
>> Numan
>>
> 
> Thanks!
> 

Actually, would it also be possible to backport this series to stable
branches as it's a bug fix?

Patch 1/2 could go down to branch-20.03.
Patch 2/2 could go down to branch-20.09.

Thanks,
Dumitru

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


Re: [ovs-dev] [PATCH ovn 1/2] ovn-detrace: Only decode br-int OVS interfaces.

2020-10-30 Thread Dumitru Ceara
On 10/30/20 10:17 AM, Numan Siddique wrote:
> On Fri, Oct 23, 2020 at 1:37 PM Dumitru Ceara  wrote:
>>
>> Do not assume 'ofport' is unique for all OVS interfaces in the system.  This
>> is true only for interfaces within the same OVS bridge.  Also, only decode
>> br-int related interfaces.
>>
>> Also, fix printing of potential duplicate UUIDs decoded from cookies.
>>
>> Reported-by: Michael Cambria 
>> Reported-at: https://bugzilla.redhat.com/1890803
>> Fixes: 8051499a6c1b ("ovn-detrace: Add support for other types of SB 
>> cookies.")
>> Signed-off-by: Dumitru Ceara 
> 
> Thanks Dumitru.
> 
> The patches LGTM. I applied both the patches in this series to master.
> 
> Numan
> 

Thanks!

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


Re: [ovs-dev] [PATCH ovn 1/2] ovn-detrace: Only decode br-int OVS interfaces.

2020-10-30 Thread Numan Siddique
On Fri, Oct 23, 2020 at 1:37 PM Dumitru Ceara  wrote:
>
> Do not assume 'ofport' is unique for all OVS interfaces in the system.  This
> is true only for interfaces within the same OVS bridge.  Also, only decode
> br-int related interfaces.
>
> Also, fix printing of potential duplicate UUIDs decoded from cookies.
>
> Reported-by: Michael Cambria 
> Reported-at: https://bugzilla.redhat.com/1890803
> Fixes: 8051499a6c1b ("ovn-detrace: Add support for other types of SB 
> cookies.")
> Signed-off-by: Dumitru Ceara 

Thanks Dumitru.

The patches LGTM. I applied both the patches in this series to master.

Numan

> ---
>  utilities/ovn-detrace.in |   35 ++-
>  1 file changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/utilities/ovn-detrace.in b/utilities/ovn-detrace.in
> index 4f8dd5f..2344f52 100755
> --- a/utilities/ovn-detrace.in
> +++ b/utilities/ovn-detrace.in
> @@ -117,18 +117,27 @@ class OVSDB(object):
>  def _find_rows(self, table_name, find_fn):
>  return filter(find_fn, self.get_table(table_name).rows.values())
>
> -def _find_rows_by_name(self, table_name, value):
> +def find_rows_by_name(self, table_name, value):
>  return self._find_rows(table_name, lambda row: row.name == value)
>
>  def find_rows_by_partial_uuid(self, table_name, value):
>  return self._find_rows(table_name,
> lambda row: str(row.uuid).startswith(value))
>
> +def get_first_record(self, table_name):
> +table_rows = self.get_table(table_name).rows.values()
> +if len(table_rows) == 0:
> +return None
> +return next(iter(table_rows))
> +
>  class CookieHandler(object):
>  def __init__(self, db, table):
>  self._db = db
>  self._table = table
>
> +def print(self, msg):
> +print_h(msg)
> +
>  def get_records(self, cookie):
>  return []
>
> @@ -320,10 +329,25 @@ class OvsInterfaceHandler(CookieHandler):
>  def __init__(self, ovs_db):
>  super(OvsInterfaceHandler, self).__init__(ovs_db, 'Interface')
>
> +# Store the interfaces connected to the integration bridge in a dict
> +# indexed by ofport.
> +br = self.get_br_int()
> +self._intfs = {
> +i.ofport[0] : i for p in br.ports
> +for i in p.interfaces if len(i.ofport) > 0
> +}
> +
> +def get_br_int(self):
> +ovsrec = self._db.get_first_record('Open_vSwitch')
> +if ovsrec:
> +br_name = ovsrec.external_ids.get('ovn-bridge', 'br-int')
> +else:
> +br_name = 'br-int'
> +return next(iter(self._db.find_rows_by_name('Bridge', br_name)))
> +
>  def get_records(self, ofport):
> -return self._db._find_rows(self._table,
> -   lambda intf: len(intf.ofport) > 0 and
> -str(intf.ofport[0]) == ofport)
> +intf = self._intfs.get(int(ofport))
> +return [intf] if intf else []
>
>  def print_record(self, intf):
>  print_p('OVS Interface: %s (%s)' %
> @@ -331,7 +355,8 @@ class OvsInterfaceHandler(CookieHandler):
>
>  def print_record_from_cookie(ovnnb_db, cookie_handlers, cookie):
>  for handler in cookie_handlers:
> -for i, record in enumerate(handler.get_records(cookie)):
> +records = list(handler.get_records(cookie))
> +for i, record in enumerate(records):
>  if i > 0:
>  handler.print('[Duplicate uuid cookie]')
>  handler.print_record(record)
>
> ___
> 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