examples/l3fwd: fix MTU configuration with event mode

MTU configuration is missing for ethdev when using eventmode
when user provides it via "--max-pkt-len" config. It is only
done in poll mode setup. Fix the event mode setup code to
do the same.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Nithin Dabilpuram 2022-04-21 19:46:31 +05:30 committed by Thomas Monjalon
parent 8bcfa9cba3
commit 3f04555589
3 changed files with 13 additions and 2 deletions

View File

@ -114,6 +114,8 @@ extern struct parm_cfg parm_config;
extern struct acl_algorithms acl_alg[];
extern uint32_t max_pkt_len;
/* Send burst of packets on an output interface */
static inline int
send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port)
@ -206,6 +208,9 @@ usage_acl_alg(char *buf, size_t sz);
int
init_mem(uint16_t portid, unsigned int nb_mbuf);
int config_port_max_pkt_len(struct rte_eth_conf *conf,
struct rte_eth_dev_info *dev_info);
/* Function pointers for ACL, LPM, EM or FIB functionality. */
void
setup_acl(const int socketid);

View File

@ -73,6 +73,12 @@ l3fwd_eth_dev_port_setup(struct rte_eth_conf *port_conf)
rte_panic("Error during getting device (port %u) info:"
"%s\n", port_id, strerror(-ret));
ret = config_port_max_pkt_len(&local_port_conf, &dev_info);
if (ret != 0)
rte_exit(EXIT_FAILURE,
"Invalid max packet length: %u (port %u)\n",
max_pkt_len, port_id);
if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;

View File

@ -134,7 +134,7 @@ static struct rte_eth_conf port_conf = {
},
};
static uint32_t max_pkt_len;
uint32_t max_pkt_len;
static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];
static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS];
@ -1180,7 +1180,7 @@ eth_dev_get_overhead_len(uint32_t max_rx_pktlen, uint16_t max_mtu)
return overhead_len;
}
static int
int
config_port_max_pkt_len(struct rte_eth_conf *conf,
struct rte_eth_dev_info *dev_info)
{