[...]

> >                             rx_desc->buf_phys_addr,
> >                             len, dma_dir);
> > -   if (data_len > 0 && sinfo->nr_frags < MAX_SKB_FRAGS) {
> > -           skb_frag_t *frag = &sinfo->frags[sinfo->nr_frags];
> > +   if (data_len > 0 && *nfrags < MAX_SKB_FRAGS) {
> > +           skb_frag_t *frag = &sinfo->frags[*nfrags];
> >             skb_frag_off_set(frag, pp->rx_offset_correction);
> >             skb_frag_size_set(frag, data_len);
> >             __skb_frag_set_page(frag, page);
> > -           sinfo->nr_frags++;
> > +           *nfrags = *nfrags + 1;
> 
> nit, why do you use nfrags variable instead of sinfo->nr_frags (as it was
> before this patch) ?
>                You doesn't seem to use the nfrags variable in the
> caller function and you update nr_frags as well.
>                If it's used in a different patch (haven't
> reviewed it all yet), maybe move it to that patch                ? (sorry in
> advance if I missed the logic here)

nfrags pointer is used to avoid the sinfo->nr_frags initialization in
mvneta_swbm_rx_frame() since skb_shared_info is not in the cache usually.
AFAIK the hw does not provide the info "this is the second descriptor" but
just "this the frist/last descriptor".

Regards,
Lorenzo

> 
> > +
> > +           if (rx_desc->status & MVNETA_RXD_LAST_DESC) {
> > +                   sinfo->nr_frags = *nfrags;
> > +                   xdp->mb = true;
> > +           }
> >             rx_desc->buf_phys_addr = 0;
> >               ...

Attachment: signature.asc
Description: PGP signature

Reply via email to