@@ -672,25 +672,29 @@ static int tcf_block_offload_cmd(struct tcf_block *block,
672
672
struct netlink_ext_ack * extack )
673
673
{
674
674
struct flow_block_offload bo = {};
675
- int err ;
676
675
677
676
tcf_block_offload_init (& bo , dev , command , ei -> binder_type ,
678
677
& block -> flow_block , tcf_block_shared (block ),
679
678
extack );
680
679
681
- if (dev -> netdev_ops -> ndo_setup_tc )
680
+ if (dev -> netdev_ops -> ndo_setup_tc ) {
681
+ int err ;
682
+
682
683
err = dev -> netdev_ops -> ndo_setup_tc (dev , TC_SETUP_BLOCK , & bo );
683
- else
684
- err = flow_indr_dev_setup_offload (dev , TC_SETUP_BLOCK , block ,
685
- & bo , tc_block_indr_cleanup );
684
+ if (err < 0 ) {
685
+ if (err != - EOPNOTSUPP )
686
+ NL_SET_ERR_MSG (extack , "Driver ndo_setup_tc failed" );
687
+ return err ;
688
+ }
686
689
687
- if (err < 0 ) {
688
- if (err != - EOPNOTSUPP )
689
- NL_SET_ERR_MSG (extack , "Driver ndo_setup_tc failed" );
690
- return err ;
690
+ return tcf_block_setup (block , & bo );
691
691
}
692
692
693
- return tcf_block_setup (block , & bo );
693
+ flow_indr_dev_setup_offload (dev , TC_SETUP_BLOCK , block , & bo ,
694
+ tc_block_indr_cleanup );
695
+ tcf_block_setup (block , & bo );
696
+
697
+ return - EOPNOTSUPP ;
694
698
}
695
699
696
700
static int tcf_block_offload_bind (struct tcf_block * block , struct Qdisc * q ,
0 commit comments