netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Bug Fixes for SFC driver
@ 2014-01-17 19:45 Shradha Shah
  2014-01-17 19:48 ` [PATCH net-next 1/2] sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command Shradha Shah
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shradha Shah @ 2014-01-17 19:45 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

I am taking over the upstream patch submission work for the 
sfc driver from Ben Hutchings.

These patches are bug fixes to the sfc driver involving 
replacement of the PORT RESET MC command and fixing transposed 
ptp_{under,over}size_sync_window_statistics

The PORT_RESET bug fix is needed for all versions supporting EF10
i.e all versions including and after 3.12.

Ben Hutchings (1):
  sfc: Fix transposed ptp_{under,over}size_sync_windows statistics

Jon Cooper (1):
  sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.

 drivers/net/ethernet/sfc/ef10.c |   31 ++++++++++++++++++++++++++-----
 drivers/net/ethernet/sfc/mcdi.c |   14 +++++++++++---
 drivers/net/ethernet/sfc/ptp.c  |    4 ++--
 3 files changed, 39 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.
  2014-01-17 19:45 [PATCH net-next 0/2] Bug Fixes for SFC driver Shradha Shah
@ 2014-01-17 19:48 ` Shradha Shah
  2014-01-17 19:48 ` [PATCH net-next 2/2] sfc: Fix transposed ptp_{under,over}size_sync_windows statistics Shradha Shah
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Shradha Shah @ 2014-01-17 19:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

From: Jon Cooper <jcooper@solarflare.com>

PORT_RESET MC command was NOP in the ef10 firmware hence we are using
ENTITY_RESET to make sure all resource allocations are reset.

Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10.c |   31 ++++++++++++++++++++++++++-----
 drivers/net/ethernet/sfc/mcdi.c |   14 +++++++++++---
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 4dfc229..174a92f 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -683,6 +683,17 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
 	return 0;
 }
 
+static void efx_ef10_reset_mc_allocations(struct efx_nic *efx)
+{
+	struct efx_ef10_nic_data *nic_data = efx->nic_data;
+
+	/* All our allocations have been reset */
+	nic_data->must_realloc_vis = true;
+	nic_data->must_restore_filters = true;
+	nic_data->must_restore_piobufs = true;
+	nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
+}
+
 static int efx_ef10_map_reset_flags(u32 *flags)
 {
 	enum {
@@ -713,6 +724,19 @@ static int efx_ef10_map_reset_flags(u32 *flags)
 	return -EINVAL;
 }
 
+static int efx_ef10_reset(struct efx_nic *efx, enum reset_type reset_type)
+{
+	int rc = efx_mcdi_reset(efx, reset_type);
+
+	/* If it was a port reset, trigger reallocation of MC resources.
+	 * Note that on an MC reset nothing needs to be done now because we'll
+	 * detect the MC reset later and handle it then.
+	 */
+	if (reset_type == RESET_TYPE_ALL && !rc)
+		efx_ef10_reset_mc_allocations(efx);
+	return rc;
+}
+
 #define EF10_DMA_STAT(ext_name, mcdi_name)			\
 	[EF10_STAT_ ## ext_name] =				\
 	{ #ext_name, 64, 8 * MC_CMD_MAC_ ## mcdi_name }
@@ -1078,10 +1102,7 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx)
 	nic_data->warm_boot_count = rc;
 
 	/* All our allocations have been reset */
-	nic_data->must_realloc_vis = true;
-	nic_data->must_restore_filters = true;
-	nic_data->must_restore_piobufs = true;
-	nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
+	efx_ef10_reset_mc_allocations(efx);
 
 	/* The datapath firmware might have been changed */
 	nic_data->must_check_datapath_caps = true;
@@ -3571,7 +3592,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
 	.fini = efx_port_dummy_op_void,
 	.map_reset_reason = efx_mcdi_map_reset_reason,
 	.map_reset_flags = efx_ef10_map_reset_flags,
-	.reset = efx_mcdi_reset,
+	.reset = efx_ef10_reset,
 	.probe_port = efx_mcdi_port_probe,
 	.remove_port = efx_mcdi_port_remove,
 	.fini_dmaq = efx_ef10_fini_dmaq,
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 0d5d7b5..eb59abb 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -1471,9 +1471,17 @@ void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
 			  NULL, 0, NULL);
 }
 
-static int efx_mcdi_reset_port(struct efx_nic *efx)
+static int efx_mcdi_reset_func(struct efx_nic *efx)
 {
-	return efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, NULL, 0, NULL, 0, NULL);
+	MCDI_DECLARE_BUF(inbuf, MC_CMD_ENTITY_RESET_IN_LEN);
+	int rc;
+
+	BUILD_BUG_ON(MC_CMD_ENTITY_RESET_OUT_LEN != 0);
+	MCDI_POPULATE_DWORD_1(inbuf, ENTITY_RESET_IN_FLAG,
+			      ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET, 1);
+	rc = efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf),
+			  NULL, 0, NULL);
+	return rc;
 }
 
 static int efx_mcdi_reset_mc(struct efx_nic *efx)
@@ -1510,7 +1518,7 @@ int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method)
 	if (method == RESET_TYPE_WORLD)
 		return efx_mcdi_reset_mc(efx);
 	else
-		return efx_mcdi_reset_port(efx);
+		return efx_mcdi_reset_func(efx);
 }
 
 static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] sfc: Fix transposed ptp_{under,over}size_sync_windows statistics
  2014-01-17 19:45 [PATCH net-next 0/2] Bug Fixes for SFC driver Shradha Shah
  2014-01-17 19:48 ` [PATCH net-next 1/2] sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command Shradha Shah
@ 2014-01-17 19:48 ` Shradha Shah
  2014-01-21 18:02 ` [PATCH net-next 0/2] Bug Fixes for SFC driver Ben Hutchings
  2014-01-21 22:47 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Shradha Shah @ 2014-01-17 19:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

From: Ben Hutchings <bhutchings@solarflare.com>

Somehow I transposed these two while bringing the original statistics
support upstream.

Fixes: 99691c4ac112 ('sfc: Add PTP counters to ethtool stats')
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ptp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 7aa0708..eb75fbd 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -753,9 +753,9 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
 		if (window < SYNCHRONISATION_GRANULARITY_NS) {
 			++ptp->invalid_sync_windows;
 		} else if (corrected >= MAX_SYNCHRONISATION_NS) {
-			++ptp->undersize_sync_windows;
-		} else if (corrected < ptp->min_synchronisation_ns) {
 			++ptp->oversize_sync_windows;
+		} else if (corrected < ptp->min_synchronisation_ns) {
+			++ptp->undersize_sync_windows;
 		} else {
 			ngood++;
 			last_good = i;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] Bug Fixes for SFC driver
  2014-01-17 19:45 [PATCH net-next 0/2] Bug Fixes for SFC driver Shradha Shah
  2014-01-17 19:48 ` [PATCH net-next 1/2] sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command Shradha Shah
  2014-01-17 19:48 ` [PATCH net-next 2/2] sfc: Fix transposed ptp_{under,over}size_sync_windows statistics Shradha Shah
@ 2014-01-21 18:02 ` Ben Hutchings
  2014-01-21 22:47 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2014-01-21 18:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, Shradha Shah

On Fri, 2014-01-17 at 19:45 +0000, Shradha Shah wrote:
> I am taking over the upstream patch submission work for the 
> sfc driver from Ben Hutchings.
> 
> These patches are bug fixes to the sfc driver involving 
> replacement of the PORT RESET MC command and fixing transposed 
> ptp_{under,over}size_sync_window_statistics
> 
> The PORT_RESET bug fix is needed for all versions supporting EF10
> i.e all versions including and after 3.12.
> 
> Ben Hutchings (1):
>   sfc: Fix transposed ptp_{under,over}size_sync_windows statistics
> 
> Jon Cooper (1):
>   sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.
> 
>  drivers/net/ethernet/sfc/ef10.c |   31 ++++++++++++++++++++++++++-----
>  drivers/net/ethernet/sfc/mcdi.c |   14 +++++++++++---
>  drivers/net/ethernet/sfc/ptp.c  |    4 ++--
>  3 files changed, 39 insertions(+), 10 deletions(-)

David, I don't know if you're waiting for my ack on these, but in case
you are:

Acked-by: Ben Hutchings <bhutchings@solarflare.com>

Shradha will send a MAINTAINERS update in the next patch series.

Ben.

-- 
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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] Bug Fixes for SFC driver
  2014-01-17 19:45 [PATCH net-next 0/2] Bug Fixes for SFC driver Shradha Shah
                   ` (2 preceding siblings ...)
  2014-01-21 18:02 ` [PATCH net-next 0/2] Bug Fixes for SFC driver Ben Hutchings
@ 2014-01-21 22:47 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-01-21 22:47 UTC (permalink / raw)
  To: sshah; +Cc: netdev, linux-net-drivers

From: Shradha Shah <sshah@solarflare.com>
Date: Fri, 17 Jan 2014 19:45:36 +0000

> I am taking over the upstream patch submission work for the 
> sfc driver from Ben Hutchings.
> 
> These patches are bug fixes to the sfc driver involving 
> replacement of the PORT RESET MC command and fixing transposed 
> ptp_{under,over}size_sync_window_statistics
> 
> The PORT_RESET bug fix is needed for all versions supporting EF10
> i.e all versions including and after 3.12.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-21 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 19:45 [PATCH net-next 0/2] Bug Fixes for SFC driver Shradha Shah
2014-01-17 19:48 ` [PATCH net-next 1/2] sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command Shradha Shah
2014-01-17 19:48 ` [PATCH net-next 2/2] sfc: Fix transposed ptp_{under,over}size_sync_windows statistics Shradha Shah
2014-01-21 18:02 ` [PATCH net-next 0/2] Bug Fixes for SFC driver Ben Hutchings
2014-01-21 22:47 ` David Miller

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).