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

Function tx_qinq_set

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

Source from the content-addressed store, hash-verified

6310}
6311
6312void
6313tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
6314{
6315 struct rte_eth_dev_info dev_info;
6316 int ret;
6317
6318 if (vlan_id_is_invalid(vlan_id))
6319 return;
6320 if (vlan_id_is_invalid(vlan_id_outer))
6321 return;
6322
6323 ret = eth_dev_info_get_print_err(port_id, &dev_info);
6324 if (ret != 0)
6325 return;
6326
6327 if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_QINQ_INSERT) == 0) {
6328 fprintf(stderr,
6329 "Error: qinq insert not supported by port %d\n",
6330 port_id);
6331 return;
6332 }
6333
6334 tx_vlan_reset(port_id);
6335 ports[port_id].dev_conf.txmode.offloads |= (RTE_ETH_TX_OFFLOAD_VLAN_INSERT |
6336 RTE_ETH_TX_OFFLOAD_QINQ_INSERT);
6337 ports[port_id].tx_vlan_id = vlan_id;
6338 ports[port_id].tx_vlan_id_outer = vlan_id_outer;
6339}
6340
6341void
6342tx_vlan_reset(portid_t port_id)

Callers 1

Calls 3

vlan_id_is_invalidFunction · 0.85
tx_vlan_resetFunction · 0.85

Tested by

no test coverage detected