DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/l3fwd: fix issue with MTU set on event mode
@ 2022-04-21 14:16 Nithin Dabilpuram
  2022-06-02  7:45 ` Jerin Jacob
  0 siblings, 1 reply; 4+ messages in thread
From: Nithin Dabilpuram @ 2022-04-21 14:16 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Nithin Dabilpuram, ferruh.yigit, stable

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 <ndabilpuram@marvell.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/l3fwd: fix issue with MTU set on event mode
  2022-04-21 14:16 [PATCH] examples/l3fwd: fix issue with MTU set on event mode Nithin Dabilpuram
@ 2022-06-02  7:45 ` Jerin Jacob
  2022-07-18 14:30   ` Nithin Kumar Dabilpuram
  2022-10-10 21:55   ` Thomas Monjalon
  0 siblings, 2 replies; 4+ messages in thread
From: Jerin Jacob @ 2022-06-02  7:45 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: Jerin Jacob, dpdk-dev, Ferruh Yigit, dpdk stable

On Thu, Apr 21, 2022 at 7:47 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> 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 <ndabilpuram@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
>  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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/l3fwd: fix issue with MTU set on event mode
  2022-06-02  7:45 ` Jerin Jacob
@ 2022-07-18 14:30   ` Nithin Kumar Dabilpuram
  2022-10-10 21:55   ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Nithin Kumar Dabilpuram @ 2022-07-18 14:30 UTC (permalink / raw)
  To: Jerin Jacob, thomas; +Cc: Jerin Jacob, dpdk-dev, Ferruh Yigit, dpdk stable

Ping.

On 2022-06-02 1:15 PM, Jerin Jacob wrote:
> On Thu, Apr 21, 2022 at 7:47 PM Nithin Dabilpuram
> <ndabilpuram@marvell.com> 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 <ndabilpuram@marvell.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> 
> 
>> ---
>>   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
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/l3fwd: fix issue with MTU set on event mode
  2022-06-02  7:45 ` Jerin Jacob
  2022-07-18 14:30   ` Nithin Kumar Dabilpuram
@ 2022-10-10 21:55   ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2022-10-10 21:55 UTC (permalink / raw)
  To: Nithin Dabilpuram
  Cc: stable, Jerin Jacob, dpdk-dev, Ferruh Yigit, Jerin Jacob

02/06/2022 09:45, Jerin Jacob:
> On Thu, Apr 21, 2022 at 7:47 PM Nithin Dabilpuram
> <ndabilpuram@marvell.com> 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 <ndabilpuram@marvell.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-10 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 14:16 [PATCH] examples/l3fwd: fix issue with MTU set on event mode Nithin Dabilpuram
2022-06-02  7:45 ` Jerin Jacob
2022-07-18 14:30   ` Nithin Kumar Dabilpuram
2022-10-10 21:55   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).