summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/bpf/main.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2018-01-10 15:25:58 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2018-01-10 15:49:35 +0300
commita0f30c97acb685d391f40c527ddaf542c13966af (patch)
tree1d2e5ff09a77539777074510b9f7dec010b239b8 /drivers/net/ethernet/netronome/nfp/bpf/main.c
parentccbdc596f4f6f6795956d46bb4b5f58c7e4bc3c8 (diff)
downloadlinux-a0f30c97acb685d391f40c527ddaf542c13966af.tar.xz
nfp: bpf: allow disabling TC offloads when XDP active
TC BPF offload was added first, so we used to assume that the ethtool TC HW offload flag cannot be touched whenever any BPF program is loaded on the NIC. This unncessarily limits changes to the TC flag when offloaded program is XDP. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/bpf/main.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/bpf/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c
index 978086580ca0..50b16b6cad0b 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/main.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c
@@ -191,7 +191,9 @@ static int nfp_bpf_setup_tc(struct nfp_app *app, struct net_device *netdev,
static bool nfp_bpf_tc_busy(struct nfp_app *app, struct nfp_net *nn)
{
- return nn->dp.ctrl & NFP_NET_CFG_CTRL_BPF;
+ struct nfp_bpf_vnic *bv = nn->app_priv;
+
+ return !!bv->tc_prog;
}
static int