+#if defined(RTE_ETH_RX_OFFLOAD_CRC_STRIP)
+ if (val)
+ cfg->requested_rx_offload |= RTE_ETH_RX_OFFLOAD_CRC_STRIP;
+ else
+ cfg->requested_rx_offload &= ~RTE_ETH_RX_OFFLOAD_CRC_STRIP;
+#else
+#if defined (RTE_ETH_RX_OFFLOAD_KEEP_CRC)
+ if (val)
+ cfg->requested_rx_offload &= ~RTE_ETH_RX_OFFLOAD_KEEP_CRC;
+ else
+ cfg->requested_rx_offload |= RTE_ETH_RX_OFFLOAD_KEEP_CRC;
+#endif
+#endif
+
+ }
+ else if (STR_EQ(str, "vlan tag")) {
+ return parse_int_set(cfg->vlan_tags, pkey, sizeof(cfg->vlan_tags) / sizeof(cfg->vlan_tags[0]));
+ }
+ 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 |= RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
+ cfg->requested_tx_offload |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
+ } else {
+ cfg->requested_rx_offload &= ~RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
+ cfg->requested_tx_offload &= ~RTE_ETH_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)) {
+ return -1;
+ }
+ if (val) {
+ cfg->mtu = val;
+ // A frame of 1526 bytes (1500 bytes mtu, 14 bytes hdr, 4 bytes crc and 8 bytes vlan)
+ // should not be considered as a jumbo frame. However rte_ethdev.c considers that
+ // the max_rx_pkt_len for a non jumbo frame is 1518
+#if RTE_VERSION < RTE_VERSION_NUM(21,11,0,0)
+ cfg->port_conf.rxmode.max_rx_pkt_len = cfg->mtu + PROX_RTE_ETHER_HDR_LEN + PROX_RTE_ETHER_CRC_LEN;
+ if (cfg->port_conf.rxmode.max_rx_pkt_len > PROX_RTE_ETHER_MAX_LEN)
+#else
+ cfg->port_conf.rxmode.mtu = cfg->mtu;
+ if (cfg->port_conf.rxmode.mtu > PROX_MTU)
+#endif
+ cfg->requested_rx_offload |= RTE_ETH_RX_OFFLOAD_JUMBO_FRAME;
+ }