net/i40e: fix DCB initialization
Stopping LLDP is necessary for DPDK, but it will cause DCB init failure.
For kernel shared code, the prerequisite for successful initialization
of DCB is that LLDP is enabled. This patch starts LLDP before DCB init
and stops it when init finishes.
Fixes: a8e84b22bd
("net/i40e/base: support persistent LLDP")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
This commit is contained in:
parent
ba77f3e171
commit
b1eca6cc85
@ -11670,11 +11670,15 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
|
||||
* LLDP MIB change event.
|
||||
*/
|
||||
if (sw_dcb == TRUE) {
|
||||
if (i40e_need_stop_lldp(dev)) {
|
||||
ret = i40e_aq_stop_lldp(hw, TRUE, TRUE, NULL);
|
||||
if (ret != I40E_SUCCESS)
|
||||
PMD_INIT_LOG(DEBUG, "Failed to stop lldp");
|
||||
}
|
||||
/* Stopping lldp is necessary for DPDK, but it will cause
|
||||
* DCB init failed. For i40e_init_dcb(), the prerequisite
|
||||
* for successful initialization of DCB is that LLDP is
|
||||
* enabled. So it is needed to start lldp before DCB init
|
||||
* and stop it after initialization.
|
||||
*/
|
||||
ret = i40e_aq_start_lldp(hw, true, NULL);
|
||||
if (ret != I40E_SUCCESS)
|
||||
PMD_INIT_LOG(DEBUG, "Failed to start lldp");
|
||||
|
||||
ret = i40e_init_dcb(hw, true);
|
||||
/* If lldp agent is stopped, the return value from
|
||||
@ -11719,6 +11723,12 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb)
|
||||
ret, hw->aq.asq_last_status);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
if (i40e_need_stop_lldp(dev)) {
|
||||
ret = i40e_aq_stop_lldp(hw, true, true, NULL);
|
||||
if (ret != I40E_SUCCESS)
|
||||
PMD_INIT_LOG(DEBUG, "Failed to stop lldp");
|
||||
}
|
||||
} else {
|
||||
ret = i40e_aq_start_lldp(hw, true, NULL);
|
||||
if (ret != I40E_SUCCESS)
|
||||
|
Loading…
Reference in New Issue
Block a user