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 0B7C2A0544; Thu, 2 Jun 2022 09:45:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5D2E40694; Thu, 2 Jun 2022 09:45:54 +0200 (CEST) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by mails.dpdk.org (Postfix) with ESMTP id 1E7CF4021E; Thu, 2 Jun 2022 09:45:54 +0200 (CEST) Received: by mail-qv1-f49.google.com with SMTP id i19so3045512qvu.13; Thu, 02 Jun 2022 00:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IKLcQ9Drod0Pqxxja/fEstK7TNwfJBsfZgbXWlsmeK0=; b=p2oT2ad6HOzUykYuY3/+2+HJKHQ9qOdbRpz6NDixs/YeCD0Dur5xdGWZePWHEzee1E +Q/9TH9v2UQSBKXbtHmPvHzGOeM9nx4PL+PBIWV7gXAXR61T5BJbyAhX9qW2L9Iz3JT+ k4qYd/Y9n4KwEeFAR4Mc9lIkWAyDWCtdes330gUmdRbl0sPTBzgHL3FGJImeJ34E72OF xU7O6KYcD8Y97r2q+S3GFbZZJxcaoImi96QE3q2xBrZ6jWlxUueyD4T3WUu0Q8INv0et upFEU5S7PVSBwPfn1+37QI76rxyF6m+gp4K5s/eHG+BmIpEqWuPGGAx/JOJdzaxlUib/ Y7KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IKLcQ9Drod0Pqxxja/fEstK7TNwfJBsfZgbXWlsmeK0=; b=i/lprLDJm2I3OQEO4PrI2LGO1BkoNMJFtgVDJeYOZhJ7kIGhpgJ06Rh/aFB8Pv6uQG He6K6JFmGYB/wgQHf2m/32FjvGKnLwQO3S0kJWhEyYFcY5L+dlwo5xi3IfNn/K/mp3ob R8FGexQQttVKn7vaGVEBhBucuyfRsuUaPB56jnWi4i1abhsle8JLYmsvlhulKC4qDCTz pCjBvsrtcWXkaUIPFm50UkuIyefrPeRct7+/HaFHHzehYxEZrHttxkfWbCpJSxZYE5Nm NpKVh1slRKySE7YCPkYoQE4hsXJt+V5HPt4AiaBznSxD4wENLBm7fIdMLjLvZgrdf4AL wp/Q== X-Gm-Message-State: AOAM5322xautDrcbLu9mz5Sb7HxscGFyt6KSFmbWuw/SNAKhUzK7T9I5 jGOaf3YkAdQ+szefX3IwMcx/XH0IwQDAE7/9mToUmKsbmQk= X-Google-Smtp-Source: ABdhPJxYoCwwx3k+VvB45fIzeVRQoZ8kKcRZnVZxDWNis4agcZsg9nW75qsn2C9q++vJDrXf+sI/wolY2uiS5b++H14= X-Received: by 2002:a05:6214:b69:b0:467:d42d:370a with SMTP id ey9-20020a0562140b6900b00467d42d370amr286735qvb.17.1654155953385; Thu, 02 Jun 2022 00:45:53 -0700 (PDT) MIME-Version: 1.0 References: <20220421141632.21676-1-ndabilpuram@marvell.com> In-Reply-To: <20220421141632.21676-1-ndabilpuram@marvell.com> From: Jerin Jacob Date: Thu, 2 Jun 2022 13:15:27 +0530 Message-ID: Subject: Re: [PATCH] examples/l3fwd: fix issue with MTU set on event mode To: Nithin Dabilpuram Cc: Jerin Jacob , dpdk-dev , Ferruh Yigit , dpdk stable Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Apr 21, 2022 at 7:47 PM Nithin Dabilpuram wrote: > > 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 Acked-by: Jerin Jacob > --- > 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 >