> -----Original Message-----
> From: Richardson, Bruce <bruce.richard...@intel.com>
> Sent: Monday, February 7, 2022 9:46 PM
> To: Wang, Haiyue <haiyue.w...@intel.com>
> Cc: Zhou, YidingX <yidingx.z...@intel.com>; Yang, Qiming
> <qiming.y...@intel.com>; Zhang, Qi Z <qi.z.zh...@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH] net/ice: fix gcc error with -
> DRTE_LIBRTE_ICE_16BYTE_RX_DESC
> 
> On Mon, Feb 07, 2022 at 01:14:18PM +0000, Wang, Haiyue wrote:
> > > -----Original Message-----
> > > From: Yiding Zhou <yidingx.z...@intel.com>
> > > Sent: Tuesday, February 8, 2022 00:48
> > > To: Yang, Qiming <qiming.y...@intel.com>; Zhang, Qi Z
> > > <qi.z.zh...@intel.com>
> > > Cc: dev@dpdk.org
> > > Subject: [PATCH] net/ice: fix gcc error with
> > > -DRTE_LIBRTE_ICE_16BYTE_RX_DESC
> > >
> > > gcc will report error "unused parameter 'rxq'" when the macro
> > > RTE_LIBRTE_ICE_16BYTE_RX_DESC is defined. use "(void)rxq" to avoid
> > > it
> > >
> > > Fixes: 7a340b0b4e03 ("net/ice: refactor Rx FlexiMD handling")
> > > Cc: sta...@dpdk.org
> > >
> > > Signed-off-by: Yiding Zhou <yidingx.z...@intel.com>
> > > ---
> > >  drivers/net/ice/ice_rxtx.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
> > > index 58700f1b92..97572d5952 100644
> > > --- a/drivers/net/ice/ice_rxtx.c
> > > +++ b/drivers/net/ice/ice_rxtx.c
> > > @@ -163,6 +163,8 @@ ice_rxd_to_pkt_fields_by_comms_aux_v1(struct
> ice_rx_queue *rxq,
> > >                   *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb)
> = metadata;
> > >           }
> > >   }
> > > +#else
> > > + (void)rxq;
> > >  #endif
> > >  }
> > >
> > > @@ -201,6 +203,8 @@ ice_rxd_to_pkt_fields_by_comms_aux_v2(struct
> ice_rx_queue *rxq,
> > >                   *RTE_NET_ICE_DYNF_PROTO_XTR_METADATA(mb)
> = metadata;
> > >           }
> > >   }
> > > +#else
> > > + (void)rxq;
> > >  #endif
> > >  }
> > >
> >
> > " __rte_unused struct ice_rx_queue *rxq" could make the fix clean.
> >
> 
> +1
> 
> Or alternatively put in "RTE_SET_USED" macro after the endif. It doesn't
> generate any instructions so doesn't need a #else clause.
> 
Thanks for your advice. Using RTE_SET_USED macro is better.
> /Bruce

Reply via email to