@@ -3574,6 +3574,34 @@ static void iavf_del_all_cloud_filters(struct iavf_adapter *adapter)
3574
3574
spin_unlock_bh (& adapter -> cloud_filter_list_lock );
3575
3575
}
3576
3576
3577
+ /**
3578
+ * iavf_is_tc_config_same - Compare the mqprio TC config with the
3579
+ * TC config already configured on this adapter.
3580
+ * @adapter: board private structure
3581
+ * @mqprio_qopt: TC config received from kernel.
3582
+ *
3583
+ * This function compares the TC config received from the kernel
3584
+ * with the config already configured on the adapter.
3585
+ *
3586
+ * Return: True if configuration is same, false otherwise.
3587
+ **/
3588
+ static bool iavf_is_tc_config_same (struct iavf_adapter * adapter ,
3589
+ struct tc_mqprio_qopt * mqprio_qopt )
3590
+ {
3591
+ struct virtchnl_channel_info * ch = & adapter -> ch_config .ch_info [0 ];
3592
+ int i ;
3593
+
3594
+ if (adapter -> num_tc != mqprio_qopt -> num_tc )
3595
+ return false;
3596
+
3597
+ for (i = 0 ; i < adapter -> num_tc ; i ++ ) {
3598
+ if (ch [i ].count != mqprio_qopt -> count [i ] ||
3599
+ ch [i ].offset != mqprio_qopt -> offset [i ])
3600
+ return false;
3601
+ }
3602
+ return true;
3603
+ }
3604
+
3577
3605
/**
3578
3606
* __iavf_setup_tc - configure multiple traffic classes
3579
3607
* @netdev: network interface device structure
@@ -3631,7 +3659,7 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)
3631
3659
if (ret )
3632
3660
return ret ;
3633
3661
/* Return if same TC config is requested */
3634
- if (adapter -> num_tc == num_tc )
3662
+ if (iavf_is_tc_config_same ( adapter , & mqprio_qopt -> qopt ) )
3635
3663
return 0 ;
3636
3664
adapter -> num_tc = num_tc ;
3637
3665
0 commit comments