From: Jakub Kicinski Date: Thu, 25 Jan 2018 22:00:44 +0000 (-0800) Subject: netdevsim: use tc_cls_can_offload_and_chain0() X-Git-Tag: v4.16-rc1~123^2~45^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2b212a507620fb0992e23f304e36d1a933e9d25;p=thirdparty%2Fkernel%2Flinux.git netdevsim: use tc_cls_can_offload_and_chain0() Make use of tc_cls_can_offload_and_chain0() to set extack msg in case ethtool tc offload flag is not set or chain unsupported. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c index 8166f121bbccd..de73c1ff09397 100644 --- a/drivers/net/netdevsim/bpf.c +++ b/drivers/net/netdevsim/bpf.c @@ -135,7 +135,7 @@ int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, return -EOPNOTSUPP; } - if (!tc_can_offload_extack(ns->netdev, cls_bpf->common.extack)) + if (!tc_cls_can_offload_and_chain0(ns->netdev, &cls_bpf->common)) return -EOPNOTSUPP; if (cls_bpf->common.protocol != htons(ETH_P_ALL)) { @@ -144,9 +144,6 @@ int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, return -EOPNOTSUPP; } - if (cls_bpf->common.chain_index) - return -EOPNOTSUPP; - if (!ns->bpf_tc_accept) { NSIM_EA(cls_bpf->common.extack, "netdevsim configured to reject BPF TC offload");