X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fodp-util.c;h=798e42540a7dd1b6199965810979f519bff1fb9f;hb=0cc96e48ab2fc573c3b7b69fe5a034bb29dde578;hp=67ce413244503d6b3ecf987a3e258d8bf7e3d5af;hpb=cd05c6ad2fdcedce229f962ca29c167287b9b21b;p=openvswitch diff --git a/lib/odp-util.c b/lib/odp-util.c index 67ce4132..798e4254 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -30,13 +30,10 @@ union odp_action * odp_actions_add(struct odp_actions *actions, uint16_t type) { union odp_action *a; - if (actions->n_actions < MAX_ODP_ACTIONS) { - a = &actions->actions[actions->n_actions++]; - } else { - COVERAGE_INC(odp_overflow); - actions->n_actions = MAX_ODP_ACTIONS + 1; - a = &actions->actions[MAX_ODP_ACTIONS - 1]; - } + size_t idx; + + idx = actions->n_actions++ & (MAX_ODP_ACTIONS - 1); + a = &actions->actions[idx]; memset(a, 0, sizeof *a); a->type = type; return a; @@ -55,6 +52,9 @@ format_odp_action(struct ds *ds, const union odp_action *a) case ODPAT_CONTROLLER: ds_put_format(ds, "ctl(%"PRIu32")", a->controller.arg); break; + case ODPAT_SET_TUNNEL: + ds_put_format(ds, "set_tunnel(0x%08"PRIx32")", ntohl(a->tunnel.tun_id)); + break; case ODPAT_SET_VLAN_VID: ds_put_format(ds, "set_vlan(%"PRIu16")", ntohs(a->vlan_vid.vlan_vid)); break; @@ -89,6 +89,15 @@ format_odp_action(struct ds *ds, const union odp_action *a) case ODPAT_SET_TP_DST: ds_put_format(ds, "set_tp_dst(%"PRIu16")", ntohs(a->tp_port.tp_port)); break; + case ODPAT_SET_PRIORITY: + ds_put_format(ds, "set_priority(0x%"PRIx32")", a->priority.priority); + break; + case ODPAT_POP_PRIORITY: + ds_put_cstr(ds, "pop_priority"); + break; + case ODPAT_DROP_SPOOFED_ARP: + ds_put_cstr(ds, "drop_spoofed_arp"); + break; default: ds_put_format(ds, "***bad action 0x%"PRIx16"***", a->type); break;