All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [bug report] igb: add XDP support
Date: Wed, 30 Sep 2020 17:29:25 +0300	[thread overview]
Message-ID: <20200930142925.GA650848@mwanda> (raw)

Hello Sven Auhagen,

The patch 9cbc948b5a20: "igb: add XDP support" from Sep 2, 2020,
leads to the following static checker warning:

	drivers/net/ethernet/intel/igb/igb_main.c:8427 igb_run_xdp()
	error: (-2147483647) too low for ERR_PTR

drivers/net/ethernet/intel/igb/igb_main.c
  2897  static int igb_xdp_xmit_back(struct igb_adapter *adapter, struct xdp_buff *xdp)
  2898  {
  2899          struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp);
  2900          int cpu = smp_processor_id();
  2901          struct igb_ring *tx_ring;
  2902          struct netdev_queue *nq;
  2903          u32 ret;
  2904  
  2905          if (unlikely(!xdpf))
  2906                  return IGB_XDP_CONSUMED;
  2907  
  2908          /* During program transitions its possible adapter->xdp_prog is assigned
  2909           * but ring has not been configured yet. In this case simply abort xmit.
  2910           */
  2911          tx_ring = adapter->xdp_prog ? igb_xdp_tx_queue_mapping(adapter) : NULL;
  2912          if (unlikely(!tx_ring))
  2913                  return -ENXIO;
                        ^^^^^^^^^^^^^^
This is only supposed to return error codes like IGB_XDP_CONSUMED.
The return here we get converted to a positive eventually it will
trigger an Oops, because it's no long an IS_ERR() nor a NULL.

  2914  
  2915          nq = txring_txq(tx_ring);
  2916          __netif_tx_lock(nq, cpu);
  2917          ret = igb_xmit_xdp_ring(adapter, tx_ring, xdpf);
  2918          __netif_tx_unlock(nq);
  2919  
  2920          return ret;
  2921  }

regards,
dan carpenter

                 reply	other threads:[~2020-09-30 14:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200930142925.GA650848@mwanda \
    --to=dan.carpenter@oracle.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.