summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/prox_args.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2018-11-04 17:29:43 +0100
committerXavier Simonart <xavier.simonart@intel.com>2018-12-05 12:46:00 +0100
commit899bdc59981a301aa6f5d02f0b1edef404e93569 (patch)
tree8631d9e322559e7f85f23f6a18501f5ff88d68a7 /VNFs/DPPD-PROX/prox_args.c
parentabbfe2212b979e5048cafc82ecb12d11ab84f764 (diff)
Add support for VLAN insert and stripping
JIRA: SAMPLEVNF-149 VLAN can be enabled on a port by adding "vlan=yes" in the port section. When VLAN is enabled on a port, then DEV_RX_OFFLOAD_VLAN_STRIP and DEV_TX_OFFLOAD_VLAN_INSERT are enabled (if device supports it). This will cause VLAN to be stripped from any packets received with the proper tag, and VLAN to be added for any packets being transmitted. The VLAN ID themselves are configured through the physical function using something like (where ens801f1 isthe PF): ip link set ens801f1 vf 0 vlan 1111 Change-Id: I945c87b0c18565da479ecaa08e5ffce91232a7ce Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_args.c')
-rw-r--r--VNFs/DPPD-PROX/prox_args.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c
index c09c563d..59c514fc 100644
--- a/VNFs/DPPD-PROX/prox_args.c
+++ b/VNFs/DPPD-PROX/prox_args.c
@@ -559,6 +559,23 @@ static int get_port_cfg(unsigned sindex, char *str, void *data)
else
cfg->requested_rx_offload &= ~DEV_RX_OFFLOAD_CRC_STRIP;
}
+ else if (STR_EQ(str, "vlan")) {
+#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,1)
+ uint32_t val;
+ if (parse_bool(&val, pkey)) {
+ return -1;
+ }
+ if (val) {
+ cfg->requested_rx_offload |= DEV_RX_OFFLOAD_VLAN_STRIP;
+ cfg->requested_tx_offload |= DEV_TX_OFFLOAD_VLAN_INSERT;
+ } else {
+ cfg->requested_rx_offload &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ cfg->requested_tx_offload &= ~DEV_TX_OFFLOAD_VLAN_INSERT;
+ }
+#else
+ plog_warn("vlan option not supported : update DPDK at least to 18.08 to support this option\n");
+#endif
+ }
else if (STR_EQ(str, "mtu size")) {
uint32_t val;
if (parse_int(&val, pkey)) {