]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
igb: Refactor igb_offload_cbs()
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Tue, 3 Jul 2018 22:42:57 +0000 (15:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jul 2018 13:30:28 +0000 (22:30 +0900)
Split code into a separate function (igb_offload_apply()) that will be
used by ETF offload implementation.

Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/igb/igb_main.c

index 8c90f1e51addf3b18eb3c8dfd3c2e0252301208e..c30ab7b260ccf76825e505894da2a13447b687c9 100644 (file)
@@ -2474,6 +2474,19 @@ igb_features_check(struct sk_buff *skb, struct net_device *dev,
        return features;
 }
 
+static void igb_offload_apply(struct igb_adapter *adapter, s32 queue)
+{
+       if (!is_fqtss_enabled(adapter)) {
+               enable_fqtss(adapter, true);
+               return;
+       }
+
+       igb_config_tx_modes(adapter, queue);
+
+       if (!is_any_cbs_enabled(adapter))
+               enable_fqtss(adapter, false);
+}
+
 static int igb_offload_cbs(struct igb_adapter *adapter,
                           struct tc_cbs_qopt_offload *qopt)
 {
@@ -2494,15 +2507,7 @@ static int igb_offload_cbs(struct igb_adapter *adapter,
        if (err)
                return err;
 
-       if (is_fqtss_enabled(adapter)) {
-               igb_config_tx_modes(adapter, qopt->queue);
-
-               if (!is_any_cbs_enabled(adapter))
-                       enable_fqtss(adapter, false);
-
-       } else {
-               enable_fqtss(adapter, true);
-       }
+       igb_offload_apply(adapter, qopt->queue);
 
        return 0;
 }