Commit 8080e6ab authored by Jesus Sanchez-Palencia's avatar Jesus Sanchez-Palencia Committed by David S. Miller

igb: Refactor igb_offload_cbs()

Split code into a separate function (igb_offload_apply()) that will be
used by ETF offload implementation.
Signed-off-by: default avatarJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0364a0d0
...@@ -2474,6 +2474,19 @@ igb_features_check(struct sk_buff *skb, struct net_device *dev, ...@@ -2474,6 +2474,19 @@ igb_features_check(struct sk_buff *skb, struct net_device *dev,
return features; 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, static int igb_offload_cbs(struct igb_adapter *adapter,
struct tc_cbs_qopt_offload *qopt) struct tc_cbs_qopt_offload *qopt)
{ {
...@@ -2494,15 +2507,7 @@ static int igb_offload_cbs(struct igb_adapter *adapter, ...@@ -2494,15 +2507,7 @@ static int igb_offload_cbs(struct igb_adapter *adapter,
if (err) if (err)
return err; return err;
if (is_fqtss_enabled(adapter)) { igb_offload_apply(adapter, qopt->queue);
igb_config_tx_modes(adapter, qopt->queue);
if (!is_any_cbs_enabled(adapter))
enable_fqtss(adapter, false);
} else {
enable_fqtss(adapter, true);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment