MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tx_vlan_set

Function tx_vlan_set

dpdk/app/test-pmd/config.c:6281–6310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6279}
6280
6281void
6282tx_vlan_set(portid_t port_id, uint16_t vlan_id)
6283{
6284 struct rte_eth_dev_info dev_info;
6285 int ret;
6286
6287 if (vlan_id_is_invalid(vlan_id))
6288 return;
6289
6290 if (ports[port_id].dev_conf.txmode.offloads &
6291 RTE_ETH_TX_OFFLOAD_QINQ_INSERT) {
6292 fprintf(stderr, "Error, as QinQ has been enabled.\n");
6293 return;
6294 }
6295
6296 ret = eth_dev_info_get_print_err(port_id, &dev_info);
6297 if (ret != 0)
6298 return;
6299
6300 if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_VLAN_INSERT) == 0) {
6301 fprintf(stderr,
6302 "Error: vlan insert is not supported by port %d\n",
6303 port_id);
6304 return;
6305 }
6306
6307 tx_vlan_reset(port_id);
6308 ports[port_id].dev_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
6309 ports[port_id].tx_vlan_id = vlan_id;
6310}
6311
6312void
6313tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)

Callers 1

cmd_tx_vlan_set_parsedFunction · 0.85

Calls 3

vlan_id_is_invalidFunction · 0.85
tx_vlan_resetFunction · 0.85

Tested by

no test coverage detected