Skip to content

Commit a2b212a

Browse files
Jakub Kicinskidavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 878db9f commit a2b212a

File tree

1 file changed

+1
-4
lines changed
  • drivers/net/netdevsim

1 file changed

+1
-4
lines changed

drivers/net/netdevsim/bpf.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type,
135135
return -EOPNOTSUPP;
136136
}
137137

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))
139139
return -EOPNOTSUPP;
140140

141141
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,
144144
return -EOPNOTSUPP;
145145
}
146146

147-
if (cls_bpf->common.chain_index)
148-
return -EOPNOTSUPP;
149-
150147
if (!ns->bpf_tc_accept) {
151148
NSIM_EA(cls_bpf->common.extack,
152149
"netdevsim configured to reject BPF TC offload");

0 commit comments

Comments
 (0)