[Intel-wired-lan] [PATCH v3 7/9] igc: Add initial XDP support

Maciej Fijalkowski maciej.fijalkowski at intel.com
Wed Nov 4 21:56:27 UTC 2020


On Tue, Nov 03, 2020 at 03:40:21PM -0800, Andre Guedes wrote:
> Quoting Maciej Fijalkowski (2020-11-02 10:07:00)
> > >  static int igc_clean_rx_irq(struct igc_q_vector *q_vector, const int budget)
> > >  {
> > >       unsigned int total_bytes = 0, total_packets = 0;
> > > @@ -1912,8 +1974,10 @@ static int igc_clean_rx_irq(struct igc_q_vector *q_vector, const int budget)
> > >               union igc_adv_rx_desc *rx_desc;
> > >               struct igc_rx_buffer *rx_buffer;
> > >               ktime_t timestamp = 0;
> > > +             struct xdp_buff xdp;
> > 
> > I'm wondering if this patch should zero-init the xdp_buff. There are two
> > pointers that are left untouched below (rxq/txq) so maybe bpf prog would
> > get some weird behavior if it would be touching them.
> 
> I see your point. While rxq is set by the next patch txq is not. I took a look
> at ice, i40e, ixgbe, and they don't seem to zero-init neither set txq so maybe
> that's OK.

To clear it up, txq in xdp_buff is explicitly set in dev_map_run_prog(),
which is sort of a xdp tx hook. That's why none of the driver has to do
that. Sorry for confusion :)


More information about the Intel-wired-lan mailing list