[Intel-wired-lan] [PATCH v2 08/10] igc: Add support for XDP_TX action
Andre Guedes
andre.guedes at intel.com
Fri Oct 30 00:00:13 UTC 2020
Quoting Maciej Fijalkowski (2020-10-29 07:30:09)
> > +
> > +struct igc_ring *igc_xdp_get_tx_ring(struct igc_adapter *adapter, int cpu)
> > +{
> > + int index = cpu;
> > +
> > + if (index >= adapter->num_tx_queues)
> > + index = index % adapter->num_tx_queues;
>
> So you kept modulos? :) I think you can simply substitute it with
> subtraction.
Did you mean something like:
while (index >= adapter->num_tx_queues)
index -= adapter->num_tx_queues
That should work too. I just followed the same approach we do in igb driver
here.
Thanks,
Andre
More information about the Intel-wired-lan
mailing list