File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
drivers/net/ethernet/chelsio/cxgb4 Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -957,6 +957,7 @@ struct adapter {
957957 struct chcr_stats_debug chcr_stats ;
958958
959959 /* TC flower offload */
960+ bool tc_flower_initialized ;
960961 struct rhashtable flower_tbl ;
961962 struct rhashtable_params flower_ht_params ;
962963 struct timer_list flower_stats_timer ;
Original file line number Diff line number Diff line change @@ -874,6 +874,9 @@ int cxgb4_init_tc_flower(struct adapter *adap)
874874{
875875 int ret ;
876876
877+ if (adap -> tc_flower_initialized )
878+ return - EEXIST ;
879+
877880 adap -> flower_ht_params = cxgb4_tc_flower_ht_params ;
878881 ret = rhashtable_init (& adap -> flower_tbl , & adap -> flower_ht_params );
879882 if (ret )
@@ -882,13 +885,18 @@ int cxgb4_init_tc_flower(struct adapter *adap)
882885 INIT_WORK (& adap -> flower_stats_work , ch_flower_stats_handler );
883886 timer_setup (& adap -> flower_stats_timer , ch_flower_stats_cb , 0 );
884887 mod_timer (& adap -> flower_stats_timer , jiffies + STATS_CHECK_PERIOD );
888+ adap -> tc_flower_initialized = true;
885889 return 0 ;
886890}
887891
888892void cxgb4_cleanup_tc_flower (struct adapter * adap )
889893{
894+ if (!adap -> tc_flower_initialized )
895+ return ;
896+
890897 if (adap -> flower_stats_timer .function )
891898 del_timer_sync (& adap -> flower_stats_timer );
892899 cancel_work_sync (& adap -> flower_stats_work );
893900 rhashtable_destroy (& adap -> flower_tbl );
901+ adap -> tc_flower_initialized = false;
894902}
Original file line number Diff line number Diff line change @@ -539,6 +539,9 @@ void t4_cleanup_sched(struct adapter *adap)
539539 struct port_info * pi = netdev2pinfo (adap -> port [j ]);
540540
541541 s = pi -> sched_tbl ;
542+ if (!s )
543+ continue ;
544+
542545 for (i = 0 ; i < s -> sched_size ; i ++ ) {
543546 struct sched_class * e ;
544547
You can’t perform that action at this time.
0 commit comments