Newer
Older
render = Render(console_width, Render.FIELD_SELECT_SCRIPT)
for line in render.format(flow_db):
- print line
+ print(line)
def main():
92009
92010
92011
92012
92013
92014
92015
92016
92017
92018
92019
92020
92021
92022
92023
92024
92025
92026
92027
92028
92029
92030
92031
92032
92033
92034
92035
92036
92037
92038
92039
92040
92041
diff --git a/utilities/ovs-l3ping.in b/utilities/ovs-l3ping.in
index 92d32acb3f..1ece06457c 100644
--- a/utilities/ovs-l3ping.in
+++ b/utilities/ovs-l3ping.in
@@ -19,7 +19,7 @@ achieved by tunneling the control connection inside the tunnel itself.
"""
import socket
-import xmlrpclib
+import xmlrpc.client
import ovstest.args as args
import ovstest.tests as tests
@@ -64,13 +64,13 @@ if __name__ == '__main__':
ps = get_packet_sizes(me, he, args.client[0])
tests.do_direct_tests(me, he, bandwidth, interval, ps)
except KeyboardInterrupt:
- print "Terminating"
- except xmlrpclib.Fault:
- print "Couldn't contact peer"
+ print("Terminating")
+ except xmlrpc.client.Fault:
+ print("Couldn't contact peer")
except socket.error:
- print "Couldn't contact peer"
- except xmlrpclib.ProtocolError:
- print "XMLRPC control channel was abruptly terminated"
+ print("Couldn't contact peer")
+ except xmlrpc.client.ProtocolError:
+ print("XMLRPC control channel was abruptly terminated")
finally:
if local_server is not None:
local_server.terminate()
92042
92043
92044
92045
92046
92047
92048
92049
92050
92051
92052
92053
92054
92055
92056
92057
92058
92059
92060
92061
92062
92063
92064
92065
92066
92067
92068
92069
92070
92071
92072
92073
92074
92075
92076
92077
92078
92079
92080
92081
92082
92083
92084
92085
92086
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 3601890f40..ede7f1e61a 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -4020,6 +4020,7 @@ ofctl_meter_mod__(const char *bridge, const char *str, int command)
enum ofputil_protocol usable_protocols;
enum ofp_version version;
+ memset(&mm, 0, sizeof mm);
if (str) {
char *error;
error = parse_ofp_meter_mod_str(&mm, str, command, &usable_protocols);
@@ -4030,7 +4031,6 @@ ofctl_meter_mod__(const char *bridge, const char *str, int command)
usable_protocols = OFPUTIL_P_OF13_UP;
mm.command = command;
mm.meter.meter_id = OFPM13_ALL;
- mm.meter.bands = NULL;
}
protocol = open_vconn_for_flow_mod(bridge, &vconn, usable_protocols);
@@ -4050,6 +4050,7 @@ ofctl_meter_request__(const char *bridge, const char *str,
enum ofputil_protocol protocol;
enum ofp_version version;
+ memset(&mm, 0, sizeof mm);
if (str) {
char *error;
error = parse_ofp_meter_mod_str(&mm, str, -1, &usable_protocols);
@@ -4059,7 +4060,6 @@ ofctl_meter_request__(const char *bridge, const char *str,
} else {
usable_protocols = OFPUTIL_P_OF13_UP;
mm.meter.meter_id = OFPM13_ALL;
- mm.meter.bands = NULL;
}
protocol = open_vconn_for_flow_mod(bridge, &vconn, usable_protocols);
@@ -5051,7 +5051,7 @@ static const struct ovs_cmdl_command all_commands[] = {
{ "add-group", "switch group",
1, 2, ofctl_add_group, OVS_RW },
{ "add-groups", "switch file",
- 1, 2, ofctl_add_groups, OVS_RW },
+ 2, 2, ofctl_add_groups, OVS_RW },
{ "mod-group", "switch group",
1, 2, ofctl_mod_group, OVS_RW },
{ "del-groups", "switch [group]",
92087
92088
92089
92090
92091
92092
92093
92094
92095
92096
92097
92098
92099
92100
92101
92102
92103
92104
92105
92106
92107
92108
92109
92110
92111
92112
92113
92114
92115
92116
92117
92118
92119
92120
92121
92122
92123
92124
92125
92126
92127
92128
92129
92130
92131
92132
92133
92134
92135
92136
92137
92138
92139
92140
92141
92142
diff --git a/utilities/ovs-parse-backtrace.in b/utilities/ovs-parse-backtrace.in
index d5506769a8..f44f05cd1e 100755
--- a/utilities/ovs-parse-backtrace.in
+++ b/utilities/ovs-parse-backtrace.in
@@ -70,7 +70,7 @@ result. Expected usage is for ovs-appctl backtrace to be piped in.""")
if os.path.exists(debug):
binary = debug
- print "Binary: %s\n" % binary
+ print("Binary: %s\n" % binary)
stdin = sys.stdin.read()
@@ -88,15 +88,15 @@ result. Expected usage is for ovs-appctl backtrace to be piped in.""")
for lines, count in traces:
longest = max(len(l) for l in lines)
- print "Backtrace Count: %d" % count
+ print("Backtrace Count: %d" % count)
for line in lines:
match = re.search(r'\[(0x.*)]', line)
if match:
- print "%s %s" % (line.ljust(longest),
- addr2line(binary, match.group(1)))
+ print("%s %s" % (line.ljust(longest),
+ addr2line(binary, match.group(1))))
else:
- print line
- print
+ print(line)
+ print()
if __name__ == "__main__":
diff --git a/utilities/ovs-pcap.in b/utilities/ovs-pcap.in
index dddbee4dfb..6b5f63399e 100755
--- a/utilities/ovs-pcap.in
+++ b/utilities/ovs-pcap.in
@@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from __future__ import print_function
-
import binascii
import getopt
import struct
@@ -79,7 +77,7 @@ if __name__ == "__main__":
try:
options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
['help', 'version'])
- except getopt.GetoptException as geo:
+ except getopt.GetoptError as geo:
sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
sys.exit(1)
diff --git a/utilities/ovs-pipegen.py b/utilities/ovs-pipegen.py
index ee5797221c..a3b6a661de 100755
--- a/utilities/ovs-pipegen.py
+++ b/utilities/ovs-pipegen.py
@@ -1,5 +1,5 @@
-#! /usr/bin/env python
-# Copyright (c) 2013, 2014, 2015 Nicira, Inc.
+#! /usr/bin/env python3
+# Copyright (c) 2013, 2014, 2015, 2020 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
92155
92156
92157
92158
92159
92160
92161
92162
92163
92164
92165
92166
92167
92168
92169
92170
92171
92172
92173
92174
92175
92176
92177
92178
92179
92180
92181
92182
92183
92184
92185
92186
92187
92188
92189
92190
92191
92192
92193
92194
92195
92196
92197
92198
92199
92200
92201
92202
92203
92204
92205
92206
92207
92208
92209
92210
92211
92212
92213
92214
92215
92216
92217
92218
92219
92220
92221
92222
92223
92224
92225
92226
92227
92228
92229
92230
92231
92232
92233
92234
92235
92236
92237
92238
92239
92240
92241
92242
92243
92244
92245
92246
92247
92248
92249
92250
92251
92252
92253
92254
92255
92256
92257
92258
92259
92260
92261
92262
92263
92264
92265
92266
92267
92268
92269
92270
diff --git a/utilities/ovs-vlan-test.in b/utilities/ovs-vlan-test.in
index 154573a9b5..de3ae16862 100755
--- a/utilities/ovs-vlan-test.in
+++ b/utilities/ovs-vlan-test.in
@@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import BaseHTTPServer
import getopt
-import httplib
+import http.client
+import http.server
import os
import threading
import time
@@ -84,7 +84,7 @@ class UDPReceiver:
try:
sock.bind((self.vlan_ip, self.vlan_port))
- except socket.error, e:
+ except socket.error as e:
print_safe('Failed to bind to %s:%d with error: %s'
% (self.vlan_ip, self.vlan_port, e))
os._exit(1) #sys.exit only exits the current thread.
@@ -95,7 +95,7 @@ class UDPReceiver:
data, _ = sock.recvfrom(4096)
except socket.timeout:
continue
- except socket.error, e:
+ except socket.error as e:
print_safe('Failed to receive from %s:%d with error: %s'
% (self.vlan_ip, self.vlan_port, e))
os._exit(1)
@@ -180,7 +180,7 @@ class VlanServer:
for _ in range(send_time * 2):
try:
send_packet(test_id, size, ip, port)
- except socket.error, e:
+ except socket.error as e:
self.set_result(test_id, 'Failure: ' + str(e))
return
time.sleep(.5)
@@ -194,15 +194,15 @@ class VlanServer:
def run(self):
self.udp_recv.start()
try:
- BaseHTTPServer.HTTPServer((self.server_ip, self.server_port),
+ http.server.HTTPServer((self.server_ip, self.server_port),
VlanServerHandler).serve_forever()
- except socket.error, e:
+ except socket.error as e:
print_safe('Failed to start control server: %s' % e)
self.udp_recv.stop()
return 1
-class VlanServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+class VlanServerHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
#Guarantee three arguments.
@@ -244,7 +244,7 @@ class VlanClient:
self.udp_recv = UDPReceiver(vlan_ip, vlan_port)
def request(self, resource):
- conn = httplib.HTTPConnection(self.server_ip_port)
+ conn = http.client.HTTPConnection(self.server_ip_port)
conn.request('GET', resource)
return conn
@@ -256,7 +256,7 @@ class VlanClient:
try:
conn = self.request('/start/recv')
data = conn.getresponse().read()
- except (socket.error, httplib.HTTPException), e:
+ except (socket.error, http.client.HTTPException) as e:
error_msg(e)
return False
@@ -277,7 +277,7 @@ class VlanClient:
send_packet(test_id, size, ip, port)
resp = self.request('/result/%d' % test_id).getresponse()
data = resp.read()
- except (socket.error, httplib.HTTPException), e:
+ except (socket.error, http.client.HTTPException) as e:
error_msg(e)
return False
@@ -302,7 +302,7 @@ class VlanClient:
try:
conn = self.request(resource)
test_id = conn.getresponse().read()
- except (socket.error, httplib.HTTPException), e:
+ except (socket.error, http.client.HTTPException) as e:
error_msg(e)
return False
@@ -335,7 +335,7 @@ class VlanClient:
try:
resp = self.request('/ping').getresponse()
data = resp.read()
- except (socket.error, httplib.HTTPException), e:
+ except (socket.error, http.client.HTTPException) as e:
error_msg(e)
return False
@@ -383,7 +383,7 @@ def main():
try:
options, args = getopt.gnu_getopt(sys.argv[1:], 'hVs',
['help', 'version', 'server'])
- except getopt.GetoptError, geo:
+ except getopt.GetoptError as geo:
print_safe('%s: %s\n' % (sys.argv[0], geo.msg))
return 1
92271
92272
92273
92274
92275
92276
92277
92278
92279
92280
92281
92282
92283
92284
92285
92286
92287
92288
92289
92290
92291
92292
92293
92294
92295
92296
92297
92298
92299
92300
92301
92302
92303
92304
92305
92306
92307
92308
92309
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index bd3972636e..37cc72d401 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -1344,9 +1344,13 @@ cmd_list_zone_tp(struct ctl_context *ctx)
struct ovsrec_ct_timeout_policy *tp = zone->timeout_policy;
- for (int j = 0; j < tp->n_timeouts; j++) {
- ds_put_format(&ctx->output, "%s=%"PRIu64" ",
- tp->key_timeouts[j], tp->value_timeouts[j]);
+ if (tp) {
+ for (int j = 0; j < tp->n_timeouts; j++) {
+ ds_put_format(&ctx->output, "%s=%"PRIu64" ",
+ tp->key_timeouts[j], tp->value_timeouts[j]);
+ }
+ } else {
+ ds_put_cstr(&ctx->output, "system default");
}
ds_chomp(&ctx->output, ' ');
ds_put_char(&ctx->output, '\n');
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index e591c26a6c..ce348b9d16 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -634,8 +634,10 @@ static void
get_timeout_policy_from_ovsrec(struct simap *tp,
const struct ovsrec_ct_timeout_policy *tp_cfg)
{
- for (size_t i = 0; i < tp_cfg->n_timeouts; i++) {
- simap_put(tp, tp_cfg->key_timeouts[i], tp_cfg->value_timeouts[i]);
+ if (tp_cfg) {
+ for (size_t i = 0; i < tp_cfg->n_timeouts; i++) {
+ simap_put(tp, tp_cfg->key_timeouts[i], tp_cfg->value_timeouts[i]);
+ }
}
}
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
92311
92312
92313
92314
92315
92316
92317
92318
92319
92320
92321
92322
92323
92324
92325
92326
92327
92328
92329
92330
92331
92332
92333
92334
92335
92336
92337
92338
92339
92340
92341
92342
92343
92344
92345
92346
92347
92348
92349
92350
92351
92352
92353
92354
92355
92356
92357
92358
92359
92360
92361
92362
92363
92364
92365
92366
92367
92368
92369
92370
92371
92372
92373
92374
92375
92376
92377
92378
92379
92380
92381
92382
92383
92384
92385
92386
92387
92388
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -653,8 +653,9 @@
type='{"type": "boolean"}'>
<p>
Configures PMD Auto Load Balancing that allows automatic assignment of
- RX queues to PMDs if any of PMDs is overloaded (i.e. processing cycles
- > 95%).
+ RX queues to PMDs if any of PMDs is overloaded (i.e. a processing
+ cycles >
+ <ref column="other_config" key="pmd-auto-lb-load-threshold"/>).
</p>
<p>
It uses current scheme of cycle based assignment of RX queues that
@@ -690,6 +691,32 @@
once in few hours or a day or a week.
</p>
</column>
+ <column name="other_config" key="pmd-auto-lb-load-threshold"
+ type='{"type": "integer", "minInteger": 0, "maxInteger": 100}'>
+ <p>
+ Specifies the minimum PMD thread load threshold (% of used cycles) of
+ any non-isolated PMD threads when a PMD Auto Load Balance may be
+ triggered.
+ </p>
+ <p>
+ The default value is <code>95%</code>.
+ </p>
+ </column>
+ <column name="other_config" key="pmd-auto-lb-improvement-threshold"
+ type='{"type": "integer", "minInteger": 0, "maxInteger": 100}'>
+ <p>
+ Specifies the minimum evaluated % improvement in load distribution
+ across the non-isolated PMD threads that will allow a PMD Auto Load
+ Balance to occur.
+ </p>
+ <p>
+ Note, setting this parameter to 0 will always allow an auto load
+ balance to occur regardless of estimated improvement or not.
+ </p>
+ <p>
+ The default value is <code>25%</code>.
+ </p>
+ </column>
<column name="other_config" key="userspace-tso-enable"
type='{"type": "boolean"}'>
<p>
@@ -2971,8 +2998,8 @@
<group title="Tunnel Options: IPsec">
<p>
Setting any of these options enables IPsec support for a given
- tunnel. <code>gre</code>, <code>ip6gre</code>,
- <code>geneve</code>, <code>vxlan</code> and <code>stt</code>
+ tunnel. <code>gre</code>, <code>geneve</code>,
+ <code>vxlan</code> and <code>stt</code>
interfaces support these options. See the <code>IPsec</code>
section in the <ref table="Open_vSwitch"/> table for a description
of each mode.
@@ -4530,7 +4557,8 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
packets per second the CIR would be set to to to 46000000. This value
can be broken into '1,000,000 x 46'. Where 1,000,000 is the policing
rate for the number of packets per second and 46 represents the size
- of the packet data for a 64 byte ip packet.
+ of the packet data for a 64 bytes IP packet without 14 bytes Ethernet
+ and 4 bytes FCS header.
</column>
<column name="other_config" key="cbs" type='{"type": "integer"}'>
The Committed Burst Size (CBS) is measured in bytes and represents a
@@ -4551,7 +4579,8 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
packets per second the EIR would be set to to to 46000000. This value
can be broken into '1,000,000 x 46'. Where 1,000,000 is the policing
rate for the number of packets per second and 46 represents the size
- of the packet data for a 64 byte ip packet.
+ of the packet data for a 64 bytes IP packet without 14 bytes Ethernet
+ and 4 bytes FCS header.
</column>
<column name="other_config" key="ebs" type='{"type": "integer"}'>
The Excess Burst Size (EBS) is measured in bytes and represents a
@@ -5976,6 +6005,15 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
True if the datapath supports OVS_ACTION_ATTR_DROP. If false,
explicit drop action will not be sent to the datapath.
</column>
+ <column name="capabilities" key="ct_zero_snat"
+ type='{"type": "boolean"}'>
+ True if the datapath supports all-zero SNAT. This is a special case
+ if the <code>src</code> IP address is configured as all 0's, i.e.,
+ <code>nat(src=0.0.0.0)</code>. In this case, when a source port
+ collision is detected during the commit, the source port will be
+ translated to an ephemeral port. If there is no collision, no SNAT
+ is performed.
+ </column>
</group>
<group title="Common Columns">
92405
92406
92407
92408
92409
92410
92411
92412
92413
92414
92415
92416
92417
92418
92419
92420
92421
92422
92423
92424
92425
92426
92427
92428
92429
92430
92431
92432
92433
92434
92435
92436
92437
92438
92439
92440
92441
92442
92443
diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
index e7404e3b00..b8db881949 100755
--- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
+++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
@@ -1,10 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# xapi plugin script to update the cache of configuration items in the
# ovs-vswitchd configuration that are managed in the xapi database when
# integrated with Citrix management tools.
-# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2020 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure
index a82043fb5b..9c20725de2 100755
--- a/xenserver/opt_xensource_libexec_interface-reconfigure
+++ b/xenserver/opt_xensource_libexec_interface-reconfigure
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (c) 2008,2009 Citrix Systems, Inc.
#
diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
index cf89600253..bff85464ba 100755
--- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
+++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
@@ -1,5 +1,5 @@
-#! /usr/bin/env python
-# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+#!/usr/bin/env python3
+# Copyright (c) 2009, 2010, 2011, 2012, 2013, 2020 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.