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: 90d97315b3 ("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>
This commit is contained in:
Jakub Kicinski 2017-11-02 01:31:31 -07:00 коммит произвёл David S. Miller
Родитель dc4646a950
Коммит f449657f83
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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;