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

Maciej Fijalkowski maciej.fijalkowski at intel.com
Tue Dec 22 12:33:14 UTC 2020


On Mon, Dec 21, 2020 at 05:13:48PM -0800, Andre Guedes wrote:
> 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().

Yikes! Sorry, it was late.


More information about the Intel-wired-lan mailing list