On Fri, Feb 06, 2026 at 10:47:11AM +0000, Loftus, Ciara wrote:
> > Subject: [PATCH v3 07/36] net/ice: refactor context descriptor handling
> > 
> > Create a single function to manage all context descriptor handling,
> > which returns either 0 or 1 depending on whether a descriptor is needed
> > or not, as well as returning directly the descriptor contents if
> > relevant.
> > 
> > Signed-off-by: Bruce Richardson <[email protected]>
> > ---
> >  drivers/net/intel/ice/ice_rxtx.c | 104 +++++++++++++++++--------------
> >  1 file changed, 57 insertions(+), 47 deletions(-)
> > 
> > diff --git a/drivers/net/intel/ice/ice_rxtx.c 
> > b/drivers/net/intel/ice/ice_rxtx.c
> > index 2a53b614b2..cc442fed75 100644
> > --- a/drivers/net/intel/ice/ice_rxtx.c
> > +++ b/drivers/net/intel/ice/ice_rxtx.c
> > @@ -2966,10 +2966,6 @@ ice_txd_enable_checksum(uint64_t ol_flags,
> >                     uint32_t *td_offset,
> >                     union ci_tx_offload tx_offload)
> >  {
> > -   /* Set MACLEN */
> > -   if (!(ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK))
> > -           *td_offset |= (tx_offload.l2_len >> 1)
> > -                   << CI_TX_DESC_LEN_MACLEN_S;
> > 
> >     /* Enable L3 checksum offloads */
> >     if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
> > @@ -3052,7 +3048,7 @@ ice_calc_context_desc(uint64_t flags)
> > 
> >  /* set ice TSO context descriptor */
> >  static inline uint64_t
> > -ice_set_tso_ctx(struct rte_mbuf *mbuf, union ci_tx_offload tx_offload)
> > +ice_set_tso_ctx(uint64_t ol_flags, const struct rte_mbuf *mbuf, union
> > ci_tx_offload tx_offload)
> >  {
> >     uint64_t ctx_desc = 0;
> >     uint32_t cd_cmd, hdr_len, cd_tso_len;
> > @@ -3063,7 +3059,7 @@ ice_set_tso_ctx(struct rte_mbuf *mbuf, union
> > ci_tx_offload tx_offload)
> >     }
> > 
> >     hdr_len = tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len;
> > -   hdr_len += (mbuf->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) ?
> > +   hdr_len += (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) ?
> >                tx_offload.outer_l2_len + tx_offload.outer_l3_len : 0;
> > 
> >     cd_cmd = CI_TX_CTX_DESC_TSO;
> > @@ -3075,6 +3071,49 @@ ice_set_tso_ctx(struct rte_mbuf *mbuf, union
> > ci_tx_offload tx_offload)
> >     return ctx_desc;
> >  }
> > 
> > +/* compute a context descriptor if one is necessary based on the ol_flags
> > + *
> > + * Returns 0 if no descriptor is necessary.
> > + * Returns 1 if one is necessary and the contents of the descriptor are
> > returned
> > + *   in the values pointed to by qw0 and qw1. td_offset may also be 
> > modified.
> 
> Regarding the comment above, "td_offset" is not a variable in this function, I
> assume the comment is obsolete.
> 

Yes, it was a parameter previously. Will fix

/Bruce

Reply via email to