diff --git a/SOURCES/openvswitch-2.13.0.patch b/SOURCES/openvswitch-2.13.0.patch index cc1e17b..77745db 100644 --- a/SOURCES/openvswitch-2.13.0.patch +++ b/SOURCES/openvswitch-2.13.0.patch @@ -80624,7 +80624,7 @@ index 68c33a0f96..9b251f81fa 100644 * 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/lib/dpif-netdev.c b/lib/dpif-netdev.c -index d393aab5e3..5233908f29 100644 +index d393aab5e3..df3c2c9c3e 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -83,9 +83,9 @@ @@ -81042,7 +81042,7 @@ index d393aab5e3..5233908f29 100644 + uint64_t max_bucket_size; + band = &meter->bands[m]; -+ max_bucket_size = (band->rate + band->burst_size) * 1000ULL; ++ max_bucket_size = band->burst_size * 1000ULL; /* Update band's bucket. */ - band->bucket += delta_t * band->up.rate; - if (band->bucket > band->up.burst_size) { @@ -81075,7 +81075,7 @@ index d393aab5e3..5233908f29 100644 exceeded_band[i] = m; } } -@@ -5913,16 +6080,15 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, +@@ -5913,16 +6080,14 @@ dpif_netdev_meter_set(struct dpif *dpif, ofproto_meter_id meter_id, config->bands[i].burst_size = config->bands[i].rate; } @@ -81088,8 +81088,7 @@ index d393aab5e3..5233908f29 100644 + meter->bands[i].rate = config->bands[i].rate; + meter->bands[i].burst_size = config->bands[i].burst_size; + /* Start with a full bucket. */ -+ meter->bands[i].bucket = -+ (meter->bands[i].burst_size + meter->bands[i].rate) * 1000ULL; ++ meter->bands[i].bucket = meter->bands[i].burst_size * 1000ULL; /* Figure out max delta_t that is enough to fill any bucket. */ band_max_delta_t @@ -81098,7 +81097,7 @@ index d393aab5e3..5233908f29 100644 if (band_max_delta_t > meter->max_delta_t) { meter->max_delta_t = band_max_delta_t; } -@@ -8040,6 +8206,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, +@@ -8040,6 +8205,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, if (pmd->ctx.now > pmd->rxq_next_cycle_store) { uint64_t curr_tsc; @@ -81106,7 +81105,7 @@ index d393aab5e3..5233908f29 100644 struct pmd_auto_lb *pmd_alb = &pmd->dp->pmd_alb; if (pmd_alb->is_enabled && !pmd->isolated && (pmd->perf_stats.counters.n[PMD_CYCLES_ITER_IDLE] >= -@@ -8056,7 +8223,9 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, +@@ -8056,7 +8222,9 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd, pmd_load = ((tot_proc * 100) / (tot_idle + tot_proc)); } @@ -82965,10 +82964,87 @@ index 4ecce1aac5..936fadf175 100644 struct ofpbuf *odp_actions, const char *tnl_type); diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c -index ddef3b0c87..6a6fdb3e5f 100644 +index ddef3b0c87..7d729a0e2d 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c -@@ -4346,6 +4346,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae, +@@ -3773,11 +3773,22 @@ parse_SET_MPLS_LABEL(char *arg, const struct ofpact_parse_params *pp) + { + struct ofpact_mpls_label *mpls_label + = ofpact_put_SET_MPLS_LABEL(pp->ofpacts); ++ uint32_t label; ++ char *error; ++ + if (*arg == '\0') { + return xstrdup("set_mpls_label: expected label."); + } + +- mpls_label->label = htonl(atoi(arg)); ++ error = str_to_u32(arg, &label); ++ if (error) { ++ return error; ++ } ++ ++ if (label & ~0xfffff) { ++ return xasprintf("%s: not a valid MPLS label", arg); ++ } ++ mpls_label->label = htonl(label); + return NULL; + } + +@@ -3833,12 +3844,22 @@ static char * OVS_WARN_UNUSED_RESULT + parse_SET_MPLS_TC(char *arg, const struct ofpact_parse_params *pp) + { + struct ofpact_mpls_tc *mpls_tc = ofpact_put_SET_MPLS_TC(pp->ofpacts); ++ uint8_t tc; ++ char *error; + + if (*arg == '\0') { + return xstrdup("set_mpls_tc: expected tc."); + } + +- mpls_tc->tc = atoi(arg); ++ error = str_to_u8(arg, "MPLS TC", &tc); ++ if (error) { ++ return error; ++ } ++ ++ if (tc & ~7) { ++ return xasprintf("%s: not a valid MPLS TC", arg); ++ } ++ mpls_tc->tc = tc; + return NULL; + } + +@@ -3846,7 +3867,7 @@ static void + format_SET_MPLS_TC(const struct ofpact_mpls_tc *a, + const struct ofpact_format_params *fp) + { +- ds_put_format(fp->s, "%sset_mpls_ttl(%s%"PRIu8"%s)%s", ++ ds_put_format(fp->s, "%sset_mpls_tc(%s%"PRIu8"%s)%s", + colors.paren, colors.end, a->tc, + colors.paren, colors.end); + } +@@ -3885,12 +3906,18 @@ static char * OVS_WARN_UNUSED_RESULT + parse_SET_MPLS_TTL(char *arg, const struct ofpact_parse_params *pp) + { + struct ofpact_mpls_ttl *mpls_ttl = ofpact_put_SET_MPLS_TTL(pp->ofpacts); ++ uint8_t ttl; ++ char *error; + + if (*arg == '\0') { + return xstrdup("set_mpls_ttl: expected ttl."); + } + +- mpls_ttl->ttl = atoi(arg); ++ error = str_to_u8(arg, "MPLS TTL", &ttl); ++ if (error) { ++ return error; ++ } ++ mpls_ttl->ttl = ttl; + return NULL; + } + +@@ -4346,6 +4373,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae, { struct ofpact_encap *encap; const struct ofp_ed_prop_header *ofp_prop; @@ -82976,7 +83052,7 @@ index ddef3b0c87..6a6fdb3e5f 100644 size_t props_len; uint16_t n_props = 0; int err; -@@ -4373,6 +4374,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae, +@@ -4373,6 +4401,7 @@ decode_NXAST_RAW_ENCAP(const struct nx_action_encap *nae, } n_props++; } @@ -82984,7 +83060,7 @@ index ddef3b0c87..6a6fdb3e5f 100644 encap->n_props = n_props; out->header = &encap->ofpact; ofpact_finish_ENCAP(out, &encap); -@@ -6657,6 +6659,7 @@ parse_CT(char *arg, const struct ofpact_parse_params *pp) +@@ -6657,6 +6686,7 @@ parse_CT(char *arg, const struct ofpact_parse_params *pp) } if (ofpbuf_oversized(pp->ofpacts)) { @@ -83114,7 +83190,7 @@ index 30d1d08eba..00497d940c 100644 struct ovsdb_idl_class { diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c -index 190143f363..2fc8a91e37 100644 +index 190143f363..325050f21e 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -219,9 +219,12 @@ struct ovsdb_idl_db { @@ -83333,7 +83409,7 @@ index 190143f363..2fc8a91e37 100644 } static unsigned int -@@ -1513,17 +1573,31 @@ ovsdb_idl_db_set_condition(struct ovsdb_idl_db *db, +@@ -1513,17 +1573,49 @@ ovsdb_idl_db_set_condition(struct ovsdb_idl_db *db, const struct ovsdb_idl_table_class *tc, const struct ovsdb_idl_condition *condition) { @@ -83344,7 +83420,6 @@ index 190143f363..2fc8a91e37 100644 - ovsdb_idl_condition_destroy(&table->condition); - ovsdb_idl_condition_clone(&table->condition, condition); - db->cond_changed = table->cond_changed = true; -+ unsigned int curr_seqno = db->cond_seqno; + + /* Compare the new condition to the last known condition which can be + * either "new" (not sent yet), "requested" or "acked", in this order. @@ -83367,12 +83442,31 @@ index 190143f363..2fc8a91e37 100644 - return seqno; + /* Conditions will be up to date when we receive replies for already -+ * requested and new conditions, if any. */ -+ return curr_seqno + (table->new_cond ? 1 : 0) + (table->req_cond ? 1 : 0); ++ * requested and new conditions, if any. This includes condition change ++ * requests for other tables too. ++ */ ++ if (table->new_cond) { ++ /* New condition will be sent out after all already requested ones ++ * are acked. ++ */ ++ bool any_req_cond = false; ++ for (size_t i = 0; i < db->class_->n_tables; i++) { ++ if (db->tables[i].req_cond) { ++ any_req_cond = true; ++ break; ++ } ++ } ++ return db->cond_seqno + any_req_cond + 1; ++ } else { ++ /* Already requested conditions should be up to date at ++ * db->cond_seqno + 1 while acked conditions are already up to date. ++ */ ++ return db->cond_seqno + !!table->req_cond; ++ } } /* Sets the replication condition for 'tc' in 'idl' to 'condition' and -@@ -1563,9 +1637,8 @@ ovsdb_idl_condition_to_json(const struct ovsdb_idl_condition *cnd) +@@ -1563,9 +1655,8 @@ ovsdb_idl_condition_to_json(const struct ovsdb_idl_condition *cnd) } static struct json * @@ -83383,7 +83477,7 @@ index 190143f363..2fc8a91e37 100644 struct json *monitor_cond_change_request = json_object_create(); struct json *cond_json = ovsdb_idl_condition_to_json(cond); -@@ -1585,8 +1658,12 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1585,8 +1676,12 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) for (size_t i = 0; i < db->class_->n_tables; i++) { struct ovsdb_idl_table *table = &db->tables[i]; @@ -83398,7 +83492,7 @@ index 190143f363..2fc8a91e37 100644 if (req) { if (!monitor_cond_change_requests) { monitor_cond_change_requests = json_object_create(); -@@ -1595,7 +1672,11 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1595,7 +1690,11 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) table->class_->name, json_array_create_1(req)); } @@ -83411,7 +83505,7 @@ index 190143f363..2fc8a91e37 100644 } } -@@ -1610,6 +1691,73 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1610,6 +1709,73 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) return jsonrpc_create_request("monitor_cond_change", params, NULL); } @@ -83485,7 +83579,7 @@ index 190143f363..2fc8a91e37 100644 static void ovsdb_idl_send_cond_change(struct ovsdb_idl *idl) { -@@ -1739,7 +1887,7 @@ ovsdb_idl_track_add_all(struct ovsdb_idl *idl) +@@ -1739,7 +1905,7 @@ ovsdb_idl_track_add_all(struct ovsdb_idl *idl) } /* Returns true if 'table' has any tracked column. */ @@ -83494,7 +83588,7 @@ index 190143f363..2fc8a91e37 100644 ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) { size_t i; -@@ -1753,29 +1901,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) +@@ -1753,29 +1919,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) } /* Returns the first tracked row in table with class 'table_class' @@ -83539,7 +83633,7 @@ index 190143f363..2fc8a91e37 100644 return NULL; } -@@ -1808,7 +1964,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, +@@ -1808,7 +1982,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, * loop when it is ready to do ovsdb_idl_run() again. */ static void @@ -83548,7 +83642,7 @@ index 190143f363..2fc8a91e37 100644 { size_t i; -@@ -1823,19 +1979,34 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1823,19 +1997,34 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) free(row->updated); row->updated = NULL; } @@ -83594,7 +83688,7 @@ index 190143f363..2fc8a91e37 100644 } } } -@@ -1850,7 +2021,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1850,7 +2039,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) void ovsdb_idl_track_clear(struct ovsdb_idl *idl) { @@ -83603,7 +83697,7 @@ index 190143f363..2fc8a91e37 100644 } static void -@@ -2064,13 +2235,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2064,13 +2253,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, monitor_request = json_object_create(); json_object_put(monitor_request, "columns", columns); @@ -83622,7 +83716,7 @@ index 190143f363..2fc8a91e37 100644 } json_object_put(monitor_requests, tc->name, json_array_create_1(monitor_request)); -@@ -2078,8 +2251,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2078,8 +2269,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, } free_schema(schema); @@ -83631,7 +83725,7 @@ index 190143f363..2fc8a91e37 100644 struct json *params = json_array_create_3( json_string_create(db->class_->database), json_clone(db->monitor_id), -@@ -2379,6 +2550,33 @@ ovsdb_idl_db_parse_update(struct ovsdb_idl_db *db, +@@ -2379,6 +2568,33 @@ ovsdb_idl_db_parse_update(struct ovsdb_idl_db *db, } } @@ -83665,7 +83759,7 @@ index 190143f363..2fc8a91e37 100644 static struct ovsdb_idl_row * ovsdb_idl_get_row(struct ovsdb_idl_table *table, const struct uuid *uuid) { -@@ -2418,6 +2616,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, +@@ -2418,6 +2634,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, if (!row) { ovsdb_idl_insert_row(ovsdb_idl_row_create(table, uuid), new); } else if (ovsdb_idl_row_is_orphan(row)) { @@ -83673,7 +83767,7 @@ index 190143f363..2fc8a91e37 100644 ovsdb_idl_insert_row(row, new); } else { VLOG_WARN_RL(&semantic_rl, "cannot add existing row "UUID_FMT" to " -@@ -2504,22 +2703,20 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, +@@ -2504,22 +2721,20 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, return true; } @@ -83694,19 +83788,19 @@ index 190143f363..2fc8a91e37 100644 + const struct ovsdb_idl_arc *arc; + LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { + struct ovsdb_idl_row *ref = arc->src; ++ ++ if (ovs_list_is_empty(&ref->track_node) && ++ ovsdb_idl_track_is_set(ref->table)) { - const struct ovsdb_idl_arc *arc; - LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { - add_tracked_change_for_references(arc->src); -+ if (ovs_list_is_empty(&ref->track_node) && -+ ovsdb_idl_track_is_set(ref->table)) { -+ + ovsdb_idl_row_track_change(ref, OVSDB_IDL_CHANGE_MODIFY); + add_tracked_change_for_references(ref); } } } -@@ -2587,7 +2784,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, +@@ -2587,7 +2802,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, row->change_seqno[change] = row->table->change_seqno[change] = row->table->db->change_seqno + 1; @@ -83721,7 +83815,7 @@ index 190143f363..2fc8a91e37 100644 add_tracked_change_for_references(row); if (!row->updated) { row->updated = bitmap_allocate(class->n_columns); -@@ -3021,7 +3225,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) +@@ -3021,7 +3243,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) { ovs_assert(row->old_datum == row->new_datum); if (!ovsdb_idl_row_is_orphan(row)) { @@ -83730,7 +83824,7 @@ index 190143f363..2fc8a91e37 100644 row->tracked_old_datum = row->old_datum; } else { const struct ovsdb_idl_table_class *class = row->table->class_; -@@ -3104,6 +3308,32 @@ ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row) +@@ -3104,6 +3326,32 @@ ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row) } } @@ -83763,7 +83857,7 @@ index 190143f363..2fc8a91e37 100644 static struct ovsdb_idl_row * ovsdb_idl_row_create__(const struct ovsdb_idl_table_class *class) { -@@ -3130,22 +3360,26 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid) +@@ -3130,22 +3378,26 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid) return row; } @@ -83800,7 +83894,7 @@ index 190143f363..2fc8a91e37 100644 } } -@@ -3237,12 +3471,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row) +@@ -3237,12 +3489,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row) { ovsdb_idl_remove_from_indexes(row); ovsdb_idl_row_clear_arcs(row, true); @@ -83814,7 +83908,7 @@ index 190143f363..2fc8a91e37 100644 } /* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false -@@ -4663,6 +4892,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, +@@ -4663,6 +4910,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, hmap_insert(&row->table->rows, &row->hmap_node, uuid_hash(&row->uuid)); hmap_insert(&txn->txn_rows, &row->txn_node, uuid_hash(&row->uuid)); ovsdb_idl_add_to_indexes(row); @@ -86058,10 +86152,10 @@ index a7982de381..39d9aa391e 100644 ]) AT_CLEANUP diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at -index 0aeb4e788f..062f0228b4 100644 +index 0aeb4e788f..1ec0054c5b 100644 --- a/tests/dpif-netdev.at +++ b/tests/dpif-netdev.at -@@ -293,59 +293,61 @@ type=drop rate=1 burst_size=2 +@@ -293,60 +293,87 @@ type=drop rate=1 burst_size=2 ]) ovs-appctl time/warp 5000 @@ -86091,25 +86185,37 @@ index 0aeb4e788f..062f0228b4 100644 # Meter 1 is measuring packets, allowing one packet per second with -# bursts of one packet, so 4 out of 5 packets should hit the drop -+# bursts of one packet, so 3 out of 5 packets should hit the drop - # band. --# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets +-# band. ++# bursts of one packet, so 4 out of 5 packets should hit the drop band. + # Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). 4 packets -# (240 bytes == 1920 bits) pass, but the last packet should hit the drop band. -+# Meter 2 is measuring kbps, with burst size 2 (== 3000 bits). 6 packets -+# (360 bytes == 2880 bits) pass, but the last packet should hit the drop band. ++# (240 bytes == 1920 bits) pass, but the last three packets should hit the ++# drop band. There should be 80 bits remaining for the next packets. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: --0: packet_count:4 byte_count:240 -+0: packet_count:3 byte_count:180 + 0: packet_count:4 byte_count:240 -meter:2 flow_count:1 packet_in_count:5 byte_in_count:300 duration:0.0s bands: +-0: packet_count:1 byte_count:60 +meter:2 flow_count:1 packet_in_count:7 byte_in_count:420 duration:0.0s bands: - 0: packet_count:1 byte_count:60 ++0: packet_count:3 byte_count:180 ]) - # Advance time by 1/2 second - ovs-appctl time/warp 500 +-# Advance time by 1/2 second +-ovs-appctl time/warp 500 ++# Advance time by 870 ms ++ovs-appctl time/warp 870 ++ ++for i in `seq 1 5`; do ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p7 \ ++ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++ ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p8 \ ++ 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++done -AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) @@ -86121,16 +86227,6 @@ index 0aeb4e788f..062f0228b4 100644 -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+for i in `seq 1 5`; do -+ AT_CHECK( -+ [ovs-appctl netdev-dummy/receive p7 \ -+ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+ -+ AT_CHECK( -+ [ovs-appctl netdev-dummy/receive p8 \ -+ 'in_port(8),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) -+done -+ sleep 1 # wait for forwarders process packets # Meter 1 is measuring packets, allowing one packet per second with @@ -86138,30 +86234,57 @@ index 0aeb4e788f..062f0228b4 100644 # band. -# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 500ms -# there should be space for 80 + 500 bits, so one new 60 byte (480 bit) packet -+# Meter 2 is measuring kbps, with burst size 2 (== 3000 bits). After 500ms -+# there should be space for 120 + 500 bits, so one new 60 byte (480 bit) packet - # should pass, remaining 4 should hit the drop band. +-# should pass, remaining 4 should hit the drop band. ++# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 870ms ++# there should be space for 80 + 870 = 950 bits, so one new 60 byte (480 bit) ++# packet should pass, remaining 4 should hit the drop band. There should be ++# 470 bits left. AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl OFPST_METER reply (OF1.3) (xid=0x2): meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: --0: packet_count:9 byte_count:540 -+0: packet_count:8 byte_count:480 + 0: packet_count:9 byte_count:540 -meter:2 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: +-0: packet_count:5 byte_count:300 +meter:2 flow_count:1 packet_in_count:12 byte_in_count:720 duration:0.0s bands: - 0: packet_count:5 byte_count:300 ++0: packet_count:7 byte_count:420 ++]) ++ ++# Advance time by 10 ms ++ovs-appctl time/warp 10 ++ ++for i in `seq 1 5`; do ++ AT_CHECK( ++ [ovs-appctl netdev-dummy/receive p7 \ ++ 'in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)' --len 60]) ++done ++ ++sleep 1 # wait for forwarders process packets ++ ++# Meter 1 should remain the same as we didn't send anything that should hit it. ++# Meter 2 is measuring kbps, with burst size 2 (== 2000 bits). After 10ms ++# there should be space for 470 + 10 = 480 bits, so one new 60 byte (480 bit) ++# packet should pass, remaining 4 should hit the drop band. ++AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl ++OFPST_METER reply (OF1.3) (xid=0x2): ++meter:1 flow_count:1 packet_in_count:10 byte_in_count:600 duration:0.0s bands: ++0: packet_count:9 byte_count:540 ++ ++meter:2 flow_count:1 packet_in_count:17 byte_in_count:1020 duration:0.0s bands: ++0: packet_count:11 byte_count:660 ]) -@@ -354,7 +356,7 @@ ovs-appctl time/warp 5000 + ovs-appctl time/warp 5000 +@@ -354,7 +381,7 @@ ovs-appctl time/warp 5000 AT_CHECK([ ovs-appctl coverage/read-counter datapath_drop_meter ], [0], [dnl -14 -+13 ++20 ]) AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout_keep_actions], [0], [dnl -@@ -364,6 +366,8 @@ recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a +@@ -364,6 +391,8 @@ recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a recirc_id(0),in_port(8),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:2 ]) @@ -86170,7 +86293,7 @@ index 0aeb4e788f..062f0228b4 100644 OVS_VSWITCHD_STOP AT_CLEANUP -@@ -371,7 +375,7 @@ m4_define([DPIF_NETDEV_FLOW_HW_OFFLOAD], +@@ -371,7 +400,7 @@ m4_define([DPIF_NETDEV_FLOW_HW_OFFLOAD], [AT_SETUP([dpif-netdev - partial hw offload - $1]) OVS_VSWITCHD_START( [add-port br0 p1 -- \ @@ -86179,7 +86302,7 @@ index 0aeb4e788f..062f0228b4 100644 set bridge br0 datapath-type=dummy \ other-config:datapath-id=1234 fail-mode=secure], [], [], [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])]) -@@ -393,7 +397,7 @@ skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc +@@ -393,7 +422,7 @@ skb_priority(0),skb_mark(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),recirc # Check that flow successfully offloaded. OVS_WAIT_UNTIL([grep "succeed to add netdev flow" ovs-vswitchd.log]) AT_CHECK([filter_hw_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl @@ -86188,7 +86311,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) # Check that datapath flow installed successfully. AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl -@@ -404,7 +408,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a +@@ -404,7 +433,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), a # Check for succesfull packet matching with installed offloaded flow. AT_CHECK([filter_hw_packet_netdev_dummy < ovs-vswitchd.log | strip_xout], [0], [dnl @@ -86197,7 +86320,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) ovs-appctl revalidator/wait -@@ -421,7 +425,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), p +@@ -421,7 +450,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), p # Check that flow successfully deleted from HW. OVS_WAIT_UNTIL([grep "succeed to delete netdev flow" ovs-vswitchd.log]) AT_CHECK([filter_hw_flow_del < ovs-vswitchd.log | strip_xout], [0], [dnl @@ -86206,7 +86329,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) OVS_VSWITCHD_STOP AT_CLEANUP]) -@@ -434,7 +438,7 @@ m4_define([DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS], +@@ -434,7 +463,7 @@ m4_define([DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS], [AT_SETUP([dpif-netdev - partial hw offload with packet modifications - $1]) OVS_VSWITCHD_START( [add-port br0 p1 -- \ @@ -86215,7 +86338,7 @@ index 0aeb4e788f..062f0228b4 100644 set bridge br0 datapath-type=dummy \ other-config:datapath-id=1234 fail-mode=secure], [], [], [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])]) -@@ -460,7 +464,7 @@ packet_type(ns=0,id=0),eth(src=00:06:07:08:09:0a,dst=00:01:02:03:04:05),eth_type +@@ -460,7 +489,7 @@ packet_type(ns=0,id=0),eth(src=00:06:07:08:09:0a,dst=00:01:02:03:04:05),eth_type # Check that flow successfully offloaded. OVS_WAIT_UNTIL([grep "succeed to add netdev flow" ovs-vswitchd.log]) AT_CHECK([filter_hw_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl @@ -86224,7 +86347,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) # Check that datapath flow installed successfully. AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl -@@ -472,7 +476,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp= +@@ -472,7 +501,7 @@ recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp= # Check for succesfull packet matching with installed offloaded flow. AT_CHECK([filter_hw_packet_netdev_dummy < ovs-vswitchd.log | strip_xout], [0], [dnl p1: packet: udp,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09:0a,dl_dst=00:01:02:03:04:05,nw_src=127.0.0.1,nw_dst=127.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=81,tp_dst=82 dnl @@ -86233,7 +86356,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) ovs-appctl revalidator/wait -@@ -490,7 +494,7 @@ packets:1, bytes:64, used:0.0s, actions:set(ipv4(src=192.168.0.7)),set(udp(dst=3 +@@ -490,7 +519,7 @@ packets:1, bytes:64, used:0.0s, actions:set(ipv4(src=192.168.0.7)),set(udp(dst=3 # Check that flow successfully deleted from HW. OVS_WAIT_UNTIL([grep "succeed to delete netdev flow" ovs-vswitchd.log]) AT_CHECK([filter_hw_flow_del < ovs-vswitchd.log | strip_xout], [0], [dnl @@ -86242,7 +86365,7 @@ index 0aeb4e788f..062f0228b4 100644 ]) # Check that ip address and udp port were correctly modified in output packets. -@@ -506,3 +510,20 @@ udp,in_port=ANY,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09: +@@ -506,3 +535,20 @@ udp,in_port=ANY,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,dl_src=00:06:07:08:09: DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS([dummy]) DPIF_NETDEV_FLOW_HW_OFFLOAD_OFFSETS([dummy-pmd]) @@ -86395,7 +86518,7 @@ index 3ab9ad62dd..516527f9cc 100644 AT_DATA([odp-in.txt], [dnl encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap())))))))))))))))))))))))))))))))) diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at -index 4893280a99..7cb09498e6 100644 +index 4893280a99..a0487341c9 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -766,6 +766,17 @@ dnl Check OpenFlow v1.3.4 Conformance Test: 430.510. @@ -86416,19 +86539,32 @@ index 4893280a99..7cb09498e6 100644 ]) sed '/^[[#&]]/d' < test-data > input.txt sed -n 's/^# //p; /^$/p' < test-data > expout +@@ -993,12 +1004,21 @@ bad_action 'dec_ttl(,)' 'dec_ttl_cnt_ids: expected at least one controller id.' + # set_mpls_label + bad_action 'set_mpls_label' 'set_mpls_label: expected label.' + ++# set_mpls_label oversized ++bad_action 'set_mpls_label(0x100000)' '0x100000: not a valid MPLS label' ++ + # set_mpls_tc + bad_action 'set_mpls_tc' 'set_mpls_tc: expected tc.' + ++# set_mpls_tc oversized ++bad_action 'set_mpls_tc(8)' '8: not a valid MPLS TC' ++ + # set_mpls_ttl + bad_action 'set_mpls_ttl' 'set_mpls_ttl: expected ttl.' + ++# set_mpls_ttl oversized ++bad_action 'set_mpls_ttl(256)' 'invalid MPLS TTL "256"' ++ + # fin_timeout + bad_action 'fin_timeout(foo=bar)' "invalid key 'foo' in 'fin_timeout' argument" + diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at -index ff1cc93707..b8fc9a6652 100644 +index ff1cc93707..6415a8a04d 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at -@@ -1871,7 +1871,7 @@ AT_CHECK([ovs-appctl revalidator/purge]) - AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log]) - - dnl Add a controller meter. --AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps stats bands=type=drop rate=2']) -+AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps burst stats bands=type=drop rate=1 burst_size=1']) - - dnl Advance time by 1 second. - AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore]) @@ -5171,6 +5171,36 @@ AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2 OVS_VSWITCHD_STOP AT_CLEANUP @@ -86560,7 +86696,7 @@ index ff1cc93707..b8fc9a6652 100644 OVS_VSWITCHD_START diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at -index c8062c8acc..9466a8cc43 100644 +index c8062c8acc..ebf0dc41c0 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -101,6 +101,7 @@ for test_case in \ @@ -86579,7 +86715,24 @@ index c8062c8acc..9466a8cc43 100644 ip,actions=ct(commit,zone=5) ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[]))) ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[]))) -@@ -490,6 +492,7 @@ NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout= +@@ -447,6 +449,16 @@ actions=output(max_len=100,port=123) + actions=output(port=100,max_len=123) + actions=output(port=LOCAL,max_len=123) + actions=output(port=IN_PORT,max_len=123) ++mpls,mpls_label=1,actions=set_mpls_label(0) ++mpls,mpls_label=1,actions=set_mpls_label(10) ++mpls,mpls_label=1,actions=set_mpls_label(0x10) ++mpls,mpls_label=1,actions=set_mpls_label(0xfffff) ++mpls,mpls_tc=1,actions=set_mpls_tc(0) ++mpls,mpls_tc=1,actions=set_mpls_tc(3) ++mpls,mpls_tc=1,actions=set_mpls_tc(7) ++mpls,mpls_ttl=1,actions=set_mpls_ttl(0) ++mpls,mpls_ttl=1,actions=set_mpls_ttl(200) ++mpls,mpls_ttl=1,actions=set_mpls_ttl(255) + ]]) + + AT_CHECK([ovs-ofctl parse-flows flows.txt +@@ -490,6 +502,7 @@ NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout= NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555) NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789) @@ -86587,6 +86740,23 @@ index c8062c8acc..9466a8cc43 100644 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,zone=5) NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[])) NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127])) +@@ -503,6 +516,16 @@ NXT_FLOW_MOD: ADD table:255 actions=output(port=123,max_len=100) + NXT_FLOW_MOD: ADD table:255 actions=output(port=100,max_len=123) + NXT_FLOW_MOD: ADD table:255 actions=output(port=LOCAL,max_len=123) + NXT_FLOW_MOD: ADD table:255 actions=output(port=IN_PORT,max_len=123) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_label=1 actions=set_mpls_label(0) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_label=1 actions=set_mpls_label(10) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_label=1 actions=set_mpls_label(16) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_label=1 actions=set_mpls_label(1048575) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_tc=1 actions=set_mpls_tc(0) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_tc=1 actions=set_mpls_tc(3) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_tc=1 actions=set_mpls_tc(7) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_ttl=1 actions=set_mpls_ttl(0) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_ttl=1 actions=set_mpls_ttl(200) ++NXT_FLOW_MOD: ADD table:255 mpls,mpls_ttl=1 actions=set_mpls_ttl(255) + ]]) + AT_CLEANUP + diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index 55c7a6e179..1f1fc3c79a 100644 --- a/tests/ovs-vsctl.at diff --git a/SPECS/openvswitch2.13.spec b/SPECS/openvswitch2.13.spec index 4cb13c9..795e84b 100644 --- a/SPECS/openvswitch2.13.spec +++ b/SPECS/openvswitch2.13.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.13.0 -Release: 112%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} +Release: 114%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -710,6 +710,14 @@ exit 0 %endif %changelog +* Fri May 21 2021 Open vSwitch CI - 2.13.0-114 +- Merging upstream branch-2.13 + [63656e47fb7ec23d8c869a3779eb412806451b6a] + +* Wed May 19 2021 Open vSwitch CI - 2.13.0-113 +- Merging upstream branch-2.13 + [43b0d45790ee550fdda3108c89510af6bf65fe7a] + * Sat May 15 2021 Open vSwitch CI - 2.13.0-112 - Merging upstream branch-2.13 [3f4fc768f047a1072907df202826465863fb36e7]