aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/mcdi_port.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-11-19 23:08:22 +0000
committerBen Hutchings <bhutchings@solarflare.com>2013-08-22 19:26:02 +0100
commit964e61355e94905e4234839d4b41678998d617b7 (patch)
tree317a5e30a89b07eabaa9376bbbb00d574fce4df2 /drivers/net/ethernet/sfc/mcdi_port.c
parentsfc: Define and use MCDI_POPULATE_DWORD_{1,2,3,4,5,6,7} (diff)
downloadlinux-dev-964e61355e94905e4234839d4b41678998d617b7.tar.xz
linux-dev-964e61355e94905e4234839d4b41678998d617b7.zip
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>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi_port.c')
-rw-r--r--drivers/net/ethernet/sfc/mcdi_port.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi_port.c b/drivers/net/ethernet/sfc/mcdi_port.c
index 30e8a1936fc2..42d52f34ad79 100644
--- a/drivers/net/ethernet/sfc/mcdi_port.c
+++ b/drivers/net/ethernet/sfc/mcdi_port.c
@@ -861,7 +861,7 @@ void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev)
int efx_mcdi_set_mac(struct efx_nic *efx)
{
- u32 reject, fcntl;
+ u32 fcntl;
MCDI_DECLARE_BUF(cmdbytes, MC_CMD_SET_MAC_IN_LEN);
BUILD_BUG_ON(MC_CMD_SET_MAC_OUT_LEN != 0);
@@ -873,12 +873,9 @@ int efx_mcdi_set_mac(struct efx_nic *efx)
EFX_MAX_FRAME_LEN(efx->net_dev->mtu));
MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_DRAIN, 0);
- /* The MCDI command provides for controlling accept/reject
- * of broadcast packets too, but the driver doesn't currently
- * expose this. */
- reject = (efx->promiscuous) ? 0 :
- (1 << MC_CMD_SET_MAC_IN_REJECT_UNCST_LBN);
- MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_REJECT, reject);
+ /* Set simple MAC filter for Siena */
+ MCDI_POPULATE_DWORD_1(cmdbytes, SET_MAC_IN_REJECT,
+ SET_MAC_IN_REJECT_UNCST, efx->unicast_filter);
switch (efx->wanted_fc) {
case EFX_FC_RX | EFX_FC_TX: