"set vf broadcast (port_id) (vf_id) (on|off)\n"
" Set VF broadcast for a VF from the PF.\n\n"
- "vlan set strip (on|off) (port_id)\n"
- " Set the VLAN strip on a port.\n\n"
-
"vlan set stripq (on|off) (port_id,queue_id)\n"
" Set the VLAN strip for a queue on a port.\n\n"
"set tc tx min-bandwidth (port_id) (bw1, bw2, ...)\n"
" Set all TCs' min bandwidth(%%) for all PF and VFs.\n\n"
- "vlan set filter (on|off) (port_id)\n"
- " Set the VLAN filter on a port.\n\n"
-
- "vlan set qinq (on|off) (port_id)\n"
- " Set the VLAN QinQ (extended queue in queue)"
- " on a port.\n\n"
+ "vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)\n"
+ " Set the VLAN strip or filter or qinq strip or extend\n\n"
"vlan set (inner|outer) tpid (value) (port_id)\n"
" Set the VLAN TPID for Packet Filtering on"
}
else if (!strcmp(res->what, "filter"))
rx_vlan_filter_set(port_id, on);
+ else if (!strcmp(res->what, "qinq_strip"))
+ rx_vlan_qinq_strip_set(port_id, on);
else
vlan_extend_set(port_id, on);
set, "set");
cmdline_parse_token_string_t cmd_vlan_offload_what =
TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
- what, "strip#filter#qinq#stripq");
+ what, "strip#filter#qinq_strip#extend#stripq");
cmdline_parse_token_string_t cmd_vlan_offload_on =
TOKEN_STRING_INITIALIZER(struct cmd_vlan_offload_result,
on, "on#off");
cmdline_parse_inst_t cmd_vlan_offload = {
.f = cmd_vlan_offload_parsed,
.data = NULL,
- .help_str = "vlan set strip|filter|qinq|stripq on|off "
+ .help_str = "vlan set strip|filter|qinq_strip|extend|stripq on|off "
"<port_id[,queue_id]>: "
- "Filter/Strip for rx side qinq(extended) for both rx/tx sides",
+ "Strip/Filter/QinQ for rx side Extend for both rx/tx sides",
.tokens = {
(void *)&cmd_vlan_offload_vlan,
(void *)&cmd_vlan_offload_set,
if (vlan_offload >= 0){
printf("VLAN offload: \n");
if (vlan_offload & ETH_VLAN_STRIP_OFFLOAD)
- printf(" strip on \n");
+ printf(" strip on, ");
else
- printf(" strip off \n");
+ printf(" strip off, ");
if (vlan_offload & ETH_VLAN_FILTER_OFFLOAD)
- printf(" filter on \n");
+ printf("filter on, ");
else
- printf(" filter off \n");
+ printf("filter off, ");
if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD)
- printf(" qinq(extend) on \n");
+ printf("extend on, ");
else
- printf(" qinq(extend) off \n");
+ printf("extend off, ");
+
+ if (vlan_offload & ETH_QINQ_STRIP_OFFLOAD)
+ printf("qinq strip on\n");
+ else
+ printf("qinq strip off\n");
}
if (dev_info.hash_key_size > 0)
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}
+void
+rx_vlan_qinq_strip_set(portid_t port_id, int on)
+{
+ int diag;
+ int vlan_offload;
+ uint64_t port_rx_offloads = ports[port_id].dev_conf.rxmode.offloads;
+
+ if (port_id_is_invalid(port_id, ENABLED_WARN))
+ return;
+
+ vlan_offload = rte_eth_dev_get_vlan_offload(port_id);
+
+ if (on) {
+ vlan_offload |= ETH_QINQ_STRIP_OFFLOAD;
+ port_rx_offloads |= DEV_RX_OFFLOAD_QINQ_STRIP;
+ } else {
+ vlan_offload &= ~ETH_QINQ_STRIP_OFFLOAD;
+ port_rx_offloads &= ~DEV_RX_OFFLOAD_QINQ_STRIP;
+ }
+
+ diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
+ if (diag < 0)
+ printf("%s(port_pi=%d, on=%d) failed "
+ "diag=%d\n", __func__, port_id, on, diag);
+ ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
+}
+
int
rx_vft_set(portid_t port_id, uint16_t vlan_id, int on)
{
void rx_vlan_filter_set(portid_t port_id, int on);
void rx_vlan_all_filter_set(portid_t port_id, int on);
+void rx_vlan_qinq_strip_set(portid_t port_id, int on);
int rx_vft_set(portid_t port_id, uint16_t vlan_id, int on);
void vlan_extend_set(portid_t port_id, int on);
void vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type,
Maximum number of MAC addresses: 64
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
- strip on
- filter on
- qinq(extend) off
+ strip on, filter on, extend off, qinq strip off
Redirection table size: 512
Supported flow types:
ipv4-frag
testpmd> set vf broadcast (port_id) (vf_id) (on|off)
-vlan set strip
-~~~~~~~~~~~~~~
-
-Set the VLAN strip on a port::
-
- testpmd> vlan set strip (on|off) (port_id)
-
vlan set stripq
~~~~~~~~~~~~~~~
testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)
-vlan set filter
-~~~~~~~~~~~~~~~
-
-Set the VLAN filter on a port::
-
- testpmd> vlan set filter (on|off) (port_id)
-
-vlan set qinq
-~~~~~~~~~~~~~
-
-Set the VLAN QinQ (extended queue in queue) on for a port::
+vlan set (strip|filter|qinq_strip|extend)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set the VLAN strip/filter/QinQ strip/extend on for a port::
- testpmd> vlan set qinq (on|off) (port_id)
+ testpmd> vlan set (strip|filter|qinq_strip|extend) (on|off) (port_id)
vlan set tpid
~~~~~~~~~~~~~
Before creating QinQ rule(s) the following commands should be issued to enable QinQ::
testpmd> port stop 0
- testpmd> vlan set qinq on 0
+ testpmd> vlan set qinq_strip on 0
The above command sets the inner and outer TPID's to 0x8100.