From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: daniel@iogearbox.net, alexei.starovoitov@gmail.com
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH bpf-next 01/14] nfp: don't try to register XDP rxq structures on control queues
Date: Tue, 9 Jan 2018 21:07:29 -0800 [thread overview]
Message-ID: <20180110050742.26226-2-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180110050742.26226-1-jakub.kicinski@netronome.com>
Some RX rings are used for control messages, those will not have
a netdev pointer in dp. Skip XDP rxq handling on those rings.
Fixes: 7f1c684a8966 ("nfp: setup xdp_rxq_info")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 05e071b3dc5b..104d6c520a52 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2253,7 +2253,8 @@ static void nfp_net_rx_ring_free(struct nfp_net_rx_ring *rx_ring)
struct nfp_net_r_vector *r_vec = rx_ring->r_vec;
struct nfp_net_dp *dp = &r_vec->nfp_net->dp;
- xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
+ if (dp->netdev)
+ xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
kfree(rx_ring->rxbufs);
if (rx_ring->rxds)
@@ -2279,9 +2280,12 @@ nfp_net_rx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring)
{
int sz, err;
- err = xdp_rxq_info_reg(&rx_ring->xdp_rxq, dp->netdev, rx_ring->idx);
- if (err < 0)
- return err;
+ if (dp->netdev) {
+ err = xdp_rxq_info_reg(&rx_ring->xdp_rxq, dp->netdev,
+ rx_ring->idx);
+ if (err < 0)
+ return err;
+ }
rx_ring->cnt = dp->rxd_cnt;
rx_ring->size = sizeof(*rx_ring->rxds) * rx_ring->cnt;
--
2.15.1
next prev parent reply other threads:[~2018-01-10 5:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 5:07 [PATCH bpf-next 00/14] nfp: bpf: relocations, verifier log, signed jumps and other updates Jakub Kicinski
2018-01-10 5:07 ` Jakub Kicinski [this message]
2018-01-10 5:07 ` [PATCH bpf-next 02/14] nfp: fix incumbent kdoc warnings Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 03/14] nfp: bpf: round up the size of the stack Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 04/14] nfp: bpf: don't allow changing MTU above BPF offload limit when active Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 05/14] nfp: bpf: allow disabling TC offloads when XDP active Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 06/14] nfp: bpf: move jump resolution to jit.c Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 07/14] nfp: bpf: add helpers for modifying branch addresses Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 08/14] nfp: bpf: relocate jump targets just before the load Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 09/14] nfp: bpf: don't depend on high order allocations for program image Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 10/14] nfp: bpf: use a large constant in unresolved branches Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 11/14] nfp: hand over to BPF offload app at coarser granularity Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 12/14] nfp: bpf: add signed jump insns Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 13/14] bpf: export function to write into verifier log buffer Jakub Kicinski
2018-01-10 10:32 ` Daniel Borkmann
2018-01-10 12:25 ` Quentin Monnet
2018-01-10 18:58 ` Jakub Kicinski
2018-01-10 5:07 ` [PATCH bpf-next 14/14] nfp: bpf: reuse verifier log for debug messages Jakub Kicinski
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=20180110050742.26226-2-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).