sfc: Cleanup Falcon-arch simple MAC filter state
On Falcon we implement MAC filtering requested by the stack using the MAC wrapper's single unicast filter and multicast hash filter. Siena is very similar, though MAC configuration is mediated by the MC. Since MCDI operations may sleep, reconfiguration is deferred from ndo_set_rx_mode to a work item. However, it still updates the private variables describing the filter state synchronously. Contrary to comments, the later use of these variables is not protected using the address lock, resulting in race conditions. Move the state update to a new function efx_farch_filter_sync_rx_mode() and make the Falcon-arch MAC configuration functions call that, so that its use is consistently serialised by the mac_lock. Invert and rename the promiscuous flag to the more accurate unicast_filter, and comment that both this and multicast_hash are not used on EF10. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
@@ -764,7 +764,7 @@ static void falcon_reconfigure_xmac_core(struct efx_nic *efx)
|
||||
FRF_AB_XM_RXEN, 1,
|
||||
FRF_AB_XM_AUTO_DEPAD, 0,
|
||||
FRF_AB_XM_ACPT_ALL_MCAST, 1,
|
||||
FRF_AB_XM_ACPT_ALL_UCAST, efx->promiscuous,
|
||||
FRF_AB_XM_ACPT_ALL_UCAST, !efx->unicast_filter,
|
||||
FRF_AB_XM_PASS_CRC_ERR, 1);
|
||||
efx_writeo(efx, ®, FR_AB_XM_RX_CFG);
|
||||
|
||||
@@ -864,6 +864,8 @@ static int falcon_reconfigure_xmac(struct efx_nic *efx)
|
||||
{
|
||||
struct falcon_nic_data *nic_data = efx->nic_data;
|
||||
|
||||
efx_farch_filter_sync_rx_mode(efx);
|
||||
|
||||
falcon_reconfigure_xgxs_core(efx);
|
||||
falcon_reconfigure_xmac_core(efx);
|
||||
|
||||
@@ -1081,7 +1083,7 @@ static void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
|
||||
EFX_POPULATE_OWORD_5(reg,
|
||||
FRF_AB_MAC_XOFF_VAL, 0xffff /* max pause time */,
|
||||
FRF_AB_MAC_BCAD_ACPT, 1,
|
||||
FRF_AB_MAC_UC_PROM, efx->promiscuous,
|
||||
FRF_AB_MAC_UC_PROM, !efx->unicast_filter,
|
||||
FRF_AB_MAC_LINK_STATUS, 1, /* always set */
|
||||
FRF_AB_MAC_SPEED, link_speed);
|
||||
/* On B0, MAC backpressure can be disabled and packets get
|
||||
|
Reference in New Issue
Block a user