+ if (val)
+ cfg->requested_rx_offload |= DEV_RX_OFFLOAD_CRC_STRIP;
+ 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)) {
+ 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
+ cfg->port_conf.rxmode.max_rx_pkt_len = cfg->mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ if (cfg->port_conf.rxmode.max_rx_pkt_len > ETHER_MAX_LEN) {
+ cfg->requested_rx_offload |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+ }
+ }