diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-01-25 17:00:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-25 21:23:08 -0500 |
commit | a2b212a507620fb0992e23f304e36d1a933e9d25 (patch) | |
tree | addd1af1989ee14bcbf355382e5f262a068e8048 /drivers/net/netdevsim/bpf.c | |
parent | 878db9f0f26df7674f6fc46f1c1c9390c99880ec (diff) |
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 <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/netdevsim/bpf.c')
-rw-r--r-- | drivers/net/netdevsim/bpf.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c index 8166f121bbcc..de73c1ff0939 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, | |||
135 | return -EOPNOTSUPP; | 135 | return -EOPNOTSUPP; |
136 | } | 136 | } |
137 | 137 | ||
138 | if (!tc_can_offload_extack(ns->netdev, cls_bpf->common.extack)) | 138 | if (!tc_cls_can_offload_and_chain0(ns->netdev, &cls_bpf->common)) |
139 | return -EOPNOTSUPP; | 139 | return -EOPNOTSUPP; |
140 | 140 | ||
141 | if (cls_bpf->common.protocol != htons(ETH_P_ALL)) { | 141 | 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, | |||
144 | return -EOPNOTSUPP; | 144 | return -EOPNOTSUPP; |
145 | } | 145 | } |
146 | 146 | ||
147 | if (cls_bpf->common.chain_index) | ||
148 | return -EOPNOTSUPP; | ||
149 | |||
150 | if (!ns->bpf_tc_accept) { | 147 | if (!ns->bpf_tc_accept) { |
151 | NSIM_EA(cls_bpf->common.extack, | 148 | NSIM_EA(cls_bpf->common.extack, |
152 | "netdevsim configured to reject BPF TC offload"); | 149 | "netdevsim configured to reject BPF TC offload"); |