_(sw_interface_set_table_reply) \
_(sw_interface_set_vpath_reply) \
_(sw_interface_set_l2_bridge_reply) \
+_(sw_interface_set_dpdk_hqos_pipe_reply) \
+_(sw_interface_set_dpdk_hqos_subport_reply) \
+_(sw_interface_set_dpdk_hqos_tctbl_reply) \
_(bridge_domain_add_del_reply) \
_(sw_interface_set_l2_xconnect_reply) \
_(l2fib_add_del_reply) \
_(pg_enable_disable_reply) \
_(ip_source_and_port_range_check_add_del_reply) \
_(ip_source_and_port_range_check_interface_add_del_reply)\
-_(delete_subif_reply)
+_(delete_subif_reply) \
+_(l2_interface_pbb_tag_rewrite_reply)
#define _(n) \
static void vl_api_##n##_t_handler \
sw_interface_set_l2_xconnect_reply) \
_(SW_INTERFACE_SET_L2_BRIDGE_REPLY, \
sw_interface_set_l2_bridge_reply) \
+_(SW_INTERFACE_SET_DPDK_HQOS_PIPE_REPLY, \
+ sw_interface_set_dpdk_hqos_pipe_reply) \
+_(SW_INTERFACE_SET_DPDK_HQOS_SUBPORT_REPLY, \
+ sw_interface_set_dpdk_hqos_subport_reply) \
+_(SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY, \
+ sw_interface_set_dpdk_hqos_tctbl_reply) \
_(BRIDGE_DOMAIN_ADD_DEL_REPLY, bridge_domain_add_del_reply) \
_(BRIDGE_DOMAIN_DETAILS, bridge_domain_details) \
_(BRIDGE_DOMAIN_SW_IF_DETAILS, bridge_domain_sw_if_details) \
ip_source_and_port_range_check_interface_add_del_reply) \
_(IPSEC_GRE_ADD_DEL_TUNNEL_REPLY, ipsec_gre_add_del_tunnel_reply) \
_(IPSEC_GRE_TUNNEL_DETAILS, ipsec_gre_tunnel_details) \
-_(DELETE_SUBIF_REPLY, delete_subif_reply)
+_(DELETE_SUBIF_REPLY, delete_subif_reply) \
+_(L2_INTERFACE_PBB_TAG_REWRITE_REPLY, l2_interface_pbb_tag_rewrite_reply)
/* M: construct, but don't yet send a message */
strncpy ((char *) mp->name_filter, "lo", sizeof (mp->name_filter) - 1);
S;
+ /* and packet-generator interfaces */
+ M (SW_INTERFACE_DUMP, sw_interface_dump);
+ mp->name_filter_valid = 1;
+ strncpy ((char *) mp->name_filter, "pg", sizeof (mp->name_filter) - 1);
+ S;
/* and vxlan-gpe tunnel interfaces */
M (SW_INTERFACE_DUMP, sw_interface_dump);
W;
}
+static int
+api_sw_interface_set_dpdk_hqos_pipe (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp;
+ f64 timeout;
+ u32 sw_if_index;
+ u8 sw_if_index_set = 0;
+ u32 subport;
+ u8 subport_set = 0;
+ u32 pipe;
+ u8 pipe_set = 0;
+ u32 profile;
+ u8 profile_set = 0;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "rx %U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "sw_if_index %u", &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "subport %u", &subport))
+ subport_set = 1;
+ else if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "pipe %u", &pipe))
+ pipe_set = 1;
+ else if (unformat (i, "profile %u", &profile))
+ profile_set = 1;
+ else
+ break;
+ }
+
+ if (sw_if_index_set == 0)
+ {
+ errmsg ("missing interface name or sw_if_index\n");
+ return -99;
+ }
+
+ if (subport_set == 0)
+ {
+ errmsg ("missing subport \n");
+ return -99;
+ }
+
+ if (pipe_set == 0)
+ {
+ errmsg ("missing pipe\n");
+ return -99;
+ }
+
+ if (profile_set == 0)
+ {
+ errmsg ("missing profile\n");
+ return -99;
+ }
+
+ M (SW_INTERFACE_SET_DPDK_HQOS_PIPE, sw_interface_set_dpdk_hqos_pipe);
+
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->subport = ntohl (subport);
+ mp->pipe = ntohl (pipe);
+ mp->profile = ntohl (profile);
+
+
+ S;
+ W;
+ /* NOTREACHED */
+ return 0;
+}
+
+static int
+api_sw_interface_set_dpdk_hqos_subport (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_sw_interface_set_dpdk_hqos_subport_t *mp;
+ f64 timeout;
+ u32 sw_if_index;
+ u8 sw_if_index_set = 0;
+ u32 subport;
+ u8 subport_set = 0;
+ u32 tb_rate = 1250000000; /* 10GbE */
+ u32 tb_size = 1000000;
+ u32 tc_rate[] = { 1250000000, 1250000000, 1250000000, 1250000000 };
+ u32 tc_period = 10;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "rx %U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "sw_if_index %u", &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "subport %u", &subport))
+ subport_set = 1;
+ else if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "rate %u", &tb_rate))
+ {
+ u32 tc_id;
+
+ for (tc_id = 0; tc_id < (sizeof (tc_rate) / sizeof (tc_rate[0]));
+ tc_id++)
+ tc_rate[tc_id] = tb_rate;
+ }
+ else if (unformat (i, "bktsize %u", &tb_size))
+ ;
+ else if (unformat (i, "tc0 %u", &tc_rate[0]))
+ ;
+ else if (unformat (i, "tc1 %u", &tc_rate[1]))
+ ;
+ else if (unformat (i, "tc2 %u", &tc_rate[2]))
+ ;
+ else if (unformat (i, "tc3 %u", &tc_rate[3]))
+ ;
+ else if (unformat (i, "period %u", &tc_period))
+ ;
+ else
+ break;
+ }
+
+ if (sw_if_index_set == 0)
+ {
+ errmsg ("missing interface name or sw_if_index\n");
+ return -99;
+ }
+
+ if (subport_set == 0)
+ {
+ errmsg ("missing subport \n");
+ return -99;
+ }
+
+ M (SW_INTERFACE_SET_DPDK_HQOS_SUBPORT, sw_interface_set_dpdk_hqos_subport);
+
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->subport = ntohl (subport);
+ mp->tb_rate = ntohl (tb_rate);
+ mp->tb_size = ntohl (tb_size);
+ mp->tc_rate[0] = ntohl (tc_rate[0]);
+ mp->tc_rate[1] = ntohl (tc_rate[1]);
+ mp->tc_rate[2] = ntohl (tc_rate[2]);
+ mp->tc_rate[3] = ntohl (tc_rate[3]);
+ mp->tc_period = ntohl (tc_period);
+
+ S;
+ W;
+ /* NOTREACHED */
+ return 0;
+}
+
+static int
+api_sw_interface_set_dpdk_hqos_tctbl (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp;
+ f64 timeout;
+ u32 sw_if_index;
+ u8 sw_if_index_set = 0;
+ u8 entry_set = 0;
+ u8 tc_set = 0;
+ u8 queue_set = 0;
+ u32 entry, tc, queue;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "rx %U", unformat_sw_if_index, vam, &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "sw_if_index %u", &sw_if_index))
+ sw_if_index_set = 1;
+ else if (unformat (i, "entry %d", &entry))
+ entry_set = 1;
+ else if (unformat (i, "tc %d", &tc))
+ tc_set = 1;
+ else if (unformat (i, "queue %d", &queue))
+ queue_set = 1;
+ else
+ break;
+ }
+
+ if (sw_if_index_set == 0)
+ {
+ errmsg ("missing interface name or sw_if_index\n");
+ return -99;
+ }
+
+ if (entry_set == 0)
+ {
+ errmsg ("missing entry \n");
+ return -99;
+ }
+
+ if (tc_set == 0)
+ {
+ errmsg ("missing traffic class \n");
+ return -99;
+ }
+
+ if (queue_set == 0)
+ {
+ errmsg ("missing queue \n");
+ return -99;
+ }
+
+ M (SW_INTERFACE_SET_DPDK_HQOS_TCTBL, sw_interface_set_dpdk_hqos_tctbl);
+
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->entry = ntohl (entry);
+ mp->tc = ntohl (tc);
+ mp->queue = ntohl (queue);
+
+ S;
+ W;
+ /* NOTREACHED */
+ return 0;
+}
+
static int
api_sw_interface_add_del_address (vat_main_t * vam)
{
u8 locator_set_name_set = 0;
ls_locator_t locator, *locators = 0;
u32 sw_if_index, priority, weight;
+ u32 data_len = 0;
/* Parse args required to build the message */
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
}
vec_add1 (locator_set_name, 0);
+ data_len = sizeof (ls_locator_t) * vec_len (locators);
+
/* Construct the API message */
- M (LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set);
+ M2 (LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set, data_len);
mp->is_add = is_add;
clib_memcpy (mp->locator_set_name, locator_set_name,
mp->locator_num = clib_host_to_net_u32 (vec_len (locators));
if (locators)
- clib_memcpy (mp->locators, locators,
- (sizeof (ls_locator_t) * vec_len (locators)));
+ clib_memcpy (mp->locators, locators, data_len);
vec_free (locators);
/* send it... */
lisp_eid_vat_t _eid, *eid = &_eid;
lisp_eid_vat_t _seid, *seid = &_seid;
u8 is_add = 1, del_all = 0, eid_set = 0, seid_set = 0;
- u32 action = ~0, p, w;
+ u32 action = ~0, p, w, data_len;
ip4_address_t rloc4;
ip6_address_t rloc6;
rloc_t *rlocs = 0, rloc, *curr_rloc = 0;
return -99;
}
- M (LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping);
+ data_len = vec_len (rlocs) * sizeof (rloc_t);
+
+ M2 (LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping, data_len);
mp->is_add = is_add;
mp->vni = htonl (vni);
mp->action = (u8) action;
lisp_eid_put_vat (mp->seid, seid->addr, seid->type);
mp->rloc_num = clib_host_to_net_u32 (vec_len (rlocs));
- clib_memcpy (mp->rlocs, rlocs, (sizeof (rloc_t) * vec_len (rlocs)));
+ clib_memcpy (mp->rlocs, rlocs, data_len);
vec_free (rlocs);
/* send it... */
vl_api_lisp_add_del_adjacency_t *mp;
f64 timeout = ~0;
u32 vni = 0;
- ip4_address_t seid4, deid4;
- ip6_address_t seid6, deid6;
- u8 deid_mac[6] = { 0 };
- u8 seid_mac[6] = { 0 };
- u8 deid_type, seid_type;
- u32 seid_len = 0, deid_len = 0, len;
+ ip4_address_t leid4, reid4;
+ ip6_address_t leid6, reid6;
+ u8 reid_mac[6] = { 0 };
+ u8 leid_mac[6] = { 0 };
+ u8 reid_type, leid_type;
+ u32 leid_len = 0, reid_len = 0, len;
u8 is_add = 1;
- seid_type = deid_type = (u8) ~ 0;
+ leid_type = reid_type = (u8) ~ 0;
/* Parse args required to build the message */
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
is_add = 1;
}
- else if (unformat (input, "deid %U/%d", unformat_ip4_address,
- &deid4, &len))
+ else if (unformat (input, "reid %U/%d", unformat_ip4_address,
+ &reid4, &len))
{
- deid_type = 0; /* ipv4 */
- deid_len = len;
+ reid_type = 0; /* ipv4 */
+ reid_len = len;
}
- else if (unformat (input, "deid %U/%d", unformat_ip6_address,
- &deid6, &len))
+ else if (unformat (input, "reid %U/%d", unformat_ip6_address,
+ &reid6, &len))
{
- deid_type = 1; /* ipv6 */
- deid_len = len;
+ reid_type = 1; /* ipv6 */
+ reid_len = len;
}
- else if (unformat (input, "deid %U", unformat_ethernet_address,
- deid_mac))
+ else if (unformat (input, "reid %U", unformat_ethernet_address,
+ reid_mac))
{
- deid_type = 2; /* mac */
+ reid_type = 2; /* mac */
}
- else if (unformat (input, "seid %U/%d", unformat_ip4_address,
- &seid4, &len))
+ else if (unformat (input, "leid %U/%d", unformat_ip4_address,
+ &leid4, &len))
{
- seid_type = 0; /* ipv4 */
- seid_len = len;
+ leid_type = 0; /* ipv4 */
+ leid_len = len;
}
- else if (unformat (input, "seid %U/%d", unformat_ip6_address,
- &seid6, &len))
+ else if (unformat (input, "leid %U/%d", unformat_ip6_address,
+ &leid6, &len))
{
- seid_type = 1; /* ipv6 */
- seid_len = len;
+ leid_type = 1; /* ipv6 */
+ leid_len = len;
}
- else if (unformat (input, "seid %U", unformat_ethernet_address,
- seid_mac))
+ else if (unformat (input, "leid %U", unformat_ethernet_address,
+ leid_mac))
{
- seid_type = 2; /* mac */
+ leid_type = 2; /* mac */
}
else if (unformat (input, "vni %d", &vni))
{
}
}
- if ((u8) ~ 0 == deid_type)
+ if ((u8) ~ 0 == reid_type)
{
errmsg ("missing params!");
return -99;
}
- if (seid_type != deid_type)
+ if (leid_type != reid_type)
{
- errmsg ("source and destination EIDs are of different types!");
+ errmsg ("remote and local EIDs are of different types!");
return -99;
}
M (LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency);
mp->is_add = is_add;
mp->vni = htonl (vni);
- mp->seid_len = seid_len;
- mp->deid_len = deid_len;
- mp->eid_type = deid_type;
+ mp->leid_len = leid_len;
+ mp->reid_len = reid_len;
+ mp->eid_type = reid_type;
switch (mp->eid_type)
{
case 0:
- clib_memcpy (mp->seid, &seid4, sizeof (seid4));
- clib_memcpy (mp->deid, &deid4, sizeof (deid4));
+ clib_memcpy (mp->leid, &leid4, sizeof (leid4));
+ clib_memcpy (mp->reid, &reid4, sizeof (reid4));
break;
case 1:
- clib_memcpy (mp->seid, &seid6, sizeof (seid6));
- clib_memcpy (mp->deid, &deid6, sizeof (deid6));
+ clib_memcpy (mp->leid, &leid6, sizeof (leid6));
+ clib_memcpy (mp->reid, &reid6, sizeof (reid6));
break;
case 2:
- clib_memcpy (mp->seid, seid_mac, 6);
- clib_memcpy (mp->deid, deid_mac, 6);
+ clib_memcpy (mp->leid, leid_mac, 6);
+ clib_memcpy (mp->reid, reid_mac, 6);
break;
default:
errmsg ("unknown EID type %d!", mp->eid_type);
W;
}
+#define foreach_pbb_vtr_op \
+_("disable", L2_VTR_DISABLED) \
+_("pop", L2_VTR_POP_2) \
+_("push", L2_VTR_PUSH_2)
+
+static int
+api_l2_interface_pbb_tag_rewrite (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ vl_api_l2_interface_pbb_tag_rewrite_t *mp;
+ f64 timeout;
+ u32 sw_if_index = ~0, vtr_op = ~0;
+ u16 outer_tag = ~0;
+ u8 dmac[6], smac[6];
+ u8 dmac_set = 0, smac_set = 0;
+ u16 vlanid = 0;
+ u32 sid = ~0;
+ u32 tmp;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))
+ ;
+ else if (unformat (i, "sw_if_index %d", &sw_if_index))
+ ;
+ else if (unformat (i, "vtr_op %d", &vtr_op))
+ ;
+#define _(n,v) else if (unformat(i, n)) {vtr_op = v;}
+ foreach_pbb_vtr_op
+#undef _
+ else if (unformat (i, "translate_pbb_stag"))
+ {
+ if (unformat (i, "%d", &tmp))
+ {
+ vtr_op = L2_VTR_TRANSLATE_2_1;
+ outer_tag = tmp;
+ }
+ else
+ {
+ errmsg
+ ("translate_pbb_stag operation requires outer tag definition\n");
+ return -99;
+ }
+ }
+ else if (unformat (i, "dmac %U", unformat_ethernet_address, dmac))
+ dmac_set++;
+ else if (unformat (i, "smac %U", unformat_ethernet_address, smac))
+ smac_set++;
+ else if (unformat (i, "sid %d", &sid))
+ ;
+ else if (unformat (i, "vlanid %d", &tmp))
+ vlanid = tmp;
+ else
+ {
+ clib_warning ("parse error '%U'", format_unformat_error, i);
+ return -99;
+ }
+ }
+
+ if ((sw_if_index == ~0) || (vtr_op == ~0))
+ {
+ errmsg ("missing sw_if_index or vtr operation\n");
+ return -99;
+ }
+ if (((vtr_op == L2_VTR_PUSH_2) || (vtr_op == L2_VTR_TRANSLATE_2_2))
+ && ((dmac_set == 0) || (smac_set == 0) || (sid == ~0)))
+ {
+ errmsg
+ ("push and translate_qinq operations require dmac, smac, sid and optionally vlanid\n");
+ return -99;
+ }
+
+ M (L2_INTERFACE_PBB_TAG_REWRITE, l2_interface_pbb_tag_rewrite);
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->vtr_op = ntohl (vtr_op);
+ mp->outer_tag = ntohs (outer_tag);
+ clib_memcpy (mp->b_dmac, dmac, sizeof (dmac));
+ clib_memcpy (mp->b_smac, smac, sizeof (smac));
+ mp->b_vlanid = ntohs (vlanid);
+ mp->i_sid = ntohl (sid);
+
+ S;
+ W;
+ /* NOTREACHED */
+ return 0;
+}
+
static int
q_or_quit (vat_main_t * vam)
{
"<intfc> | sw_if_index <id> bd_id <bridge-domain-id>\n" \
"[shg <split-horizon-group>] [bvi]\n" \
"enable | disable") \
+_(sw_interface_set_dpdk_hqos_pipe, \
+ "rx <intfc> | sw_if_index <id> subport <subport-id> pipe <pipe-id>\n" \
+ "profile <profile-id>\n") \
+_(sw_interface_set_dpdk_hqos_subport, \
+ "rx <intfc> | sw_if_index <id> subport <subport-id> [rate <n>]\n" \
+ "[bktsize <n>] [tc0 <n>] [tc1 <n>] [tc2 <n>] [tc3 <n>] [period <n>]\n") \
+_(sw_interface_set_dpdk_hqos_tctbl, \
+ "rx <intfc> | sw_if_index <id> entry <n> tc <n> queue <n>\n") \
_(bridge_domain_add_del, \
"bd_id <bridge-domain-id> [flood 1|0] [uu-flood 1|0] [forward 1|0] [learn 1|0] [arp-term 1|0] [del]\n")\
_(bridge_domain_dump, "[bd_id <bridge-domain-id>]\n") \
"rloc <locator> p <prio> " \
"w <weight> [rloc <loc> ... ] " \
"action <action> [del-all]") \
-_(lisp_add_del_adjacency, "add|del vni <vni> deid <dest-eid> seid " \
- "<src-eid> rloc <locator> p <prio> w <weight>"\
- "[rloc <loc> ... ] action <action>") \
+_(lisp_add_del_adjacency, "add|del vni <vni> reid <remote-eid> leid " \
+ "<local-eid>") \
_(lisp_pitr_set_locator_set, "locator-set <loc-set-name> | del") \
_(lisp_map_request_mode, "src-dst|dst-only") \
_(lisp_add_del_map_request_itr_rlocs, "<loc-set-name> [del]") \
_(ipsec_gre_add_del_tunnel, \
"src <addr> dst <addr> local_sa <sa-id> remote_sa <sa-id> [del]") \
_(ipsec_gre_tunnel_dump, "[sw_if_index <nn>]") \
-_(delete_subif,"sub_sw_if_index <nn> sub_if_id <nn>")
+_(delete_subif,"sub_sw_if_index <nn> sub_if_id <nn>") \
+_(l2_interface_pbb_tag_rewrite, \
+ "<intfc> | sw_if_index <nn> \n" \
+ "[disable | push | pop | translate_pbb_stag <outer_tag>] \n" \
+ "dmac <mac> smac <mac> sid <nn> [vlanid <nn>]")
/* List of command functions, CLI names map directly to functions */
#define foreach_cli_function \