From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5CCE0A00BE for ; Thu, 21 Apr 2022 16:17:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54740427EE; Thu, 21 Apr 2022 16:17:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 69B924067C; Thu, 21 Apr 2022 16:17:11 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23LCoepE003230; Thu, 21 Apr 2022 07:17:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=RhPISKI1OA0MTRSviryoBbrEhDujm1+qX7QIMt6Q0/M=; b=kqy4S4NY6DwJi/amWP3/OK3u7bOOY+HQEWYiLeAIdkWMMUZlpMk8XoOfbzXW691BhrYG WYH/m+rguPMmst+ndwjKvSAd3z9Yz9P1I3GWDaF3iCucEXGACJLYOeWm5b7YeosKkHkd lZvjycRP27clI8GvGblgcu9T5sb+2uLp7lz4TJjDdhGW0BzZYf4lsnySC2+3d4FQvlsA NdwvfguipBc67qO+8q1s8KfIzD+aISEPMfFsfZDNUV9PQDhpYV1K7H9nlZTcV5bEoYgB E1blV7WGgrUFEuHcwGNMVQ829nj6z9abpYOVcOAvuryFu4Q6igeky/4m29fcGUeoZG7u BQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3fk7mk0a2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Apr 2022 07:17:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 21 Apr 2022 07:17:09 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 21 Apr 2022 07:17:09 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 6564E3F705F; Thu, 21 Apr 2022 07:17:07 -0700 (PDT) From: Nithin Dabilpuram To: CC: , Nithin Dabilpuram , , Subject: [PATCH] examples/l3fwd: fix issue with MTU set on event mode Date: Thu, 21 Apr 2022 19:46:31 +0530 Message-ID: <20220421141632.21676-1-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: -LW8zLUFHMQBOP8-dv2osOVUWwBMEl1o X-Proofpoint-GUID: -LW8zLUFHMQBOP8-dv2osOVUWwBMEl1o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-21_01,2022-04-21_01,2022-02-23_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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: 1bb4a528c41f ("ethdev: fix max Rx packet length") Cc: ferruh.yigit@intel.com Cc: stable@dpdk.org Signed-off-by: Nithin Dabilpuram --- examples/l3fwd/l3fwd.h | 5 +++++ examples/l3fwd/l3fwd_event.c | 6 ++++++ examples/l3fwd/main.c | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index ad39496..b0bfdcc 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -107,6 +107,8 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; extern struct parm_cfg parm_config; +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) @@ -193,6 +195,9 @@ is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len) 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 LPM, EM or FIB functionality. */ void setup_lpm(const int socketid); diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c index 7a40129..e72add8 100644 --- a/examples/l3fwd/l3fwd_event.c +++ b/examples/l3fwd/l3fwd_event.c @@ -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; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index a629198..6585c8b 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -135,7 +135,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]; @@ -1136,7 +1136,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) { -- 2.8.4