diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-11-02 01:31:31 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-02 20:27:11 +0900 |
commit | f449657f83532807f388b9b99cf0c3f7be65eda9 (patch) | |
tree | 96ef7382ea1434c8b7f3677670856191fd5f2e55 /drivers/net/ethernet/netronome | |
parent | dc4646a950153242313ed340f0a404de38b21d5c (diff) | |
download | linux-f449657f83532807f388b9b99cf0c3f7be65eda9.tar.bz2 |
nfp: bpf: reject TC offload if XDP loaded
Recent TC changes dropped the check protecting us from trying
to offload a TC program if XDP programs are already loaded.
Fixes: 90d97315b3e7 ("nfp: bpf: Convert ndo_setup_tc offloads to block callbacks")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/bpf/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c index 04424db24b80..8e3e89cace8d 100644 --- a/drivers/net/ethernet/netronome/nfp/bpf/main.c +++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c @@ -130,6 +130,9 @@ static int nfp_bpf_setup_tc_block_cb(enum tc_setup_type type, cls_bpf->common.protocol != htons(ETH_P_ALL) || cls_bpf->common.chain_index) return -EOPNOTSUPP; + if (nn->dp.bpf_offload_xdp) + return -EBUSY; + return nfp_net_bpf_offload(nn, cls_bpf); default: return -EOPNOTSUPP; |