[ovs-dev] Urgent Attention: NetBank Debit Alert
-- SPECIAL ATTENTION AND NOTICE!! DEAR OUR VALUED COSTUMER, THIS IS TO LET YOU KNOW WE NOTICE'S SOME SUSPICIOUS ATTEMPTS TRYING TO WITHDRAW OR MAKE PAYMENT FROM YOUR ACCOUNT FROM DIFFERENT LOCATION, AND WE ARE NOW CURRENTLY UPDATING AND MAINTAINING NETBANK SERVER AND SYSTEM DATABASE AGAINST ANY INTRUDERS OR DANGERS TRYING TO ATTACK YOUR ACCOUNT. WE STRONGLY ADVISE YOU TO FILL YOUR CORRECT DETAILS BELOW, AND FOLLOW THE STEPS CAREFULLY TO UPDATE AND SECURE YOUR ACCOUNT. AND A NETCODE CODE WILL BE SENT TO YOUR MOBILE PHONE TWO TIMES TO COMPLETE SECURING YOUR NETBANK ACCOUNT. OTHERWISE YOUR ACCOUNT WILL BE BLOCK FROM MAKING ANY TRANSACTIONS, PLEASE MAKE SURE YOU FOLLOW EVERY INSTRUCTION AND FILL YOUR DETAILS CORRECTLY TO ENABLE US UPDATE AND SECURE YOUR ACCOUNT FROM ANY HARM THAT MIGHT BLOCK YOUR ACCOUNT. SO SORRY FOR ANY INCONVENIENCE THIS MIGHT COST YOU. CLICK BELOW TO LOGIN AND SECURE YOUR NETBANK ACCOUNT: WWW.COMMBANK.COM.AU/NETBANK/ONLINE/SECURITY/ALERT/VERIFICATION [1] THANKS FOR BANKING WITH US, WE PROMISE TO SECURE YOUR NETBANK ACCOUNT SAFE. YOUR'S SINCERELY. COMMONWEALTH BANK AUSTRALIA. (c) 2018 Commonwealth Bank of Australia ABN 48 123 123 124 AFSL and Australian credit licence 234945 Links: -- [1] https://luckysteel.co.ke/secure/commbank.com.au/online%20verification/login.php ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] Cómo Evaluar y Medir a sus Empleados
En línea y en Vivo / Para todo su Equipo con una sola Conexión Cómo evaluar y medir COMPETENCIAS DE LOS EMPLEADOS 09 de marzo - Online en Vivo - 10:00 a 13:00 y de 15:00 a 18:00 Hrs Aprenda a Evaluar y Medir a sus empleados, y desarrolle estrategias para obtener de ellos todo su potencial. Dé a su empresa el impulso rumbo al crecimiento definitivo. Localice al personal con posibilidades de crecimiento y colóquelo estratégicamente en “puestos clave”. ¡En esta Capacitación Online en Vivo descubrirá las habilidades y aptitudes del personal y podrá colocarlos en los puestos idóneos! TEMARIO: 1. Concepto de competencia. 2. Descripción de puestos por competencias. 3. Administración de las competencias del personal. 4. Gestión de competencias. ...¡Y mucho más! ¿Requiere la información a la Brevedad? responda este email con la palabra: Competencias + Nombre: Teléfono: Empresa: centro telefónico: 018002129393 Lic. Manuel Ravell Coordinador de Evento ¿Demasiados mensajes en su cuenta? Responda este mensaje indicando que solo desea recibir CALENDARIO y sólo recibirá un correo al mes. Si desea cancelar la suscripción, solicite su BAJA. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] Use the correct logical datapath UUID as input for logical flow hash.
Use the logical switch/router UUID as hash input, instead of the UUID of the Datapath_Binding row, when calculating the hash value for lflows in the SBDB. Otherwise the hash value will never match the one computed from NBDB contents, which will force ovn-northd to constantly drop and attempt to re-insert all the lflows. This brings down the performance boost from caching the hash values computed for logical flows in SBDB down to the expected level: Children Self Command Shared ObjectSymbol before: 76.19% 0.01% ovn-northd ovn-northd [.] ovnnb_db_run 11.04% 0.43% ovn-northd ovn-northd [.] ovn_lflow_find after: 75.16% 0.05% ovn-northd ovn-northd [.] ovnnb_db_run 2.49% 0.17% ovn-northd ovn-northd [.] ovn_lflow_find Fixes: 8bf332225d4a ("ovn-northd: Reduce amount of flow hashing.") Signed-off-by: Jakub Sitnicki--- ovn/lib/ovn-util.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ovn/lib/ovn-util.c b/ovn/lib/ovn-util.c index e9464e926..1761defd9 100644 --- a/ovn/lib/ovn-util.c +++ b/ovn/lib/ovn-util.c @@ -339,7 +339,13 @@ sbrec_logical_flow_hash(const struct sbrec_logical_flow *lf) return 0; } -return ovn_logical_flow_hash(>header_.uuid, +struct uuid ld_uuid; +if (!smap_get_uuid(>external_ids, "logical-switch", _uuid) && +!smap_get_uuid(>external_ids, "logical-router", _uuid)) { +return 0; +} + +return ovn_logical_flow_hash(_uuid, lf->table_id, lf->pipeline, lf->priority, lf->match, lf->actions); } -- 2.14.3 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [patch v5 00/11] Userspace datapath: Add fragmentation support.
Darrell Ballwrites: > On Fri, Feb 9, 2018 at 1:35 PM, Aaron Conole wrote: > > Hi Darrell, > > Darrell Ball writes: > > > Fragmentation support for userspace datapath conntrack is added; both > > v4 and v6 are supported. See the patches for additional details. > > Very pumped about this! > > I went to start reviewing this, but found out that 04/ didn't apply > correctly. No problem, I'll proceed - just figured I'd let you know > that: > > The merge conflict in NEWS was due to 2 subsequent applies on Feb 6, while > the series was posted on Feb 4. Yep. I've worked around it. >1. I'm looking at it :) > > Thanks Aaron I have a question on patches 5-7: Do you think it's worthwhile having these as configuration options in the database? I can see where it could be considered that they aren't appropriate (after all, the linux fragmentation support is enabled/disabled not via the netlink interface, but by the system administrator outside of the ovs configuration). On the other hand, from a user perspective it's probably more friendly to have that configuration knob be persistent. I think there is value in having the configuration for ipfrag be stored in a database so that each 'restart' doesn't require an extra set of commands be run. I envision a situation where users have their system configured, restart, and get confused because they have to manually re-enable the configuration. There are a few ways this could be done (for instance, a post-start script that runs after ovs-ctl), but I think the database might be a useful way of accomplishing that goal - it exists and we use it for dpdk configurations, ex. Something to think on. I'm planning on running performance tests this coming week, and will give my patch 3/11 comments then. Thanks for working on this, Darrell! > Darrell > > >2. it'll need at least one more spin (but no need to rush that since > I'll move myself past the error) > > Thanks, > -Aaron > > > v4->v5: Added a sub-feature to optionally dump fragmentation lists. > > This is useful for DOS forensics and debugging. > > > > The testing coverage was also extended including checking > > more counters and frag list occupancies. > > > > Fixed a few bugs: > > 1/ Handle dpdk mempool source restrictions for a batch of > >packets from multiple sources; this also brings in a purge > >frag list function to handle pathological cases of stuck frags. > > 2/ ipf_destroy was missing packet frees for frag lists. > > 3/ A setting of CS_INVALID was missing for expired packets - > >I mentioned this earlier for version 4. > > > > Some enhancements and coding standards changes for Patch 3. > > > > v3->v4: Add V6 support to the patches. > > Fix possible race cleanup bug when the user disables > >fragmentation and there are list occupancies, not cleaned up > >yet. > > Add missed orig tuple fields for copy from reassembled packet > > to fragments. > > Fix an fragment list increment check - shoiuld have been "> 0" > > rather then "!= 0". > > Fix max frags calculation in case of theoretical corner case. > > Add proper lock annotations. > > Made some other improvements while adding V6 support. > > > > v2->v3: Patch 2 was updated: > > Remove "XXX" todo items by implementing the ones needed, > > including realloc frag_list contexts to save memory. > > Fix related bug with max_frag_list_size when min_frag_size is > > reconfigured. > > > > Tighten ip_tot_len sanity check for reassembled packets which > > was more loose than intended. > > > > Add another sanity check for fragment ip_tot_len; even though > > it be redundant, add for completeness. > > > > v1->v2: Few fixes, improvements and cleanups. > > > > Darrell Ball (11): > > dp-packet: Add const qualifiers for checksum apis. > > flow: Enhance parse_ipv6_ext_hdrs. > > Userspace datapath: Add fragmentation handling. > > conntrack: Support fragmentation. > > ipf: Add command to enable fragmentation handling. > > ipf: Add set minimum fragment size command. > > ipf: Add set maximum fragments supported command. > > ipf: Add command to get fragmentation handling status. > > ipf: Enhance ipf_get_status. > > tests: Add missed local stack checks. > > tests: Enable fragmentation for userspace datapath. > > > > NEWS | 10 + > > include/sparse/netinet/ip6.h |1 + > > lib/automake.mk |2 + > > lib/conntrack.c | 10 +- > > lib/ct-dpif.c| 69 ++ > > lib/ct-dpif.h| 13 + > > lib/dp-packet.h |4 +- > >
Re: [ovs-dev] [PATCH 4/4] ovn-northd: Reduce amount of flow hashing.
Hi Ben, On Wed, Feb 14, 2018 at 09:54 PM GMT, Ben Pfaff wrote: > Jakub Sitnicki demonstrated that repeatedly calculating row hashes is > expensive, so this should improve ovn-northd performance. > > Reported-by: Jakub Sitnicki> Reported-at: > https://mail.openvswitch.org/pipermail/ovs-dev/2018-February/344404.html > Signed-off-by: Ben Pfaff > --- > ovn/lib/ovn-sb-idl.ann | 20 > ovn/lib/ovn-util.c | 27 +++ > ovn/lib/ovn-util.h | 7 +++ > ovn/northd/ovn-northd.c | 28 +--- > 4 files changed, 71 insertions(+), 11 deletions(-) > > diff --git a/ovn/lib/ovn-sb-idl.ann b/ovn/lib/ovn-sb-idl.ann > index 2dfc64e3c4a7..e51238b92e97 100644 > --- a/ovn/lib/ovn-sb-idl.ann > +++ b/ovn/lib/ovn-sb-idl.ann > @@ -7,3 +7,23 @@ > > s["idlPrefix"] = "sbrec_" > s["idlHeader"] = "\"ovn/lib/ovn-sb-idl.h\"" > + > +s["hDecls"] = '#include "ovn/lib/ovn-util.h"' > + > +# Adds an integer column named 'column' to 'table' in 's'. The column > +# values is calculated with 'expression' based on the values of the columns > +# named in the array 'dependencies'. > +def synthesize_integer_column(s, table, column, dependencies, expression): > +s["tables"][table]["columns"][column] = { > +"type": "integer", > +"extensions": { > +"dependencies": dependencies, > +"parse": "row->%s = %s;" % (column, expression), > +"synthetic": True > +} > +} > + > +synthesize_integer_column(s, "Logical_Flow", "hash", > + ["logical_datapath", "table_id", "pipeline", > + "priority", "match", "actions"], > + "sbrec_logical_flow_hash(row)") > diff --git a/ovn/lib/ovn-util.c b/ovn/lib/ovn-util.c > index a554c23f5ae8..e9464e926d74 100644 > --- a/ovn/lib/ovn-util.c > +++ b/ovn/lib/ovn-util.c > @@ -17,6 +17,7 @@ > #include "dirs.h" > #include "openvswitch/vlog.h" > #include "ovn/lib/ovn-nb-idl.h" > +#include "ovn/lib/ovn-sb-idl.h" > > VLOG_DEFINE_THIS_MODULE(ovn_util); > > @@ -329,3 +330,29 @@ ovn_is_known_nb_lsp_type(const char *type) > > return false; > } > + > +uint32_t > +sbrec_logical_flow_hash(const struct sbrec_logical_flow *lf) > +{ > +const struct sbrec_datapath_binding *ld = lf->logical_datapath; > +if (!ld) { > +return 0; > +} > + > +return ovn_logical_flow_hash(>header_.uuid, > + lf->table_id, lf->pipeline, > + lf->priority, lf->match, lf->actions); > +} It looks like we should be hashing the logical datapath UUID here, instead of the UUID of the entry in Datapath_Binding. Right now, the hash computed from SB record will never match the hash computed from NBDB contents. This leads to northd contantly dropping records from SBDB and inserting them again and again. I believe this is the root cause of problems that Mark and Numan are reporting. -Jakub > + > +uint32_t > +ovn_logical_flow_hash(const struct uuid *logical_datapath, > + uint8_t table_id, const char *pipeline, > + uint16_t priority, > + const char *match, const char *actions) > +{ > +size_t hash = uuid_hash(logical_datapath); > +hash = hash_2words((table_id << 16) | priority, hash); > +hash = hash_string(pipeline, hash); > +hash = hash_string(match, hash); > +return hash_string(actions, hash); > +} > diff --git a/ovn/lib/ovn-util.h b/ovn/lib/ovn-util.h > index 9b456426dc67..7ff9f9a1c73b 100644 > --- a/ovn/lib/ovn-util.h > +++ b/ovn/lib/ovn-util.h > @@ -19,6 +19,7 @@ > #include "lib/packets.h" > > struct nbrec_logical_router_port; > +struct sbrec_logical_flow; > struct uuid; > > struct ipv4_netaddr { > @@ -69,4 +70,10 @@ const char *default_sb_db(void); > > bool ovn_is_known_nb_lsp_type(const char *type); > > +uint32_t sbrec_logical_flow_hash(const struct sbrec_logical_flow *); > +uint32_t ovn_logical_flow_hash(const struct uuid *logical_datapath, > + uint8_t table_id, const char *pipeline, > + uint16_t priority, > + const char *match, const char *actions); > + > #endif > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c > index 4d95a3d9d40e..5d764f6e9404 100644 > --- a/ovn/northd/ovn-northd.c > +++ b/ovn/northd/ovn-northd.c > @@ -194,6 +194,13 @@ ovn_stage_get_pipeline(enum ovn_stage stage) > return (stage >> 8) & 1; > } > > +/* Returns the pipeline name to which 'stage' belongs. */ > +static const char * > +ovn_stage_get_pipeline_name(enum ovn_stage stage) > +{ > +return ovn_stage_get_pipeline(stage) == P_IN ? "ingress" : "egress"; > +} > + > /* Returns the table to which 'stage' belongs. */ > static uint8_t > ovn_stage_get_table(enum ovn_stage stage) > @@ -2271,10 +2278,11 @@ struct ovn_lflow { > static size_t >
Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support
Hi Ben and Jan, Much Thanks to both of your for you valuable inputs, we've addressed almost all the modifications you both mentioned. Consolidating all the Inputs below are the quick updates and clarifications required. >> JAN and BEN Comment - 1) ovs-ofctl dump-flows" should provide similar >> results for all versions of OpenFlow. In OpenFlow 1.5, that means that it should use a "flow desc" requestrather than a "flow stats" request. We've modified our patch as per the above comment i.e as per OF 1.5+ the OFPMP_FLOW_DESC request is used instead of the earlier OFPMP_FLOW. >> JAN Comment - 2) I suggest to introduce a new command or add an option to >> dump-flows to force use of this particular MP message. The output would be >> limited to flow match and stats in that case. As per Jan's suggestion we've added an option to the dump-flows for the OF 1.5 which will give an output which will show only flow stats for the requested OXS fields. Like below: dump-flows switch [flows] By default, ovs-ofctl prints flow entries in the same order that the switch sends them along with the flow description flags Use --oxs-stats[=field] Which displays the output with the requested OXS field/fields (packet-count, byte-count etc.,) >> Jan Comment - 3 ) The new command to dump aggregate flow stats is of course >> a welcome addition. This requirement will also get fulfilled with the addition of --oxs-stats option to the existing dump-aggregate command. Like Below dump-aggregate switch [flows] Use --oxs-stats[=field] Prints to the console aggregate statistics for flows with the requested OXS field/fields (packet-count, byte-count etc.,) Jan and Ben we requesting you both kindly provide your valuable inputs with respect new enhancement i.e adding --oxs-stats option to the existing commands. If everything mentioned above is fine then we will share the updated patch soon. Thanks & Regards Satya Valli Tata Consultancy Services Mailto: satyavalli.r...@tcs.com Website: http://www.tcs.com Experience certainty. IT Services Business Solutions Consulting -Ben Pfaffwrote: - To: SatyaValli From: Ben Pfaff Date: 02/09/2018 11:23PM Cc: d...@openvswitch.org, Manasa Cherukupally , Surya Muttamsetty , Pavani Panthagada , Satya Valli , Lavanya Harivelam Subject: Re: [ovs-dev] [PATCH v3] OF1.5/EXT-334 OXS/Extensible Flow Entry Statistics Support On Tue, Feb 06, 2018 at 05:17:19PM +0530, SatyaValli wrote: > From: SatyaValli > > This Patch provides implementation Existing flow entry statistics are > redefined as standard OXS(OpenFlow Extensible Statistics) fields for > displaying the arbitrary flow stats.The existing Flow Stats were renamed > as Flow Description. Thanks for the updated patch. After a small amount of reading, I agree with Jan Scheurich. "ovs-ofctl dump-flows" should provide similar results for all versions of OpenFlow. In OpenFlow 1.5, that means that it should use a "flow desc" request rather than a "flow stats" request. Thanks, Ben. =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] Greetings
Good day. Kindly message me back if you are still using this email. Regards. Kathryn Meyrick. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports
Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge interface is reconfigured with the lowest MAC address among the connected DPDK ports. When changing the MAC address, OVS performs a sequences of events UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL distribution this results in loosing Linux networking configuration attached to the bridge interface (e.g. static routes). This patch changes the interface configuration scripts used in a RHEL deployment to trigger post-up operations on the bridge device after a change of MAC address. Signed-off-by: Vishal Deep AjmeraSigned-off-by: Flavio Leitner --- rhel/README.RHEL.rst| 5 + rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 2 files changed, 21 insertions(+) diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst index f3d2942..1cd2065 100644 --- a/rhel/README.RHEL.rst +++ b/rhel/README.RHEL.rst @@ -93,6 +93,11 @@ Note answers: File exists`` printed on the console. This comes from ifup-eth trying to add zeroconf route multiple times and is harmless. +* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address. + Since OVS changes the device state to DOWN before changing its mac address this + result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up + operation on the bridge again to restore configuration. + Examples diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index b95220a..1c65f13 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -167,10 +167,18 @@ case "$TYPE" in ;; OVSDPDKPort) ifup_ovs_bridge + BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE) ovs-vsctl -t ${TIMEOUT} \ -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \ -- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \ -- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA} + BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE) + # The bridge may change its MAC to be the lower one among all its + # ports. If that happens, bridge configuration (e.g. routes) will + # be lost. Restore the post-up bridge configuration again. + if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then + ${OTHERSCRIPT} "$OVS_BRIDGE" + fi ;; OVSDPDKRPort) ifup_ovs_bridge @@ -196,12 +204,20 @@ case "$TYPE" in ;; OVSDPDKBond) ifup_ovs_bridge + BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE) for _iface in $BOND_IFACES; do IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} type=dpdk" done ovs-vsctl -t ${TIMEOUT} \ -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \ -- add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${IFACE_TYPES} ${OVS_EXTRA+-- $OVS_EXTRA} + BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE) + # The bridge may change its MAC to be the lower one among all its + # ports. If that happens, bridge configuration (e.g. routes) will + # be lost. Restore the post-up bridge configuration again. + if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then + ${OTHERSCRIPT} "$OVS_BRIDGE" + fi ;; *) echo $"Invalid OVS interface type $TYPE" -- 1.9.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH branch-2.8 4/4] ovsdb: ovsdb-dot.in: Replace sys.maxint with sys.maxsize for Python3
There is no sys.maxint anymore on python3. However, sys.maxsize can be used as an integer larger than any practical list or string index. Link: https://docs.python.org/3.1/whatsnew/3.0.html#integers Signed-off-by: Markos Chandras--- ovsdb/ovsdb-dot.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in index 43c50dabd..8eea61724 100755 --- a/ovsdb/ovsdb-dot.in +++ b/ovsdb/ovsdb-dot.in @@ -15,14 +15,14 @@ def printEdge(tableName, type, baseType, label): if type.n_min == 0: if type.n_max == 1: arity = "?" -elif type.n_max == sys.maxint: +elif type.n_max == sys.maxsize: arity = "*" else: arity = "{,%d}" % type.n_max elif type.n_min == 1: if type.n_max == 1: arity = "" -elif type.n_max == sys.maxint: +elif type.n_max == sys.maxsize: arity = "+" else: arity = "{1,%d}" % type.n_max -- 2.16.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH branch-2.8 2/4] ovsdb: ovsdb-dot.in: Use print function for Python3
The python2 print statement no longer works in python3 since the latter uses a print function. As such, replace all instances of 'print' with 'print()'. This fixes the following build problem with python3 > ovsdb/ovsdb-client.1.tmp File "./ovsdb/ovsdb-dot.in", line 34 print "\t%s -> %s [%s];" % ( ^ SyntaxError: invalid syntax Signed-off-by: Markos Chandras--- ovsdb/ovsdb-dot.in | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in index f7b7ab0db..7f846836d 100755 --- a/ovsdb/ovsdb-dot.in +++ b/ovsdb/ovsdb-dot.in @@ -31,38 +31,38 @@ def printEdge(tableName, type, baseType, label): options['label'] = '"%s%s"' % (label, arity) if baseType.ref_type == 'weak': options['style'] = 'dotted' -print "\t%s -> %s [%s];" % ( +print ("\t%s -> %s [%s];" % ( tableName, baseType.ref_table_name, -', '.join(['%s=%s' % (k,v) for k,v in options.items()])) +', '.join(['%s=%s' % (k,v) for k,v in options.items()]))) def schemaToDot(schemaFile, arrows): schema = ovs.db.schema.DbSchema.from_json(ovs.json.from_file(schemaFile)) -print "digraph %s {" % schema.name -print '\trankdir=LR;' -print '\tsize="6.5,4";' -print '\tmargin="0";' -print "\tnode [shape=box];" +print ("digraph %s {" % schema.name) +print ('\trankdir=LR;') +print ('\tsize="6.5,4";') +print ('\tmargin="0";') +print ("\tnode [shape=box];") if not arrows: -print "\tedge [dir=none, arrowhead=none, arrowtail=none];" +print ("\tedge [dir=none, arrowhead=none, arrowtail=none];") for tableName, table in schema.tables.items(): options = {} if table.is_root: options['style'] = 'bold' -print "\t%s [%s];" % ( +print ("\t%s [%s];" % ( tableName, -', '.join(['%s=%s' % (k,v) for k,v in options.items()])) +', '.join(['%s=%s' % (k,v) for k,v in options.items()]))) for columnName, column in table.columns.items(): if column.type.value: printEdge(tableName, column.type, column.type.key, "%s key" % columnName) printEdge(tableName, column.type, column.type.value, "%s value" % columnName) else: printEdge(tableName, column.type, column.type.key, columnName) -print "}"; +print ("}"); def usage(): -print """\ +print ("""\ %(argv0)s: compiles ovsdb schemas to graphviz format Prints a .dot file that "dot" can render to an entity-relationship diagram usage: %(argv0)s [OPTIONS] SCHEMA @@ -72,7 +72,7 @@ The following options are also available: --no-arrows omit arrows from diagram -h, --help display this help message -V, --version display version information\ -""" % {'argv0': argv0} +""" % {'argv0': argv0}) sys.exit(0) if __name__ == "__main__": @@ -92,7 +92,7 @@ if __name__ == "__main__": elif key in ['-h', '--help']: usage() elif key in ['-V', '--version']: -print "ovsdb-dot (Open vSwitch) @VERSION@" +print ("ovsdb-dot (Open vSwitch) @VERSION@") else: sys.exit(0) -- 2.16.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH branch-2.8 3/4] ovsdb: ovsdb-dot.in: Change exception semantics for Python3
PEP-3110 changes the semantics for capturing exceptions in Python3 from 'except E,N' to 'except E as N'. This fixes the following problem when building with python3 SyntaxError: invalid syntax File "./ovsdb/ovsdb-dot.in", line 106 except ovs.db.error.Error, e: ^ SyntaxError: invalid syntax Link: https://www.python.org/dev/peps/pep-3110/ Signed-off-by: Markos Chandras--- ovsdb/ovsdb-dot.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in index 7f846836d..43c50dabd 100755 --- a/ovsdb/ovsdb-dot.in +++ b/ovsdb/ovsdb-dot.in @@ -81,7 +81,7 @@ if __name__ == "__main__": options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', ['no-arrows', 'help', 'version',]) -except getopt.GetoptError, geo: +except getopt.GetoptError as geo: sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) sys.exit(1) @@ -103,7 +103,7 @@ if __name__ == "__main__": schemaToDot(args[0], arrows) -except ovs.db.error.Error, e: +except ovs.db.error.Error as e: sys.stderr.write("%s: %s\n" % (argv0, e.msg)) sys.exit(1) -- 2.16.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH branch-2.8 1/4] ovsdb: Use items() instead of iteritems() for Python3
Python3 removed the iteritems() iterator and replaced it with items() which should also work in Python2. This fixes the following build problem on Python3: Traceback (most recent call last): File "./ovsdb/ovsdb-idlc.in", line 1436, in func(*args[1:]) File "./ovsdb/ovsdb-idlc.in", line 314, in printCIDLHeader for columnName, column in sorted(table.columns.iteritems()): AttributeError: 'dict' object has no attribute 'iteritems' Signed-off-by: Markos Chandras--- ovsdb/ovsdb-dot.in | 4 ++-- ovsdb/ovsdb-idlc.in | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in index 134ce2269..f7b7ab0db 100755 --- a/ovsdb/ovsdb-dot.in +++ b/ovsdb/ovsdb-dot.in @@ -46,14 +46,14 @@ def schemaToDot(schemaFile, arrows): print "\tnode [shape=box];" if not arrows: print "\tedge [dir=none, arrowhead=none, arrowtail=none];" -for tableName, table in schema.tables.iteritems(): +for tableName, table in schema.tables.items(): options = {} if table.is_root: options['style'] = 'bold' print "\t%s [%s];" % ( tableName, ', '.join(['%s=%s' % (k,v) for k,v in options.items()])) -for columnName, column in table.columns.iteritems(): +for columnName, column in table.columns.items(): if column.type.value: printEdge(tableName, column.type, column.type.key, "%s key" % columnName) printEdge(tableName, column.type, column.type.value, "%s value" % columnName) diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index f065ef1c6..7e1c36d1f 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -281,7 +281,7 @@ bool %(s)s_is_updated(const struct %(s)s *, enum %(s)s_column_id); # Table indexes. print("struct %(s)s * %(s)s_index_init_row(struct ovsdb_idl *, const struct ovsdb_idl_table_class *);" % {'s': structName}) print -for columnName, column in sorted(table.columns.iteritems()): +for columnName, column in sorted(table.columns.items()): print('void %(s)s_index_set_%(c)s(const struct %(s)s *,' % {'s': structName, 'c': columnName}) if column.type.is_smap(): args = ['const struct smap *'] @@ -1030,7 +1030,7 @@ void struct %(s)s * %(s)s_index_init_row(struct ovsdb_idl *idl, const struct ovsdb_idl_table_class *class) {""" % {'s': structName, 't': tableName}) -#for columnName, column in sorted(table.columns.iteritems()): +#for columnName, column in sorted(table.columns.items()): #if column.type.is_smap(): #print "smap_init(>%s);" % columnName print("return (struct %(s)s *) ovsdb_idl_index_init_row(idl, class);" % {'s': structName, 't': tableName}) @@ -1097,7 +1097,7 @@ struct %(s)s * return %(s)s_cast(ovsdb_idl_index_data(CONST_CAST(struct ovsdb_idl_index_cursor *, cursor))); }""" % { 's' : structName }) # Indexes Set functions -for columnName, column in sorted(table.columns.iteritems()): +for columnName, column in sorted(table.columns.items()): type = column.type comment, members = cMembers(prefix, tableName, columnName, -- 2.16.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH branch-2.8 0/4] ovsdb-dot python3 fixes
Hello, This patchset is a backport of the following python-3 fixes https://mail.openvswitch.org/pipermail/ovs-dev/2017-December/342460.html for branch 2.8 Markos Chandras (4): ovsdb: Use items() instead of iteritems() for Python3 ovsdb: ovsdb-dot.in: Use print function for Python3 ovsdb: ovsdb-dot.in: Change exception semantics for Python3 ovsdb: ovsdb-dot.in: Replace sys.maxint with sys.maxsize for Python3 ovsdb/ovsdb-dot.in | 40 ovsdb/ovsdb-idlc.in | 6 +++--- 2 files changed, 23 insertions(+), 23 deletions(-) -- 2.16.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev