summaryrefslogtreecommitdiff
path: root/service/src/phydev.c
diff options
context:
space:
mode:
Diffstat (limited to 'service/src/phydev.c')
-rw-r--r--service/src/phydev.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/service/src/phydev.c b/service/src/phydev.c
index fe4fd04..92edbed 100644
--- a/service/src/phydev.c
+++ b/service/src/phydev.c
@@ -462,14 +462,16 @@ static int phydev_setup(struct sc_main * sc, struct phydev_main * ctx, struct ph
Check this NIC can support hairpin or not.
The SmartOffload can not use when hairpin mode is unavailable.
*/
-
- struct rte_eth_hairpin_cap hairpin_cap = {};
- retval = rte_eth_dev_hairpin_capability_get(dev->port_id, &hairpin_cap);
- if (unlikely(retval != 0))
+ if (dev->en_smartoffload )
{
- MR_ERROR("device %s hairpin mode is unavliable, SmartOffload can not be enabled: retval = %d, %s", dev->symbol,
- retval, rte_strerror(retval));
- return RT_ERR;
+ struct rte_eth_hairpin_cap hairpin_cap = {};
+ retval = rte_eth_dev_hairpin_capability_get(dev->port_id, &hairpin_cap);
+ if (unlikely(retval != 0))
+ {
+ MR_ERROR("device %s hairpin mode is unavliable, SmartOffload can not be enabled: retval = %d, %s", dev->symbol,
+ retval, rte_strerror(retval));
+ return RT_ERR;
+ }
}
/*