diff options
| author | songyanchao <[email protected]> | 2022-04-12 22:31:04 -0400 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2022-04-12 22:31:04 -0400 |
| commit | 0fe6ba8867e8cfc141c22c8a2f9d6479b2b137e7 (patch) | |
| tree | 9f95a60c9246622f36939cec122b60fca6a65706 /service/src/phydev.c | |
| parent | d9c07e3a7a177586e20a00786798f38848b5ebbb (diff) | |
🎈 perf(TSG-10204): 完善SmartOffload功能开关v4.5.1-20220413
完善SmartOffload功能开关
https://jira.geedge.net/browse/TSG-10204?filter=-1
Diffstat (limited to 'service/src/phydev.c')
| -rw-r--r-- | service/src/phydev.c | 16 |
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; + } } /* |
