[PATCH] eventdev/eth_rx: fix timestamp field register in mbuf

Rahul Bhansali rbhansali at marvell.com
Wed Sep 20 18:17:29 CEST 2023



> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.harish.k at intel.com>
> Sent: Wednesday, September 20, 2023 6:03 PM
> To: Rahul Bhansali <rbhansali at marvell.com>; dev at dpdk.org; Jerin Jacob
> Kollanukkaran <jerinj at marvell.com>; Kundapura, Ganapati
> <ganapati.kundapura at intel.com>
> Cc: stable at dpdk.org
> Subject: [EXT] RE: [PATCH] eventdev/eth_rx: fix timestamp field register in mbuf
> 
> External Email
> 
> ----------------------------------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Rahul Bhansali <rbhansali at marvell.com>
> > Sent: Monday, September 18, 2023 1:56 PM
> > To: dev at dpdk.org; Naga Harish K, S V <s.v.naga.harish.k at intel.com>;
> > Jerin Jacob <jerinj at marvell.com>; Kundapura, Ganapati
> > <ganapati.kundapura at intel.com>
> > Cc: Rahul Bhansali <rbhansali at marvell.com>; stable at dpdk.org
> > Subject: [PATCH] eventdev/eth_rx: fix timestamp field register in mbuf
> >
> > For eventdev internal port, timestamp dynamic field registration in
> > mbuf is not required as that will be done from net device.
> > For SW eventdev, Rx timestamp field registration will be done during
> > Rx queue add operation as per device capabilities and offload configuration.
> >
> > Fixes: 83ab470d1259 ("eventdev/eth_rx: use timestamp as dynamic mbuf
> > field")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Rahul Bhansali <rbhansali at marvell.com>
> > ---
> >  lib/eventdev/rte_event_eth_rx_adapter.c | 19 ++++++++++++-------
> >  1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c
> > b/lib/eventdev/rte_event_eth_rx_adapter.c
> > index 3ebfa5366d..5a5fade466 100644
> > --- a/lib/eventdev/rte_event_eth_rx_adapter.c
> > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c
> > @@ -2472,13 +2472,6 @@ rxa_create(uint8_t id, uint8_t dev_id,
> >  	if (conf_cb == rxa_default_conf_cb)
> >  		rx_adapter->default_cb_arg = 1;
> >
> > -	if (rte_mbuf_dyn_rx_timestamp_register(
> > -			&event_eth_rx_timestamp_dynfield_offset,
> > -			&event_eth_rx_timestamp_dynflag) != 0) {
> > -		RTE_EDEV_LOG_ERR("Error registering timestamp field in
> > mbuf\n");
> > -		return -rte_errno;
> > -	}
> > -
> >  	rte_eventdev_trace_eth_rx_adapter_create(id, dev_id, conf_cb,
> >  		conf_arg);
> >  	return 0;
> > @@ -2738,6 +2731,7 @@ rte_event_eth_rx_adapter_queue_add(uint8_t id,
> >  					1);
> >  		}
> >  	} else {
> > +		uint64_t dev_offloads;
> >  		rte_spinlock_lock(&rx_adapter->rx_lock);
> >  		dev_info->internal_event_port = 0;
> >  		ret = rxa_init_service(rx_adapter, id); @@ -2749,6 +2743,17
> @@
> > rte_event_eth_rx_adapter_queue_add(uint8_t id,
> >  				rxa_sw_adapter_queue_count(rx_adapter));
> >  		}
> >  		rte_spinlock_unlock(&rx_adapter->rx_lock);
> > +
> > +		dev_offloads = dev_info->dev->data-
> > >dev_conf.rxmode.offloads;
> 
> This is a one-time operation and need not happen for every queue_add.
> Move this registration to "rxa_init_service()" function which executes only once
> for creating rte_service.
> 
> Also, no need to check for offload capabilities and directly do the registration
> inside Rxa_init_service as done before in rxa_create.
> Mbuf field is global to the entire application and need not be done based on
> ethdev offload capabilities.
> 
> 
Ack, will address and send v2.
 
> > +		if (dev_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
> > +			if (rte_mbuf_dyn_rx_timestamp_register(
> > +
> > 	&event_eth_rx_timestamp_dynfield_offset,
> > +
> > 	&event_eth_rx_timestamp_dynflag) != 0) {
> > +				RTE_EDEV_LOG_ERR("Error registering
> > timestamp field in mbuf\n");
> > +				return -rte_errno;
> > +			}
> > +		}
> > +
> >  	}
> >
> >  	rte_eventdev_trace_eth_rx_adapter_queue_add(id, eth_dev_id,
> > --
> > 2.25.1



More information about the stable mailing list