All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH 04/10] igc: Refactor XDP rxq info registration
Date: Mon, 21 Dec 2020 17:13:30 -0800	[thread overview]
Message-ID: <160859961079.45139.12880409788363593695@bgdudka-mobl.amr.corp.intel.com> (raw)
In-Reply-To: <20201221225345.GB2943@ranger.igk.intel.com>

Quoting Maciej Fijalkowski (2020-12-21 14:53:45)
> > @@ -460,9 +460,12 @@ int igc_setup_rx_resources(struct igc_ring *rx_ring)
> >       struct device *dev = rx_ring->dev;
> >       int size, desc_len, res;
> >  
> > -     res = igc_xdp_register_rxq_info(rx_ring);
> > -     if (res < 0)
> > +     res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, ndev, rx_ring->queue_index,
> > +                            0);
> > +     if (res < 0) {
> > +             netdev_err(ndev, "Failed to register xdp rxq info\n");
> 
> Maybe print out q idx?

I'll add that.

> > @@ -536,6 +539,9 @@ static void igc_configure_rx_ring(struct igc_adapter *adapter,
> >       u32 srrctl = 0, rxdctl = 0;
> >       u64 rdba = ring->dma;
> >  
> > +     WARN_ON(xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
> > +                                        MEM_TYPE_PAGE_SHARED, NULL));
> 
> You should do the unroll in case it fails just like it was done in
> igc_xdp_register_rxq_info.

This was inspired in ixgbe driver.

The only reason xdp_rxq_info_reg_mem_model() could fail here is if xdp_rxq
wasn't registered. However, this is very unlikely to happen since it is
registered in igc_setup_rx_resources() which is always called before
igc_configure_rx_ring(). The WARN_ON() macro is used just in case.

If we really want to unroll, we should propagate the error back in the call
chain, changing the returning type of igc_configure_rx_ring() as well as the
other functions in the call chain, so the unrolling is done in the proper
place.

IMO, such change isn't worth it. It seems like a lot of change to cover a case
that is never expected. WARN_ON() sound more suitable in those cases. Also,
ixgbe is around for quite some time and this doesn't seem to be an issue.

  reply	other threads:[~2020-12-22  1:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 20:24 [Intel-wired-lan] [PATCH 00/10] igc: Add support for AF_XDP zero-copy Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 01/10] igc: Move igc_xdp_is_enabled() Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 02/10] igc: Refactor igc_xdp_run_prog() Andre Guedes
2020-12-21 22:45   ` Maciej Fijalkowski
2020-12-22  1:12     ` Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 03/10] igc: Refactor igc_clean_rx_ring() Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 04/10] igc: Refactor XDP rxq info registration Andre Guedes
2020-12-21 22:53   ` Maciej Fijalkowski
2020-12-22  1:13     ` Andre Guedes [this message]
2020-12-22 12:32       ` Maciej Fijalkowski
2020-12-22 17:43         ` Andre Guedes
2020-12-22 20:59           ` Maciej Fijalkowski
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 05/10] igc: Introduce igc_update_rx_stats() Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 06/10] igc: Introduce igc_update_tx_stats() Andre Guedes
2020-12-21 22:58   ` Maciej Fijalkowski
2020-12-22  1:13     ` Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 07/10] igc: Introduce igc_unmap_tx_buffer() helper Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 08/10] igc: Replace IGC_TX_FLAGS_XDP flag by an enum Andre Guedes
2020-12-21 23:09   ` Maciej Fijalkowski
2020-12-22  1:13     ` Andre Guedes
2020-12-22 12:33       ` Maciej Fijalkowski
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 09/10] igc: Enable RX via AF_XDP zero-copy Andre Guedes
2020-12-22 13:14   ` Maciej Fijalkowski
2020-12-22 17:43     ` Andre Guedes
2020-12-22 20:59       ` Maciej Fijalkowski
2020-12-23 19:27         ` Andre Guedes
2020-12-17 20:24 ` [Intel-wired-lan] [PATCH 10/10] igc: Enable TX " Andre Guedes
2020-12-22 14:16   ` Maciej Fijalkowski
2020-12-22 14:20 ` [Intel-wired-lan] [PATCH 00/10] igc: Add support for " Maciej Fijalkowski
2020-12-22 17:43   ` Andre Guedes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160859961079.45139.12880409788363593695@bgdudka-mobl.amr.corp.intel.com \
    --to=andre.guedes@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.