aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-09-13 14:47:48 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-01-26 19:10:48 -0500
commit30b81cda9516878906b44fed16aac9df1dbb89c7 (patch)
treee3e7f48c69176373d6ffb9406f5ac6ec7b8ed7e4
parent1daf417029ddc10b7854430c1e1118df791d0eaf (diff)
sfc: Remove efx_nic_type::push_multicast_hash operation
Both implementations of efx_nic_type::reconfigure_mac operation push the multicast hash filter to the hardware. It is therefore redundant to call efx_nic_type::push_multicast_hash as well. efx_mcdi_mac_reconfigure() also uses this operation, but the implementation for Siena just uses MCDI anyway. Merge that into efx_mcdi_mac_reconfigure(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.c5
-rw-r--r--drivers/net/ethernet/sfc/falcon.c2
-rw-r--r--drivers/net/ethernet/sfc/mcdi_mac.c10
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h5
-rw-r--r--drivers/net/ethernet/sfc/siena.c10
5 files changed, 9 insertions, 23 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 1d20e01c6aea..de162474c3c5 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -898,10 +898,8 @@ static void efx_mac_work(struct work_struct *data)
898 struct efx_nic *efx = container_of(data, struct efx_nic, mac_work); 898 struct efx_nic *efx = container_of(data, struct efx_nic, mac_work);
899 899
900 mutex_lock(&efx->mac_lock); 900 mutex_lock(&efx->mac_lock);
901 if (efx->port_enabled) { 901 if (efx->port_enabled)
902 efx->type->push_multicast_hash(efx);
903 efx->type->reconfigure_mac(efx); 902 efx->type->reconfigure_mac(efx);
904 }
905 mutex_unlock(&efx->mac_lock); 903 mutex_unlock(&efx->mac_lock);
906} 904}
907 905
@@ -968,7 +966,6 @@ static void efx_start_port(struct efx_nic *efx)
968 966
969 /* efx_mac_work() might have been scheduled after efx_stop_port(), 967 /* efx_mac_work() might have been scheduled after efx_stop_port(),
970 * and then cancelled by efx_flush_all() */ 968 * and then cancelled by efx_flush_all() */
971 efx->type->push_multicast_hash(efx);
972 efx->type->reconfigure_mac(efx); 969 efx->type->reconfigure_mac(efx);
973 970
974 mutex_unlock(&efx->mac_lock); 971 mutex_unlock(&efx->mac_lock);
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c
index 1a8a316bb538..fe21c7e349b6 100644
--- a/drivers/net/ethernet/sfc/falcon.c
+++ b/drivers/net/ethernet/sfc/falcon.c
@@ -1766,7 +1766,6 @@ const struct efx_nic_type falcon_a1_nic_type = {
1766 .stop_stats = falcon_stop_nic_stats, 1766 .stop_stats = falcon_stop_nic_stats,
1767 .set_id_led = falcon_set_id_led, 1767 .set_id_led = falcon_set_id_led,
1768 .push_irq_moderation = falcon_push_irq_moderation, 1768 .push_irq_moderation = falcon_push_irq_moderation,
1769 .push_multicast_hash = falcon_push_multicast_hash,
1770 .reconfigure_port = falcon_reconfigure_port, 1769 .reconfigure_port = falcon_reconfigure_port,
1771 .reconfigure_mac = falcon_reconfigure_xmac, 1770 .reconfigure_mac = falcon_reconfigure_xmac,
1772 .check_mac_fault = falcon_xmac_check_fault, 1771 .check_mac_fault = falcon_xmac_check_fault,
@@ -1809,7 +1808,6 @@ const struct efx_nic_type falcon_b0_nic_type = {
1809 .stop_stats = falcon_stop_nic_stats, 1808 .stop_stats = falcon_stop_nic_stats,
1810 .set_id_led = falcon_set_id_led, 1809 .set_id_led = falcon_set_id_led,
1811 .push_irq_moderation = falcon_push_irq_moderation, 1810 .push_irq_moderation = falcon_push_irq_moderation,
1812 .push_multicast_hash = falcon_push_multicast_hash,
1813 .reconfigure_port = falcon_reconfigure_port, 1811 .reconfigure_port = falcon_reconfigure_port,
1814 .reconfigure_mac = falcon_reconfigure_xmac, 1812 .reconfigure_mac = falcon_reconfigure_xmac,
1815 .check_mac_fault = falcon_xmac_check_fault, 1813 .check_mac_fault = falcon_xmac_check_fault,
diff --git a/drivers/net/ethernet/sfc/mcdi_mac.c b/drivers/net/ethernet/sfc/mcdi_mac.c
index 559d79861faf..f67cf921bd1b 100644
--- a/drivers/net/ethernet/sfc/mcdi_mac.c
+++ b/drivers/net/ethernet/sfc/mcdi_mac.c
@@ -115,12 +115,14 @@ int efx_mcdi_mac_reconfigure(struct efx_nic *efx)
115{ 115{
116 int rc; 116 int rc;
117 117
118 WARN_ON(!mutex_is_locked(&efx->mac_lock));
119
118 rc = efx_mcdi_set_mac(efx); 120 rc = efx_mcdi_set_mac(efx);
119 if (rc != 0) 121 if (rc != 0)
120 return rc; 122 return rc;
121 123
122 /* Restore the multicast hash registers. */ 124 return efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
123 efx->type->push_multicast_hash(efx); 125 efx->multicast_hash.byte,
124 126 sizeof(efx->multicast_hash),
125 return 0; 127 NULL, 0, NULL);
126} 128}
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index aa5a321a1419..a88e95f58b0a 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -826,9 +826,9 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)
826 * @stop_stats: Stop the regular fetching of statistics 826 * @stop_stats: Stop the regular fetching of statistics
827 * @set_id_led: Set state of identifying LED or revert to automatic function 827 * @set_id_led: Set state of identifying LED or revert to automatic function
828 * @push_irq_moderation: Apply interrupt moderation value 828 * @push_irq_moderation: Apply interrupt moderation value
829 * @push_multicast_hash: Apply multicast hash table
830 * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY 829 * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY
831 * @reconfigure_mac: Reconfigure MAC only. Serialised by the mac_lock 830 * @reconfigure_mac: Push MAC address, MTU, flow control and filter settings
831 * to the hardware. Serialised by the mac_lock.
832 * @check_mac_fault: Check MAC fault state. True if fault present. 832 * @check_mac_fault: Check MAC fault state. True if fault present.
833 * @get_wol: Get WoL configuration from driver state 833 * @get_wol: Get WoL configuration from driver state
834 * @set_wol: Push WoL configuration to the NIC 834 * @set_wol: Push WoL configuration to the NIC
@@ -872,7 +872,6 @@ struct efx_nic_type {
872 void (*stop_stats)(struct efx_nic *efx); 872 void (*stop_stats)(struct efx_nic *efx);
873 void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode); 873 void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode);
874 void (*push_irq_moderation)(struct efx_channel *channel); 874 void (*push_irq_moderation)(struct efx_channel *channel);
875 void (*push_multicast_hash)(struct efx_nic *efx);
876 int (*reconfigure_port)(struct efx_nic *efx); 875 int (*reconfigure_port)(struct efx_nic *efx);
877 int (*reconfigure_mac)(struct efx_nic *efx); 876 int (*reconfigure_mac)(struct efx_nic *efx);
878 bool (*check_mac_fault)(struct efx_nic *efx); 877 bool (*check_mac_fault)(struct efx_nic *efx);
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c
index 775b6784cbdb..d681f2597e74 100644
--- a/drivers/net/ethernet/sfc/siena.c
+++ b/drivers/net/ethernet/sfc/siena.c
@@ -52,15 +52,6 @@ static void siena_push_irq_moderation(struct efx_channel *channel)
52 channel->channel); 52 channel->channel);
53} 53}
54 54
55static void siena_push_multicast_hash(struct efx_nic *efx)
56{
57 WARN_ON(!mutex_is_locked(&efx->mac_lock));
58
59 efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
60 efx->multicast_hash.byte, sizeof(efx->multicast_hash),
61 NULL, 0, NULL);
62}
63
64static int siena_mdio_write(struct net_device *net_dev, 55static int siena_mdio_write(struct net_device *net_dev,
65 int prtad, int devad, u16 addr, u16 value) 56 int prtad, int devad, u16 addr, u16 value)
66{ 57{
@@ -629,7 +620,6 @@ const struct efx_nic_type siena_a0_nic_type = {
629 .stop_stats = siena_stop_nic_stats, 620 .stop_stats = siena_stop_nic_stats,
630 .set_id_led = efx_mcdi_set_id_led, 621 .set_id_led = efx_mcdi_set_id_led,
631 .push_irq_moderation = siena_push_irq_moderation, 622 .push_irq_moderation = siena_push_irq_moderation,
632 .push_multicast_hash = siena_push_multicast_hash,
633 .reconfigure_mac = efx_mcdi_mac_reconfigure, 623 .reconfigure_mac = efx_mcdi_mac_reconfigure,
634 .check_mac_fault = efx_mcdi_mac_check_fault, 624 .check_mac_fault = efx_mcdi_mac_check_fault,
635 .reconfigure_port = efx_mcdi_phy_reconfigure, 625 .reconfigure_port = efx_mcdi_phy_reconfigure,