[Intel-wired-lan] [PATCH 08/10] igc: Replace IGC_TX_FLAGS_XDP flag by an enum

Andre Guedes andre.guedes at intel.com
Tue Dec 22 01:13:48 UTC 2020


Quoting Maciej Fijalkowski (2020-12-21 15:09:05)
> > @@ -191,10 +191,18 @@ static void igc_clean_tx_ring(struct igc_ring *tx_ring)
> >       while (i != tx_ring->next_to_use) {
> >               union igc_adv_tx_desc *eop_desc, *tx_desc;
> >  
> > -             if (tx_buffer->tx_flags & IGC_TX_FLAGS_XDP)
> > +             switch (tx_buffer->type) {
> > +             case IGC_TX_BUFFER_TYPE_XDP:
> >                       xdp_return_frame(tx_buffer->xdpf);
> > -             else
> > +                     break;
> > +             case IGC_TX_BUFFER_TYPE_SKB:
> >                       dev_kfree_skb_any(tx_buffer->skb);
> > +                     break;
> > +             default:
> > +                     netdev_warn_once(tx_ring->netdev,
> > +                                      "Unknown tx buffer type\n");
> > +                     break;
> > +             }
> 
> nit: you've been doing some effort in order to reduce the code duplication
> as much as it's possible, yet here you introduce duplicated code for that
> desc cleanup :p maybe add a little helper for that as well?

Note that the handling in IGC_TX_BUFFER_TYPE_SKB case is different in
igc_clean_tx_irq(): dev_kfree_skb_any() vs napi_consume_skb().


More information about the Intel-wired-lan mailing list