diff mbox

[net-next,v2,01/14] sfc: Add code to export port_num in netdev->dev_port

Message ID 556C575C.2040403@solarflare.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Shradha Shah June 1, 2015, 1 p.m. UTC
In the case where we have multiple functions (PFs and VFs), this
sysfs entry is useful to identify the physical port corresponding
to the function we are interested in.

Signed-off-by: Shradha Shah <sshah@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller June 1, 2015, 7:01 p.m. UTC | #1
From: Shradha Shah <sshah@solarflare.com>
Date: Mon, 1 Jun 2015 14:00:12 +0100

> In the case where we have multiple functions (PFs and VFs), this
> sysfs entry is useful to identify the physical port corresponding
> to the function we are interested in.
> 
> Signed-off-by: Shradha Shah <sshah@solarflare.com>

This is a low effort change.

You retained all of the error handling changes that were only necessary when
you added the new sysfs file, but are completely unnecessary if you're
just reporting it via netdev->dev_port.

This is extremely disappointing, because you expect me to put a good effort
into reviewing your changes yet you aren't putting that level of effort into
the submission itself.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shradha Shah June 2, 2015, 9:14 a.m. UTC | #2
On 01/06/15 20:01, David Miller wrote:
> From: Shradha Shah <sshah@solarflare.com>
> Date: Mon, 1 Jun 2015 14:00:12 +0100
> 
>> In the case where we have multiple functions (PFs and VFs), this
>> sysfs entry is useful to identify the physical port corresponding
>> to the function we are interested in.
>>
>> Signed-off-by: Shradha Shah <sshah@solarflare.com>
> 
> This is a low effort change.
> 
> You retained all of the error handling changes that were only necessary when
> you added the new sysfs file, but are completely unnecessary if you're
> just reporting it via netdev->dev_port.

With the addition of the sysfs change in my previous version, the error handling
code required the addition of a fail4 tag to deal with the sysfs file on the
error path.

Without the sysfs file in my current version v2, there is no extra fail4 tag, I
have reverted back to using fail3.

The changes that are seen in the patch are stylistic changes following the rule
that every branch of an if statement should have parenthesis if one of the
branch uses parenthesis.

The previous version of the patch touched this bit of code so the style change
was relevant.

I think my mistake here is that I left it in v2 as a style change, but I can
assure you that I looked at the error path before submitting the patch and
also that this patch does not affect the error path.

Maybe I should have separated the style change to go as a different patch.

I will do so now and submit a v3.

Thanks.

> 
> This is extremely disappointing, because you expect me to put a good effort
> into reviewing your changes yet you aren't putting that level of effort into
> the submission itself.
>
diff mbox

Patch

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index a547ceb..dacf9f8 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -249,6 +249,7 @@  static int efx_ef10_get_mac_address_vf(struct efx_nic *efx, u8 *mac_address)
 static int efx_ef10_probe(struct efx_nic *efx)
 {
 	struct efx_ef10_nic_data *nic_data;
+	struct net_device *net_dev = efx->net_dev;
 	int i, rc;
 
 	/* We can have one VI for each 8K region.  However, until we
@@ -326,6 +327,7 @@  static int efx_ef10_probe(struct efx_nic *efx)
 	if (rc < 0)
 		goto fail3;
 	efx->port_num = rc;
+	net_dev->dev_port = rc;
 
 	rc = efx->type->get_mac_address(efx, efx->net_dev->perm_addr);
 	if (rc)
@@ -334,6 +336,7 @@  static int efx_ef10_probe(struct efx_nic *efx)
 	rc = efx_ef10_get_sysclk_freq(efx);
 	if (rc < 0)
 		goto fail3;
+
 	efx->timer_quantum_ns = 1536000 / rc; /* 1536 cycles */
 
 	/* Check whether firmware supports bug 35388 workaround.
@@ -341,9 +344,9 @@  static int efx_ef10_probe(struct efx_nic *efx)
 	 * ask if it's already enabled
 	 */
 	rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG35388, true);
-	if (rc == 0)
+	if (rc == 0) {
 		nic_data->workaround_35388 = true;
-	else if (rc == -EPERM) {
+	} else if (rc == -EPERM) {
 		unsigned int enabled;
 
 		rc = efx_mcdi_get_workarounds(efx, NULL, &enabled);
@@ -351,9 +354,10 @@  static int efx_ef10_probe(struct efx_nic *efx)
 			goto fail3;
 		nic_data->workaround_35388 = enabled &
 			MC_CMD_GET_WORKAROUNDS_OUT_BUG35388;
-	}
-	else if (rc != -ENOSYS && rc != -ENOENT)
+	} else if (rc != -ENOSYS && rc != -ENOENT) {
 		goto fail3;
+	}
+
 	netif_dbg(efx, probe, efx->net_dev,
 		  "workaround for bug 35388 is %sabled\n",
 		  nic_data->workaround_35388 ? "en" : "dis");