On Wed, 16 Oct 2019 12:09:00 +0200, Lorenzo Bianconi wrote: > > > +static int > > > +mvneta_xdp_xmit_back(struct mvneta_port *pp, struct xdp_buff *xdp) > > > +{ > > > + struct xdp_frame *xdpf = convert_to_xdp_frame(xdp); > > > + int cpu = smp_processor_id(); > > > + struct mvneta_tx_queue *txq; > > > + struct netdev_queue *nq; > > > + u32 ret; > > > + > > > + if (unlikely(!xdpf)) > > > + return MVNETA_XDP_CONSUMED; > > > > Personally I'd prefer you haven't called a function which return code > > has to be error checked in local variable init. > > do you mean moving cpu = smp_processor_id(); after the if condition?
[...] struct xdp_frame *xdpf; [...] xdpf = convert_to_xdp_frame(xdp); if (unlikely(!xdpf)) return MVNETA_XDP_CONSUMED; I meant xdpf, sorry to be unclear.