[ovs-dev] [PATCH ovn] ovn-nbctl: Add some hint for --ecmp in error message.

2020-06-19 Thread Han Zhou
Add the hint to remind user about --ecmp option when needed.

Signed-off-by: Han Zhou 
---
 tests/ovn-nbctl.at| 2 +-
 utilities/ovn-nbctl.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 14de1a8..54b4ad2 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -1414,7 +1414,7 @@ AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.1/24 
11.0.0.2])
 
 dnl Add overlapping route with 10.0.0.1/24
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111/24 11.0.0.1], [1], [],
-  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip)
+  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip). Use option 
--ecmp to allow this for ECMP routing.
 ])
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111a/24 11.0.0.1], [1], [],
   [ovn-nbctl: bad prefix argument: 10.0.0.111a/24
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 6ccc702..75fd8f9 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3833,7 +3833,8 @@ nbctl_lr_route_add(struct ctl_context *ctx)
 }
 
 if (!may_exist) {
-ctl_error(ctx, "duplicate prefix: %s (policy: %s)",
+ctl_error(ctx, "duplicate prefix: %s (policy: %s). Use option"
+  " --ecmp to allow this for ECMP routing.",
   prefix, is_src_route ? "src-ip" : "dst-ip");
 free(next_hop);
 free(rt_prefix);
-- 
2.1.0

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


[ovs-dev] Demandas - Acciones preventivas y de negociación

2020-06-19 Thread Terminacion de la relacion laboral
Buenos día 
Quise aprovechar la oportunidad de hacerte una invitación para tomar nuestro 
curso de 4 horas :
 
Nombre: Mediación de conflictos y prevención de demandas laborales.
Fecha: Miércoles 8 de Julio 
Horario: 10:00 am a 14:00 pm 
Formato: En línea con interacción en vivo.
Lugar: En Vivo desde su computadora
Instructor: Gerardo Vázquez cuenta con experiencia de 22 años en la gestión de 
Recursos Humanos con lineamientos 
operativos y corporativos en empresas productoras y comerciales.

Nuestro webinar interactivo le brindará herramientas que le ayudarán para 
mejorar los procesos en la administración del
recurso humano mediante acciones preventivas y de negociación de conflictos 
para evitar el litigio laboral.
El participante dispondrá, con mayor certeza, de información para ejecutar los 
procesos de Recursos Humanos
considerando los aspectos legales y laborales y procurando un mejor ambiente 
laboral y sin conflictos.

Ejes Temáticos:

- Contratación del personal
- Sistema disciplinario
- Obligaciones del patron y trabajadores
- Seguridad y Salud en el Trabajo
- Gestion laboral Sindical
- Normatividad Laboral
- Terminacion de la relacion laboral
- Derecho laboral procesal

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

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

Números de Atención: 55 15 54 66 30 - 55 30 16 70 85  

Qué tengas un gran día.
Saludos.


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


[ovs-dev] [PATCH v2] tc: Changes to netlink message population for OVS-TC Flower Offload

2020-06-19 Thread dsatish
From: Satish Dhote 

OVS-TC offload sends only fields that are not completely masked out
to the TC kernel module. Some of the hardware we work with requires
all fields extracted from the packet along with the mask to be sent
to the driver. Hardware may optimize tables based on entire fields
of packet and mask of fields, even though certain fields are masked
out.

OVS when offloading to ovs kernel datapath sends the entire key
along with the mask. Proposal requests for similar behaviour in
ovs-vswitchd in case of tc-offload. While constructing netlink
messages, ovs-vswitchd is removing completely masked out fields.
Sending additional masked fields should not impact existing drivers.
TC internally uses dissectors to extract non masked fields, so it
should not impact existing drivers in tc.

Example:
ovs-rule:ovs-ofctl add-flow br0 \
"table=0, dl_dst=00:a1:45:23:23:11/ff:ff:ff:ff:ff:ff, actions=1"

If we have above rule in ovs and an icmp packet matching destination
MAC 00:a1:45:23:23:11 arrives, ovs prepares the key and mask with all
relevant fields. When sending to TC it removes fields which are
completely masked out. In this case ethertype, and dst_mac fields are
sent as part of netlink message to tc.

OVS patch also requires minor fixes in TC. Patch to TC is submitted
at following link. 1/3 patch has the fix for the same.
http://patchwork.ozlabs.org/project/netdev/list/?series=184493

Co-authored-by: Chandra Kesava 
Co-authored-by: Prathibha Nagooru 
Signed-off-by: Chandra Kesava 
Signed-off-by: Prathibha Nagooru 
Signed-off-by: Satish Dhote 
---
v2:
- Corrected From author name.
- Added missing co-author detail.
- Deleted unused variable.
---
 lib/tc.c | 111 +--
 1 file changed, 42 insertions(+), 69 deletions(-)

diff --git a/lib/tc.c b/lib/tc.c
index c2ab77553..4d0232120 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -2648,9 +2648,6 @@ nl_msg_put_masked_value(struct ofpbuf *request, uint16_t 
type,
 const void *mask_data, size_t len)
 {
 if (mask_type != TCA_FLOWER_UNSPEC) {
-if (is_all_zeros(mask_data, len)) {
-return;
-}
 nl_msg_put_unspec(request, mask_type, mask_data, len);
 }
 nl_msg_put_unspec(request, type, data, len);
@@ -2705,17 +2702,16 @@ nl_msg_put_flower_tunnel(struct ofpbuf *request, struct 
tc_flower *flower)
 uint8_t ttl = flower->key.tunnel.ttl;
 uint8_t tos_mask = flower->mask.tunnel.tos;
 uint8_t ttl_mask = flower->mask.tunnel.ttl;
-ovs_be64 id_mask = flower->mask.tunnel.id;
 
-if (ipv4_dst_mask || ipv4_src_mask) {
+if (ipv4_dst || ipv4_src) {
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,
 ipv4_dst_mask);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,
 ipv4_src_mask);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_DST, ipv4_dst);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_SRC, ipv4_src);
-} else if (ipv6_addr_is_set(ipv6_dst_mask) ||
-   ipv6_addr_is_set(ipv6_src_mask)) {
+} else if (ipv6_addr_is_set(ipv6_dst) ||
+   ipv6_addr_is_set(ipv6_src)) {
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,
 ipv6_dst_mask);
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,
@@ -2723,20 +2719,18 @@ nl_msg_put_flower_tunnel(struct ofpbuf *request, struct 
tc_flower *flower)
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_DST, ipv6_dst);
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_SRC, ipv6_src);
 }
-if (tos_mask) {
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS, tos);
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS_MASK, tos_mask);
-}
-if (ttl_mask) {
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
-}
+
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS, tos);
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS_MASK, tos_mask);
+
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
+
 if (tp_dst) {
 nl_msg_put_be16(request, TCA_FLOWER_KEY_ENC_UDP_DST_PORT, tp_dst);
 }
-if (id_mask) {
-nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);
-}
+
+nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);
 nl_msg_put_flower_tunnel_opts(request, TCA_FLOWER_KEY_ENC_OPTS,
   flower->key.tunnel.metadata);
 nl_msg_put_flower_tunnel_opts(request, TCA_FLOWER_KEY_ENC_OPTS_MASK,
@@ -2796,12 +2790,10 @@ nl_msg_put_flower_options(struct ofpbuf *request, 
struct tc_flower *flower)
   flower->key.ip_proto);
 }
 
-if (flower->mask.flags) {
-nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS,

Re: [ovs-dev] [PATCH v7 ovn] Add support for DHCP domain search option (119)

2020-06-19 Thread 0-day Robot
Bleep bloop.  Greetings Ankur Sharma, 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: Ankur Sharma 
ERROR: Use ovs_strlcpy() in place of strcpy()
#77 FILE: lib/actions.c:2358:
strcpy(suffix, domain);

ERROR: Use ovs_strlcpy() in place of strcpy()
#105 FILE: lib/actions.c:2386:
   strcpy(suffix, domain);

Lines checked: 307, Warnings: 1, 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 v7 ovn] Add support for DHCP domain search option (119)

2020-06-19 Thread Ankur Sharma
From: Dhathri Purohith 

Domain search list is encoded according to the specifications in RFC 1035,
section 4.1.4.

Signed-off-by: Dhathri Purohith 
Signed-off-by: Ankur Sharma 
---
 lib/actions.c   | 90 -
 lib/ovn-l7.h|  3 ++
 northd/ovn-northd.c |  1 +
 ovn-nb.xml  | 13 
 ovn-sb.ovsschema|  6 ++--
 ovn-sb.xml  | 11 +++
 tests/ovn.at| 36 +
 tests/test-ovn.c|  1 +
 8 files changed, 157 insertions(+), 4 deletions(-)

diff --git a/lib/actions.c b/lib/actions.c
index 9baa90f..ad7ae78 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1982,7 +1982,8 @@ parse_gen_opt(struct action_context *ctx, struct 
ovnact_gen_option *o,
 return;
 }
 
-if (!strcmp(o->option->type, "str")) {
+if (!strcmp(o->option->type, "str") ||
+!strcmp(o->option->type, "domains")) {
 if (o->value.type != EXPR_C_STRING) {
 lexer_error(ctx->lexer, "%s option %s requires string value.",
 opts_type, o->option->name);
@@ -2317,6 +2318,93 @@ encode_put_dhcpv4_option(const struct ovnact_gen_option 
*o,
opt_header[1] = sizeof(ovs_be32);
ofpbuf_put(ofpacts, >value.ipv4, sizeof(ovs_be32));
 }
+} else if (!strcmp(o->option->type, "domains")) {
+/* Please refer to RFC 1035, section 4.1.4 for the format of encoding
+ * domain names. Below is an example for encoding a search list
+ * consisting of the "abc.com" and "xyz.abc.com".
+ *
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * |119|14 | 3 |'a'|'b'|'c'| 3 |'c'|'o'|'m'| 0 |'x'|'y'|'z'|xC0|x00|
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ *
+ * The encoding of "abc.com" ends with 0 to mark the end of the
+ * domain name as required by RFC 1035.
+ *
+ * The encoding of "xyz" (for "xyz.abc.com") ends with the two-octet
+ * compression pointer C000 (hex), which points to offset 0 where
+ * another validly encoded domain name can be found to complete
+ * the name ("abc.com").
+ *
+ * Encoding adds 2 bytes (one for length and one for delimiter) for
+ * every domain name that is unique. If all the domain names are unique
+ * (which probably never happens in real world), then encoded string
+ * could be longer than the original string. Just to be on the safer
+ * side, allocate the (approx.) worst case length here.
+ */
+uint8_t *dns_encoded = xzalloc(2 * strlen(c->string));
+uint16_t encode_offset = 0;
+struct shash label_offset_map;
+shash_init(_offset_map);
+char *domain_list = xstrdup(c->string), *dom_ptr = NULL;
+char *suffix = xzalloc(strlen(domain_list));
+for (char *domain = strtok_r(domain_list, ",", _ptr);
+ domain != NULL;
+ domain = strtok_r(NULL, ",", _ptr)) {
+if (strlen(domain) > DOMAIN_NAME_MAX_LEN) {
+VLOG_WARN("Domain names longer than 255 characters are not"
+  "supported");
+goto out;
+}
+strcpy(suffix, domain);
+char *label;
+for (label = strtok_r(domain, ".", );
+ label != NULL;
+ label = strtok_r(NULL, ".", )) {
+/* Check if we have already encoded this suffix.
+ * If yes, fill in the reference and break. */
+uint16_t *get_offset;
+get_offset  = shash_find_data(_offset_map, suffix);
+if (get_offset != NULL) {
+ovs_be16 temp = htons(0xc000) | htons(*get_offset);
+memcpy(dns_encoded + encode_offset, ,
+sizeof(temp));
+encode_offset += sizeof(temp);
+break;
+} else {
+/* The suffix was not encoded before, encode it now
+ * and add the offset to the label_offset_map. */
+uint16_t *set_offset = xzalloc(sizeof(uint16_t));
+*set_offset = encode_offset;
+shash_add_once(_offset_map, suffix, set_offset);
+
+uint8_t len = strlen(label);
+memcpy(dns_encoded + encode_offset, , sizeof(uint8_t));
+encode_offset += sizeof(uint8_t);
+memcpy(dns_encoded + encode_offset, label, len);
+encode_offset += len;
+}
+   strcpy(suffix, domain);
+}
+/* Add the end marker (0 byte) to determine the end of the
+ * domain. */
+if (label == NULL) {
+uint8_t end = 0;
+memcpy(dns_encoded + encode_offset, , sizeof(uint8_t));
+

[ovs-dev] FINALE NOTIFICATION FUER DIE AUSZAHLUNG IHRES GEWINNES

2020-06-19 Thread FINALE NOTIFICATION FUER DIE AUSZAHLUNG IHRES GEWINNES
Sehr geehrter Begьnstigter,   

Wir mцchten Sie ьber Ihren Gewinnbetrag informieren,Bitte цffnen Sie den 
Anhang, um es zu sehen.

Anbei erhalten sie die Finale Notification fuer die Auszahlung ihres Gewinnes.
Setzen sie sich bitte Umgehend mit uns in Verbindung,damit wir den 
Auazahlungsprozess 
in die Wege leiten koennen.
 
Mit Freundlichen Gruessen
DR. Richardo Dasilva 

TEL . +34 602 039 408,
FAX:  +34 917 915 205.
EMAIL:abogados.mfont...@gmail.com

*** Dieses E-Mail enthдlt vertrauliche und/oder rechtlich geschьtzte 
Informationen, 
die nur fьr die oben angefьhrte(n) Person(en) bestimmt ist/sind. Jede andere 
Verwendung, 
Weitergabe oder Kopie ist untersagt. Wenn Sie dieses E-Mail irrtьmlich erhalten 
haben, 
bitte ich Sie, mich unverzьglich anzurufen, das E-Mail an mich ohne Anfertigung 
von 
Kopien zurьckzuschicken und es zu lцschen.***

*** This e-mail may contain confidential and/or privileged information, 
intended only for 
the person(s) named above. Any other distribution, copying or disclosure is 
strictly prohibited. 
If you have received this e-mail in error, please notify me immediately by 
phone, return the 
e-mail to me without making a copy and delete it.***
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] ovs-dpctl-top: Skip "eth()" element

2020-06-19 Thread Timothy Redaelli
With commit efde188622ae ("odp-util: Print eth() for Ethernet flows if
packet_type is absent.") "eth()" is printed for Ethernet flows if packet_type
is absent, but this broke "ovs-dpctl-top" since it expects that every
element has a value.

This commit skips the parsing of the empty "eth()" element.

Fixes: efde188622ae ("odp-util: Print eth() for Ethernet flows if packet_type
is absent.")
Cc: b...@ovn.org
Signed-off-by: Timothy Redaelli 
---
v2:
- Added missing Signed-off-by

 utilities/ovs-dpctl-top.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index 011cc64b7..fbe6e4f56 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -480,6 +480,8 @@ def elements_to_dict(elements):
 """ Convert line to a hierarchy of dictionaries. """
 result = {}
 for element in elements:
+if (element == "eth()"):
+continue
 match = FIELDS_CMPND.search(element)
 if (match):
 key = match.group(1)
-- 
2.26.2

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


[ovs-dev] [PATCH v2] ovs-dpctl-top: Open stdin in binary mode

2020-06-19 Thread Timothy Redaelli
On Python3 buffering can only be disabled on files opened in binary mode.

Signed-off-by: Timothy Redaelli 
---
v2:
- Added missing Signed-off-by

 utilities/ovs-dpctl-top.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index fbe6e4f56..97dc12f27 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -1236,7 +1236,7 @@ def flows_script(args):

 if (args.flowFiles is None):
 logging.info("reading flows from stdin")
-ihdl = os.fdopen(sys.stdin.fileno(), 'r', 0)
+ihdl = os.fdopen(sys.stdin.fileno(), 'rb', 0)
 try:
 flow_db = flows_read(ihdl, flow_db)
 finally:
--
2.26.2

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


[ovs-dev] ATTN: Check Your Accounts

2020-06-19 Thread Grace Nguyen
Image of your report
For: 

Date: June 19th, 2020




Due to Equifax's latest security breach, your current
TransUnion, Equifax, and Experian scores may have changed. 





Your Scores are available now at no charge. 


View Your Score



Unsubscribe 
To stop receiving emails from us please click above or write to:
A/43, Amarabati, Kolkata 700110

###T_URL###















 Aandeel gif simplon treffen 
bestuur dat ons hun systeem drijven.  Rekening te mogelijk bezetten al 
verkocht.  Zij selangor kapitaal men voorzorg zou tot.  Klimaat grooten haalden 
ontdekt als zou.  Planten mee zal gevolgd luister genomen wolfram.  Nu zake 
dekt kost deed er in ze.  Dichtbij te of uitgaven afstands talrijke losmaken 
bedragen.  Des rug een gemengd afneemt wolfram.  Weinig zoo bergen lijden zin 
breken sap groene.  Al weldra dragen vierde na spuwen ik moeite.  Uit gehouden 
dikwijls als omwonden.  Schipbreuk te op in concurrent en verbazende initiatief 
uitstekend.  Stroomen en geschikt wisselen al plaatsen bedreven.  Simplon 
zekeren oorzaak ad bontste na af.  Vervangen bewegende meehelpen al ze.  
Rijkdommen feestdagen karrijders in ze verbazende aanplanten de er.  Nu 
minerale mogelijk talrijke verschil ze.  Het belangrijk nauwelijks kan 
europeanen hun opgebrach
 t archimedes instorting.  Inkrimpt was kan hij troepjes bedreven bij britsche 
dichtbij.  Vlakten zekeren vliegen dit verdere drijven die nam zou.  Afstand 
brokken kemming op citadel af cultuur de of werkman.  En nu puin geen bouw de 
ad daar.  Cultures voorzorg systemen de ze ze.  Ik australie stroomend ze al 
behoeften overwaard vertoonen.  Maar te mier werk of ze er veld dekt.  Dit nam 
bijgeloof vermijden ook vreedzame.  Is op steeds aantal deelen.  Belangrijk ad 
ik woekeraars gewasschen natuurlijk getaxeerde vergissing om.  Met are neen 
zijn stof.  Koeken buizen invoer ver handel noodig dit.  Genomen gebeurt zij 
nam luister met tienden dat beperkt uitvoer.  Verbruik getracht ze invallen 
omwonden bordeaux meenemen er.  Nu hoewel moeite geheel de buizen meende kedona 
al.  Dien meer op ging de nu puin is.  Houden na gedaan en streng en vormen.  
Maar was vrij sap wier bak wel.  Langs de anson in reden en heele ouden te 
geldt.  Japan sap batoe omdat zes zij perak massa hij werkt.  Bedro
 egen afgestaan eindelijk zoo hen.  Steenen amboina dal tin tinmijn genomen 
dit.  Kreeg het tot klein deden tegen rijke.  Koffie af kriang in en tonnen 
blijft kamper de.  Af de afwegen de sneller vervoer ze meester kemming uitvoer. 
 Een ptolomaeus voorloopig zuidoosten goa nauwelijks toe primitieve schoonheid. 
 Hoogere dus nam tijdens aandeel talrijk.  Begrenzing uiteenvalt nu ontsnappen 
initiatief of werkwijzen.  Der hooge aldus hitte sap tegen als.  Ringen is 
zoodat daarin marmer af bezoek ze soegei.  Op kaal geld acre om af west.  In 
hout om liep doet is af.  In tweeden malakka ik moesten valorem af al.  
Goudmijnen voorschijn verwijderd europeesch uit sap verzekeren.  Gewijzigd 
krachtige dat alluviale gas waaronder verklaart evenwicht.  Duur far zit als 
dure zes zoon.  Zilver hadden op wolken succes af werden ze oosten.  Ton tegen 
onzer dit zijde alles goa matig nadat  Hand mee puin was noch door.  Loopt op 
wordt langs in bevel wilde al.  Far vruchtbaar aan interesten gewasschen u
 itgegeven per met.  Moeten andere den missen het succes dag ten.  Onzuivere en 
bloeiende inlandsen ad kapitalen.  Drie naar op haar deed toen en.  Rijkdommen 
al ze ongebruikt kilometers buitendien ontwouding tinwinning.  Tweemaal mei 
menschen bak dan beletsel talrijke reiziger.  Middellijn bevorderen dan 
interesten voorschijn smeltovens wat tot.  Dieper zee zilver staten koeken men. 
 Op deed ziet duim hout gaat de te.  Heuvel zouden dan rijken een ziekte weg 
tot.  Ik al koopman en nu planken vroeger gomboom vlakken.  Vestigen op 
troepjes uitgeput af de atjehers.  De bovendien degelijke in leeningen 
visschers af is behandelt.  Deel af daar ze zien.  Ton bedreven zin kostbaar 
inkrimpt.  Dit men sterke pijlen stadje soegei enorme gezegd.  Na kleederen 
nutteloos in nu japansche de.  Ontginning dal doorzoeken ingezameld werkwijzen 
sap aanleiding voertuigen.  Liep de over nu jaar te zout voet.  Zal bevatten 
verdeeld bedragen wie talrijke zandlaag menschen.  De oude ze in puin weer ad 
ader
  bron kwam.  Moeilijker dweepzieke dal heb monopolies mislukking beschaving 
dit.  Lengte tonnen zonder zit tin woords heb.  Ad aangaan is bereikt aardige 
na nu opnieuw grooter.  Het inwoners heerlijk bak gesloten.  Tijdens ik rechten 
in tweeden nu waarbij.  Oven duim zit zijn duur hun
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] tc: Changes to netlink message population for OVS-TC Flower Offload

2020-06-19 Thread 0-day Robot
Bleep bloop.  Greetings dsatish, 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 dsatish  needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors 
or committers: Chandra Kesava , Prathibha Nagooru 
, Satish Dhote 

Lines checked: 213, Warnings: 1, Errors: 1


build:
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. 
   -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall 
-Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security 
-Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align 
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes 
-Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror   -g 
-O2 -MT lib/netlink-socket.lo -MD -MP -MF $depbase.Tpo -c -o 
lib/netlink-socket.lo lib/netlink-socket.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include 
-I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare 
-Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter 
-Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition 
-Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow 
-Werror -Werror -g -O2 -MT lib/netlink-socket.lo -MD -MP -MF 
lib/.deps/netlink-socket.Tpo -c lib/netlink-socket.c -o lib/netlink-socket.o
depbase=`echo lib/rtnetlink.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. 
   -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall 
-Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security 
-Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align 
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes 
-Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror   -g 
-O2 -MT lib/rtnetlink.lo -MD -MP -MF $depbase.Tpo -c -o lib/rtnetlink.lo 
lib/rtnetlink.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include 
-I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare 
-Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter 
-Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition 
-Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow 
-Werror -Werror -g -O2 -MT lib/rtnetlink.lo -MD -MP -MF lib/.deps/rtnetlink.Tpo 
-c lib/rtnetlink.c -o lib/rtnetlink.o
depbase=`echo lib/route-table.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. 
   -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall 
-Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security 
-Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align 
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes 
-Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror   -g 
-O2 -MT lib/route-table.lo -MD -MP -MF $depbase.Tpo -c -o lib/route-table.lo 
lib/route-table.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include 
-I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare 
-Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter 
-Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition 
-Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow 
-Werror -Werror -g -O2 -MT lib/route-table.lo -MD -MP -MF 
lib/.deps/route-table.Tpo -c lib/route-table.c -o lib/route-table.o
depbase=`echo lib/tc.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. 
   -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall 
-Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security 
-Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align 
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes 
-Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror   -g 
-O2 -MT lib/tc.lo -MD -MP -MF $depbase.Tpo -c -o lib/tc.lo lib/tc.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include 
-I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare 
-Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter 
-Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition 
-Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow 
-Werror -Werror -g -O2 -MT lib/tc.lo -MD -MP -MF lib/.deps/tc.Tpo -c lib/tc.c 
-o lib/tc.o
lib/tc.c: In function 'nl_msg_put_flower_tunnel':

Re: [ovs-dev] [PATCH ovn v13 0/7] Incremental processing improvements.

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 6:09 PM Dumitru Ceara  wrote:

> On 6/19/20 1:09 PM, num...@ovn.org wrote:
> > From: Numan Siddique 
> >
> > This patch series handles port binding, datapath binding, ovs interface
> changes,
> > runtime data changes, sb chassis changes incrementally.
> >
> >
> > v12 -> v13
> > -
> >  * Addressed the review comments from Dumitru.
> >  * Fixed the test case added in p5 which was failing intermittently.
> >  * Patch 3 commit message has the test results with these patches.
> >
> > v11 -> v12
> > 
> >  * Rebased the patches to latest master.
> >  * Add a new patch p7 which changes the signature of some of
> >the static functions added recently in binding.c so that the out
> >param is the last param.
> >
> > v10 -> v11
> > 
> >  * The firt 3 patches of v10 are now merged to master.
> >  * The v11 has now 6 patches.
> >  * Addressed the review comments from Dumitru.
> >  * Added another new patch - which adds the util function
> >get_unique_lport_key() and use this function in places
> >where it was generating this key earlier.
> >
> > v9 -> v10
> > 
> >  * Addressed review comments.
> >  * Changed the patch 4 from adding a separate tracking variable in I-P
> >engine to just adding a new function - clear_tracked_data() as per
> >the review comments.
> >  * Dropped the patch 9 - "ovn-controller: Handle sbrec_chassis changes
> incrementally."
> >from the series. I couldn't address the review comments for this
> patch in v9.
> >Hence dropped this patch for now. I'll work on it later and submit
> >the patch separately.
> >  * Added a new test only patch - patch 9 in ovn-performance.at to test
> the
> >distributed logical router ports scenario and BFD.
> >
> > v8 -> v9
> > 
> >  * Addressed the review comments from Dumitru and missed v7 comments from
> >Han.
> >  * Any change to the 'local_lport_ids' while handling the OVS interface
> and Port
> >binding changes in binding.c is now added to the tracked
> >datapaths which was not done earlier.
> >  * Dropped the check to lflow_evaluate_pb_changes() in flow_output port
> >binding handler as it is not required.
> >
> > v7 -> v8
> > 
> >  * Dropped the patch 4 as it is not needed, thanks to Han.
> >  * Swapped the patches 5 and 6, which are now patch 4 and 5. The v8
> patch 5 will now make
> >use of tracked data support of engine to clear the physical_flow
> >changes.
> >  * Addressed comments from Han. Added comments in Patch 5 and Patch 6.
> >
> > v6 -> v7
> > 
> >   * Addressed the review comments from Han in patch 1 and patch 2.
> >
> > v5 -> v6
> > 
> >   * Addressed the review comments from Dumitru.
> >   * Patch 1 and Patch 2 are significantly changed due to
> > further refactoring.
> >
> > v4 -> v5
> > 
> >   * Applied patch 1 of v4 to master.
> >   * Addressed the review comments from Han for patch 2.
> >   * Rebased to latest master.
> >
> > v3 -> v4
> > 
> >   * A small fix in patch 3 when binding the port for ovs interface
> > change.
> >   * Rebased to latest master.
> >
> >
> > v2 -> v3
> > 
> >   * Added back the patch 5 and 6 and added 4 more patches. So totally
> > totally 10 patches in the series
> >   * Handling the runtime data changes in flow computation.
> >   * Handling sbrec_chassis changes.
> >
> > v1 -> v2
> > --
> >   * Addressed the review comments from Han in patch 1, 2 and 3.
> >   * Removed patch 5 and 6 from the series. As per the comments
> > from Han, we should handle runtime data changes in flow output
> > engine. But the patch 6 of the series had added a no-op
> > handler. So removed these 2 patches until those are addressed.
> >
> > RFC v2 -> v1
> > -
> >  * Fixed the 2 failing test cases.
> >  * Updated the commit messages.
> >
> >
> > RFC v1 -> RFC v2
> > -
> >  * Added 2 new patches
> >  * Patch 5 (ofctrl_check_and_add_flow) was submitted earlier too and
> >the previous discussion is here -
> https://patchwork.ozlabs.org/patch/1202417/
> >  * Patch 6 handles I-P for ct_zone and OVS interface changes in
> >flow_output_run stage.
> > Numan Siddique (6):
> >   Refactor binding_run()to take two context argument - binding_ctx_in
> > and binding_ctx_out.
> >   ovn-controller: Refactor binding.c
> >   ovn-controller: I-P for port binding in runtime_data stage
> >   ovn-controller: I-P for datapath binding
> >   ofctrl_check_and_add_flow: Replace the actions of an existing flow if
> > actions have changed.
> >   ovn-controller: I-P for ct zone  and OVN
> >
> >
> >
> > Numan Siddique (6):
> >   I-P engine: Provide the option for an engine to clear tracked engine
> > data in every run.
> >   ovn-controller: I-P for ct zone and OVS interface changes in flow
> > output stage.
> >   ovn-controller: Handle runtime data changes in flow output engine
> >   tests: Enhance ovn-performance testing by adding gw router port.
> >   Add an util function 

Re: [ovs-dev] [PATCH ovn v13 0/7] Incremental processing improvements.

2020-06-19 Thread Dumitru Ceara
On 6/19/20 1:09 PM, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> This patch series handles port binding, datapath binding, ovs interface 
> changes,
> runtime data changes, sb chassis changes incrementally.
> 
> 
> v12 -> v13
> -
>  * Addressed the review comments from Dumitru.
>  * Fixed the test case added in p5 which was failing intermittently.
>  * Patch 3 commit message has the test results with these patches.
> 
> v11 -> v12
> 
>  * Rebased the patches to latest master.
>  * Add a new patch p7 which changes the signature of some of
>the static functions added recently in binding.c so that the out
>param is the last param.
> 
> v10 -> v11
> 
>  * The firt 3 patches of v10 are now merged to master.
>  * The v11 has now 6 patches.
>  * Addressed the review comments from Dumitru.
>  * Added another new patch - which adds the util function
>get_unique_lport_key() and use this function in places
>where it was generating this key earlier.
> 
> v9 -> v10
> 
>  * Addressed review comments.
>  * Changed the patch 4 from adding a separate tracking variable in I-P
>engine to just adding a new function - clear_tracked_data() as per
>the review comments.
>  * Dropped the patch 9 - "ovn-controller: Handle sbrec_chassis changes 
> incrementally."
>from the series. I couldn't address the review comments for this patch in 
> v9.
>Hence dropped this patch for now. I'll work on it later and submit
>the patch separately.
>  * Added a new test only patch - patch 9 in ovn-performance.at to test the
>distributed logical router ports scenario and BFD.
> 
> v8 -> v9
> 
>  * Addressed the review comments from Dumitru and missed v7 comments from
>Han.
>  * Any change to the 'local_lport_ids' while handling the OVS interface and 
> Port
>binding changes in binding.c is now added to the tracked
>datapaths which was not done earlier.
>  * Dropped the check to lflow_evaluate_pb_changes() in flow_output port
>binding handler as it is not required.
> 
> v7 -> v8
> 
>  * Dropped the patch 4 as it is not needed, thanks to Han.
>  * Swapped the patches 5 and 6, which are now patch 4 and 5. The v8 patch 5 
> will now make
>use of tracked data support of engine to clear the physical_flow
>changes.
>  * Addressed comments from Han. Added comments in Patch 5 and Patch 6.
> 
> v6 -> v7
> 
>   * Addressed the review comments from Han in patch 1 and patch 2.
> 
> v5 -> v6
> 
>   * Addressed the review comments from Dumitru.
>   * Patch 1 and Patch 2 are significantly changed due to
> further refactoring.
> 
> v4 -> v5
> 
>   * Applied patch 1 of v4 to master.
>   * Addressed the review comments from Han for patch 2.
>   * Rebased to latest master.
> 
> v3 -> v4
> 
>   * A small fix in patch 3 when binding the port for ovs interface
> change.
>   * Rebased to latest master.
> 
> 
> v2 -> v3
> 
>   * Added back the patch 5 and 6 and added 4 more patches. So totally
> totally 10 patches in the series
>   * Handling the runtime data changes in flow computation.
>   * Handling sbrec_chassis changes.
> 
> v1 -> v2
> --
>   * Addressed the review comments from Han in patch 1, 2 and 3.
>   * Removed patch 5 and 6 from the series. As per the comments
> from Han, we should handle runtime data changes in flow output
> engine. But the patch 6 of the series had added a no-op
> handler. So removed these 2 patches until those are addressed.
> 
> RFC v2 -> v1
> -
>  * Fixed the 2 failing test cases.
>  * Updated the commit messages.
> 
> 
> RFC v1 -> RFC v2
> -
>  * Added 2 new patches
>  * Patch 5 (ofctrl_check_and_add_flow) was submitted earlier too and
>the previous discussion is here - 
> https://patchwork.ozlabs.org/patch/1202417/
>  * Patch 6 handles I-P for ct_zone and OVS interface changes in
>flow_output_run stage.
> Numan Siddique (6):
>   Refactor binding_run()to take two context argument - binding_ctx_in
> and binding_ctx_out.
>   ovn-controller: Refactor binding.c
>   ovn-controller: I-P for port binding in runtime_data stage
>   ovn-controller: I-P for datapath binding
>   ofctrl_check_and_add_flow: Replace the actions of an existing flow if
> actions have changed.
>   ovn-controller: I-P for ct zone  and OVN
> 
> 
> 
> Numan Siddique (6):
>   I-P engine: Provide the option for an engine to clear tracked engine
> data in every run.
>   ovn-controller: I-P for ct zone and OVS interface changes in flow
> output stage.
>   ovn-controller: Handle runtime data changes in flow output engine
>   tests: Enhance ovn-performance testing by adding gw router port.
>   Add an util function get_unique_lport_key() for generating unique
> lport key.
>   binding.c: Reorder out params of some of the static functions.
> 
> Venkata Anil (1):
>   ovn-controller: Use the tracked runtime data changes for flow
> calculation.
> 
>  controller/binding.c| 260 

Re: [ovs-dev] [PATCH ovn v13 3/7] ovn-controller: Handle runtime data changes in flow output engine

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 5:22 PM Dumitru Ceara  wrote:

> On 6/19/20 1:10 PM, num...@ovn.org wrote:
> > From: Numan Siddique 
> >
> > In order to handle runtime data changes incrementally, the flow outut
> > runtime data handle should know the changed runtime data.
> > Runtime data now tracks the changed data for any OVS interface
> > and SB port binding changes. The tracked data contains a hmap
> > of tracked datapaths (which changed during runtime data processing.
> >
> > The flow outout runtime_data handler in this patch doesn't do much
> > with the tracked data. It returns false if there is tracked data
> available
> > so that flow_output run is called. If no tracked data is available
> > then there is no need for flow computation and the handler returns true.
> >
> > Next patch in the series processes the tracked data incrementally.
> >
> > Acked-by: Han Zhou 
> > Acked-by: Dumitru Ceara 
> > Co-Authored-by: Venkata Anil 
> > Signed-off-by: Venkata Anil 
> > Signed-off-by: Numan Siddique 
> > ---
> >  controller/binding.c| 195 ++--
> >  controller/binding.h|  23 +
> >  controller/ovn-controller.c | 143 +-
> >  tests/ovn-performance.at|  20 ++--
> >  4 files changed, 336 insertions(+), 45 deletions(-)
> >
> > diff --git a/controller/binding.c b/controller/binding.c
> > index 67fd2777f..58e0bf59f 100644
> > --- a/controller/binding.c
> > +++ b/controller/binding.c
> > @@ -69,13 +69,24 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl)
> >  ovsdb_idl_add_column(ovs_idl, _qos_col_type);
> >  }
> >
> > +static struct tracked_binding_datapath *tracked_binding_datapath_create(
> > +const struct sbrec_datapath_binding *,
> > +bool is_new, struct hmap *tracked_dps);
> > +static struct tracked_binding_datapath *tracked_binding_datapath_find(
> > +struct hmap *, const struct sbrec_datapath_binding *);
> > +static void tracked_binding_datapath_lport_add(
> > +const struct sbrec_port_binding *, struct hmap *tracked_datapaths);
> > +static void update_lport_tracking(const struct sbrec_port_binding *pb,
> > +  struct hmap *tracked_dp_bindings);
> > +
> >  static void
> >  add_local_datapath__(struct ovsdb_idl_index
> *sbrec_datapath_binding_by_key,
> >   struct ovsdb_idl_index
> *sbrec_port_binding_by_datapath,
> >   struct ovsdb_idl_index *sbrec_port_binding_by_name,
> >   const struct sbrec_datapath_binding *datapath,
> >   bool has_local_l3gateway, int depth,
> > - struct hmap *local_datapaths)
> > + struct hmap *local_datapaths,
> > + struct hmap *tracked_datapaths)
> >  {
> >  uint32_t dp_key = datapath->tunnel_key;
> >  struct local_datapath *ld = get_local_datapath(local_datapaths,
> dp_key);
> > @@ -92,6 +103,11 @@ add_local_datapath__(struct ovsdb_idl_index
> *sbrec_datapath_binding_by_key,
> >  ld->localnet_port = NULL;
> >  ld->has_local_l3gateway = has_local_l3gateway;
> >
> > +if (tracked_datapaths &&
> > +!tracked_binding_datapath_find(tracked_datapaths, datapath)) {
> > +tracked_binding_datapath_create(datapath, true,
> tracked_datapaths);
> > +}
> > +
> >  if (depth >= 100) {
> >  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
> >  VLOG_WARN_RL(, "datapaths nested too deep");
> > @@ -124,7 +140,8 @@ add_local_datapath__(struct ovsdb_idl_index
> *sbrec_datapath_binding_by_key,
> >
>  sbrec_port_binding_by_datapath,
> >   sbrec_port_binding_by_name,
> >   peer->datapath, false,
> > - depth + 1,
> local_datapaths);
> > + depth + 1, local_datapaths,
> > + tracked_datapaths);
> >  }
> >  ld->n_peer_ports++;
> >  if (ld->n_peer_ports > ld->n_allocated_peer_ports) {
> > @@ -147,12 +164,14 @@ add_local_datapath(struct ovsdb_idl_index
> *sbrec_datapath_binding_by_key,
> > struct ovsdb_idl_index
> *sbrec_port_binding_by_datapath,
> > struct ovsdb_idl_index *sbrec_port_binding_by_name,
> > const struct sbrec_datapath_binding *datapath,
> > -   bool has_local_l3gateway, struct hmap
> *local_datapaths)
> > +   bool has_local_l3gateway, struct hmap
> *local_datapaths,
> > +   struct hmap *tracked_datapaths)
> >  {
> >  add_local_datapath__(sbrec_datapath_binding_by_key,
> >   sbrec_port_binding_by_datapath,
> >   sbrec_port_binding_by_name,
> > - datapath, has_local_l3gateway, 0,
> local_datapaths);
> > +  

Re: [ovs-dev] [PATCH ovn v13 5/7] tests: Enhance ovn-performance testing by adding gw router port.

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 5:57 PM Dumitru Ceara  wrote:

> On Fri, Jun 19, 2020 at 1:11 PM  wrote:
> >
> > From: Numan Siddique 
> >
> > This covers the scenario of setting up/deleting of BFD tunnels
> > for HA.
> >
> > Acked-by: Han Zhou 
> > Signed-off-by: Numan Siddique 
> > ---
> >  tests/ovn-performance.at | 106 +++
> >  1 file changed, 106 insertions(+)
> >
> > diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
> > index a12757e18..400b833e1 100644
> > --- a/tests/ovn-performance.at
> > +++ b/tests/ovn-performance.at
> > @@ -239,6 +239,16 @@ for i in 1 2; do
> >  ovn_attach n1 br-phys 192.168.0.$i
> >  done
> >
> > +for i in 1 2 3; do
> > +sim_add gw$i
> > +as gw$i
> > +ovs-vsctl add-br br-phys
> > +ovs-vsctl add-br br-ex
> > +ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex"
> > +j=$((i + 2))
> > +ovn_attach n1 br-phys 192.168.0.$j
> > +done
> > +
> >  # Wait for the tunnel ports to be created and up.
> >  # Otherwise this may affect the lflow_run count.
> >
> > @@ -399,6 +409,102 @@ OVN_CONTROLLER_EXPECT_NO_HIT(
> >  [ovn-nbctl --wait=hv acl-add pg1 to-lport 1001 'outport == @pg1 &&
> ip4.src == $pg1_ip4' allow]
> >  )
> >
> > +# Create a public logical switch and attach the router to it.
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv ls-add public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-add public public-lr1]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-type public-lr1 router]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-addresses public-lr1 router]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-options public-lr1
> router-port=lr1-public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-add lr1 lr1-public 00:00:20:20:12:13
> 172.168.0.100/24]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-add public ln-public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-type ln-public localnet]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-addresses ln-public unknown]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-options ln-public network_name=public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [=0 =0 >0 =0 =0],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw1 30 &&
> ovn-nbctl --wait=hv sync]
> > +)
> > +
> > +# After this, BFD should be enabled from hv1 and hv2 to gw1.
> > +# So there should be lflow_run hits in hv1, hv2, gw1 and gw2
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [>0 >0 >0 >0 =0],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 20 &&
> ovn-nbctl --wait=hv sync]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10 &&
> ovn-nbctl --wait=hv sync]
> > +)
> > +
> > +# Make gw2 master. There is remote possibility that full recompute
> > +# triggers for gw2 after it becomes master. Most of the time
> > +# there will be no recompute.
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [=0 =0 =0 >=0 =0],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 40 &&
> ovn-nbctl --wait=hv sync]
> > +)
> > +
> > +# Delete gw2 from gateway chassis
> > +OVN_CONTROLLER_EXPECT_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw2 &&
> ovn-nbctl --wait=hv sync]
> > +)
> > +
> > +# Delete gw1 from gateway chassis
> > +# After this, the BFD should be disabled entirely as gw3 is the
> > +# only gateway chassis.
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [>0 >0 >0 =0 >0],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw1]
> > +)
> > +
> > +# Delete gw3 from gateway chassis. There should be no lflow_run.
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw3]
> > +)
> > +
> >  for i in 1 2; do
> >  j=$((i%2 + 1))
> >  lp=lp$i
> > --
> > 2.26.2
> >
>
> Hi Numan,
>
> This test still fails occasionally on my machine. The following
> incremental makes it work.
>
> What do you think?
>


Thanks Dumitru for testing it and for fixing 

Re: [ovs-dev] [PATCH] ovs-dpctl-top: open stdin in binary mode

2020-06-19 Thread 0-day Robot
Bleep bloop.  Greetings Timothy Redaelli, 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 Timothy Redaelli  needs to sign off.
Lines checked: 27, 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 ovn v13 5/7] tests: Enhance ovn-performance testing by adding gw router port.

2020-06-19 Thread Dumitru Ceara
On Fri, Jun 19, 2020 at 1:11 PM  wrote:
>
> From: Numan Siddique 
>
> This covers the scenario of setting up/deleting of BFD tunnels
> for HA.
>
> Acked-by: Han Zhou 
> Signed-off-by: Numan Siddique 
> ---
>  tests/ovn-performance.at | 106 +++
>  1 file changed, 106 insertions(+)
>
> diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
> index a12757e18..400b833e1 100644
> --- a/tests/ovn-performance.at
> +++ b/tests/ovn-performance.at
> @@ -239,6 +239,16 @@ for i in 1 2; do
>  ovn_attach n1 br-phys 192.168.0.$i
>  done
>
> +for i in 1 2 3; do
> +sim_add gw$i
> +as gw$i
> +ovs-vsctl add-br br-phys
> +ovs-vsctl add-br br-ex
> +ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex"
> +j=$((i + 2))
> +ovn_attach n1 br-phys 192.168.0.$j
> +done
> +
>  # Wait for the tunnel ports to be created and up.
>  # Otherwise this may affect the lflow_run count.
>
> @@ -399,6 +409,102 @@ OVN_CONTROLLER_EXPECT_NO_HIT(
>  [ovn-nbctl --wait=hv acl-add pg1 to-lport 1001 'outport == @pg1 && 
> ip4.src == $pg1_ip4' allow]
>  )
>
> +# Create a public logical switch and attach the router to it.
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv ls-add public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-add public public-lr1]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-type public-lr1 router]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-addresses public-lr1 router]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-options public-lr1 router-port=lr1-public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-add lr1 lr1-public 00:00:20:20:12:13 
> 172.168.0.100/24]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-add public ln-public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-type ln-public localnet]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-addresses ln-public unknown]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-options ln-public network_name=public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [=0 =0 >0 =0 =0],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw1 30 && 
> ovn-nbctl --wait=hv sync]
> +)
> +
> +# After this, BFD should be enabled from hv1 and hv2 to gw1.
> +# So there should be lflow_run hits in hv1, hv2, gw1 and gw2
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [>0 >0 >0 >0 =0],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 20 && 
> ovn-nbctl --wait=hv sync]
> +)
> +
> +OVN_CONTROLLER_EXPECT_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10 && 
> ovn-nbctl --wait=hv sync]
> +)
> +
> +# Make gw2 master. There is remote possibility that full recompute
> +# triggers for gw2 after it becomes master. Most of the time
> +# there will be no recompute.
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [=0 =0 =0 >=0 =0],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 40 && 
> ovn-nbctl --wait=hv sync]
> +)
> +
> +# Delete gw2 from gateway chassis
> +OVN_CONTROLLER_EXPECT_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw2 && ovn-nbctl 
> --wait=hv sync]
> +)
> +
> +# Delete gw1 from gateway chassis
> +# After this, the BFD should be disabled entirely as gw3 is the
> +# only gateway chassis.
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [>0 >0 >0 =0 >0],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw1]
> +)
> +
> +# Delete gw3 from gateway chassis. There should be no lflow_run.
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw3]
> +)
> +
>  for i in 1 2; do
>  j=$((i%2 + 1))
>  lp=lp$i
> --
> 2.26.2
>

Hi Numan,

This test still fails occasionally on my machine. The following
incremental makes it work.

What do you think?

Thanks,
Dumitru

diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
index 400b833..3010860 100644
--- a/tests/ovn-performance.at
+++ b/tests/ovn-performance.at
@@ -480,9 +480,13 @@ OVN_CONTROLLER_EXPECT_HIT(
 # Make gw2 master. There is remote possibility that full recompute
 # triggers for gw2 after it becomes master. Most of the time
 # there will be no recompute.

Re: [ovs-dev] [PATCH 0/7] user defined events and notification

2020-06-19 Thread Gowrishankar Muthukrishnan
Hi,
Just curious to probe you again if you had a chance to check this feature.

Thanks in advance.

On Tue, Jun 2, 2020 at 3:40 PM Gowrishankar Muthukrishnan <
gmuth...@redhat.com> wrote:

> This patchset enables new feature "user defined events and notification".
> In short, by this feature, one can enable asynchronous and less intrusive
> monitoring in Openvswitch data plane and control plane resources, by
> defining one or more events to populate inside Openvswitch. Based on the
> type of the event, their behaviour is defined (to wait for some condition
> be met or to inform in work flow). More information on how to use this
> feature is in Documentation/topics/user-defined-events.rst.
>
> This feature is targeting troubleshooting and live debugging situations
> in production deployment, hence more helpful for operators and developers
> debugging functional and performance issues in Openvswitch. This proposal
> is not extensively coveraing all traceable places in Openvswitch, but
> demonstrating how it can be helpful and be extended based on the usecases.
> Based on how it is perceived, I can work on enhancing this for optimations
> whereever needed.
>
> Gowrishankar Muthukrishnan (7):
>   event: add api to manage user defined events
>   stopwatch: expose required api for event library
>   dpif: hook timer event api in datapath functions
>   coverage: support conditional notification from events
>   event: test daemon to receive notification from event api
>   event: documentation notes on event library
>   system-event: add event testsuite
>
>  Documentation/automake.mk|   1 +
>  Documentation/topics/index.rst   |   1 +
>  Documentation/topics/user-defined-events.rst | 306 +++
>  lib/automake.mk  |   2 +
>  lib/coverage.c   |  61 +++
>  lib/coverage.h   |   4 +
>  lib/dpif-netdev.c|   5 +-
>  lib/event.c  | 764
> +++
>  lib/event.h  | 269 ++
>  lib/netdev-dpdk.c|   3 +
>  lib/stopwatch.c  |  20 +-
>  lib/stopwatch.h  |   9 +
>  lib/timeval.c|   3 +
>  tests/automake.mk|  18 +
>  tests/system-event.at| 351 
>  utilities/automake.mk|   6 +-
>  utilities/ovs-testeventd.c   | 156 ++
>  vswitchd/bridge.c|   2 +
>  18 files changed, 1978 insertions(+), 3 deletions(-)
>  create mode 100644 Documentation/topics/user-defined-events.rst
>  create mode 100644 lib/event.c
>  create mode 100644 lib/event.h
>  create mode 100644 tests/system-event.at
>  create mode 100644 utilities/ovs-testeventd.c
>
> --
> 1.8.3.1
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>

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


[ovs-dev] [PATCH] tc: Changes to netlink message population for OVS-TC Flower Offload

2020-06-19 Thread dsatish
OVS-TC offload sends only fields that are not completely masked out
to the TC kernel module. Some of the hardware we work with requires
all fields extracted from the packet along with the mask to be sent
to the driver. Hardware may optimize tables based on entire fields
of packet and mask of fields, even though certain fields are masked
out.

OVS when offloading to ovs kernel datapath sends the entire key
along with the mask. Proposal requests for similar behaviour in
ovs-vswitchd in case of tc-offload. While constructing netlink
messages, ovs-vswitchd is removing completely masked out fields.
Sending additional masked fields should not impact existing drivers.
TC internally uses dissectors to extract non masked fields, so it
should not impact existing drivers in tc.

Example:
ovs-rule:ovs-ofctl add-flow br0 \
"table=0, dl_dst=00:a1:45:23:23:11/ff:ff:ff:ff:ff:ff, actions=1"

If we have above rule in ovs and an icmp packet matching destination
MAC 00:a1:45:23:23:11 arrives, ovs prepares the key and mask with all
relevant fields. When sending to TC it removes fields which are
completely masked out. In this case ethertype, and dst_mac fields are
sent as part of netlink message to tc.

OVS patch also requires minor fixes in TC. Patch to TC is submitted
at following link. 1/3 patch has the fix for the same.
http://patchwork.ozlabs.org/project/netdev/list/?series=184493

Signed-off-by: Chandra Kesava 
Signed-off-by: Prathibha Nagooru 
Signed-off-by: Satish Dhote 
---
 lib/tc.c | 110 +--
 1 file changed, 42 insertions(+), 68 deletions(-)

diff --git a/lib/tc.c b/lib/tc.c
index c2ab77553..56280890b 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -2648,9 +2648,6 @@ nl_msg_put_masked_value(struct ofpbuf *request, uint16_t 
type,
 const void *mask_data, size_t len)
 {
 if (mask_type != TCA_FLOWER_UNSPEC) {
-if (is_all_zeros(mask_data, len)) {
-return;
-}
 nl_msg_put_unspec(request, mask_type, mask_data, len);
 }
 nl_msg_put_unspec(request, type, data, len);
@@ -2707,15 +2704,15 @@ nl_msg_put_flower_tunnel(struct ofpbuf *request, struct 
tc_flower *flower)
 uint8_t ttl_mask = flower->mask.tunnel.ttl;
 ovs_be64 id_mask = flower->mask.tunnel.id;
 
-if (ipv4_dst_mask || ipv4_src_mask) {
+if (ipv4_dst || ipv4_src) {
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,
 ipv4_dst_mask);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,
 ipv4_src_mask);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_DST, ipv4_dst);
 nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_IPV4_SRC, ipv4_src);
-} else if (ipv6_addr_is_set(ipv6_dst_mask) ||
-   ipv6_addr_is_set(ipv6_src_mask)) {
+} else if (ipv6_addr_is_set(ipv6_dst) ||
+   ipv6_addr_is_set(ipv6_src)) {
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,
 ipv6_dst_mask);
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,
@@ -2723,20 +2720,18 @@ nl_msg_put_flower_tunnel(struct ofpbuf *request, struct 
tc_flower *flower)
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_DST, ipv6_dst);
 nl_msg_put_in6_addr(request, TCA_FLOWER_KEY_ENC_IPV6_SRC, ipv6_src);
 }
-if (tos_mask) {
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS, tos);
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS_MASK, tos_mask);
-}
-if (ttl_mask) {
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
-nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
-}
+
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS, tos);
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TOS_MASK, tos_mask);
+
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL, ttl);
+nl_msg_put_u8(request, TCA_FLOWER_KEY_ENC_IP_TTL_MASK, ttl_mask);
+
 if (tp_dst) {
 nl_msg_put_be16(request, TCA_FLOWER_KEY_ENC_UDP_DST_PORT, tp_dst);
 }
-if (id_mask) {
-nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);
-}
+
+nl_msg_put_be32(request, TCA_FLOWER_KEY_ENC_KEY_ID, id);
 nl_msg_put_flower_tunnel_opts(request, TCA_FLOWER_KEY_ENC_OPTS,
   flower->key.tunnel.metadata);
 nl_msg_put_flower_tunnel_opts(request, TCA_FLOWER_KEY_ENC_OPTS_MASK,
@@ -2796,12 +2791,10 @@ nl_msg_put_flower_options(struct ofpbuf *request, 
struct tc_flower *flower)
   flower->key.ip_proto);
 }
 
-if (flower->mask.flags) {
-nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS,
-   htonl(flower->key.flags));
-nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS_MASK,
-   htonl(flower->mask.flags));
-}
+nl_msg_put_be32(request, TCA_FLOWER_KEY_FLAGS,
+   

Re: [ovs-dev] [PATCH] ovs-dpctl-top: Skip "eth()" element

2020-06-19 Thread 0-day Robot
Bleep bloop.  Greetings Timothy Redaelli, 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 Timothy Redaelli  needs to sign off.
Lines checked: 36, 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 ovn v13 3/7] ovn-controller: Handle runtime data changes in flow output engine

2020-06-19 Thread Dumitru Ceara
On 6/19/20 1:10 PM, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> In order to handle runtime data changes incrementally, the flow outut
> runtime data handle should know the changed runtime data.
> Runtime data now tracks the changed data for any OVS interface
> and SB port binding changes. The tracked data contains a hmap
> of tracked datapaths (which changed during runtime data processing.
> 
> The flow outout runtime_data handler in this patch doesn't do much
> with the tracked data. It returns false if there is tracked data available
> so that flow_output run is called. If no tracked data is available
> then there is no need for flow computation and the handler returns true.
> 
> Next patch in the series processes the tracked data incrementally.
> 
> Acked-by: Han Zhou 
> Acked-by: Dumitru Ceara 
> Co-Authored-by: Venkata Anil 
> Signed-off-by: Venkata Anil 
> Signed-off-by: Numan Siddique 
> ---
>  controller/binding.c| 195 ++--
>  controller/binding.h|  23 +
>  controller/ovn-controller.c | 143 +-
>  tests/ovn-performance.at|  20 ++--
>  4 files changed, 336 insertions(+), 45 deletions(-)
> 
> diff --git a/controller/binding.c b/controller/binding.c
> index 67fd2777f..58e0bf59f 100644
> --- a/controller/binding.c
> +++ b/controller/binding.c
> @@ -69,13 +69,24 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl)
>  ovsdb_idl_add_column(ovs_idl, _qos_col_type);
>  }
>  
> +static struct tracked_binding_datapath *tracked_binding_datapath_create(
> +const struct sbrec_datapath_binding *,
> +bool is_new, struct hmap *tracked_dps);
> +static struct tracked_binding_datapath *tracked_binding_datapath_find(
> +struct hmap *, const struct sbrec_datapath_binding *);
> +static void tracked_binding_datapath_lport_add(
> +const struct sbrec_port_binding *, struct hmap *tracked_datapaths);
> +static void update_lport_tracking(const struct sbrec_port_binding *pb,
> +  struct hmap *tracked_dp_bindings);
> +
>  static void
>  add_local_datapath__(struct ovsdb_idl_index *sbrec_datapath_binding_by_key,
>   struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
>   struct ovsdb_idl_index *sbrec_port_binding_by_name,
>   const struct sbrec_datapath_binding *datapath,
>   bool has_local_l3gateway, int depth,
> - struct hmap *local_datapaths)
> + struct hmap *local_datapaths,
> + struct hmap *tracked_datapaths)
>  {
>  uint32_t dp_key = datapath->tunnel_key;
>  struct local_datapath *ld = get_local_datapath(local_datapaths, dp_key);
> @@ -92,6 +103,11 @@ add_local_datapath__(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
>  ld->localnet_port = NULL;
>  ld->has_local_l3gateway = has_local_l3gateway;
>  
> +if (tracked_datapaths &&
> +!tracked_binding_datapath_find(tracked_datapaths, datapath)) {
> +tracked_binding_datapath_create(datapath, true, tracked_datapaths);
> +}
> +
>  if (depth >= 100) {
>  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
>  VLOG_WARN_RL(, "datapaths nested too deep");
> @@ -124,7 +140,8 @@ add_local_datapath__(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
>   sbrec_port_binding_by_datapath,
>   sbrec_port_binding_by_name,
>   peer->datapath, false,
> - depth + 1, local_datapaths);
> + depth + 1, local_datapaths,
> + tracked_datapaths);
>  }
>  ld->n_peer_ports++;
>  if (ld->n_peer_ports > ld->n_allocated_peer_ports) {
> @@ -147,12 +164,14 @@ add_local_datapath(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
> struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
> struct ovsdb_idl_index *sbrec_port_binding_by_name,
> const struct sbrec_datapath_binding *datapath,
> -   bool has_local_l3gateway, struct hmap *local_datapaths)
> +   bool has_local_l3gateway, struct hmap *local_datapaths,
> +   struct hmap *tracked_datapaths)
>  {
>  add_local_datapath__(sbrec_datapath_binding_by_key,
>   sbrec_port_binding_by_datapath,
>   sbrec_port_binding_by_name,
> - datapath, has_local_l3gateway, 0, local_datapaths);
> + datapath, has_local_l3gateway, 0, local_datapaths,
> + tracked_datapaths);
>  }
>  
>  static void
> @@ -506,6 +525,11 @@ update_local_lport_ids(struct 

[ovs-dev] [PATCH net] openvswitch: take into account de-fragmentation in execute_check_pkt_len

2020-06-19 Thread Lorenzo Bianconi
ovs connection tracking module performs de-fragmentation on incoming
fragmented traffic. Take info account if traffic has been de-fragmented
in execute_check_pkt_len action otherwise we will perform the wrong
nested action considering the original packet size. This issue typically
occurs if ovs-vswitchd adds a rule in the pipeline that requires connection
tracking (e.g. OVN stateful ACLs) before execute_check_pkt_len action.

Fixes: 4d5ec89fc8d14 ("net: openvswitch: Add a new action check_pkt_len")
Signed-off-by: Lorenzo Bianconi 
---
 net/openvswitch/actions.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index fc0efd8833c8..9f4dd64e53bb 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -1169,9 +1169,10 @@ static int execute_check_pkt_len(struct datapath *dp, 
struct sk_buff *skb,
 struct sw_flow_key *key,
 const struct nlattr *attr, bool last)
 {
+   struct ovs_skb_cb *ovs_cb = OVS_CB(skb);
const struct nlattr *actions, *cpl_arg;
const struct check_pkt_len_arg *arg;
-   int rem = nla_len(attr);
+   int len, rem = nla_len(attr);
bool clone_flow_key;
 
/* The first netlink attribute in 'attr' is always
@@ -1180,7 +1181,8 @@ static int execute_check_pkt_len(struct datapath *dp, 
struct sk_buff *skb,
cpl_arg = nla_data(attr);
arg = nla_data(cpl_arg);
 
-   if (skb->len <= arg->pkt_len) {
+   len = ovs_cb->mru ? ovs_cb->mru : skb->len;
+   if (len <= arg->pkt_len) {
/* Second netlink attribute in 'attr' is always
 * 'OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL'.
 */
-- 
2.26.2

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


[ovs-dev] [PATCH] ovs-dpctl-top: open stdin in binary mode

2020-06-19 Thread Timothy Redaelli
On Python3 buffering can only be disabled on files opened in binary mode.
---
 utilities/ovs-dpctl-top.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index fbe6e4f56..97dc12f27 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -1236,7 +1236,7 @@ def flows_script(args):
 
 if (args.flowFiles is None):
 logging.info("reading flows from stdin")
-ihdl = os.fdopen(sys.stdin.fileno(), 'r', 0)
+ihdl = os.fdopen(sys.stdin.fileno(), 'rb', 0)
 try:
 flow_db = flows_read(ihdl, flow_db)
 finally:
-- 
2.26.2

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


Re: [ovs-dev] [PATCH ovn v12 5/7] tests: Enhance ovn-performance testing by adding gw router port.

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 2:08 PM Dumitru Ceara  wrote:

> On 6/11/20 2:44 PM, num...@ovn.org wrote:
> > From: Numan Siddique 
> >
> > This covers the scenario of setting up/deleting of BFD tunnels
> > for HA.
> >
> > Tested-by: Dumitru Ceara 
> > Signed-off-by: Numan Siddique 
>
> Hi Numan,
>
> This test now fails for me:
>
> 0   0   0   0   0   ovn-nbctl --wait=hv
> lrp-set-gateway-chassis lr1-public gw1 30
>
> ./ovn-performance.at:463: test $rc -eq 0 -a $rv -eq 1
> ./ovn-performance.at:463: exit code was 1, expected 0
>
> Maybe we missed something in the previous patches?
>

There was a race condition window. Fixed it by adding ovn-sbctl --wait=hv
sync

Thanks for the suggestion.

I have submitted v13 addressing the comments and fixing this test failure.
Please take a look.

Numan


>
> Thanks,
> Dumitru
>
> > ---
> >  tests/ovn-performance.at | 104 +++
> >  1 file changed, 104 insertions(+)
> >
> > diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
> > index a12757e18..2a15cb473 100644
> > --- a/tests/ovn-performance.at
> > +++ b/tests/ovn-performance.at
> > @@ -239,6 +239,16 @@ for i in 1 2; do
> >  ovn_attach n1 br-phys 192.168.0.$i
> >  done
> >
> > +for i in 1 2 3; do
> > +sim_add gw$i
> > +as gw$i
> > +ovs-vsctl add-br br-phys
> > +ovs-vsctl add-br br-ex
> > +ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex"
> > +j=$((i + 2))
> > +ovn_attach n1 br-phys 192.168.0.$j
> > +done
> > +
> >  # Wait for the tunnel ports to be created and up.
> >  # Otherwise this may affect the lflow_run count.
> >
> > @@ -399,6 +409,100 @@ OVN_CONTROLLER_EXPECT_NO_HIT(
> >  [ovn-nbctl --wait=hv acl-add pg1 to-lport 1001 'outport == @pg1 &&
> ip4.src == $pg1_ip4' allow]
> >  )
> >
> > +# Create a public logical switch and attach the router to it.
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv ls-add public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-add public public-lr1]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-type public-lr1 router]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-addresses public-lr1 router]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-options public-lr1
> router-port=lr1-public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-add lr1 lr1-public 00:00:20:20:12:13
> 172.168.0.100/24]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-add public ln-public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-type ln-public localnet]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-addresses ln-public unknown]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2], [lflow_run],
> > +[ovn-nbctl --wait=hv lsp-set-options ln-public network_name=public]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [=0 =0 >0 =0 =0],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw1 30]
> > +)
> > +
> > +# After this, BFD should be enabled from hv1 and hv2 to gw1.
> > +# So there should be lflow_run hits in hv1, hv2, gw1 and gw2
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [>0 >0 >0 >0 =0],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 20]
> > +)
> > +
> > +OVN_CONTROLLER_EXPECT_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10]
> > +)
> > +
> > +# Make gw2 master.
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 40]
> > +)
> > +
> > +# Delete gw2 from gateway chassis
> > +OVN_CONTROLLER_EXPECT_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw2]
> > +)
> > +
> > +# Delete gw1 from gateway chassis
> > +# After this, the BFD should be disabled entirely as gw3 is the
> > +# only gateway chassis.
> > +OVN_CONTROLLER_EXPECT_HIT_COND(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [>0 >0 >0 =0 >0],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw1]
> > +)
> > +
> > +# Delete gw3 from gateway chassis. There should be no lflow_run.
> > +OVN_CONTROLLER_EXPECT_NO_HIT(
> > +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> > +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw3]
> > +)
> > +
> >  for i in 1 2; do
> > 

[ovs-dev] [PATCH ovn v13 7/7] binding.c: Reorder out params of some of the static functions.

2020-06-19 Thread numans
From: Numan Siddique 

Acked-by: Han Zhou 
Signed-off-by: Numan Siddique 
---
 controller/binding.c | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index 9dbbb34df..b2c388146 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -495,7 +495,7 @@ update_ld_localnet_port(const struct sbrec_port_binding 
*binding_rec,
  * Also track if the set has changed.
  */
 static void
-update_local_lports(struct binding_ctx_out *b_ctx, const char *iface_id)
+update_local_lports(const char *iface_id, struct binding_ctx_out *b_ctx)
 {
 if (sset_add(b_ctx->local_lports, iface_id) != NULL) {
 b_ctx->local_lports_changed = true;
@@ -506,7 +506,7 @@ update_local_lports(struct binding_ctx_out *b_ctx, const 
char *iface_id)
  * set has changed.
  */
 static void
-remove_local_lports(struct binding_ctx_out *b_ctx, const char *iface_id)
+remove_local_lports(const char *iface_id, struct binding_ctx_out *b_ctx)
 {
 if (sset_find_and_delete(b_ctx->local_lports, iface_id)) {
 b_ctx->local_lports_changed = true;
@@ -517,8 +517,8 @@ remove_local_lports(struct binding_ctx_out *b_ctx, const 
char *iface_id)
  * lport IDs. Also track if the set has changed.
  */
 static void
-update_local_lport_ids(struct binding_ctx_out *b_ctx,
-   const struct sbrec_port_binding *pb)
+update_local_lport_ids(const struct sbrec_port_binding *pb,
+   struct binding_ctx_out *b_ctx)
 {
 char buf[16];
 get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,
@@ -537,8 +537,8 @@ update_local_lport_ids(struct binding_ctx_out *b_ctx,
  * the set has changed.
  */
 static void
-remove_local_lport_ids(struct binding_ctx_out *b_ctx,
-   const struct sbrec_port_binding *pb)
+remove_local_lport_ids(const struct sbrec_port_binding *pb,
+   struct binding_ctx_out *b_ctx)
 {
 char buf[16];
 get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,
@@ -999,7 +999,7 @@ consider_vif_lport_(const struct sbrec_port_binding *pb,
pb->datapath, false,
b_ctx_out->local_datapaths,
b_ctx_out->tracked_dp_bindings);
-update_local_lport_ids(b_ctx_out, pb);
+update_local_lport_ids(pb, b_ctx_out);
 if (lbinding->iface && qos_map && b_ctx_in->ovs_idl_txn) {
 get_qos_params(pb, qos_map);
 }
@@ -1182,7 +1182,7 @@ consider_nonvif_lport_(const struct sbrec_port_binding 
*pb,
struct binding_ctx_out *b_ctx_out)
 {
 if (our_chassis) {
-update_local_lports(b_ctx_out, pb->logical_port);
+update_local_lports(pb->logical_port, b_ctx_out);
 add_local_datapath(b_ctx_in->sbrec_datapath_binding_by_key,
b_ctx_in->sbrec_port_binding_by_datapath,
b_ctx_in->sbrec_port_binding_by_name,
@@ -1190,7 +1190,7 @@ consider_nonvif_lport_(const struct sbrec_port_binding 
*pb,
b_ctx_out->local_datapaths,
b_ctx_out->tracked_dp_bindings);
 
-update_local_lport_ids(b_ctx_out, pb);
+update_local_lport_ids(pb, b_ctx_out);
 return claim_lport(pb, b_ctx_in->chassis_rec, NULL,
!b_ctx_in->ovnsb_idl_txn,
b_ctx_out->tracked_dp_bindings);
@@ -1234,13 +1234,13 @@ consider_localnet_lport(const struct sbrec_port_binding 
*pb,
 {
 /* Add all localnet ports to local_ifaces so that we allocate ct zones
  * for them. */
-update_local_lports(b_ctx_out, pb->logical_port);
+update_local_lports(pb->logical_port, b_ctx_out);
 
 if (qos_map && b_ctx_in->ovs_idl_txn) {
 get_qos_params(pb, qos_map);
 }
 
-update_local_lport_ids(b_ctx_out, pb);
+update_local_lport_ids(pb, b_ctx_out);
 }
 
 static bool
@@ -1270,7 +1270,7 @@ consider_ha_lport(const struct sbrec_port_binding *pb,
pb->datapath, false,
b_ctx_out->local_datapaths,
b_ctx_out->tracked_dp_bindings);
-update_local_lport_ids(b_ctx_out, pb);
+update_local_lport_ids(pb, b_ctx_out);
 }
 
 return consider_nonvif_lport_(pb, our_chassis, false, b_ctx_in, b_ctx_out);
@@ -1336,7 +1336,7 @@ build_local_bindings(struct binding_ctx_in *b_ctx_in,
 ovs_assert(lbinding->type == BT_VIF);
 }
 
-update_local_lports(b_ctx_out, iface_id);
+update_local_lports(iface_id, b_ctx_out);
 smap_replace(b_ctx_out->local_iface_ids, iface_rec->name,
  iface_id);
 }
@@ -1392,7 +1392,7 @@ binding_run(struct binding_ctx_in *b_ctx_in, struct 
binding_ctx_out *b_ctx_out)
 case LP_PATCH:
 case 

[ovs-dev] [PATCH ovn v13 6/7] Add an util function get_unique_lport_key() for generating unique lport key.

2020-06-19 Thread numans
From: Numan Siddique 

Suggested-by: Dumitru Ceara 
Acked-by: Han Zhou 
Signed-off-by: Numan Siddique 
---
 controller/binding.c | 8 
 controller/lflow.c   | 8 
 lib/ovn-util.h   | 8 
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index 58e0bf59f..9dbbb34df 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -521,8 +521,8 @@ update_local_lport_ids(struct binding_ctx_out *b_ctx,
const struct sbrec_port_binding *pb)
 {
 char buf[16];
-snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64,
- pb->datapath->tunnel_key, pb->tunnel_key);
+get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,
+ buf, sizeof(buf));
 if (sset_add(b_ctx->local_lport_ids, buf) != NULL) {
 b_ctx->local_lport_ids_changed = true;
 
@@ -541,8 +541,8 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
const struct sbrec_port_binding *pb)
 {
 char buf[16];
-snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64,
- pb->datapath->tunnel_key, pb->tunnel_key);
+get_unique_lport_key(pb->datapath->tunnel_key, pb->tunnel_key,
+ buf, sizeof(buf));
 if (sset_find_and_delete(b_ctx->local_lport_ids, buf)) {
 b_ctx->local_lport_ids_changed = true;
 
diff --git a/controller/lflow.c b/controller/lflow.c
index c76ba4e92..15f1a6acb 100644
--- a/controller/lflow.c
+++ b/controller/lflow.c
@@ -130,7 +130,7 @@ is_chassis_resident_cb(const void *c_aux_, const char 
*port_name)
 /* Store the port_name to lflow reference. */
 int64_t dp_id = pb->datapath->tunnel_key;
 char buf[16];
-snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64, dp_id, pb->tunnel_key);
+get_unique_lport_key(dp_id, pb->tunnel_key, buf, sizeof(buf));
 lflow_resource_add(c_aux->lfrr, REF_TYPE_PORTBINDING, buf,
_aux->lflow->header_.uuid);
 
@@ -664,7 +664,7 @@ consider_logical_flow(const struct sbrec_logical_flow 
*lflow,
 if (port_id) {
 int64_t dp_id = lflow->logical_datapath->tunnel_key;
 char buf[16];
-snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64, dp_id, 
port_id);
+get_unique_lport_key(dp_id, port_id, buf, sizeof(buf));
 lflow_resource_add(l_ctx_out->lfrr, REF_TYPE_PORTBINDING, buf,
>header_.uuid);
 if (!sset_contains(l_ctx_in->local_lport_ids, buf)) {
@@ -928,8 +928,8 @@ lflow_handle_flows_for_lport(const struct 
sbrec_port_binding *pb,
 bool changed;
 int64_t dp_id = pb->datapath->tunnel_key;
 char pb_ref_name[16];
-snprintf(pb_ref_name, sizeof(pb_ref_name), "%"PRId64"_%"PRId64,
- dp_id, pb->tunnel_key);
+get_unique_lport_key(dp_id, pb->tunnel_key, pb_ref_name,
+ sizeof(pb_ref_name));
 
 return lflow_handle_changed_ref(REF_TYPE_PORTBINDING, pb_ref_name,
 l_ctx_in, l_ctx_out, );
diff --git a/lib/ovn-util.h b/lib/ovn-util.h
index e13cf4d78..eba2948ff 100644
--- a/lib/ovn-util.h
+++ b/lib/ovn-util.h
@@ -114,6 +114,14 @@ bool ovn_tnlid_in_use(const struct hmap *set, uint32_t 
tnlid);
 uint32_t ovn_allocate_tnlid(struct hmap *set, const char *name, uint32_t min,
 uint32_t max, uint32_t *hint);
 
+static inline void
+get_unique_lport_key(uint64_t dp_tunnel_key, uint64_t lport_tunnel_key,
+ char *buf, size_t buf_size)
+{
+snprintf(buf, buf_size, "%"PRId64"_%"PRId64, dp_tunnel_key,
+ lport_tunnel_key);
+}
+
 char *ovn_chassis_redirect_name(const char *port_name);
 void ovn_set_pidfile(const char *name);
 
-- 
2.26.2

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


[ovs-dev] [PATCH ovn v13 5/7] tests: Enhance ovn-performance testing by adding gw router port.

2020-06-19 Thread numans
From: Numan Siddique 

This covers the scenario of setting up/deleting of BFD tunnels
for HA.

Acked-by: Han Zhou 
Signed-off-by: Numan Siddique 
---
 tests/ovn-performance.at | 106 +++
 1 file changed, 106 insertions(+)

diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
index a12757e18..400b833e1 100644
--- a/tests/ovn-performance.at
+++ b/tests/ovn-performance.at
@@ -239,6 +239,16 @@ for i in 1 2; do
 ovn_attach n1 br-phys 192.168.0.$i
 done
 
+for i in 1 2 3; do
+sim_add gw$i
+as gw$i
+ovs-vsctl add-br br-phys
+ovs-vsctl add-br br-ex
+ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex"
+j=$((i + 2))
+ovn_attach n1 br-phys 192.168.0.$j
+done
+
 # Wait for the tunnel ports to be created and up.
 # Otherwise this may affect the lflow_run count.
 
@@ -399,6 +409,102 @@ OVN_CONTROLLER_EXPECT_NO_HIT(
 [ovn-nbctl --wait=hv acl-add pg1 to-lport 1001 'outport == @pg1 && ip4.src 
== $pg1_ip4' allow]
 )
 
+# Create a public logical switch and attach the router to it.
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv ls-add public]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-add public public-lr1]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-type public-lr1 router]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-addresses public-lr1 router]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-options public-lr1 router-port=lr1-public]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lrp-add lr1 lr1-public 00:00:20:20:12:13 
172.168.0.100/24]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-add public ln-public]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-type ln-public localnet]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-addresses ln-public unknown]
+)
+
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2], [lflow_run],
+[ovn-nbctl --wait=hv lsp-set-options ln-public network_name=public]
+)
+
+OVN_CONTROLLER_EXPECT_HIT_COND(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run], [=0 =0 >0 =0 =0],
+[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw1 30 && 
ovn-nbctl --wait=hv sync]
+)
+
+# After this, BFD should be enabled from hv1 and hv2 to gw1.
+# So there should be lflow_run hits in hv1, hv2, gw1 and gw2
+OVN_CONTROLLER_EXPECT_HIT_COND(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run], [>0 >0 >0 >0 =0],
+[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 20 && 
ovn-nbctl --wait=hv sync]
+)
+
+OVN_CONTROLLER_EXPECT_HIT(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run],
+[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10 && 
ovn-nbctl --wait=hv sync]
+)
+
+# Make gw2 master. There is remote possibility that full recompute
+# triggers for gw2 after it becomes master. Most of the time
+# there will be no recompute.
+OVN_CONTROLLER_EXPECT_HIT_COND(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [=0 =0 =0 >=0 =0],
+[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 40 && 
ovn-nbctl --wait=hv sync]
+)
+
+# Delete gw2 from gateway chassis
+OVN_CONTROLLER_EXPECT_HIT(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run],
+[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw2 && ovn-nbctl 
--wait=hv sync]
+)
+
+# Delete gw1 from gateway chassis
+# After this, the BFD should be disabled entirely as gw3 is the
+# only gateway chassis.
+OVN_CONTROLLER_EXPECT_HIT_COND(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [>0 >0 >0 =0 >0],
+[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw1]
+)
+
+# Delete gw3 from gateway chassis. There should be no lflow_run.
+OVN_CONTROLLER_EXPECT_NO_HIT(
+[hv1 hv2 gw1 gw2 gw3], [lflow_run],
+[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw3]
+)
+
 for i in 1 2; do
 j=$((i%2 + 1))
 lp=lp$i
-- 
2.26.2

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


[ovs-dev] [PATCH ovn v13 4/7] ovn-controller: Use the tracked runtime data changes for flow calculation.

2020-06-19 Thread numans
From: Venkata Anil 

This patch processes the logical flows of tracked datapaths
and tracked logical ports. To handle the tracked logical port
changes, reference of logical flows to port bindings is maintained.

Below are the results of some testing done with ovn-fake-multinode setup
comparing these incremental processing improvement patches and the
master.

Test setup
--
 1. ovn-central fake node running OVN dbs and 2 compute nodes running
ovn-controller.

 2. Before running the tests, used an existing OVN db with the below
resources
   No of logical switches - 53
   No of logical ports- 1256
   No of logical routers  - 9
   No of logical router ports - 56
   No of port groups  - 152
   No of logical flows- 45447

   Port bindings on compute-1 -  19
   Port bindings on compute-2 -  18
   No of OF flows on compute-1 - 84996
   No of OF flows on compute-2 - 84901

 3. The test does the following
- Creates 2 logical switches (one for each compute node) and connect to a
  logical router for each compute node.
- 100 logical ports are created (50 per lswitch), a simple ACL is added and 
the address
  set is created for each port.
- Each port is bound on the respective compute node and the test
  pings the IP of the port (from another port belonging to the same
  lswitch created earlier).

Below are the results with OVN master

+--+
|   Response Times (sec)
   |
+--+++++++-+---+
| action   | min| median | 90%ile | 
95%ile | max| avg| success | count |
+--+++++++-+---+
| ovn.create_or_update_network_policy  | 1.02   | 1.266  | 1.522  | 
1.552  | 2.053  | 1.284  | 100.0%  | 100   |
| ovn.create_or_update_network_policy_address_sets | 0.222  | 0.276  | 0.289  | 
0.294  | 0.318  | 0.272  | 100.0%  | 100   |
| ovn.create_port_group_acls   | 0.462  | 0.54   | 0.57   | 
0.576  | 0.588  | 0.531  | 50.0%   | 100   |
| ovn.create_or_update_name_space  | 0.346  | 0.476  | 0.554  | 
0.569  | 0.595  | 0.47   | 100.0%  | 100   |
| ovn_network.bind_port| 1.235  | 1.349  | 1.404  | 
1.425  | 1.45   | 1.351  | 100.0%  | 100   |
| ovn.bind_ovs_vm  | 0.394  | 0.458  | 0.494  | 
0.501  | 0.536  | 0.458  | 100.0%  | 100   |
| ovn.bind_internal_vm | 0.795  | 0.894  | 0.938  | 
0.95   | 0.978  | 0.893  | 100.0%  | 100   |
| ovn_network.wait_port_ping   | 7.388  | 7.669  | 7.774  | 
7.83   | 8.6| 7.682  | 100.0%  | 100   |
| total| 10.546 | 11.007 | 11.401 | 
11.526 | 12.222 | 11.044 | 100.0%  | 100   |
+--+++++++-+---+
Load duration: 1106.4100859165192
Full duration: 1108.1457152366638

Below are the results with these I-P improvement patches

+---+
| Response Times (sec)  
|
+--+---++++---+---+-+---+
| action   | min   | median | 90%ile | 
95%ile | max   | avg   | success | count |
+--+---++++---+---+-+---+
| ovn.create_or_update_network_policy  | 0.97  | 1.229  | 1.451  | 
1.46   | 1.944 | 1.24  | 100.0%  | 100   |
| ovn.create_or_update_network_policy_address_sets | 0.224 | 0.267  | 0.28   | 
0.282  | 0.291 | 0.266 | 100.0%  | 100   |
| ovn.create_port_group_acls   | 0.462 | 0.526  | 0.539  | 
0.544  | 0.564 | 0.52  | 50.0%   | 100   |
| ovn.create_or_update_name_space  | 0.33  | 0.467  | 0.549  | 
0.556  | 0.562 | 0.463 | 100.0%  | 100   |
| ovn_network.bind_port| 1.231 | 1.313  | 1.386  | 
1.4| 1.446 | 1.317 | 100.0%  | 100   |
| ovn.bind_ovs_vm  | 0.392 | 0.436  | 0.464  | 
0.475  | 0.502 | 0.438 | 100.0%  | 100   |
| ovn.bind_internal_vm | 0.816 | 0.876  | 0.936  | 
0.967  | 0.997 | 0.879 | 100.0%  | 100   |
| ovn_network.wait_port_ping   | 0.097 | 0.141  | 0.177  | 
0.18   | 0.203 | 

[ovs-dev] [PATCH ovn v13 1/7] I-P engine: Provide the option for an engine to clear tracked engine data in every run.

2020-06-19 Thread numans
From: Numan Siddique 

A new function is added in the engine node called - clear_tracked_data() to
clear any engine data which was tracked during the engine run. This tracked data
has to be part of the engine 'data'. engine_init_run() calls 
clear_tracked_data()
and each engine node interested in tracking the data needs to implement the
en_clear_tracked_data() function.

With this patch, an engine node can store any changes done to the engine data
separately in the engine change handlers. The parent of this engine node
can use this tracked data for incrementally processing the changes. Upcoming
patches in the series will make use of this.

Acked-by: Dumitru Ceara 
Acked-by: Han Zhou 
Signed-off-by: Numan Siddique 
---
 lib/inc-proc-eng.c | 8 
 lib/inc-proc-eng.h | 9 +
 2 files changed, 17 insertions(+)

diff --git a/lib/inc-proc-eng.c b/lib/inc-proc-eng.c
index 9b1479a1c..8b56cbaec 100644
--- a/lib/inc-proc-eng.c
+++ b/lib/inc-proc-eng.c
@@ -121,6 +121,10 @@ void
 engine_cleanup(void)
 {
 for (size_t i = 0; i < engine_n_nodes; i++) {
+if (engine_nodes[i]->clear_tracked_data) {
+engine_nodes[i]->clear_tracked_data(engine_nodes[i]->data);
+}
+
 if (engine_nodes[i]->cleanup) {
 engine_nodes[i]->cleanup(engine_nodes[i]->data);
 }
@@ -260,6 +264,10 @@ engine_init_run(void)
 VLOG_DBG("Initializing new run");
 for (size_t i = 0; i < engine_n_nodes; i++) {
 engine_set_node_state(engine_nodes[i], EN_STALE);
+
+if (engine_nodes[i]->clear_tracked_data) {
+engine_nodes[i]->clear_tracked_data(engine_nodes[i]->data);
+}
 }
 }
 
diff --git a/lib/inc-proc-eng.h b/lib/inc-proc-eng.h
index 8606a360b..e25bcb29c 100644
--- a/lib/inc-proc-eng.h
+++ b/lib/inc-proc-eng.h
@@ -149,6 +149,10 @@ struct engine_node {
  * doesn't store pointers to DB records it's still safe to use).
  */
 bool (*is_valid)(struct engine_node *);
+
+/* Method to clear up tracked data maintained by the engine node in the
+ * engine 'data'. It may be NULL. */
+void (*clear_tracked_data)(void *tracked_data);
 };
 
 /* Initialize the data for the engine nodes. It calls each node's
@@ -282,6 +286,7 @@ void engine_ovsdb_node_add_index(struct engine_node *, 
const char *name,
 .run = en_##NAME##_run, \
 .cleanup = en_##NAME##_cleanup, \
 .is_valid = en_##NAME##_is_valid, \
+.clear_tracked_data = NULL, \
 };
 
 #define ENGINE_NODE_CUSTOM_DATA(NAME, NAME_STR) \
@@ -291,6 +296,10 @@ void engine_ovsdb_node_add_index(struct engine_node *, 
const char *name,
 static bool (*en_##NAME##_is_valid)(struct engine_node *node) = NULL; \
 ENGINE_NODE_DEF(NAME, NAME_STR)
 
+#define ENGINE_NODE_WITH_CLEAR_TRACK_DATA(NAME, NAME_STR) \
+ENGINE_NODE(NAME, NAME_STR) \
+en_##NAME.clear_tracked_data = en_##NAME##_clear_tracked_data;
+
 /* Macro to define member functions of an engine node which represents
  * a table of OVSDB */
 #define ENGINE_FUNC_OVSDB(DB_NAME, TBL_NAME) \
-- 
2.26.2

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


[ovs-dev] [PATCH ovn v13 2/7] ovn-controller: I-P for ct zone and OVS interface changes in flow output stage.

2020-06-19 Thread numans
From: Numan Siddique 

This patch handles ct zone changes and OVS interface changes incrementally
in the flow output stage.

Any changes to ct zone can be handled by running physical_run() instead of 
running
flow_output_run(). And any changes to OVS interfaces can be either handled
incrementally (for OVS interfaces representing VIFs) or just running
physical_run() (for tunnel and other types of interfaces).

To better handle this, a new engine node 'physical_flow_changes' is added which
handles changes to ct zone and OVS interfaces.

Acked-by: Han Zhou 
Acked-by: Dumitru Ceara 
Signed-off-by: Numan Siddique 
---
 controller/binding.c|  23 +-
 controller/binding.h|  24 ++-
 controller/ovn-controller.c | 136 +++-
 controller/physical.c   |  53 ++
 controller/physical.h   |   5 +-
 5 files changed, 216 insertions(+), 25 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index 06ecb93fb..67fd2777f 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -535,7 +535,7 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
  * 'struct local_binding' is used. A shash of these local bindings is
  * maintained with the 'external_ids:iface-id' as the key to the shash.
  *
- * struct local_binding has 3 main fields:
+ * struct local_binding (defined in binding.h) has 3 main fields:
  *- type
  *- OVS interface row object
  *- Port_Binding row object
@@ -586,21 +586,6 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
  *   - For each 'virtual' Port Binding (of type BT_VIRTUAL) provided its parent
  * is bound to this chassis.
  */
-enum local_binding_type {
-BT_VIF,
-BT_CONTAINER,
-BT_VIRTUAL
-};
-
-struct local_binding {
-char *name;
-enum local_binding_type type;
-const struct ovsrec_interface *iface;
-const struct sbrec_port_binding *pb;
-
-/* shash of 'struct local_binding' representing children. */
-struct shash children;
-};
 
 static struct local_binding *
 local_binding_create(const char *name, const struct ovsrec_interface *iface,
@@ -622,12 +607,6 @@ local_binding_add(struct shash *local_bindings, struct 
local_binding *lbinding)
 shash_add(local_bindings, lbinding->name, lbinding);
 }
 
-static struct local_binding *
-local_binding_find(struct shash *local_bindings, const char *name)
-{
-return shash_find_data(local_bindings, name);
-}
-
 static void
 local_binding_destroy(struct local_binding *lbinding)
 {
diff --git a/controller/binding.h b/controller/binding.h
index 9214a7479..161766d2f 100644
--- a/controller/binding.h
+++ b/controller/binding.h
@@ -18,6 +18,7 @@
 #define OVN_BINDING_H 1
 
 #include 
+#include "openvswitch/shash.h"
 
 struct hmap;
 struct ovsdb_idl;
@@ -32,7 +33,6 @@ struct sbrec_chassis;
 struct sbrec_port_binding_table;
 struct sset;
 struct sbrec_port_binding;
-struct shash;
 
 struct binding_ctx_in {
 struct ovsdb_idl_txn *ovnsb_idl_txn;
@@ -77,6 +77,28 @@ struct binding_ctx_out {
 struct smap *local_iface_ids;
 };
 
+enum local_binding_type {
+BT_VIF,
+BT_CONTAINER,
+BT_VIRTUAL
+};
+
+struct local_binding {
+char *name;
+enum local_binding_type type;
+const struct ovsrec_interface *iface;
+const struct sbrec_port_binding *pb;
+
+/* shash of 'struct local_binding' representing children. */
+struct shash children;
+};
+
+static inline struct local_binding *
+local_binding_find(struct shash *local_bindings, const char *name)
+{
+return shash_find_data(local_bindings, name);
+}
+
 void binding_register_ovs_idl(struct ovsdb_idl *);
 void binding_run(struct binding_ctx_in *, struct binding_ctx_out *);
 bool binding_cleanup(struct ovsdb_idl_txn *ovnsb_idl_txn,
diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index bf7214e45..dde531c6e 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -1312,6 +1312,89 @@ en_mff_ovn_geneve_run(struct engine_node *node, void 
*data)
 engine_set_node_state(node, EN_VALID);
 }
 
+/* Engine node en_physical_flow_changes indicates whether
+ * there is a need to
+ *   - recompute only physical flows or
+ *   - we can incrementally process the physical flows.
+ *
+ * en_physical_flow_changes is an input to flow_output engine node.
+ * If the engine node 'en_physical_flow_changes' gets updated during
+ * engine run, it means the handler for this -
+ * flow_output_physical_flow_changes_handler() will either
+ *- recompute the physical flows by calling 'physical_run() or
+ *- incrementlly process some of the changes for physical flow
+ *  calculation. Right now we handle OVS interfaces changes
+ *  for physical flow computation.
+ *
+ * When ever a port binding happens, the follow up
+ * activity is the zone id allocation for that port binding.
+ * With this intermediate engine node, we avoid full recomputation.
+ * Instead we do physical flow computation (either full 

[ovs-dev] [PATCH ovn v13 3/7] ovn-controller: Handle runtime data changes in flow output engine

2020-06-19 Thread numans
From: Numan Siddique 

In order to handle runtime data changes incrementally, the flow outut
runtime data handle should know the changed runtime data.
Runtime data now tracks the changed data for any OVS interface
and SB port binding changes. The tracked data contains a hmap
of tracked datapaths (which changed during runtime data processing.

The flow outout runtime_data handler in this patch doesn't do much
with the tracked data. It returns false if there is tracked data available
so that flow_output run is called. If no tracked data is available
then there is no need for flow computation and the handler returns true.

Next patch in the series processes the tracked data incrementally.

Acked-by: Han Zhou 
Acked-by: Dumitru Ceara 
Co-Authored-by: Venkata Anil 
Signed-off-by: Venkata Anil 
Signed-off-by: Numan Siddique 
---
 controller/binding.c| 195 ++--
 controller/binding.h|  23 +
 controller/ovn-controller.c | 143 +-
 tests/ovn-performance.at|  20 ++--
 4 files changed, 336 insertions(+), 45 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index 67fd2777f..58e0bf59f 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -69,13 +69,24 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl)
 ovsdb_idl_add_column(ovs_idl, _qos_col_type);
 }
 
+static struct tracked_binding_datapath *tracked_binding_datapath_create(
+const struct sbrec_datapath_binding *,
+bool is_new, struct hmap *tracked_dps);
+static struct tracked_binding_datapath *tracked_binding_datapath_find(
+struct hmap *, const struct sbrec_datapath_binding *);
+static void tracked_binding_datapath_lport_add(
+const struct sbrec_port_binding *, struct hmap *tracked_datapaths);
+static void update_lport_tracking(const struct sbrec_port_binding *pb,
+  struct hmap *tracked_dp_bindings);
+
 static void
 add_local_datapath__(struct ovsdb_idl_index *sbrec_datapath_binding_by_key,
  struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
  struct ovsdb_idl_index *sbrec_port_binding_by_name,
  const struct sbrec_datapath_binding *datapath,
  bool has_local_l3gateway, int depth,
- struct hmap *local_datapaths)
+ struct hmap *local_datapaths,
+ struct hmap *tracked_datapaths)
 {
 uint32_t dp_key = datapath->tunnel_key;
 struct local_datapath *ld = get_local_datapath(local_datapaths, dp_key);
@@ -92,6 +103,11 @@ add_local_datapath__(struct ovsdb_idl_index 
*sbrec_datapath_binding_by_key,
 ld->localnet_port = NULL;
 ld->has_local_l3gateway = has_local_l3gateway;
 
+if (tracked_datapaths &&
+!tracked_binding_datapath_find(tracked_datapaths, datapath)) {
+tracked_binding_datapath_create(datapath, true, tracked_datapaths);
+}
+
 if (depth >= 100) {
 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
 VLOG_WARN_RL(, "datapaths nested too deep");
@@ -124,7 +140,8 @@ add_local_datapath__(struct ovsdb_idl_index 
*sbrec_datapath_binding_by_key,
  sbrec_port_binding_by_datapath,
  sbrec_port_binding_by_name,
  peer->datapath, false,
- depth + 1, local_datapaths);
+ depth + 1, local_datapaths,
+ tracked_datapaths);
 }
 ld->n_peer_ports++;
 if (ld->n_peer_ports > ld->n_allocated_peer_ports) {
@@ -147,12 +164,14 @@ add_local_datapath(struct ovsdb_idl_index 
*sbrec_datapath_binding_by_key,
struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
struct ovsdb_idl_index *sbrec_port_binding_by_name,
const struct sbrec_datapath_binding *datapath,
-   bool has_local_l3gateway, struct hmap *local_datapaths)
+   bool has_local_l3gateway, struct hmap *local_datapaths,
+   struct hmap *tracked_datapaths)
 {
 add_local_datapath__(sbrec_datapath_binding_by_key,
  sbrec_port_binding_by_datapath,
  sbrec_port_binding_by_name,
- datapath, has_local_l3gateway, 0, local_datapaths);
+ datapath, has_local_l3gateway, 0, local_datapaths,
+ tracked_datapaths);
 }
 
 static void
@@ -506,6 +525,11 @@ update_local_lport_ids(struct binding_ctx_out *b_ctx,
  pb->datapath->tunnel_key, pb->tunnel_key);
 if (sset_add(b_ctx->local_lport_ids, buf) != NULL) {
 b_ctx->local_lport_ids_changed = true;
+
+if (b_ctx->tracked_dp_bindings) {
+/* Add the 

[ovs-dev] [PATCH ovn v13 0/7] Incremental processing improvements.

2020-06-19 Thread numans
From: Numan Siddique 

This patch series handles port binding, datapath binding, ovs interface changes,
runtime data changes, sb chassis changes incrementally.


v12 -> v13
-
 * Addressed the review comments from Dumitru.
 * Fixed the test case added in p5 which was failing intermittently.
 * Patch 3 commit message has the test results with these patches.

v11 -> v12

 * Rebased the patches to latest master.
 * Add a new patch p7 which changes the signature of some of
   the static functions added recently in binding.c so that the out
   param is the last param.

v10 -> v11

 * The firt 3 patches of v10 are now merged to master.
 * The v11 has now 6 patches.
 * Addressed the review comments from Dumitru.
 * Added another new patch - which adds the util function
   get_unique_lport_key() and use this function in places
   where it was generating this key earlier.

v9 -> v10

 * Addressed review comments.
 * Changed the patch 4 from adding a separate tracking variable in I-P
   engine to just adding a new function - clear_tracked_data() as per
   the review comments.
 * Dropped the patch 9 - "ovn-controller: Handle sbrec_chassis changes 
incrementally."
   from the series. I couldn't address the review comments for this patch in v9.
   Hence dropped this patch for now. I'll work on it later and submit
   the patch separately.
 * Added a new test only patch - patch 9 in ovn-performance.at to test the
   distributed logical router ports scenario and BFD.

v8 -> v9

 * Addressed the review comments from Dumitru and missed v7 comments from
   Han.
 * Any change to the 'local_lport_ids' while handling the OVS interface and Port
   binding changes in binding.c is now added to the tracked
   datapaths which was not done earlier.
 * Dropped the check to lflow_evaluate_pb_changes() in flow_output port
   binding handler as it is not required.

v7 -> v8

 * Dropped the patch 4 as it is not needed, thanks to Han.
 * Swapped the patches 5 and 6, which are now patch 4 and 5. The v8 patch 5 
will now make
   use of tracked data support of engine to clear the physical_flow
   changes.
 * Addressed comments from Han. Added comments in Patch 5 and Patch 6.

v6 -> v7

  * Addressed the review comments from Han in patch 1 and patch 2.

v5 -> v6

  * Addressed the review comments from Dumitru.
  * Patch 1 and Patch 2 are significantly changed due to
further refactoring.

v4 -> v5

  * Applied patch 1 of v4 to master.
  * Addressed the review comments from Han for patch 2.
  * Rebased to latest master.

v3 -> v4

  * A small fix in patch 3 when binding the port for ovs interface
change.
  * Rebased to latest master.


v2 -> v3

  * Added back the patch 5 and 6 and added 4 more patches. So totally
totally 10 patches in the series
  * Handling the runtime data changes in flow computation.
  * Handling sbrec_chassis changes.

v1 -> v2
--
  * Addressed the review comments from Han in patch 1, 2 and 3.
  * Removed patch 5 and 6 from the series. As per the comments
from Han, we should handle runtime data changes in flow output
engine. But the patch 6 of the series had added a no-op
handler. So removed these 2 patches until those are addressed.

RFC v2 -> v1
-
 * Fixed the 2 failing test cases.
 * Updated the commit messages.


RFC v1 -> RFC v2
-
 * Added 2 new patches
 * Patch 5 (ofctrl_check_and_add_flow) was submitted earlier too and
   the previous discussion is here - https://patchwork.ozlabs.org/patch/1202417/
 * Patch 6 handles I-P for ct_zone and OVS interface changes in
   flow_output_run stage.
Numan Siddique (6):
  Refactor binding_run()to take two context argument - binding_ctx_in
and binding_ctx_out.
  ovn-controller: Refactor binding.c
  ovn-controller: I-P for port binding in runtime_data stage
  ovn-controller: I-P for datapath binding
  ofctrl_check_and_add_flow: Replace the actions of an existing flow if
actions have changed.
  ovn-controller: I-P for ct zone  and OVN



Numan Siddique (6):
  I-P engine: Provide the option for an engine to clear tracked engine
data in every run.
  ovn-controller: I-P for ct zone and OVS interface changes in flow
output stage.
  ovn-controller: Handle runtime data changes in flow output engine
  tests: Enhance ovn-performance testing by adding gw router port.
  Add an util function get_unique_lport_key() for generating unique
lport key.
  binding.c: Reorder out params of some of the static functions.

Venkata Anil (1):
  ovn-controller: Use the tracked runtime data changes for flow
calculation.

 controller/binding.c| 260 +
 controller/binding.h|  47 -
 controller/lflow.c  |  89 -
 controller/lflow.h  |  12 +-
 controller/ovn-controller.c | 374 +++-
 controller/physical.c   |  53 +
 controller/physical.h   |   5 +-
 lib/inc-proc-eng.c  |   8 +
 

[ovs-dev] [PATCH] ovs-dpctl-top: Skip "eth()" element

2020-06-19 Thread Timothy Redaelli
With commit efde188622ae ("odp-util: Print eth() for Ethernet flows if
packet_type is absent.") "eth()" is printed for Ethernet flows if packet_type
is absent, but this broke "ovs-dpctl-top" since it expects that every
element has a value.

This commit skips the parsing of the empty "eth()" element.

Fixes: efde188622ae ("odp-util: Print eth() for Ethernet flows if packet_type
is absent.")
Cc: b...@ovn.org
---
 utilities/ovs-dpctl-top.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index 011cc64b7..fbe6e4f56 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -480,6 +480,8 @@ def elements_to_dict(elements):
 """ Convert line to a hierarchy of dictionaries. """
 result = {}
 for element in elements:
+if (element == "eth()"):
+continue
 match = FIELDS_CMPND.search(element)
 if (match):
 key = match.group(1)
-- 
2.26.2

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


Re: [ovs-dev] [PATCH ovn v12 5/7] tests: Enhance ovn-performance testing by adding gw router port.

2020-06-19 Thread Dumitru Ceara
On 6/11/20 2:44 PM, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> This covers the scenario of setting up/deleting of BFD tunnels
> for HA.
> 
> Tested-by: Dumitru Ceara 
> Signed-off-by: Numan Siddique 

Hi Numan,

This test now fails for me:

0   0   0   0   0   ovn-nbctl --wait=hv
lrp-set-gateway-chassis lr1-public gw1 30

./ovn-performance.at:463: test $rc -eq 0 -a $rv -eq 1
./ovn-performance.at:463: exit code was 1, expected 0

Maybe we missed something in the previous patches?

Thanks,
Dumitru

> ---
>  tests/ovn-performance.at | 104 +++
>  1 file changed, 104 insertions(+)
> 
> diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at
> index a12757e18..2a15cb473 100644
> --- a/tests/ovn-performance.at
> +++ b/tests/ovn-performance.at
> @@ -239,6 +239,16 @@ for i in 1 2; do
>  ovn_attach n1 br-phys 192.168.0.$i
>  done
>  
> +for i in 1 2 3; do
> +sim_add gw$i
> +as gw$i
> +ovs-vsctl add-br br-phys
> +ovs-vsctl add-br br-ex
> +ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex"
> +j=$((i + 2))
> +ovn_attach n1 br-phys 192.168.0.$j
> +done
> +
>  # Wait for the tunnel ports to be created and up.
>  # Otherwise this may affect the lflow_run count.
>  
> @@ -399,6 +409,100 @@ OVN_CONTROLLER_EXPECT_NO_HIT(
>  [ovn-nbctl --wait=hv acl-add pg1 to-lport 1001 'outport == @pg1 && 
> ip4.src == $pg1_ip4' allow]
>  )
>  
> +# Create a public logical switch and attach the router to it.
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv ls-add public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-add public public-lr1]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-type public-lr1 router]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-addresses public-lr1 router]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-options public-lr1 router-port=lr1-public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-add lr1 lr1-public 00:00:20:20:12:13 
> 172.168.0.100/24]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-add public ln-public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-type ln-public localnet]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-addresses ln-public unknown]
> +)
> +
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2], [lflow_run],
> +[ovn-nbctl --wait=hv lsp-set-options ln-public network_name=public]
> +)
> +
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [=0 =0 >0 =0 =0],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw1 30]
> +)
> +
> +# After this, BFD should be enabled from hv1 and hv2 to gw1.
> +# So there should be lflow_run hits in hv1, hv2, gw1 and gw2
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run], [>0 >0 >0 >0 =0],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 20]
> +)
> +
> +OVN_CONTROLLER_EXPECT_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10]
> +)
> +
> +# Make gw2 master.
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw2 40]
> +)
> +
> +# Delete gw2 from gateway chassis
> +OVN_CONTROLLER_EXPECT_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw2]
> +)
> +
> +# Delete gw1 from gateway chassis
> +# After this, the BFD should be disabled entirely as gw3 is the
> +# only gateway chassis.
> +OVN_CONTROLLER_EXPECT_HIT_COND(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],  [>0 >0 >0 =0 >0],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw1]
> +)
> +
> +# Delete gw3 from gateway chassis. There should be no lflow_run.
> +OVN_CONTROLLER_EXPECT_NO_HIT(
> +[hv1 hv2 gw1 gw2 gw3], [lflow_run],
> +[ovn-nbctl --wait=hv lrp-del-gateway-chassis lr1-public gw3]
> +)
> +
>  for i in 1 2; do
>  j=$((i%2 + 1))
>  lp=lp$i
> 

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


Re: [ovs-dev] [PATCH ovn v12 4/7] ovn-controller: Use the tracked runtime data changes for flow calculation.

2020-06-19 Thread Dumitru Ceara
On 6/11/20 2:44 PM, num...@ovn.org wrote:
> From: Venkata Anil 
> 
> This patch processes the logical flows of tracked datapaths
> and tracked logical ports. To handle the tracked logical port
> changes, reference of logical flows to port bindings is maintained.
> 
> Co-Authored-by: Numan Siddique 
> Signed-off-by: Venkata Anil 
> Signed-off-by: Numan Siddique 

A couple minor issues inline. With those addressed:

Acked-by: Dumitru Ceara 

Thanks,
Dumitru

> ---
>  controller/lflow.c  |  86 +
>  controller/lflow.h  |  12 +++-
>  controller/ovn-controller.c | 107 ++--
>  tests/ovn-performance.at|  12 ++--
>  4 files changed, 156 insertions(+), 61 deletions(-)
> 
> diff --git a/controller/lflow.c b/controller/lflow.c
> index 01214a3a6..eb6be0100 100644
> --- a/controller/lflow.c
> +++ b/controller/lflow.c
> @@ -59,6 +59,10 @@ struct condition_aux {
>  struct ovsdb_idl_index *sbrec_port_binding_by_name;
>  const struct sbrec_chassis *chassis;
>  const struct sset *active_tunnels;
> +const struct sbrec_logical_flow *lflow;
> +/* Resource reference to store the port name referenced
> + * in is_chassis_resident() to lhe logicl flow. */

Typo: s/lhe logicl/the logical

> +struct lflow_resource_ref *lfrr;
>  };
>  
>  static bool
> @@ -68,6 +72,8 @@ consider_logical_flow(const struct sbrec_logical_flow 
> *lflow,
>struct controller_event_options *controller_event_opts,
>struct lflow_ctx_in *l_ctx_in,
>struct lflow_ctx_out *l_ctx_out);
> +static void lflow_resource_add(struct lflow_resource_ref *, enum ref_type,
> +   const char *ref_name, const struct uuid *);
>  
>  static bool
>  lookup_port_cb(const void *aux_, const char *port_name, unsigned int *portp)
> @@ -120,6 +126,14 @@ is_chassis_resident_cb(const void *c_aux_, const char 
> *port_name)
>  if (!pb) {
>  return false;
>  }
> +
> +/* Store the port_name to lflow reference. */
> +int64_t dp_id = pb->datapath->tunnel_key;
> +char buf[16];
> +snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64, dp_id, pb->tunnel_key);
> +lflow_resource_add(c_aux->lfrr, REF_TYPE_PORTBINDING, buf,
> +   _aux->lflow->header_.uuid);
> +
>  if (strcmp(pb->type, "chassisredirect")) {
>  /* for non-chassisredirect ports */
>  return pb->chassis && pb->chassis == c_aux->chassis;
> @@ -594,6 +608,8 @@ consider_logical_flow(const struct sbrec_logical_flow 
> *lflow,
>  .sbrec_port_binding_by_name = l_ctx_in->sbrec_port_binding_by_name,
>  .chassis = l_ctx_in->chassis,
>  .active_tunnels = l_ctx_in->active_tunnels,
> +.lflow = lflow,
> +.lfrr = l_ctx_out->lfrr
>  };
>  expr = expr_simplify(expr, is_chassis_resident_cb, _aux);
>  expr = expr_normalize(expr);
> @@ -649,6 +665,8 @@ consider_logical_flow(const struct sbrec_logical_flow 
> *lflow,
>  int64_t dp_id = lflow->logical_datapath->tunnel_key;
>  char buf[16];
>  snprintf(buf, sizeof(buf), "%"PRId64"_%"PRId64, dp_id, 
> port_id);
> +lflow_resource_add(l_ctx_out->lfrr, REF_TYPE_PORTBINDING, 
> buf,
> +   >header_.uuid);
>  if (!sset_contains(l_ctx_in->local_lport_ids, buf)) {
>  VLOG_DBG("lflow "UUID_FMT
>   " port %s in match is not local, skip",
> @@ -847,3 +865,71 @@ lflow_destroy(void)
>  expr_symtab_destroy();
>  shash_destroy();
>  }
> +
> +bool
> +lflow_add_flows_for_datapath(const struct sbrec_datapath_binding *dp,
> + struct lflow_ctx_in *l_ctx_in,
> + struct lflow_ctx_out *l_ctx_out)
> +{
> +bool handled = true;
> +struct hmap dhcp_opts = HMAP_INITIALIZER(_opts);
> +struct hmap dhcpv6_opts = HMAP_INITIALIZER(_opts);
> +const struct sbrec_dhcp_options *dhcp_opt_row;
> +SBREC_DHCP_OPTIONS_TABLE_FOR_EACH (dhcp_opt_row,
> +   l_ctx_in->dhcp_options_table) {
> +dhcp_opt_add(_opts, dhcp_opt_row->name, dhcp_opt_row->code,
> + dhcp_opt_row->type);
> +}
> +
> +
> +const struct sbrec_dhcpv6_options *dhcpv6_opt_row;
> +SBREC_DHCPV6_OPTIONS_TABLE_FOR_EACH (dhcpv6_opt_row,
> + l_ctx_in->dhcpv6_options_table) {
> +   dhcp_opt_add(_opts, dhcpv6_opt_row->name, dhcpv6_opt_row->code,
> +dhcpv6_opt_row->type);
> +}
> +
> +struct hmap nd_ra_opts = HMAP_INITIALIZER(_ra_opts);
> +nd_ra_opts_init(_ra_opts);
> +
> +struct controller_event_options controller_event_opts;
> +controller_event_opts_init(_event_opts);
> +
> +struct sbrec_logical_flow *lf_row = sbrec_logical_flow_index_init_row(
> +

Re: [ovs-dev] [PATCH ovn v12 2/7] ovn-controller: I-P for ct zone and OVS interface changes in flow output stage.

2020-06-19 Thread Dumitru Ceara
On 6/19/20 10:18 AM, Numan Siddique wrote:
> 
> 
> On Fri, Jun 19, 2020 at 1:39 PM Numan Siddique  > wrote:
> 
> 
> 
> On Fri, Jun 19, 2020 at 1:11 PM Dumitru Ceara  > wrote:
> 
> On 6/11/20 2:43 PM, num...@ovn.org  wrote:
> > From: Numan Siddique mailto:num...@ovn.org>>
> >
> > This patch handles ct zone changes and OVS interface changes
> incrementally
> > in the flow output stage.
> >
> > Any changes to ct zone can be handled by running
> physical_run() instead of running
> > flow_output_run(). And any changes to OVS interfaces can be
> either handled
> > incrementally (for OVS interfaces representing VIFs) or just
> running
> > physical_run() (for tunnel and other types of interfaces).
> >
> > To better handle this, a new engine node
> 'physical_flow_changes' is added which
> > handles changes to ct zone and OVS interfaces.
> >
> > Signed-off-by: Numan Siddique  >
> 
> Hi Numan,
> 
> I have a few comments on this patch. Please see below.
> 
> > ---
> >  controller/binding.c        |  23 +-
> >  controller/binding.h        |  24 ++-
> >  controller/ovn-controller.c | 136
> +++-
> >  controller/physical.c       |  51 ++
> >  controller/physical.h       |   5 +-
> >  5 files changed, 214 insertions(+), 25 deletions(-)
> >
> > diff --git a/controller/binding.c b/controller/binding.c
> > index 06ecb93fb..67fd2777f 100644
> > --- a/controller/binding.c
> > +++ b/controller/binding.c
> > @@ -535,7 +535,7 @@ remove_local_lport_ids(struct
> binding_ctx_out *b_ctx,
> >   * 'struct local_binding' is used. A shash of these local
> bindings is
> >   * maintained with the 'external_ids:iface-id' as the key to
> the shash.
> >   *
> > - * struct local_binding has 3 main fields:
> > + * struct local_binding (defined in binding.h) has 3 main fields:
> >   *    - type
> >   *    - OVS interface row object
> >   *    - Port_Binding row object
> > @@ -586,21 +586,6 @@ remove_local_lport_ids(struct
> binding_ctx_out *b_ctx,
> >   *   - For each 'virtual' Port Binding (of type BT_VIRTUAL)
> provided its parent
> >   *     is bound to this chassis.
> >   */
> > -enum local_binding_type {
> > -    BT_VIF,
> > -    BT_CONTAINER,
> > -    BT_VIRTUAL
> > -};
> > -
> > -struct local_binding {
> > -    char *name;
> > -    enum local_binding_type type;
> > -    const struct ovsrec_interface *iface;
> > -    const struct sbrec_port_binding *pb;
> > -
> > -    /* shash of 'struct local_binding' representing children. */
> > -    struct shash children;
> > -};
> > 
> >  static struct local_binding *
> >  local_binding_create(const char *name, const struct
> ovsrec_interface *iface,
> > @@ -622,12 +607,6 @@ local_binding_add(struct shash
> *local_bindings, struct local_binding *lbinding)
> >      shash_add(local_bindings, lbinding->name, lbinding);
> >  }
> > 
> > -static struct local_binding *
> > -local_binding_find(struct shash *local_bindings, const char
> *name)
> > -{
> > -    return shash_find_data(local_bindings, name);
> > -}
> > -
> >  static void
> >  local_binding_destroy(struct local_binding *lbinding)
> >  {
> > diff --git a/controller/binding.h b/controller/binding.h
> > index 9214a7479..161766d2f 100644
> > --- a/controller/binding.h
> > +++ b/controller/binding.h
> > @@ -18,6 +18,7 @@
> >  #define OVN_BINDING_H 1
> > 
> >  #include 
> > +#include "openvswitch/shash.h"
> > 
> >  struct hmap;
> >  struct ovsdb_idl;
> > @@ -32,7 +33,6 @@ struct sbrec_chassis;
> >  struct sbrec_port_binding_table;
> >  struct sset;
> >  struct sbrec_port_binding;
> > -struct shash;
> > 
> >  struct binding_ctx_in {
> >      struct ovsdb_idl_txn *ovnsb_idl_txn;
> > @@ -77,6 +77,28 @@ struct binding_ctx_out {
> >      struct smap *local_iface_ids;
> >  };
> > 
> > +enum local_binding_type {
> > +    BT_VIF,
> > +    BT_CONTAINER,
> > +    BT_VIRTUAL
> > +};
> > +
> > +struct local_binding {
> > +    char *name;
> > +    enum 

Re: [ovs-dev] [PATCH ovn v12 2/7] ovn-controller: I-P for ct zone and OVS interface changes in flow output stage.

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 1:39 PM Numan Siddique  wrote:

>
>
> On Fri, Jun 19, 2020 at 1:11 PM Dumitru Ceara  wrote:
>
>> On 6/11/20 2:43 PM, num...@ovn.org wrote:
>> > From: Numan Siddique 
>> >
>> > This patch handles ct zone changes and OVS interface changes
>> incrementally
>> > in the flow output stage.
>> >
>> > Any changes to ct zone can be handled by running physical_run() instead
>> of running
>> > flow_output_run(). And any changes to OVS interfaces can be either
>> handled
>> > incrementally (for OVS interfaces representing VIFs) or just running
>> > physical_run() (for tunnel and other types of interfaces).
>> >
>> > To better handle this, a new engine node 'physical_flow_changes' is
>> added which
>> > handles changes to ct zone and OVS interfaces.
>> >
>> > Signed-off-by: Numan Siddique 
>>
>> Hi Numan,
>>
>> I have a few comments on this patch. Please see below.
>>
>> > ---
>> >  controller/binding.c|  23 +-
>> >  controller/binding.h|  24 ++-
>> >  controller/ovn-controller.c | 136 +++-
>> >  controller/physical.c   |  51 ++
>> >  controller/physical.h   |   5 +-
>> >  5 files changed, 214 insertions(+), 25 deletions(-)
>> >
>> > diff --git a/controller/binding.c b/controller/binding.c
>> > index 06ecb93fb..67fd2777f 100644
>> > --- a/controller/binding.c
>> > +++ b/controller/binding.c
>> > @@ -535,7 +535,7 @@ remove_local_lport_ids(struct binding_ctx_out
>> *b_ctx,
>> >   * 'struct local_binding' is used. A shash of these local bindings is
>> >   * maintained with the 'external_ids:iface-id' as the key to the shash.
>> >   *
>> > - * struct local_binding has 3 main fields:
>> > + * struct local_binding (defined in binding.h) has 3 main fields:
>> >   *- type
>> >   *- OVS interface row object
>> >   *- Port_Binding row object
>> > @@ -586,21 +586,6 @@ remove_local_lport_ids(struct binding_ctx_out
>> *b_ctx,
>> >   *   - For each 'virtual' Port Binding (of type BT_VIRTUAL) provided
>> its parent
>> >   * is bound to this chassis.
>> >   */
>> > -enum local_binding_type {
>> > -BT_VIF,
>> > -BT_CONTAINER,
>> > -BT_VIRTUAL
>> > -};
>> > -
>> > -struct local_binding {
>> > -char *name;
>> > -enum local_binding_type type;
>> > -const struct ovsrec_interface *iface;
>> > -const struct sbrec_port_binding *pb;
>> > -
>> > -/* shash of 'struct local_binding' representing children. */
>> > -struct shash children;
>> > -};
>> >
>> >  static struct local_binding *
>> >  local_binding_create(const char *name, const struct ovsrec_interface
>> *iface,
>> > @@ -622,12 +607,6 @@ local_binding_add(struct shash *local_bindings,
>> struct local_binding *lbinding)
>> >  shash_add(local_bindings, lbinding->name, lbinding);
>> >  }
>> >
>> > -static struct local_binding *
>> > -local_binding_find(struct shash *local_bindings, const char *name)
>> > -{
>> > -return shash_find_data(local_bindings, name);
>> > -}
>> > -
>> >  static void
>> >  local_binding_destroy(struct local_binding *lbinding)
>> >  {
>> > diff --git a/controller/binding.h b/controller/binding.h
>> > index 9214a7479..161766d2f 100644
>> > --- a/controller/binding.h
>> > +++ b/controller/binding.h
>> > @@ -18,6 +18,7 @@
>> >  #define OVN_BINDING_H 1
>> >
>> >  #include 
>> > +#include "openvswitch/shash.h"
>> >
>> >  struct hmap;
>> >  struct ovsdb_idl;
>> > @@ -32,7 +33,6 @@ struct sbrec_chassis;
>> >  struct sbrec_port_binding_table;
>> >  struct sset;
>> >  struct sbrec_port_binding;
>> > -struct shash;
>> >
>> >  struct binding_ctx_in {
>> >  struct ovsdb_idl_txn *ovnsb_idl_txn;
>> > @@ -77,6 +77,28 @@ struct binding_ctx_out {
>> >  struct smap *local_iface_ids;
>> >  };
>> >
>> > +enum local_binding_type {
>> > +BT_VIF,
>> > +BT_CONTAINER,
>> > +BT_VIRTUAL
>> > +};
>> > +
>> > +struct local_binding {
>> > +char *name;
>> > +enum local_binding_type type;
>> > +const struct ovsrec_interface *iface;
>> > +const struct sbrec_port_binding *pb;
>> > +
>> > +/* shash of 'struct local_binding' representing children. */
>> > +struct shash children;
>> > +};
>> > +
>> > +static inline struct local_binding *
>> > +local_binding_find(struct shash *local_bindings, const char *name)
>> > +{
>> > +return shash_find_data(local_bindings, name);
>> > +}
>> > +
>> >  void binding_register_ovs_idl(struct ovsdb_idl *);
>> >  void binding_run(struct binding_ctx_in *, struct binding_ctx_out *);
>> >  bool binding_cleanup(struct ovsdb_idl_txn *ovnsb_idl_txn,
>> > diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
>> > index bf7214e45..6e66705da 100644
>> > --- a/controller/ovn-controller.c
>> > +++ b/controller/ovn-controller.c
>> > @@ -1368,6 +1368,10 @@ static void init_physical_ctx(struct engine_node
>> *node,
>> >
>> >  ovs_assert(br_int && chassis);
>> >
>> > +struct ovsrec_interface_table *iface_table =
>> > +(struct ovsrec_interface_table 

Re: [ovs-dev] [PATCH ovn v12 2/7] ovn-controller: I-P for ct zone and OVS interface changes in flow output stage.

2020-06-19 Thread Numan Siddique
On Fri, Jun 19, 2020 at 1:11 PM Dumitru Ceara  wrote:

> On 6/11/20 2:43 PM, num...@ovn.org wrote:
> > From: Numan Siddique 
> >
> > This patch handles ct zone changes and OVS interface changes
> incrementally
> > in the flow output stage.
> >
> > Any changes to ct zone can be handled by running physical_run() instead
> of running
> > flow_output_run(). And any changes to OVS interfaces can be either
> handled
> > incrementally (for OVS interfaces representing VIFs) or just running
> > physical_run() (for tunnel and other types of interfaces).
> >
> > To better handle this, a new engine node 'physical_flow_changes' is
> added which
> > handles changes to ct zone and OVS interfaces.
> >
> > Signed-off-by: Numan Siddique 
>
> Hi Numan,
>
> I have a few comments on this patch. Please see below.
>
> > ---
> >  controller/binding.c|  23 +-
> >  controller/binding.h|  24 ++-
> >  controller/ovn-controller.c | 136 +++-
> >  controller/physical.c   |  51 ++
> >  controller/physical.h   |   5 +-
> >  5 files changed, 214 insertions(+), 25 deletions(-)
> >
> > diff --git a/controller/binding.c b/controller/binding.c
> > index 06ecb93fb..67fd2777f 100644
> > --- a/controller/binding.c
> > +++ b/controller/binding.c
> > @@ -535,7 +535,7 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
> >   * 'struct local_binding' is used. A shash of these local bindings is
> >   * maintained with the 'external_ids:iface-id' as the key to the shash.
> >   *
> > - * struct local_binding has 3 main fields:
> > + * struct local_binding (defined in binding.h) has 3 main fields:
> >   *- type
> >   *- OVS interface row object
> >   *- Port_Binding row object
> > @@ -586,21 +586,6 @@ remove_local_lport_ids(struct binding_ctx_out
> *b_ctx,
> >   *   - For each 'virtual' Port Binding (of type BT_VIRTUAL) provided
> its parent
> >   * is bound to this chassis.
> >   */
> > -enum local_binding_type {
> > -BT_VIF,
> > -BT_CONTAINER,
> > -BT_VIRTUAL
> > -};
> > -
> > -struct local_binding {
> > -char *name;
> > -enum local_binding_type type;
> > -const struct ovsrec_interface *iface;
> > -const struct sbrec_port_binding *pb;
> > -
> > -/* shash of 'struct local_binding' representing children. */
> > -struct shash children;
> > -};
> >
> >  static struct local_binding *
> >  local_binding_create(const char *name, const struct ovsrec_interface
> *iface,
> > @@ -622,12 +607,6 @@ local_binding_add(struct shash *local_bindings,
> struct local_binding *lbinding)
> >  shash_add(local_bindings, lbinding->name, lbinding);
> >  }
> >
> > -static struct local_binding *
> > -local_binding_find(struct shash *local_bindings, const char *name)
> > -{
> > -return shash_find_data(local_bindings, name);
> > -}
> > -
> >  static void
> >  local_binding_destroy(struct local_binding *lbinding)
> >  {
> > diff --git a/controller/binding.h b/controller/binding.h
> > index 9214a7479..161766d2f 100644
> > --- a/controller/binding.h
> > +++ b/controller/binding.h
> > @@ -18,6 +18,7 @@
> >  #define OVN_BINDING_H 1
> >
> >  #include 
> > +#include "openvswitch/shash.h"
> >
> >  struct hmap;
> >  struct ovsdb_idl;
> > @@ -32,7 +33,6 @@ struct sbrec_chassis;
> >  struct sbrec_port_binding_table;
> >  struct sset;
> >  struct sbrec_port_binding;
> > -struct shash;
> >
> >  struct binding_ctx_in {
> >  struct ovsdb_idl_txn *ovnsb_idl_txn;
> > @@ -77,6 +77,28 @@ struct binding_ctx_out {
> >  struct smap *local_iface_ids;
> >  };
> >
> > +enum local_binding_type {
> > +BT_VIF,
> > +BT_CONTAINER,
> > +BT_VIRTUAL
> > +};
> > +
> > +struct local_binding {
> > +char *name;
> > +enum local_binding_type type;
> > +const struct ovsrec_interface *iface;
> > +const struct sbrec_port_binding *pb;
> > +
> > +/* shash of 'struct local_binding' representing children. */
> > +struct shash children;
> > +};
> > +
> > +static inline struct local_binding *
> > +local_binding_find(struct shash *local_bindings, const char *name)
> > +{
> > +return shash_find_data(local_bindings, name);
> > +}
> > +
> >  void binding_register_ovs_idl(struct ovsdb_idl *);
> >  void binding_run(struct binding_ctx_in *, struct binding_ctx_out *);
> >  bool binding_cleanup(struct ovsdb_idl_txn *ovnsb_idl_txn,
> > diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
> > index bf7214e45..6e66705da 100644
> > --- a/controller/ovn-controller.c
> > +++ b/controller/ovn-controller.c
> > @@ -1368,6 +1368,10 @@ static void init_physical_ctx(struct engine_node
> *node,
> >
> >  ovs_assert(br_int && chassis);
> >
> > +struct ovsrec_interface_table *iface_table =
> > +(struct ovsrec_interface_table *)EN_OVSDB_GET(
> > +engine_get_input("OVS_interface", node));
> > +
> >  struct ed_type_ct_zones *ct_zones_data =
> >  engine_get_input_data("ct_zones", node);
> >  struct simap 

Re: [ovs-dev] [PATCH ovn v12 3/7] ovn-controller: Handle runtime data changes in flow output engine

2020-06-19 Thread Dumitru Ceara
On 6/11/20 2:44 PM, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> In order to handle runtime data changes incrementally, the flow outut
> runtime data handle should know the changed runtime data.
> Runtime data now tracks the changed data for any OVS interface
> and SB port binding changes. The tracked data contains a hmap
> of tracked datapaths (which changed during runtime data processing.
> 
> The flow outout runtime_data handler in this patch doesn't do much

Hi Numan,

Typo: s/outout/output.

I have 3 more minor comments below. With all addressed:

Acked-by: Dumitru Ceara 

Thanks,
Dumitru

> with the tracked data. It returns false if there is tracked data available
> so that flow_output run is called. If no tracked data is available
> then there is no need for flow computation and the handler returns true.
> 
> Next patch in the series processes the tracked data incrementally.
> 
> Co-Authored-by: Venkata Anil 
> Signed-off-by: Venkata Anil 
> Signed-off-by: Numan Siddique 
> ---
>  controller/binding.c| 198 ++--
>  controller/binding.h|  23 +
>  controller/ovn-controller.c | 143 +-
>  tests/ovn-performance.at|  20 ++--
>  4 files changed, 339 insertions(+), 45 deletions(-)
> 
> diff --git a/controller/binding.c b/controller/binding.c
> index 67fd2777f..77ed7441a 100644
> --- a/controller/binding.c
> +++ b/controller/binding.c
> @@ -69,13 +69,25 @@ binding_register_ovs_idl(struct ovsdb_idl *ovs_idl)
>  ovsdb_idl_add_column(ovs_idl, _qos_col_type);
>  }
>  
> +static struct tracked_binding_datapath *tracked_binding_datapath_create(
> +const struct sbrec_datapath_binding *,
> +bool is_new, struct hmap *tracked_dps);
> +static struct tracked_binding_datapath *tracked_binding_datapath_find(
> +struct hmap *, const struct sbrec_datapath_binding *);
> +static void tracked_binding_datapath_lport_add(
> +const struct sbrec_port_binding *, struct hmap *tracked_datapaths);
> +static void update_lport_tracking(const struct sbrec_port_binding *pb,
> +  bool old_claim, bool new_claim,
> +  struct hmap *tracked_dp_bindings);
> +
>  static void
>  add_local_datapath__(struct ovsdb_idl_index *sbrec_datapath_binding_by_key,
>   struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
>   struct ovsdb_idl_index *sbrec_port_binding_by_name,
>   const struct sbrec_datapath_binding *datapath,
>   bool has_local_l3gateway, int depth,
> - struct hmap *local_datapaths)
> + struct hmap *local_datapaths,
> + struct hmap *tracked_datapaths)
>  {
>  uint32_t dp_key = datapath->tunnel_key;
>  struct local_datapath *ld = get_local_datapath(local_datapaths, dp_key);
> @@ -92,6 +104,11 @@ add_local_datapath__(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
>  ld->localnet_port = NULL;
>  ld->has_local_l3gateway = has_local_l3gateway;
>  
> +if (tracked_datapaths &&
> +!tracked_binding_datapath_find(tracked_datapaths, datapath)) {
> +tracked_binding_datapath_create(datapath, true, tracked_datapaths);
> +}
> +
>  if (depth >= 100) {
>  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
>  VLOG_WARN_RL(, "datapaths nested too deep");
> @@ -124,7 +141,8 @@ add_local_datapath__(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
>   sbrec_port_binding_by_datapath,
>   sbrec_port_binding_by_name,
>   peer->datapath, false,
> - depth + 1, local_datapaths);
> + depth + 1, local_datapaths,
> + tracked_datapaths);
>  }
>  ld->n_peer_ports++;
>  if (ld->n_peer_ports > ld->n_allocated_peer_ports) {
> @@ -147,12 +165,14 @@ add_local_datapath(struct ovsdb_idl_index 
> *sbrec_datapath_binding_by_key,
> struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
> struct ovsdb_idl_index *sbrec_port_binding_by_name,
> const struct sbrec_datapath_binding *datapath,
> -   bool has_local_l3gateway, struct hmap *local_datapaths)
> +   bool has_local_l3gateway, struct hmap *local_datapaths,
> +   struct hmap *tracked_datapaths)
>  {
>  add_local_datapath__(sbrec_datapath_binding_by_key,
>   sbrec_port_binding_by_datapath,
>   sbrec_port_binding_by_name,
> - datapath, has_local_l3gateway, 0, local_datapaths);
> + datapath, has_local_l3gateway, 0, 

Re: [ovs-dev] [PATCH v6 ovn] Add support for DHCP domain search option (119)

2020-06-19 Thread 0-day Robot
Bleep bloop.  Greetings Ankur Sharma, 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: Ankur Sharma 
ERROR: Use ovs_strlcpy() in place of strcpy()
#77 FILE: lib/actions.c:2358:
strcpy(suffix, domain);

ERROR: Use ovs_strlcpy() in place of strcpy()
#105 FILE: lib/actions.c:2386:
   strcpy(suffix, domain);

Lines checked: 307, Warnings: 1, 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


Re: [ovs-dev] [PATCH ovn v12 2/7] ovn-controller: I-P for ct zone and OVS interface changes in flow output stage.

2020-06-19 Thread Dumitru Ceara
On 6/11/20 2:43 PM, num...@ovn.org wrote:
> From: Numan Siddique 
> 
> This patch handles ct zone changes and OVS interface changes incrementally
> in the flow output stage.
> 
> Any changes to ct zone can be handled by running physical_run() instead of 
> running
> flow_output_run(). And any changes to OVS interfaces can be either handled
> incrementally (for OVS interfaces representing VIFs) or just running
> physical_run() (for tunnel and other types of interfaces).
> 
> To better handle this, a new engine node 'physical_flow_changes' is added 
> which
> handles changes to ct zone and OVS interfaces.
> 
> Signed-off-by: Numan Siddique 

Hi Numan,

I have a few comments on this patch. Please see below.

> ---
>  controller/binding.c|  23 +-
>  controller/binding.h|  24 ++-
>  controller/ovn-controller.c | 136 +++-
>  controller/physical.c   |  51 ++
>  controller/physical.h   |   5 +-
>  5 files changed, 214 insertions(+), 25 deletions(-)
> 
> diff --git a/controller/binding.c b/controller/binding.c
> index 06ecb93fb..67fd2777f 100644
> --- a/controller/binding.c
> +++ b/controller/binding.c
> @@ -535,7 +535,7 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
>   * 'struct local_binding' is used. A shash of these local bindings is
>   * maintained with the 'external_ids:iface-id' as the key to the shash.
>   *
> - * struct local_binding has 3 main fields:
> + * struct local_binding (defined in binding.h) has 3 main fields:
>   *- type
>   *- OVS interface row object
>   *- Port_Binding row object
> @@ -586,21 +586,6 @@ remove_local_lport_ids(struct binding_ctx_out *b_ctx,
>   *   - For each 'virtual' Port Binding (of type BT_VIRTUAL) provided its 
> parent
>   * is bound to this chassis.
>   */
> -enum local_binding_type {
> -BT_VIF,
> -BT_CONTAINER,
> -BT_VIRTUAL
> -};
> -
> -struct local_binding {
> -char *name;
> -enum local_binding_type type;
> -const struct ovsrec_interface *iface;
> -const struct sbrec_port_binding *pb;
> -
> -/* shash of 'struct local_binding' representing children. */
> -struct shash children;
> -};
>  
>  static struct local_binding *
>  local_binding_create(const char *name, const struct ovsrec_interface *iface,
> @@ -622,12 +607,6 @@ local_binding_add(struct shash *local_bindings, struct 
> local_binding *lbinding)
>  shash_add(local_bindings, lbinding->name, lbinding);
>  }
>  
> -static struct local_binding *
> -local_binding_find(struct shash *local_bindings, const char *name)
> -{
> -return shash_find_data(local_bindings, name);
> -}
> -
>  static void
>  local_binding_destroy(struct local_binding *lbinding)
>  {
> diff --git a/controller/binding.h b/controller/binding.h
> index 9214a7479..161766d2f 100644
> --- a/controller/binding.h
> +++ b/controller/binding.h
> @@ -18,6 +18,7 @@
>  #define OVN_BINDING_H 1
>  
>  #include 
> +#include "openvswitch/shash.h"
>  
>  struct hmap;
>  struct ovsdb_idl;
> @@ -32,7 +33,6 @@ struct sbrec_chassis;
>  struct sbrec_port_binding_table;
>  struct sset;
>  struct sbrec_port_binding;
> -struct shash;
>  
>  struct binding_ctx_in {
>  struct ovsdb_idl_txn *ovnsb_idl_txn;
> @@ -77,6 +77,28 @@ struct binding_ctx_out {
>  struct smap *local_iface_ids;
>  };
>  
> +enum local_binding_type {
> +BT_VIF,
> +BT_CONTAINER,
> +BT_VIRTUAL
> +};
> +
> +struct local_binding {
> +char *name;
> +enum local_binding_type type;
> +const struct ovsrec_interface *iface;
> +const struct sbrec_port_binding *pb;
> +
> +/* shash of 'struct local_binding' representing children. */
> +struct shash children;
> +};
> +
> +static inline struct local_binding *
> +local_binding_find(struct shash *local_bindings, const char *name)
> +{
> +return shash_find_data(local_bindings, name);
> +}
> +
>  void binding_register_ovs_idl(struct ovsdb_idl *);
>  void binding_run(struct binding_ctx_in *, struct binding_ctx_out *);
>  bool binding_cleanup(struct ovsdb_idl_txn *ovnsb_idl_txn,
> diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
> index bf7214e45..6e66705da 100644
> --- a/controller/ovn-controller.c
> +++ b/controller/ovn-controller.c
> @@ -1368,6 +1368,10 @@ static void init_physical_ctx(struct engine_node *node,
>  
>  ovs_assert(br_int && chassis);
>  
> +struct ovsrec_interface_table *iface_table =
> +(struct ovsrec_interface_table *)EN_OVSDB_GET(
> +engine_get_input("OVS_interface", node));
> +
>  struct ed_type_ct_zones *ct_zones_data =
>  engine_get_input_data("ct_zones", node);
>  struct simap *ct_zones = _zones_data->current;
> @@ -1377,12 +1381,14 @@ static void init_physical_ctx(struct engine_node 
> *node,
>  p_ctx->mc_group_table = multicast_group_table;
>  p_ctx->br_int = br_int;
>  p_ctx->chassis_table = chassis_table;
> +p_ctx->iface_table = iface_table;
>  p_ctx->chassis = chassis;

[ovs-dev] [PATCH v6 ovn] Add support for DHCP domain search option (119)

2020-06-19 Thread Ankur Sharma
From: Dhathri Purohith 

Domain search list is encoded according to the specifications in RFC 1035,
section 4.1.4.

Signed-off-by: Dhathri Purohith 
Signed-off-by: Ankur Sharma 
---
 lib/actions.c   | 90 -
 lib/ovn-l7.h|  3 ++
 northd/ovn-northd.c |  1 +
 ovn-nb.xml  | 13 
 ovn-sb.ovsschema|  6 ++--
 ovn-sb.xml  | 11 +++
 tests/ovn.at| 36 +
 tests/test-ovn.c|  1 +
 8 files changed, 157 insertions(+), 4 deletions(-)

diff --git a/lib/actions.c b/lib/actions.c
index f21be6d..d329ed1 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1982,7 +1982,8 @@ parse_gen_opt(struct action_context *ctx, struct 
ovnact_gen_option *o,
 return;
 }
 
-if (!strcmp(o->option->type, "str")) {
+if (!strcmp(o->option->type, "str") ||
+!strcmp(o->option->type, "domains")) {
 if (o->value.type != EXPR_C_STRING) {
 lexer_error(ctx->lexer, "%s option %s requires string value.",
 opts_type, o->option->name);
@@ -2317,6 +2318,93 @@ encode_put_dhcpv4_option(const struct ovnact_gen_option 
*o,
opt_header[1] = sizeof(ovs_be32);
ofpbuf_put(ofpacts, >value.ipv4, sizeof(ovs_be32));
 }
+} else if (!strcmp(o->option->type, "domains")) {
+/* Please refer to RFC 1035, section 4.1.4 for the format of encoding
+ * domain names. Below is an example for encoding a search list
+ * consisting of the "abc.com" and "xyz.abc.com".
+ *
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ * |119|14 | 3 |'a'|'b'|'c'| 3 |'c'|'o'|'m'| 0 |'x'|'y'|'z'|xC0|x00|
+ * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ *
+ * The encoding of "abc.com" ends with 0 to mark the end of the
+ * domain name as required by RFC 1035.
+ *
+ * The encoding of "xyz" (for "xyz.abc.com") ends with the two-octet
+ * compression pointer C000 (hex), which points to offset 0 where
+ * another validly encoded domain name can be found to complete
+ * the name ("abc.com").
+ *
+ * Encoding adds 2 bytes (one for length and one for delimiter) for
+ * every domain name that is unique. If all the domain names are unique
+ * (which probably never happens in real world), then encoded string
+ * could be longer than the original string. Just to be on the safer
+ * side, allocate the (approx.) worst case length here.
+ */
+uint8_t *dns_encoded = xzalloc(2 * strlen(c->string));
+uint16_t encode_offset = 0;
+struct shash label_offset_map;
+shash_init(_offset_map);
+char *domain_list = xstrdup(c->string), *dom_ptr = NULL;
+char *suffix = xzalloc(strlen(domain_list));
+for (char *domain = strtok_r(domain_list, ",", _ptr);
+ domain != NULL;
+ domain = strtok_r(NULL, ",", _ptr)) {
+if (strlen(domain) > DOMAIN_NAME_MAX_LEN) {
+VLOG_WARN("Domain names longer than 255 characters are not"
+  "supported");
+goto out;
+}
+strcpy(suffix, domain);
+char *label;
+for (label = strtok_r(domain, ".", );
+ label != NULL;
+ label = strtok_r(NULL, ".", )) {
+/* Check if we have already encoded this suffix.
+ * If yes, fill in the reference and break. */
+uint16_t *get_offset;
+get_offset  = shash_find_data(_offset_map, suffix);
+if (get_offset != NULL) {
+ovs_be16 temp = htons(0xc000) | htons(*get_offset);
+memcpy(dns_encoded + encode_offset, ,
+sizeof(temp));
+encode_offset += sizeof(temp);
+break;
+} else {
+/* The suffix was not encoded before, encode it now
+ * and add the offset to the label_offset_map. */
+uint16_t *set_offset = xzalloc(sizeof(uint16_t));
+memcpy(set_offset, _offset, sizeof(uint16_t));
+shash_add_once(_offset_map, suffix, set_offset);
+
+uint8_t len = strlen(label);
+memcpy(dns_encoded + encode_offset, , sizeof(uint8_t));
+encode_offset += sizeof(uint8_t);
+memcpy(dns_encoded + encode_offset, label, len);
+encode_offset += len;
+}
+   strcpy(suffix, domain);
+}
+/* Add the end marker (0 byte) to determine the end of the
+ * domain. */
+if (label == NULL) {
+uint8_t end = 0;
+memcpy(dns_encoded + encode_offset, , sizeof(uint8_t));

Re: [ovs-dev] [PATCH] netdev-offload-tc: Revert tunnel src/dst port masks handling

2020-06-19 Thread Simon Horman
On Thu, Jun 18, 2020 at 07:36:52PM +0300, Roi Dayan wrote:
> 
> 
> On 2020-06-16 6:48 PM, Simon Horman wrote:
> > On Tue, Jun 16, 2020 at 05:06:49PM +0300, Roi Dayan wrote:
> >>
> >>
> >> On 2020-06-16 4:03 PM, Roi Dayan wrote:
> >>> The cited commit intended to add tc support for masking tunnel src/dst
> >>> ips and ports. It's not possible to do tunnel ports masking with
> >>> openflow rules and the default mask for tunnel ports set to 0 in
> >>> tnl_wc_init(), unlike tunnel ports default mask which is full mask.
> >>> So instead of never passing tunnel ports to tc, revert the changes
> >>> to tunnel ports to always pass the tunnel port.
> >>> In sw classification is done by the kernel, but for hw we must match
> >>> the tunnel dst port.
> >>>
> >>> Fixes: 5f568d049130 ("netdev-offload-tc: Allow to match the IP and port 
> >>> mask of tunnel")
> >>> Signed-off-by: Roi Dayan 
> >>> Reviewed-by: Eli Britstein 
> >>> ---
> >>>  NEWS|  2 --
> >>>  include/openvswitch/match.h |  3 ---
> >>>  lib/match.c | 13 -
> >>>  lib/netdev-offload-tc.c | 13 ++---
> >>>  lib/tc.c| 28 ++--
> >>>  tests/tunnel.at |  4 ++--
> >>>  6 files changed, 6 insertions(+), 57 deletions(-)
> >>>
> >>> diff --git a/NEWS b/NEWS
> >>> index 88b273a0af89..22cacda20ac7 100644
> >>> --- a/NEWS
> >>> +++ b/NEWS
> >>> @@ -19,8 +19,6 @@ Post-v2.13.0
> >>> - Tunnels: TC Flower offload
> >>>   * Tunnel Local endpoint address masked match are supported.
> >>>   * Tunnel Romte endpoint address masked match are supported.
> >>> - * Tunnel Local endpoint ports masked match are supported.
> >>> - * Tunnel Romte endpoint ports masked match are supported.
> >>>  
> >>>  
> >>>  v2.13.0 - 14 Feb 2020
> >>> diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h
> >>> index 9e480318e2b3..2e8812048e86 100644
> >>> --- a/include/openvswitch/match.h
> >>> +++ b/include/openvswitch/match.h
> >>> @@ -105,9 +105,6 @@ void match_set_tun_flags(struct match *match, 
> >>> uint16_t flags);
> >>>  void match_set_tun_flags_masked(struct match *match, uint16_t flags, 
> >>> uint16_t mask);
> >>>  void match_set_tun_tp_dst(struct match *match, ovs_be16 tp_dst);
> >>>  void match_set_tun_tp_dst_masked(struct match *match, ovs_be16 port, 
> >>> ovs_be16 mask);
> >>> -void match_set_tun_tp_src(struct match *match, ovs_be16 tp_src);
> >>> -void match_set_tun_tp_src_masked(struct match *match,
> >>> - ovs_be16 port, ovs_be16 mask);
> >>>  void match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, 
> >>> ovs_be16 mask);
> >>>  void match_set_tun_gbp_id(struct match *match, ovs_be16 gbp_id);
> >>>  void match_set_tun_gbp_flags_masked(struct match *match, uint8_t flags, 
> >>> uint8_t mask);
> >>> diff --git a/lib/match.c b/lib/match.c
> >>> index a77554851146..ba716579d8ec 100644
> >>> --- a/lib/match.c
> >>> +++ b/lib/match.c
> >>> @@ -294,19 +294,6 @@ match_set_tun_tp_dst_masked(struct match *match, 
> >>> ovs_be16 port, ovs_be16 mask)
> >>>  }
> >>>  
> >>>  void
> >>> -match_set_tun_tp_src(struct match *match, ovs_be16 tp_src)
> >>> -{
> >>> -match_set_tun_tp_src_masked(match, tp_src, OVS_BE16_MAX);
> >>> -}
> >>> -
> >>> -void
> >>> -match_set_tun_tp_src_masked(struct match *match, ovs_be16 port, ovs_be16 
> >>> mask)
> >>> -{
> >>> -match->wc.masks.tunnel.tp_src = mask;
> >>> -match->flow.tunnel.tp_src = port & mask;
> >>> -}
> >>> -
> >>> -void
> >>>  match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, 
> >>> ovs_be16 mask)
> >>>  {
> >>>  match->wc.masks.tunnel.gbp_id = mask;
> >>> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> >>> index aa6d22e74f29..258d31f54b08 100644
> >>> --- a/lib/netdev-offload-tc.c
> >>> +++ b/lib/netdev-offload-tc.c
> >>> @@ -712,15 +712,8 @@ parse_tc_flower_to_match(struct tc_flower *flower,
> >>>  match_set_tun_ttl_masked(match, flower->key.tunnel.ttl,
> >>>   flower->mask.tunnel.ttl);
> >>>  }
> >>> -if (flower->mask.tunnel.tp_dst) {
> >>> -match_set_tun_tp_dst_masked(match,
> >>> -flower->key.tunnel.tp_dst,
> >>> -flower->mask.tunnel.tp_dst);
> >>> -}
> >>> -if (flower->mask.tunnel.tp_src) {
> >>> -match_set_tun_tp_src_masked(match,
> >>> -flower->key.tunnel.tp_src,
> >>> -flower->mask.tunnel.tp_src);
> >>> +if (flower->key.tunnel.tp_dst) {
> >>> +match_set_tun_tp_dst(match, flower->key.tunnel.tp_dst);
> >>>  }
> >>>  if (flower->key.tunnel.metadata.present.len) {
> >>>  flower_tun_opt_to_match(match, flower);
> >>> @@ -1470,8 +1463,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct 
> 

[ovs-dev] [PATCH ovn v3] Support packet metadata marking for logical router policies.

2020-06-19 Thread numans
From: Numan Siddique 

This patch adds a new column 'options' of type smap in the
Logical_Router_Policy table in the NB DB and supports the key 'pkt_mark'.
CMS can set a desired value for this key in the 'options' column. When this
router policy is applied, the packet metadata is marked with the specified
value (to the NXM_NX_PKT_MARK OVS field).

In the case of Linux, this corresponds to struct sk_buff's "skb_mark"
member and this mark can be seen by the linux networking subsystem.
CMS can inspect this value (as an iptables rule or adding an OF flow
in another ovs bridge) and take appropriate action when the marked packet
leaves the integration bridge via the patch port.

Requested-at: https://bugzilla.redhat.com/show_bug.cgi?id=1828933
Requested-by: Alexander Constantinescu 
Signed-off-by: Numan Siddique 
---

v2 -> v3
---
 * Added test cases for IPv6 routing policies as suggested by Alexander
   Constantinescu.

v1 -> v2
---
 * Addressed review comments from Gabriele Cerami.
 * Documented the  field pkt.mark in ovn-sb.xml.


 NEWS |   2 +
 lib/logical-fields.c |   2 +
 northd/ovn-northd.c  |   8 ++
 ovn-nb.ovsschema |   7 +-
 ovn-nb.xml   |   9 ++
 ovn-sb.xml   |   1 +
 tests/ovn.at | 288 +++
 7 files changed, 315 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index c6bb9b2fb..893063b01 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
 Post-v20.06.0
 --
+   - Added packet marking support for traffic routed with
+ a routing policy.
 
 OVN v20.06.0
 --
diff --git a/lib/logical-fields.c b/lib/logical-fields.c
index a007085b3..8ad56aa53 100644
--- a/lib/logical-fields.c
+++ b/lib/logical-fields.c
@@ -254,6 +254,8 @@ ovn_init_symtab(struct shash *symtab)
 expr_symtab_add_field(symtab, "sctp.src", MFF_SCTP_SRC, "sctp", false);
 expr_symtab_add_field(symtab, "sctp.dst", MFF_SCTP_DST, "sctp", false);
 
+expr_symtab_add_field(symtab, "pkt.mark", MFF_PKT_MARK, NULL, false);
+
 expr_symtab_add_ovn_field(symtab, "icmp4.frag_mtu", OVN_ICMP4_FRAG_MTU);
 }
 
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 6a9b097e5..369b258c0 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -7101,6 +7101,10 @@ build_routing_policy_flow(struct hmap *lflows, struct 
ovn_datapath *od,
  rule->priority, rule->nexthop);
 return;
 }
+uint32_t pkt_mark = smap_get_int(>options, "pkt_mark", 0);
+if (pkt_mark) {
+ds_put_format(, "pkt.mark = %u; ", pkt_mark);
+}
 bool is_ipv4 = strchr(rule->nexthop, '.') ? true : false;
 ds_put_format(, "%sreg0 = %s; "
   "%sreg1 = %s; "
@@ -7118,6 +7122,10 @@ build_routing_policy_flow(struct hmap *lflows, struct 
ovn_datapath *od,
 } else if (!strcmp(rule->action, "drop")) {
 ds_put_cstr(, "drop;");
 } else if (!strcmp(rule->action, "allow")) {
+uint32_t pkt_mark = smap_get_int(>options, "pkt_mark", 0);
+if (pkt_mark) {
+ds_put_format(, "pkt.mark = %u; ", pkt_mark);
+}
 ds_put_cstr(, "next;");
 }
 ds_put_format(, "%s", rule->match);
diff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema
index a06972aa0..da9af7157 100644
--- a/ovn-nb.ovsschema
+++ b/ovn-nb.ovsschema
@@ -1,7 +1,7 @@
 {
 "name": "OVN_Northbound",
-"version": "5.23.0",
-"cksum": "111023208 25806",
+"version": "5.24.0",
+"cksum": "1092394564 25961",
 "tables": {
 "NB_Global": {
 "columns": {
@@ -379,6 +379,9 @@
 "key": {"type": "string",
 "enum": ["set", ["allow", "drop", "reroute"]]}}},
 "nexthop": {"type": {"key": "string", "min": 0, "max": 1}},
+"options": {
+"type": {"key": "string", "value": "string",
+ "min": 0, "max": "unlimited"}},
 "external_ids": {
 "type": {"key": "string", "value": "string",
  "min": 0, "max": "unlimited"}}},
diff --git a/ovn-nb.xml b/ovn-nb.xml
index 8368d5108..21fe5e773 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -2541,6 +2541,15 @@
   
 
 
+
+  
+Marks the packet with the value specified when the router policy
+is applied. CMS can inspect this packet marker and take some decisions
+if desired. This value is not preserved when the packet goes out of the
+wire.
+  
+
+
 
   
 See External IDs at the beginning of this document.
diff --git a/ovn-sb.xml b/ovn-sb.xml
index 208fb936f..00e7e7fc5 100644
--- a/ovn-sb.xml
+++ b/ovn-sb.xml
@@ -975,6 +975,7 @@
 xxreg0 xxreg1
 inport outport
 flags.loopback
+pkt.mark
 eth.src eth.dst 
eth.type
 vlan.tci vlan.vid vlan.pcp 
vlan.present
 ip.proto ip.dscp ip.ecn 
ip.ttl