]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sfc: Remove efx_nic_type::push_multicast_hash operation
authorBen Hutchings <bhutchings@solarflare.com>
Tue, 13 Sep 2011 18:47:48 +0000 (19:47 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 27 Jan 2012 00:10:48 +0000 (00:10 +0000)
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>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/falcon.c
drivers/net/ethernet/sfc/mcdi_mac.c
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/siena.c

index 1d20e01c6aeae3261020ce9d0838f63da5198ffa..de162474c3c530f7579018e7fd2394a02fce3c9d 100644 (file)
@@ -898,10 +898,8 @@ static void efx_mac_work(struct work_struct *data)
        struct efx_nic *efx = container_of(data, struct efx_nic, mac_work);
 
        mutex_lock(&efx->mac_lock);
-       if (efx->port_enabled) {
-               efx->type->push_multicast_hash(efx);
+       if (efx->port_enabled)
                efx->type->reconfigure_mac(efx);
-       }
        mutex_unlock(&efx->mac_lock);
 }
 
@@ -968,7 +966,6 @@ static void efx_start_port(struct efx_nic *efx)
 
        /* efx_mac_work() might have been scheduled after efx_stop_port(),
         * and then cancelled by efx_flush_all() */
-       efx->type->push_multicast_hash(efx);
        efx->type->reconfigure_mac(efx);
 
        mutex_unlock(&efx->mac_lock);
index 1a8a316bb538d1f4b1ec9f7b8d101fc277f475b6..fe21c7e349b6c5689ac72895d55cc8f6ae237c1e 100644 (file)
@@ -1766,7 +1766,6 @@ const struct efx_nic_type falcon_a1_nic_type = {
        .stop_stats = falcon_stop_nic_stats,
        .set_id_led = falcon_set_id_led,
        .push_irq_moderation = falcon_push_irq_moderation,
-       .push_multicast_hash = falcon_push_multicast_hash,
        .reconfigure_port = falcon_reconfigure_port,
        .reconfigure_mac = falcon_reconfigure_xmac,
        .check_mac_fault = falcon_xmac_check_fault,
@@ -1809,7 +1808,6 @@ const struct efx_nic_type falcon_b0_nic_type = {
        .stop_stats = falcon_stop_nic_stats,
        .set_id_led = falcon_set_id_led,
        .push_irq_moderation = falcon_push_irq_moderation,
-       .push_multicast_hash = falcon_push_multicast_hash,
        .reconfigure_port = falcon_reconfigure_port,
        .reconfigure_mac = falcon_reconfigure_xmac,
        .check_mac_fault = falcon_xmac_check_fault,
index 559d79861faffbbda10428214e096e370e959baa..f67cf921bd1b29c43925c33bc858f7c4c1bcc055 100644 (file)
@@ -115,12 +115,14 @@ int efx_mcdi_mac_reconfigure(struct efx_nic *efx)
 {
        int rc;
 
+       WARN_ON(!mutex_is_locked(&efx->mac_lock));
+
        rc = efx_mcdi_set_mac(efx);
        if (rc != 0)
                return rc;
 
-       /* Restore the multicast hash registers. */
-       efx->type->push_multicast_hash(efx);
-
-       return 0;
+       return efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
+                           efx->multicast_hash.byte,
+                           sizeof(efx->multicast_hash),
+                           NULL, 0, NULL);
 }
index aa5a321a141979254ae41b6d4b408ca2a93b1046..a88e95f58b0acdb9b5a0ed0851cdd6d6c94808a4 100644 (file)
@@ -826,9 +826,9 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)
  * @stop_stats: Stop the regular fetching of statistics
  * @set_id_led: Set state of identifying LED or revert to automatic function
  * @push_irq_moderation: Apply interrupt moderation value
- * @push_multicast_hash: Apply multicast hash table
  * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY
- * @reconfigure_mac: Reconfigure MAC only. Serialised by the mac_lock
+ * @reconfigure_mac: Push MAC address, MTU, flow control and filter settings
+ *     to the hardware.  Serialised by the mac_lock.
  * @check_mac_fault: Check MAC fault state. True if fault present.
  * @get_wol: Get WoL configuration from driver state
  * @set_wol: Push WoL configuration to the NIC
@@ -872,7 +872,6 @@ struct efx_nic_type {
        void (*stop_stats)(struct efx_nic *efx);
        void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode);
        void (*push_irq_moderation)(struct efx_channel *channel);
-       void (*push_multicast_hash)(struct efx_nic *efx);
        int (*reconfigure_port)(struct efx_nic *efx);
        int (*reconfigure_mac)(struct efx_nic *efx);
        bool (*check_mac_fault)(struct efx_nic *efx);
index 775b6784cbdbd5d8c0fe971c4abc5395cd2fa77f..d681f2597e741d934f27ab3a17a93b6fe8985690 100644 (file)
@@ -52,15 +52,6 @@ static void siena_push_irq_moderation(struct efx_channel *channel)
                               channel->channel);
 }
 
-static void siena_push_multicast_hash(struct efx_nic *efx)
-{
-       WARN_ON(!mutex_is_locked(&efx->mac_lock));
-
-       efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH,
-                    efx->multicast_hash.byte, sizeof(efx->multicast_hash),
-                    NULL, 0, NULL);
-}
-
 static int siena_mdio_write(struct net_device *net_dev,
                            int prtad, int devad, u16 addr, u16 value)
 {
@@ -629,7 +620,6 @@ const struct efx_nic_type siena_a0_nic_type = {
        .stop_stats = siena_stop_nic_stats,
        .set_id_led = efx_mcdi_set_id_led,
        .push_irq_moderation = siena_push_irq_moderation,
-       .push_multicast_hash = siena_push_multicast_hash,
        .reconfigure_mac = efx_mcdi_mac_reconfigure,
        .check_mac_fault = efx_mcdi_mac_check_fault,
        .reconfigure_port = efx_mcdi_phy_reconfigure,