Skip to content

Commit

Permalink
i40e: Remove LLDP frame filters
Browse files Browse the repository at this point in the history
[ Upstream commit 8085a36 ]

Remove filters from being setup in case of software DCB and allow the
LLDP frames to be properly transmitted to the wire.

It is not possible to transmit the LLDP frame out of the port, if they
are filtered by control VSI. This prohibits software LLDP agent
properly communicate its DCB capabilities to the neighbors.

Fixes: 4b208ea ("i40e: Add init and default config of software based DCB")
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Imam Hassan Reza Biswas <imam.hassan.reza.biswas@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kubalewski authored and gregkh committed May 19, 2021
1 parent bd4febf commit ca1fff5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e.h
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,6 @@ static inline bool i40e_is_sw_dcb(struct i40e_pf *pf)
return !!(pf->flags & I40E_FLAG_DISABLE_FW_LLDP);
}

void i40e_set_lldp_forwarding(struct i40e_pf *pf, bool enable);
#ifdef CONFIG_I40E_DCB
void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
struct i40e_dcbx_config *old_cfg,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -5288,7 +5288,6 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
i40e_aq_cfg_lldp_mib_change_event(&pf->hw, false, NULL);
i40e_aq_stop_lldp(&pf->hw, true, false, NULL);
} else {
i40e_set_lldp_forwarding(pf, false);
status = i40e_aq_start_lldp(&pf->hw, false, NULL);
if (status) {
adq_err = pf->hw.aq.asq_last_status;
Expand Down
42 changes: 0 additions & 42 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6878,40 +6878,6 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
}
#endif /* CONFIG_I40E_DCB */

/**
* i40e_set_lldp_forwarding - set forwarding of lldp frames
* @pf: PF being configured
* @enable: if forwarding to OS shall be enabled
*
* Toggle forwarding of lldp frames behavior,
* When passing DCB control from firmware to software
* lldp frames must be forwarded to the software based
* lldp agent.
*/
void i40e_set_lldp_forwarding(struct i40e_pf *pf, bool enable)
{
if (pf->lan_vsi == I40E_NO_VSI)
return;

if (!pf->vsi[pf->lan_vsi])
return;

/* No need to check the outcome, commands may fail
* if desired value is already set
*/
i40e_aq_add_rem_control_packet_filter(&pf->hw, NULL, ETH_P_LLDP,
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX |
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC,
pf->vsi[pf->lan_vsi]->seid, 0,
enable, NULL, NULL);

i40e_aq_add_rem_control_packet_filter(&pf->hw, NULL, ETH_P_LLDP,
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX |
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC,
pf->vsi[pf->lan_vsi]->seid, 0,
enable, NULL, NULL);
}

/**
* i40e_print_link_message - print link up or down
* @vsi: the VSI for which link needs a message
Expand Down Expand Up @@ -10735,10 +10701,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
*/
i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
pf->main_vsi_seid);
#ifdef CONFIG_I40E_DCB
if (pf->flags & I40E_FLAG_DISABLE_FW_LLDP)
i40e_set_lldp_forwarding(pf, true);
#endif /* CONFIG_I40E_DCB */

/* restart the VSIs that were rebuilt and running before the reset */
i40e_pf_unquiesce_all_vsi(pf);
Expand Down Expand Up @@ -15753,10 +15715,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
pf->main_vsi_seid);
#ifdef CONFIG_I40E_DCB
if (pf->flags & I40E_FLAG_DISABLE_FW_LLDP)
i40e_set_lldp_forwarding(pf, true);
#endif /* CONFIG_I40E_DCB */

if ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||
(pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))
Expand Down

0 comments on commit ca1fff5

Please sign in to comment.