Commit f449657f authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

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: 90d97315 ("nfp: bpf: Convert ndo_setup_tc offloads to block callbacks")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc4646a9
...@@ -130,6 +130,9 @@ static int nfp_bpf_setup_tc_block_cb(enum tc_setup_type type, ...@@ -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.protocol != htons(ETH_P_ALL) ||
cls_bpf->common.chain_index) cls_bpf->common.chain_index)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (nn->dp.bpf_offload_xdp)
return -EBUSY;
return nfp_net_bpf_offload(nn, cls_bpf); return nfp_net_bpf_offload(nn, cls_bpf);
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment