From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next 15/32] sfc: Remove efx_nic_type::push_multicast_hash operation
Date: Fri, 27 Jan 2012 20:46:30 +0000 [thread overview]
Message-ID: <1327697190.2503.22.camel@bwh-desktop> (raw)
In-Reply-To: <1327696858.2503.7.camel@bwh-desktop>
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 | 5 +----
drivers/net/ethernet/sfc/falcon.c | 2 --
drivers/net/ethernet/sfc/mcdi_mac.c | 10 ++++++----
drivers/net/ethernet/sfc/net_driver.h | 5 ++---
drivers/net/ethernet/sfc/siena.c | 10 ----------
5 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 1d20e01..de16247 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)
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);
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c
index 1a8a316..fe21c7e 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 = {
.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,
diff --git a/drivers/net/ethernet/sfc/mcdi_mac.c b/drivers/net/ethernet/sfc/mcdi_mac.c
index 559d798..f67cf92 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)
{
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);
}
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index aa5a321..a88e95f 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)
* @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);
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c
index 775b678..d681f25 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)
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,
--
1.7.7.5
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-01-27 20:46 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 20:40 pull request: sfc-next 2012-01-27 Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 01/32] sfc: Fix some formatting errors reported by checkpatch Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 02/32] sfc: Avoid assignment in an if-statement, " Ben Hutchings
2012-01-27 20:42 ` [PATCH net-next 03/32] sfc: Remove parentheses around return expressions, " Ben Hutchings
2012-01-27 21:01 ` Joe Perches
2012-01-30 16:45 ` Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 04/32] sfc: Const-qualify static data as appropriate, partly prompted " Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 05/32] sfc: Remove unnecessary inclusion of <asm/io.h>, " Ben Hutchings
2012-01-27 20:43 ` [PATCH net-next 06/32] sfc: Update MCDI (firmware interface) definitions Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 07/32] sfc: Rename efx_wanted_channels() to efx_wanted_parallelism() Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 08/32] sfc: Set default parallelism to per-core by default Ben Hutchings
2012-01-27 20:44 ` [PATCH net-next 09/32] sfc: Remove fallback for invalid permanent MAC address Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 10/32] sfc: Make handling of MC reboot more reliable Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 11/32] sfc: Use new names for MC shared memory layout constants Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 12/32] sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_stats Ben Hutchings
2012-01-27 20:45 ` [PATCH net-next 13/32] sfc: Merge efx_mac_operations into efx_nic_type Ben Hutchings
2012-01-27 20:46 ` [PATCH net-next 14/32] sfc: Merge efx_mcdi_mac_check_fault() and efx_mcdi_get_mac_faults() Ben Hutchings
2012-01-27 20:46 ` Ben Hutchings [this message]
2012-01-27 20:46 ` [PATCH net-next 16/32] sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUG Ben Hutchings
2012-01-27 20:47 ` [PATCH net-next 17/32] sfc: Support extraction of CAPABILITIES from GET_BOARD_CFG response Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 18/32] sfc: Correct interrupt timer quantum for Siena (normal and turbo mode) Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 19/32] sfc: Remove dependence on NAPI polling in efx_test_eventq_irq() Ben Hutchings
2012-01-27 20:48 ` [PATCH net-next 20/32] Partly revert "sfc: Handle serious errors in exactly one interrupt handler" Ben Hutchings
2012-01-27 20:49 ` [PATCH net-next 21/32] sfc: Clean up test interrupt handling Ben Hutchings
2012-01-27 20:49 ` [PATCH net-next 22/32] sfc: Add hwmon driver for boards using SFC9000-family controllers Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 23/32] sfc: Update the description of SFC_MTD Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 24/32] sfc: Remove obsolete function efx_dev_name() Ben Hutchings
2012-01-27 20:50 ` [PATCH net-next 25/32] sfc: Remove remnants of on-load self-test Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 26/32] sfc: Use existing local variables instead of repeated indirect lookups Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 27/32] sfc: Minor formatting fixes Ben Hutchings
2012-01-27 20:51 ` [PATCH net-next 28/32] sfc: Remove redundant 'rc' variable, always set to 0 Ben Hutchings
2012-01-27 20:52 ` [PATCH net-next 29/32] sfc: Rename implementation of ndo_set_rx_mode Ben Hutchings
2012-01-27 20:53 ` [PATCH net-next 30/32] sfc: Make all MAC statistics consistently 64 bits wide Ben Hutchings
2012-01-27 20:54 ` [PATCH net-next 31/32] sfc: Move the end of the non-GRO RX path into its own function Ben Hutchings
2012-01-27 20:54 ` [PATCH net-next 32/32] sfc: Replace efx_rx_buffer::is_page and other booleans with a flags field Ben Hutchings
2012-01-29 21:18 ` pull request: sfc-next 2012-01-27 David Miller
2012-01-29 21:40 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327697190.2503.22.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).