[PATCH v3 2/4] net/idpf: add splitq jumbo packet handling

Shetty, Praveen praveen.shetty at intel.com
Mon Sep 29 20:55:57 CEST 2025


On Tue, Sep 23, 2025 at 02:54:53PM +0200, Shetty, Praveen wrote:
> From: Praveen Shetty <praveen.shetty at intel.com>
> 
> This patch will add the jumbo packets handling in the 
> idpf_dp_splitq_recv_pkts function.
> 
> Signed-off-by: Praveen Shetty <praveen.shetty at intel.com>
> Signed-off-by: Dhananjay Shukla <dhananjay.shukla at intel.com>
> Signed-off-by: atulpatel261194 <Atul.Patel at intel.com>
> ---

One small comment inline below.

/Bruce

>  drivers/net/intel/idpf/idpf_common_rxtx.c | 50 
> ++++++++++++++++++-----
>  1 file changed, 40 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/intel/idpf/idpf_common_rxtx.c 
> b/drivers/net/intel/idpf/idpf_common_rxtx.c
> index eb25b091d8..412aff8f5f 100644
> --- a/drivers/net/intel/idpf/idpf_common_rxtx.c
> +++ b/drivers/net/intel/idpf/idpf_common_rxtx.c
> @@ -623,10 +623,12 @@ idpf_dp_splitq_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>  	volatile struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc_ring;
>  	volatile struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc;
>  	uint16_t pktlen_gen_bufq_id;
> -	struct idpf_rx_queue *rxq;
> +	struct idpf_rx_queue *rxq = rx_queue;
>  	const uint32_t *ptype_tbl;
>  	uint8_t status_err0_qw1;
>  	struct idpf_adapter *ad;
> +	struct rte_mbuf *first_seg = rxq->pkt_first_seg;
> +	struct rte_mbuf *last_seg = rxq->pkt_last_seg;
>  	struct rte_mbuf *rxm;
>  	uint16_t rx_id_bufq1;
>  	uint16_t rx_id_bufq2;
> @@ -659,6 +661,7 @@ idpf_dp_splitq_recv_pkts(void *rx_queue, struct 
> rte_mbuf **rx_pkts,
>  
>  		pktlen_gen_bufq_id =
>  			rte_le_to_cpu_16(rx_desc->pktlen_gen_bufq_id);
> +		status_err0_qw1 = rte_le_to_cpu_16(rx_desc->status_err0_qw1);
>  		gen_id = (pktlen_gen_bufq_id &
>  			  VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_M) >>
>  			VIRTCHNL2_RX_FLEX_DESC_ADV_GEN_S;
> @@ -697,16 +700,39 @@ idpf_dp_splitq_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>  		rxm->pkt_len = pkt_len;
>  		rxm->data_len = pkt_len;
>  		rxm->data_off = RTE_PKTMBUF_HEADROOM;
> +
> +		/*
> +		 * If this is the first buffer of the received packet, set the
> +		 * pointer to the first mbuf of the packet and initialize its
> +		 * context. Otherwise, update the total length and the number
> +		 * of segments of the current scattered packet, and update the
> +		 * pointer to the last mbuf of the current packet.
> +		 */
> +		if (!first_seg) {
> +			first_seg = rxm;
> +			first_seg->nb_segs = 1;
> +			first_seg->pkt_len = pkt_len;
> +		} else {
> +			first_seg->pkt_len =
> +					(uint16_t)(first_seg->pkt_len +
> +							pkt_len);

Since we allow 100 characters per line, does this line really need to be split into 3? [I realise this is a copy-paste from other drivers, but we can clean it up as new code here]
> thanks, will address this in v4.

> +			first_seg->nb_segs++;
> +			last_seg->next = rxm;
> +		}
> +
> +		if (!(status_err0_qw1 & (1 << VIRTCHNL2_RX_FLEX_DESC_ADV_STATUS0_EOF_S))) {
> +			last_seg = rxm;
> +			continue;
> +		}
> +
>  		rxm->next = NULL;
> -		rxm->nb_segs = 1;
> -		rxm->port = rxq->port_id;
> -		rxm->ol_flags = 0;
> -		rxm->packet_type =
> +		first_seg->port = rxq->port_id;
> +		first_seg->ol_flags = 0;
> +		first_seg->packet_type =
>  			ptype_tbl[(rte_le_to_cpu_16(rx_desc->ptype_err_fflags0) &
>  				   VIRTCHNL2_RX_FLEX_DESC_ADV_PTYPE_M) >>
>  				  VIRTCHNL2_RX_FLEX_DESC_ADV_PTYPE_S];
> -
> -		status_err0_qw1 = rx_desc->status_err0_qw1;
> +		status_err0_qw1 = rte_le_to_cpu_16(rx_desc->status_err0_qw1);
>  		pkt_flags = idpf_splitq_rx_csum_offload(status_err0_qw1);
>  		pkt_flags |= idpf_splitq_rx_rss_offload(rxm, rx_desc);
>  		if (idpf_timestamp_dynflag > 0 &&
> @@ -719,16 +745,20 @@ idpf_dp_splitq_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
>  			*RTE_MBUF_DYNFIELD(rxm,
>  					   idpf_timestamp_dynfield_offset,
>  					   rte_mbuf_timestamp_t *) = ts_ns;
> -			rxm->ol_flags |= idpf_timestamp_dynflag;
> +			first_seg->ol_flags |= idpf_timestamp_dynflag;
>  		}
>  
> -		rxm->ol_flags |= pkt_flags;
> +		first_seg->ol_flags |= pkt_flags;
>  
> -		rx_pkts[nb_rx++] = rxm;
> +		rx_pkts[nb_rx++] = first_seg;
> +
> +		first_seg = NULL;
>  	}
>  
>  	if (nb_rx > 0) {
>  		rxq->rx_tail = rx_id;
> +		rxq->pkt_first_seg = first_seg;
> +		rxq->pkt_last_seg = last_seg;
>  		if (rx_id_bufq1 != rxq->bufq1->rx_next_avail)
>  			rxq->bufq1->rx_next_avail = rx_id_bufq1;
>  		if (rx_id_bufq2 != rxq->bufq2->rx_next_avail)
> --
> 2.37.3
> 


More information about the dev mailing list