patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 03/53] net/sfc/base: fix result code in MCDI NVRAM update finish
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
@ 2017-11-16  8:03 ` Andrew Rybchenko
  2017-11-16  8:03 ` [dpdk-stable] [PATCH 11/53] net/sfc/base: fix check in NVRAM validate Andrew Rybchenko
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:03 UTC (permalink / raw)
  To: dev; +Cc: Andy Moreton, stable

From: Andy Moreton <amoreton@solarflare.com>

Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_nvram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c
index 6ee2a71..14ff829 100644
--- a/drivers/net/sfc/base/efx_nvram.c
+++ b/drivers/net/sfc/base/efx_nvram.c
@@ -921,7 +921,7 @@ efx_mcdi_nvram_update_finish(
 	efx_mcdi_req_t req;
 	uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN,
 			    MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)];
-	uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */
+	uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
 	efx_rc_t rc;
 
 	(void) memset(payload, 0, sizeof (payload));
-- 
2.7.4

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

* [dpdk-stable] [PATCH 11/53] net/sfc/base: fix check in NVRAM validate
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
  2017-11-16  8:03 ` [dpdk-stable] [PATCH 03/53] net/sfc/base: fix result code in MCDI NVRAM update finish Andrew Rybchenko
@ 2017-11-16  8:03 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues Andrew Rybchenko
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:03 UTC (permalink / raw)
  To: dev; +Cc: Andy Moreton, stable

From: Andy Moreton <amoreton@solarflare.com>

Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_nvram.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c
index a2b0e05..bdad5d5 100644
--- a/drivers/net/sfc/base/efx_nvram.c
+++ b/drivers/net/sfc/base/efx_nvram.c
@@ -468,10 +468,11 @@ efx_nvram_validate(
 	if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
 		goto fail1;
 
-	if (envop->envo_type_to_partn != NULL &&
-	    ((rc = envop->envo_buffer_validate(enp, partn,
-	    partn_data, partn_size)) != 0))
-		goto fail2;
+	if (envop->envo_buffer_validate != NULL) {
+		if ((rc = envop->envo_buffer_validate(enp, partn,
+			    partn_data, partn_size)) != 0)
+			goto fail2;
+	}
 
 	return (0);
 
-- 
2.7.4

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

* [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
  2017-11-16  8:03 ` [dpdk-stable] [PATCH 03/53] net/sfc/base: fix result code in MCDI NVRAM update finish Andrew Rybchenko
  2017-11-16  8:03 ` [dpdk-stable] [PATCH 11/53] net/sfc/base: fix check in NVRAM validate Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-27 19:58   ` Ferruh Yigit
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled Andrew Rybchenko
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andy Moreton, stable

From: Andy Moreton <amoreton@solarflare.com>

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx.h     | 12 ++++++------
 drivers/net/sfc/base/efx_phy.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 834eea0..ca0f945 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -913,13 +913,13 @@ efx_phy_media_type_get(
 	__in		efx_nic_t *enp,
 	__out		efx_phy_media_type_t *typep);
 
-extern					efx_rc_t
+extern	__checkReturn		efx_rc_t
 efx_phy_module_get_info(
-	__in				efx_nic_t *enp,
-	__in				uint8_t dev_addr,
-	__in				uint8_t offset,
-	__in				uint8_t len,
-	__out_bcount(len)		uint8_t *data);
+	__in			efx_nic_t *enp,
+	__in			uint8_t dev_addr,
+	__in			uint8_t offset,
+	__in			uint8_t len,
+	__out_bcount(len)	uint8_t *data);
 
 #if EFSYS_OPT_PHY_STATS
 
diff --git a/drivers/net/sfc/base/efx_phy.c b/drivers/net/sfc/base/efx_phy.c
index 752cd52..c81a91c 100644
--- a/drivers/net/sfc/base/efx_phy.c
+++ b/drivers/net/sfc/base/efx_phy.c
@@ -296,7 +296,7 @@ efx_phy_media_type_get(
 		*typep = epp->ep_fixed_port_type;
 }
 
-	__checkReturn	efx_rc_t
+	__checkReturn		efx_rc_t
 efx_phy_module_get_info(
 	__in			efx_nic_t *enp,
 	__in			uint8_t dev_addr,
-- 
2.7.4

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

* [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (2 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-27 19:59   ` Ferruh Yigit
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 41/53] net/sfc/base: fix diagnostics support build without Siena Andrew Rybchenko
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Vijay Srivastava, stable

From: Vijay Srivastava <vijays@solarflare.com>

Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
Medford.

Fixes: b1d06c75e32c ("net/sfc/base: import PHY LEDs control")
Fixes: 0a7864349106 ("net/sfc/base: import PHY statistics")
Cc: stable@dpdk.org

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_phy.c  | 2 ++
 drivers/net/sfc/base/efx_check.h | 4 ++--
 drivers/net/sfc/base/siena_nic.c | 2 ++
 drivers/net/sfc/base/siena_phy.c | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_phy.c b/drivers/net/sfc/base/ef10_phy.c
index 81309f2..ad40d51 100644
--- a/drivers/net/sfc/base/ef10_phy.c
+++ b/drivers/net/sfc/base/ef10_phy.c
@@ -280,7 +280,9 @@ ef10_phy_reconfigure(
 	uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
 			    MC_CMD_SET_LINK_OUT_LEN)];
 	uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
 	unsigned int led_mode;
+#endif
 	unsigned int speed;
 	boolean_t supported;
 	efx_rc_t rc;
diff --git a/drivers/net/sfc/base/efx_check.h b/drivers/net/sfc/base/efx_check.h
index c8548c0..4ed7148 100644
--- a/drivers/net/sfc/base/efx_check.h
+++ b/drivers/net/sfc/base/efx_check.h
@@ -224,8 +224,8 @@
 
 #if EFSYS_OPT_PHY_LED_CONTROL
 /* Support for PHY LED control */
-# if !EFSYS_OPT_SIENA
-#  error "PHY_LED_CONTROL requires SIENA"
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
+#  error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD"
 # endif
 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
 
diff --git a/drivers/net/sfc/base/siena_nic.c b/drivers/net/sfc/base/siena_nic.c
index d574b24..5216cc6 100644
--- a/drivers/net/sfc/base/siena_nic.c
+++ b/drivers/net/sfc/base/siena_nic.c
@@ -190,7 +190,9 @@ static	__checkReturn	efx_rc_t
 siena_phy_cfg(
 	__in		efx_nic_t *enp)
 {
+#if EFSYS_OPT_PHY_STATS
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+#endif	/* EFSYS_OPT_PHY_STATS */
 	efx_rc_t rc;
 
 	/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
diff --git a/drivers/net/sfc/base/siena_phy.c b/drivers/net/sfc/base/siena_phy.c
index b90ccab..b1bd69f 100644
--- a/drivers/net/sfc/base/siena_phy.c
+++ b/drivers/net/sfc/base/siena_phy.c
@@ -273,7 +273,9 @@ siena_phy_reconfigure(
 			    MAX(MC_CMD_SET_LINK_IN_LEN,
 				MC_CMD_SET_LINK_OUT_LEN))];
 	uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
 	unsigned int led_mode;
+#endif
 	unsigned int speed;
 	efx_rc_t rc;
 
-- 
2.7.4

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

* [dpdk-stable] [PATCH 41/53] net/sfc/base: fix diagnostics support build without Siena
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (3 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support Andrew Rybchenko
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Mark Spender, stable

From: Mark Spender <mspender@solarflare.com>

The compilation failed because __efx_sram_pattern_fns was used in
efx_nic.c, but defined in efx_sram.c which is only needed when
supporting Siena.

To fix it move all the code using __efx_sram_pattern_fns into
Siena-specific files (except for the definition in efx_sram.c itself,
as that file only needs to be included in Siena-supporting builds
anyway).

The functions to test registers and tables are unlikely to apply to any
new hardware and so can be moved into Siena files. Since Huntington
such tests have been implemented in firmware.

Fixes: 7571c3168798 ("net/sfc/base: import diagnostics support")
Cc: stable@dpdk.org

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_impl.h   |  26 -------
 drivers/net/sfc/base/efx_nic.c    | 133 ----------------------------------
 drivers/net/sfc/base/siena_impl.h |   9 +++
 drivers/net/sfc/base/siena_nic.c  | 148 ++++++++++++++++++++++++++++++++++++--
 4 files changed, 150 insertions(+), 166 deletions(-)

diff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/net/sfc/base/efx_impl.h
index 255a6af..fa976eb 100644
--- a/drivers/net/sfc/base/efx_impl.h
+++ b/drivers/net/sfc/base/efx_impl.h
@@ -1145,32 +1145,6 @@ efx_vpd_hunk_set(
 
 #endif	/* EFSYS_OPT_VPD */
 
-#if EFSYS_OPT_DIAG
-
-extern	efx_sram_pattern_fn_t	__efx_sram_pattern_fns[];
-
-typedef struct efx_register_set_s {
-	unsigned int		address;
-	unsigned int		step;
-	unsigned int		rows;
-	efx_oword_t		mask;
-} efx_register_set_t;
-
-extern	__checkReturn	efx_rc_t
-efx_nic_test_registers(
-	__in		efx_nic_t *enp,
-	__in		efx_register_set_t *rsp,
-	__in		size_t count);
-
-extern	__checkReturn	efx_rc_t
-efx_nic_test_tables(
-	__in		efx_nic_t *enp,
-	__in		efx_register_set_t *rsp,
-	__in		efx_pattern_type_t pattern,
-	__in		size_t count);
-
-#endif	/* EFSYS_OPT_DIAG */
-
 #if EFSYS_OPT_MCDI
 
 extern	__checkReturn		efx_rc_t
diff --git a/drivers/net/sfc/base/efx_nic.c b/drivers/net/sfc/base/efx_nic.c
index 4896619..65eed6e 100644
--- a/drivers/net/sfc/base/efx_nic.c
+++ b/drivers/net/sfc/base/efx_nic.c
@@ -689,139 +689,6 @@ efx_nic_register_test(
 	return (rc);
 }
 
-	__checkReturn	efx_rc_t
-efx_nic_test_registers(
-	__in		efx_nic_t *enp,
-	__in		efx_register_set_t *rsp,
-	__in		size_t count)
-{
-	unsigned int bit;
-	efx_oword_t original;
-	efx_oword_t reg;
-	efx_oword_t buf;
-	efx_rc_t rc;
-
-	while (count > 0) {
-		/* This function is only suitable for registers */
-		EFSYS_ASSERT(rsp->rows == 1);
-
-		/* bit sweep on and off */
-		EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original,
-			    B_TRUE);
-		for (bit = 0; bit < 128; bit++) {
-			/* Is this bit in the mask? */
-			if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit))
-				continue;
-
-			/* Test this bit can be set in isolation */
-			reg = original;
-			EFX_AND_OWORD(reg, rsp->mask);
-			EFX_SET_OWORD_BIT(reg, bit);
-
-			EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &reg,
-				    B_TRUE);
-			EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-				    B_TRUE);
-
-			EFX_AND_OWORD(buf, rsp->mask);
-			if (memcmp(&reg, &buf, sizeof (reg))) {
-				rc = EIO;
-				goto fail1;
-			}
-
-			/* Test this bit can be cleared in isolation */
-			EFX_OR_OWORD(reg, rsp->mask);
-			EFX_CLEAR_OWORD_BIT(reg, bit);
-
-			EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &reg,
-				    B_TRUE);
-			EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-				    B_TRUE);
-
-			EFX_AND_OWORD(buf, rsp->mask);
-			if (memcmp(&reg, &buf, sizeof (reg))) {
-				rc = EIO;
-				goto fail2;
-			}
-		}
-
-		/* Restore the old value */
-		EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original,
-			    B_TRUE);
-
-		--count;
-		++rsp;
-	}
-
-	return (0);
-
-fail2:
-	EFSYS_PROBE(fail2);
-fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
-	/* Restore the old value */
-	EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE);
-
-	return (rc);
-}
-
-	__checkReturn	efx_rc_t
-efx_nic_test_tables(
-	__in		efx_nic_t *enp,
-	__in		efx_register_set_t *rsp,
-	__in		efx_pattern_type_t pattern,
-	__in		size_t count)
-{
-	efx_sram_pattern_fn_t func;
-	unsigned int index;
-	unsigned int address;
-	efx_oword_t reg;
-	efx_oword_t buf;
-	efx_rc_t rc;
-
-	EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES);
-	func = __efx_sram_pattern_fns[pattern];
-
-	while (count > 0) {
-		/* Write */
-		address = rsp->address;
-		for (index = 0; index < rsp->rows; ++index) {
-			func(2 * index + 0, B_FALSE, &reg.eo_qword[0]);
-			func(2 * index + 1, B_FALSE, &reg.eo_qword[1]);
-			EFX_AND_OWORD(reg, rsp->mask);
-			EFSYS_BAR_WRITEO(enp->en_esbp, address, &reg, B_TRUE);
-
-			address += rsp->step;
-		}
-
-		/* Read */
-		address = rsp->address;
-		for (index = 0; index < rsp->rows; ++index) {
-			func(2 * index + 0, B_FALSE, &reg.eo_qword[0]);
-			func(2 * index + 1, B_FALSE, &reg.eo_qword[1]);
-			EFX_AND_OWORD(reg, rsp->mask);
-			EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE);
-			if (memcmp(&reg, &buf, sizeof (reg))) {
-				rc = EIO;
-				goto fail1;
-			}
-
-			address += rsp->step;
-		}
-
-		++rsp;
-		--count;
-	}
-
-	return (0);
-
-fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
-	return (rc);
-}
-
 #endif	/* EFSYS_OPT_DIAG */
 
 #if EFSYS_OPT_LOOPBACK
diff --git a/drivers/net/sfc/base/siena_impl.h b/drivers/net/sfc/base/siena_impl.h
index 654baa5..2e3d390 100644
--- a/drivers/net/sfc/base/siena_impl.h
+++ b/drivers/net/sfc/base/siena_impl.h
@@ -65,6 +65,15 @@ siena_nic_init(
 
 #if EFSYS_OPT_DIAG
 
+extern	efx_sram_pattern_fn_t	__efx_sram_pattern_fns[];
+
+typedef struct siena_register_set_s {
+	unsigned int		address;
+	unsigned int		step;
+	unsigned int		rows;
+	efx_oword_t		mask;
+} siena_register_set_t;
+
 extern	__checkReturn	efx_rc_t
 siena_nic_register_test(
 	__in		efx_nic_t *enp);
diff --git a/drivers/net/sfc/base/siena_nic.c b/drivers/net/sfc/base/siena_nic.c
index 5216cc6..f9cda34 100644
--- a/drivers/net/sfc/base/siena_nic.c
+++ b/drivers/net/sfc/base/siena_nic.c
@@ -457,7 +457,7 @@ siena_nic_unprobe(
 
 #if EFSYS_OPT_DIAG
 
-static efx_register_set_t __siena_registers[] = {
+static siena_register_set_t __siena_registers[] = {
 	{ FR_AZ_ADR_REGION_REG_OFST, 0, 1 },
 	{ FR_CZ_USR_EV_CFG_OFST, 0, 1 },
 	{ FR_AZ_RX_CFG_REG_OFST, 0, 1 },
@@ -489,7 +489,7 @@ static const uint32_t __siena_register_masks[] = {
 	0xFFFFFFFF, 0xFFFFFFFF, 0x00000007, 0x00000000
 };
 
-static efx_register_set_t __siena_tables[] = {
+static siena_register_set_t __siena_tables[] = {
 	{ FR_AZ_RX_FILTER_TBL0_OFST, FR_AZ_RX_FILTER_TBL0_STEP,
 	    FR_AZ_RX_FILTER_TBL0_ROWS },
 	{ FR_CZ_RX_MAC_FILTER_TBL0_OFST, FR_CZ_RX_MAC_FILTER_TBL0_STEP,
@@ -516,10 +516,144 @@ static const uint32_t __siena_table_masks[] = {
 };
 
 	__checkReturn	efx_rc_t
+siena_nic_test_registers(
+	__in		efx_nic_t *enp,
+	__in		siena_register_set_t *rsp,
+	__in		size_t count)
+{
+	unsigned int bit;
+	efx_oword_t original;
+	efx_oword_t reg;
+	efx_oword_t buf;
+	efx_rc_t rc;
+
+	while (count > 0) {
+		/* This function is only suitable for registers */
+		EFSYS_ASSERT(rsp->rows == 1);
+
+		/* bit sweep on and off */
+		EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original,
+			    B_TRUE);
+		for (bit = 0; bit < 128; bit++) {
+			/* Is this bit in the mask? */
+			if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit))
+				continue;
+
+			/* Test this bit can be set in isolation */
+			reg = original;
+			EFX_AND_OWORD(reg, rsp->mask);
+			EFX_SET_OWORD_BIT(reg, bit);
+
+			EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &reg,
+				    B_TRUE);
+			EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
+				    B_TRUE);
+
+			EFX_AND_OWORD(buf, rsp->mask);
+			if (memcmp(&reg, &buf, sizeof (reg))) {
+				rc = EIO;
+				goto fail1;
+			}
+
+			/* Test this bit can be cleared in isolation */
+			EFX_OR_OWORD(reg, rsp->mask);
+			EFX_CLEAR_OWORD_BIT(reg, bit);
+
+			EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &reg,
+				    B_TRUE);
+			EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
+				    B_TRUE);
+
+			EFX_AND_OWORD(buf, rsp->mask);
+			if (memcmp(&reg, &buf, sizeof (reg))) {
+				rc = EIO;
+				goto fail2;
+			}
+		}
+
+		/* Restore the old value */
+		EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original,
+			    B_TRUE);
+
+		--count;
+		++rsp;
+	}
+
+	return (0);
+
+fail2:
+	EFSYS_PROBE(fail2);
+fail1:
+	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+	/* Restore the old value */
+	EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE);
+
+	return (rc);
+}
+
+	__checkReturn	efx_rc_t
+siena_nic_test_tables(
+	__in		efx_nic_t *enp,
+	__in		siena_register_set_t *rsp,
+	__in		efx_pattern_type_t pattern,
+	__in		size_t count)
+{
+	efx_sram_pattern_fn_t func;
+	unsigned int index;
+	unsigned int address;
+	efx_oword_t reg;
+	efx_oword_t buf;
+	efx_rc_t rc;
+
+	EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES);
+	func = __efx_sram_pattern_fns[pattern];
+
+	while (count > 0) {
+		/* Write */
+		address = rsp->address;
+		for (index = 0; index < rsp->rows; ++index) {
+			func(2 * index + 0, B_FALSE, &reg.eo_qword[0]);
+			func(2 * index + 1, B_FALSE, &reg.eo_qword[1]);
+			EFX_AND_OWORD(reg, rsp->mask);
+			EFSYS_BAR_WRITEO(enp->en_esbp, address, &reg, B_TRUE);
+
+			address += rsp->step;
+		}
+
+		/* Read */
+		address = rsp->address;
+		for (index = 0; index < rsp->rows; ++index) {
+			func(2 * index + 0, B_FALSE, &reg.eo_qword[0]);
+			func(2 * index + 1, B_FALSE, &reg.eo_qword[1]);
+			EFX_AND_OWORD(reg, rsp->mask);
+			EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE);
+			if (memcmp(&reg, &buf, sizeof (reg))) {
+				rc = EIO;
+				goto fail1;
+			}
+
+			address += rsp->step;
+		}
+
+		++rsp;
+		--count;
+	}
+
+	return (0);
+
+fail1:
+	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+	return (rc);
+}
+
+
+	__checkReturn	efx_rc_t
 siena_nic_register_test(
 	__in		efx_nic_t *enp)
 {
-	efx_register_set_t *rsp;
+	siena_register_set_t *rsp;
 	const uint32_t *dwordp;
 	unsigned int nitems;
 	unsigned int count;
@@ -553,21 +687,21 @@ siena_nic_register_test(
 		rsp->mask.eo_u32[3] = *dwordp++;
 	}
 
-	if ((rc = efx_nic_test_registers(enp, __siena_registers,
+	if ((rc = siena_nic_test_registers(enp, __siena_registers,
 	    EFX_ARRAY_SIZE(__siena_registers))) != 0)
 		goto fail1;
 
-	if ((rc = efx_nic_test_tables(enp, __siena_tables,
+	if ((rc = siena_nic_test_tables(enp, __siena_tables,
 	    EFX_PATTERN_BYTE_ALTERNATE,
 	    EFX_ARRAY_SIZE(__siena_tables))) != 0)
 		goto fail2;
 
-	if ((rc = efx_nic_test_tables(enp, __siena_tables,
+	if ((rc = siena_nic_test_tables(enp, __siena_tables,
 	    EFX_PATTERN_BYTE_CHANGING,
 	    EFX_ARRAY_SIZE(__siena_tables))) != 0)
 		goto fail3;
 
-	if ((rc = efx_nic_test_tables(enp, __siena_tables,
+	if ((rc = siena_nic_test_tables(enp, __siena_tables,
 	    EFX_PATTERN_BIT_SWEEP, EFX_ARRAY_SIZE(__siena_tables))) != 0)
 		goto fail4;
 
-- 
2.7.4

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

* [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (4 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 41/53] net/sfc/base: fix diagnostics support build without Siena Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-27 19:58   ` Ferruh Yigit
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 43/53] net/sfc/base: fix warnings from VS2015 C compiler (C4310) Andrew Rybchenko
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Mark Spender, stable

From: Mark Spender <mspender@solarflare.com>

Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
Cc: stable@dpdk.org

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_lic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/net/sfc/base/efx_lic.c
index de25c5c..cfff51a 100644
--- a/drivers/net/sfc/base/efx_lic.c
+++ b/drivers/net/sfc/base/efx_lic.c
@@ -498,7 +498,7 @@ efx_lic_v1v2_find_key(
 	return (found);
 
 fail1:
-	EFSYS_PROBE(fail1);
+	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
 	return (B_FALSE);
 }
@@ -540,7 +540,7 @@ efx_lic_v1v2_validate_key(
 fail2:
 	EFSYS_PROBE(fail2);
 fail1:
-	EFSYS_PROBE(fail1);
+	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
 	return (B_FALSE);
 }
@@ -1158,7 +1158,7 @@ efx_lic_v3_validate_key(
 fail2:
 	EFSYS_PROBE(fail2);
 fail1:
-	EFSYS_PROBE(fail1);
+	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
 	return (B_FALSE);
 }
-- 
2.7.4

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

* [dpdk-stable] [PATCH 43/53] net/sfc/base: fix warnings from VS2015 C compiler (C4310)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (5 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 44/53] net/sfc/base: fix warnings from VS2015 C compiler (C4244) Andrew Rybchenko
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix level 4 warning
"C4310: cast truncates constant value";
no functional changes.

Fixes: 354df7eadf66 ("net/sfc/base: import bootrom configuration")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_bootcfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_bootcfg.c b/drivers/net/sfc/base/efx_bootcfg.c
index c47d16b..660d000 100644
--- a/drivers/net/sfc/base/efx_bootcfg.c
+++ b/drivers/net/sfc/base/efx_bootcfg.c
@@ -356,7 +356,7 @@ efx_bootcfg_read(
 	rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
 	    &used_bytes);
 	if (rc != 0 || used_bytes == 0) {
-		payload[0] = (uint8_t)~DHCP_END;
+		payload[0] = (uint8_t)(~DHCP_END & 0xff);
 		payload[1] = DHCP_END;
 		used_bytes = 2;
 	}
-- 
2.7.4

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

* [dpdk-stable] [PATCH 44/53] net/sfc/base: fix warnings from VS2015 C compiler (C4244)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (6 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 43/53] net/sfc/base: fix warnings from VS2015 C compiler (C4310) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 45/53] net/sfc/base: fix warnings from VS2015 C compiler (C4245) Andrew Rybchenko
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss
of data"; no functional changes.

Fixes: 946ba3b6941a ("net/sfc/base: import VPD support")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx_vpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_vpd.c b/drivers/net/sfc/base/efx_vpd.c
index 1e47df2..956460f 100644
--- a/drivers/net/sfc/base/efx_vpd.c
+++ b/drivers/net/sfc/base/efx_vpd.c
@@ -928,7 +928,7 @@ efx_vpd_hunk_set(
 		}
 
 		/* Modify tag length (large resource type) */
-		taglen += (dest - source);
+		taglen += (uint16_t)(dest - source);
 		EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen);
 		data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0);
 		data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1);
-- 
2.7.4

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

* [dpdk-stable] [PATCH 45/53] net/sfc/base: fix warnings from VS2015 C compiler (C4245)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (7 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 44/53] net/sfc/base: fix warnings from VS2015 C compiler (C4244) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 46/53] net/sfc/base: fix warnings from VS2015 C compiler (C4100) Andrew Rybchenko
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix level 4 warning
"C4245: 'initializing': conversion from 'int' to 'uint32_t',
signed/unsigned mismatch" warning; no functional changes.

Fixes: f9565517ff4f ("net/sfc/base: import filters support")
Fixes: daa007afd04b ("net/sfc/base: split local MAC I/G back into separate flags")
Fixes: 23c6d0dbac80 ("net/sfc/base: improve API to get supported filter matches")
Fixes: 457beb2c4d3e ("net/sfc/base: support filters for encapsulated packets")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_filter.c |  2 +-
 drivers/net/sfc/base/efx.h         | 54 ++++++++++++++++++++++----------------
 2 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_filter.c b/drivers/net/sfc/base/ef10_filter.c
index 2dd823b..9e16243 100644
--- a/drivers/net/sfc/base/ef10_filter.c
+++ b/drivers/net/sfc/base/ef10_filter.c
@@ -995,7 +995,7 @@ ef10_filter_supported_filters(
 	size_t list_length;
 	uint32_t i;
 	efx_rc_t rc;
-	uint32_t all_filter_flags =
+	efx_filter_match_flags_t all_filter_flags =
 	    (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST |
 	    EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT |
 	    EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT |
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index eb44279..151aae8 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -2278,29 +2278,37 @@ typedef unsigned int efx_filter_flags_t;
  * Flags which specify the fields to match on. The values are the same as in the
  * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands.
  */
-typedef enum efx_filter_match_flags_e {
-	EFX_FILTER_MATCH_REM_HOST = 0x0001,	/* Match by remote IP host
-						 * address */
-	EFX_FILTER_MATCH_LOC_HOST = 0x0002,	/* Match by local IP host
-						 * address */
-	EFX_FILTER_MATCH_REM_MAC = 0x0004,	/* Match by remote MAC address */
-	EFX_FILTER_MATCH_REM_PORT = 0x0008,	/* Match by remote TCP/UDP port */
-	EFX_FILTER_MATCH_LOC_MAC = 0x0010,	/* Match by remote TCP/UDP port */
-	EFX_FILTER_MATCH_LOC_PORT = 0x0020,	/* Match by local TCP/UDP port */
-	EFX_FILTER_MATCH_ETHER_TYPE = 0x0040,	/* Match by Ether-type */
-	EFX_FILTER_MATCH_INNER_VID = 0x0080,	/* Match by inner VLAN ID */
-	EFX_FILTER_MATCH_OUTER_VID = 0x0100,	/* Match by outer VLAN ID */
-	EFX_FILTER_MATCH_IP_PROTO = 0x0200,	/* Match by IP transport
-						 * protocol */
-	/* For encapsulated packets, match all multicast inner frames */
-	EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000,
-	/* For encapsulated packets, match all unicast inner frames */
-	EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000,
-	/* Match otherwise-unmatched multicast and broadcast packets */
-	EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000,
-	/* Match otherwise-unmatched unicast packets */
-	EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x80000000,
-} efx_filter_match_flags_t;
+
+/* Match by remote IP host address */
+#define	EFX_FILTER_MATCH_REM_HOST		0x00000001
+/* Match by local IP host address */
+#define	EFX_FILTER_MATCH_LOC_HOST		0x00000002
+/* Match by remote MAC address */
+#define	EFX_FILTER_MATCH_REM_MAC		0x00000004
+/* Match by remote TCP/UDP port */
+#define	EFX_FILTER_MATCH_REM_PORT		0x00000008
+/* Match by remote TCP/UDP port */
+#define	EFX_FILTER_MATCH_LOC_MAC		0x00000010
+/* Match by local TCP/UDP port */
+#define	EFX_FILTER_MATCH_LOC_PORT		0x00000020
+/* Match by Ether-type */
+#define	EFX_FILTER_MATCH_ETHER_TYPE		0x00000040
+/* Match by inner VLAN ID */
+#define	EFX_FILTER_MATCH_INNER_VID		0x00000080
+/* Match by outer VLAN ID */
+#define	EFX_FILTER_MATCH_OUTER_VID		0x00000100
+/* Match by IP transport protocol */
+#define	EFX_FILTER_MATCH_IP_PROTO		0x00000200
+/* For encapsulated packets, match all multicast inner frames */
+#define	EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST	0x01000000
+/* For encapsulated packets, match all unicast inner frames */
+#define	EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST	0x02000000
+/* Match otherwise-unmatched multicast and broadcast packets */
+#define	EFX_FILTER_MATCH_UNKNOWN_MCAST_DST	0x40000000
+/* Match otherwise-unmatched unicast packets */
+#define	EFX_FILTER_MATCH_UNKNOWN_UCAST_DST	0x80000000
+
+typedef uint32_t efx_filter_match_flags_t;
 
 typedef enum efx_filter_priority_s {
 	EFX_FILTER_PRI_HINT = 0,	/* Performance hint */
-- 
2.7.4

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

* [dpdk-stable] [PATCH 46/53] net/sfc/base: fix warnings from VS2015 C compiler (C4100)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (8 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 45/53] net/sfc/base: fix warnings from VS2015 C compiler (C4245) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 47/53] net/sfc/base: fix warnings from VS2015 C compiler (C4189) Andrew Rybchenko
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix multiple level 4 warnings
"C4100: 'xxx': unreferenced formal parameter"
no functional changes.

The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
Studio 2015 C compiler with the following:

    #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
    #define _NOTE(_annotation)   _NOTE_ ## _annotation

Fixes: 099c33bef343 ("net/sfc/base: import MCDI proxy authorization")
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Fixes: 7243cc0869f8 ("net/sfc/base: import software per-queue statistics")
Fixes: d96a34d165b1 ("net/sfc/base: import NVRAM support")
Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_nvram.c | 3 +++
 drivers/net/sfc/base/ef10_rx.c    | 2 ++
 drivers/net/sfc/base/ef10_tx.c    | 8 ++++++++
 drivers/net/sfc/base/efx_ev.c     | 2 ++
 drivers/net/sfc/base/efx_lic.c    | 6 +++---
 drivers/net/sfc/base/efx_mcdi.c   | 2 ++
 6 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/net/sfc/base/ef10_nvram.c
index d0ee1be..8b99bd5 100644
--- a/drivers/net/sfc/base/ef10_nvram.c
+++ b/drivers/net/sfc/base/ef10_nvram.c
@@ -672,6 +672,7 @@ ef10_nvram_buffer_validate(
 	int pos;
 	efx_rc_t rc;
 
+	_NOTE(ARGUNUSED(enp, partn))
 	EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK);
 
 	if ((partn_data == NULL) || (partn_size == 0)) {
@@ -1282,6 +1283,8 @@ ef10_nvram_buf_read_tlv(
 	caddr_t value;
 	efx_rc_t rc;
 
+	_NOTE(ARGUNUSED(enp))
+
 	if ((seg_data == NULL) || (max_seg_size == 0)) {
 		rc = EINVAL;
 		goto fail1;
diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c
index cebc34f..5cf5910 100644
--- a/drivers/net/sfc/base/ef10_rx.c
+++ b/drivers/net/sfc/base/ef10_rx.c
@@ -749,6 +749,8 @@ ef10_rx_qpost(
 	unsigned int offset;
 	unsigned int id;
 
+	_NOTE(ARGUNUSED(completed))
+
 #if EFSYS_OPT_RX_PACKED_STREAM
 	/*
 	 * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT
diff --git a/drivers/net/sfc/base/ef10_tx.c b/drivers/net/sfc/base/ef10_tx.c
index 14b23d0..8f84f80 100644
--- a/drivers/net/sfc/base/ef10_tx.c
+++ b/drivers/net/sfc/base/ef10_tx.c
@@ -606,6 +606,8 @@ ef10_tx_qdesc_dma_create(
 	__in	boolean_t eop,
 	__out	efx_desc_t *edp)
 {
+	_NOTE(ARGUNUSED(etp))
+
 	/* No limitations on boundary crossing */
 	EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
@@ -629,6 +631,8 @@ ef10_tx_qdesc_tso_create(
 	__in	uint8_t  tcp_flags,
 	__out	efx_desc_t *edp)
 {
+	_NOTE(ARGUNUSED(etp))
+
 	EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
 		    uint16_t, ipv4_id, uint32_t, tcp_seq,
 		    uint8_t, tcp_flags);
@@ -651,6 +655,8 @@ ef10_tx_qdesc_tso2_create(
 	__out_ecount(count)	efx_desc_t *edp,
 	__in			int count)
 {
+	_NOTE(ARGUNUSED(etp, count))
+
 	EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
 		    uint16_t, ipv4_id, uint32_t, tcp_seq,
 		    uint16_t, tcp_mss);
@@ -680,6 +686,8 @@ ef10_tx_qdesc_vlantci_create(
 	__in	uint16_t  tci,
 	__out	efx_desc_t *edp)
 {
+	_NOTE(ARGUNUSED(etp))
+
 	EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
 		    uint16_t, tci);
 
diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/net/sfc/base/efx_ev.c
index e7f49d7..e0f6ba2 100644
--- a/drivers/net/sfc/base/efx_ev.c
+++ b/drivers/net/sfc/base/efx_ev.c
@@ -1417,6 +1417,8 @@ efx_ev_qstat_name(
 	__in	efx_nic_t *enp,
 	__in	unsigned int id)
 {
+	_NOTE(ARGUNUSED(enp))
+
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(id, <, EV_NQSTATS);
 
diff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/net/sfc/base/efx_lic.c
index cfff51a..15405f9 100644
--- a/drivers/net/sfc/base/efx_lic.c
+++ b/drivers/net/sfc/base/efx_lic.c
@@ -561,7 +561,7 @@ efx_lic_v1v2_read_key(
 {
 	efx_rc_t rc;
 
-	_NOTE(ARGUNUSED(enp))
+	_NOTE(ARGUNUSED(enp, buffer_size))
 	EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX +
 	    EFX_LICENSE_V1V2_HEADER_LENGTH));
 
@@ -631,7 +631,7 @@ efx_lic_v1v2_delete_key(
 	uint32_t move_start = offset + length;
 	uint32_t move_length = end - move_start;
 
-	_NOTE(ARGUNUSED(enp))
+	_NOTE(ARGUNUSED(enp, buffer_size))
 	EFSYS_ASSERT(end <= buffer_size);
 
 	/* Shift everything after the key down */
@@ -649,7 +649,7 @@ efx_lic_v1v2_create_partition(
 				caddr_t bufferp,
 	__in			size_t buffer_size)
 {
-	_NOTE(ARGUNUSED(enp))
+	_NOTE(ARGUNUSED(enp, buffer_size))
 	EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size);
 
 	/* Write terminator */
diff --git a/drivers/net/sfc/base/efx_mcdi.c b/drivers/net/sfc/base/efx_mcdi.c
index 936ad25..3799b05 100644
--- a/drivers/net/sfc/base/efx_mcdi.c
+++ b/drivers/net/sfc/base/efx_mcdi.c
@@ -809,6 +809,8 @@ efx_mcdi_get_proxy_handle(
 {
 	efx_rc_t rc;
 
+	_NOTE(ARGUNUSED(enp))
+
 	/*
 	 * Return proxy handle from MCDI request that returned with error
 	 * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching
-- 
2.7.4

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

* [dpdk-stable] [PATCH 47/53] net/sfc/base: fix warnings from VS2015 C compiler (C4189)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (9 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 46/53] net/sfc/base: fix warnings from VS2015 C compiler (C4100) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 48/53] net/sfc/base: fix warnings from VS2015 C compiler (C4057) Andrew Rybchenko
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix multiple level 4 warnings
"C4189: 'xxx': local variable is initialized but not referenced";
no functional changes.

Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_ev.c  |  7 ++++---
 drivers/net/sfc/base/efx_ev.c   |  4 ++--
 drivers/net/sfc/base/efx_tx.c   |  4 ++--
 drivers/net/sfc/base/mcdi_mon.c | 11 ++++++-----
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c
index e3a91c2..ee576a0 100644
--- a/drivers/net/sfc/base/ef10_ev.c
+++ b/drivers/net/sfc/base/ef10_ev.c
@@ -575,7 +575,7 @@ ef10_ev_qdestroy(
 	EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
 	    enp->en_family == EFX_FAMILY_MEDFORD);
 
-	(void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
+	(void) efx_mcdi_fini_evq(enp, eep->ee_index);
 }
 
 	__checkReturn	efx_rc_t
@@ -1346,9 +1346,12 @@ ef10_ev_rxlabel_init(
 	__in		efx_rxq_type_t type)
 {
 	efx_evq_rxq_state_t *eersp;
+#if EFSYS_OPT_RX_PACKED_STREAM
 	boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) &&
 	    (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K);
+#endif
 
+	_NOTE(ARGUNUSED(type))
 	EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state));
 	eersp = &eep->ee_rxq_state[label];
 
@@ -1386,8 +1389,6 @@ ef10_ev_rxlabel_init(
 		EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, <=,
 		    EFX_RX_PACKED_STREAM_MAX_CREDITS);
 	}
-#else
-	EFSYS_ASSERT(!packed_stream);
 #endif
 }
 
diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/net/sfc/base/efx_ev.c
index e0f6ba2..7515aae 100644
--- a/drivers/net/sfc/base/efx_ev.c
+++ b/drivers/net/sfc/base/efx_ev.c
@@ -223,14 +223,14 @@ efx_ev_qcreate(
 	__deref_out	efx_evq_t **eepp)
 {
 	const efx_ev_ops_t *eevop = enp->en_eevop;
-	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_evq_t *eep;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
 
-	EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
+	EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <,
+	    enp->en_nic_cfg.enc_evq_limit);
 
 	switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) {
 	case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT:
diff --git a/drivers/net/sfc/base/efx_tx.c b/drivers/net/sfc/base/efx_tx.c
index a68babc..0cdf7e1 100644
--- a/drivers/net/sfc/base/efx_tx.c
+++ b/drivers/net/sfc/base/efx_tx.c
@@ -298,14 +298,14 @@ efx_tx_qcreate(
 	__out		unsigned int *addedp)
 {
 	const efx_tx_ops_t *etxop = enp->en_etxop;
-	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_txq_t *etp;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
 
-	EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
+	EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <,
+	    enp->en_nic_cfg.enc_txq_limit);
 
 	/* Allocate an TXQ object */
 	EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);
diff --git a/drivers/net/sfc/base/mcdi_mon.c b/drivers/net/sfc/base/mcdi_mon.c
index a083eac..8ea4216 100644
--- a/drivers/net/sfc/base/mcdi_mon.c
+++ b/drivers/net/sfc/base/mcdi_mon.c
@@ -264,7 +264,6 @@ mcdi_mon_ev(
 	__out				efx_mon_stat_value_t *valuep)
 {
 	efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
-	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	uint16_t port_mask;
 	uint16_t sensor;
 	uint16_t state;
@@ -280,11 +279,13 @@ mcdi_mon_ev(
 	value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
 
 	/* Hardware must support this MCDI sensor */
-	EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size));
+	EFSYS_ASSERT3U(sensor, <,
+	    (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size));
 	EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT);
-	EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL);
-	EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] &
-		(1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
+	EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL);
+	EFSYS_ASSERT(
+	    (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] &
+	    (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
 
 	/* But we don't have to understand it */
 	if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) {
-- 
2.7.4

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

* [dpdk-stable] [PATCH 48/53] net/sfc/base: fix warnings from VS2015 C compiler (C4057)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (10 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 47/53] net/sfc/base: fix warnings from VS2015 C compiler (C4189) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 49/53] net/sfc/base: fix warnings from VS2015 C compiler (C4214) Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 52/53] net/sfc/base: fix PreFAST static analysis warning (C6001) Andrew Rybchenko
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix two level 4 warnings
"C4057: 'function': 'const uint8_t *' differs in indirection to
slightly different base types from 'caddr_t'"; no functional changes.

Fixes: 354df7eadf66 ("net/sfc/base: import bootrom configuration")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx.h         | 4 ++--
 drivers/net/sfc/base/efx_bootcfg.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 151aae8..1b1be82 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -1506,13 +1506,13 @@ efx_bootcfg_copy_sector(
 extern				efx_rc_t
 efx_bootcfg_read(
 	__in			efx_nic_t *enp,
-	__out_bcount(size)	caddr_t data,
+	__out_bcount(size)	uint8_t *data,
 	__in			size_t size);
 
 extern				efx_rc_t
 efx_bootcfg_write(
 	__in			efx_nic_t *enp,
-	__in_bcount(size)	caddr_t data,
+	__in_bcount(size)	uint8_t *data,
 	__in			size_t size);
 
 #endif	/* EFSYS_OPT_BOOTCFG */
diff --git a/drivers/net/sfc/base/efx_bootcfg.c b/drivers/net/sfc/base/efx_bootcfg.c
index 660d000..75f7388 100644
--- a/drivers/net/sfc/base/efx_bootcfg.c
+++ b/drivers/net/sfc/base/efx_bootcfg.c
@@ -290,7 +290,7 @@ efx_bootcfg_copy_sector(
 				efx_rc_t
 efx_bootcfg_read(
 	__in			efx_nic_t *enp,
-	__out_bcount(size)	caddr_t data,
+	__out_bcount(size)	uint8_t *data,
 	__in			size_t size)
 {
 	uint8_t *payload = NULL;
@@ -353,7 +353,7 @@ efx_bootcfg_read(
 		goto fail7;
 
 	/* Verify that the area is correctly formatted and checksummed */
-	rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
+	rc = efx_bootcfg_verify(enp, payload, sector_length,
 	    &used_bytes);
 	if (rc != 0 || used_bytes == 0) {
 		payload[0] = (uint8_t)(~DHCP_END & 0xff);
@@ -430,7 +430,7 @@ efx_bootcfg_read(
 				efx_rc_t
 efx_bootcfg_write(
 	__in			efx_nic_t *enp,
-	__in_bcount(size)	caddr_t data,
+	__in_bcount(size)	uint8_t *data,
 	__in			size_t size)
 {
 	uint8_t *partn_data;
-- 
2.7.4

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

* [dpdk-stable] [PATCH 49/53] net/sfc/base: fix warnings from VS2015 C compiler (C4214)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (11 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 48/53] net/sfc/base: fix warnings from VS2015 C compiler (C4057) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 52/53] net/sfc/base: fix PreFAST static analysis warning (C6001) Andrew Rybchenko
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix multiple level 4 warnings
"C4214: nonstandard extension used: bit field types other than int";
no functional changes.

Fixes: f9565517ff4f ("net/sfc/base: import filters support")
Fixes: 457beb2c4d3e ("net/sfc/base: support filters for encapsulated packets")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/efx.h | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 1b1be82..93accd7 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -2272,7 +2272,7 @@ efx_tx_qdestroy(
 /* Filter is for TX */
 #define	EFX_FILTER_FLAG_TX		0x10
 
-typedef unsigned int efx_filter_flags_t;
+typedef uint8_t efx_filter_flags_t;
 
 /*
  * Flags which specify the fields to match on. The values are the same as in the
@@ -2329,22 +2329,22 @@ typedef enum efx_filter_priority_s {
  */
 
 typedef struct efx_filter_spec_s {
-	uint32_t		efs_match_flags;
-	uint32_t		efs_priority:2;
-	uint32_t		efs_flags:6;
-	uint32_t		efs_dmaq_id:12;
-	uint32_t		efs_rss_context;
-	uint16_t		efs_outer_vid;
-	uint16_t		efs_inner_vid;
-	uint8_t			efs_loc_mac[EFX_MAC_ADDR_LEN];
-	uint8_t			efs_rem_mac[EFX_MAC_ADDR_LEN];
-	uint16_t		efs_ether_type;
-	uint8_t			efs_ip_proto;
-	efx_tunnel_protocol_t	efs_encap_type;
-	uint16_t		efs_loc_port;
-	uint16_t		efs_rem_port;
-	efx_oword_t		efs_rem_host;
-	efx_oword_t		efs_loc_host;
+	efx_filter_match_flags_t	efs_match_flags;
+	uint8_t				efs_priority;
+	efx_filter_flags_t		efs_flags;
+	uint16_t			efs_dmaq_id;
+	uint32_t			efs_rss_context;
+	uint16_t			efs_outer_vid;
+	uint16_t			efs_inner_vid;
+	uint8_t				efs_loc_mac[EFX_MAC_ADDR_LEN];
+	uint8_t				efs_rem_mac[EFX_MAC_ADDR_LEN];
+	uint16_t			efs_ether_type;
+	uint8_t				efs_ip_proto;
+	efx_tunnel_protocol_t		efs_encap_type;
+	uint16_t			efs_loc_port;
+	uint16_t			efs_rem_port;
+	efx_oword_t			efs_rem_host;
+	efx_oword_t			efs_loc_host;
 } efx_filter_spec_t;
 
 
-- 
2.7.4

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

* [dpdk-stable] [PATCH 52/53] net/sfc/base: fix PreFAST static analysis warning (C6001)
       [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
                   ` (12 preceding siblings ...)
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 49/53] net/sfc/base: fix warnings from VS2015 C compiler (C4214) Andrew Rybchenko
@ 2017-11-16  8:04 ` Andrew Rybchenko
  13 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-16  8:04 UTC (permalink / raw)
  To: dev; +Cc: Andrew Lee, stable

From: Andrew Lee <alee@solarflare.com>

Fix warning
"C6001: Using uninitialized memory '*sensor_maskp'"
which could occur when the npages argument to efx_mcdi_sensor_info()
is less than or equal to zero.

Fixes: dfb3b1ce15f6 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/mcdi_mon.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sfc/base/mcdi_mon.c b/drivers/net/sfc/base/mcdi_mon.c
index 8ea4216..7e4264a 100644
--- a/drivers/net/sfc/base/mcdi_mon.c
+++ b/drivers/net/sfc/base/mcdi_mon.c
@@ -396,6 +396,11 @@ efx_mcdi_sensor_info(
 
 	EFSYS_ASSERT(sensor_maskp != NULL);
 
+	if (npages < 1) {
+		rc = EINVAL;
+		goto fail1;
+	}
+
 	for (page = 0; page < npages; page++) {
 		uint32_t mask;
 
@@ -412,7 +417,7 @@ efx_mcdi_sensor_info(
 
 		if (req.emr_rc != 0) {
 			rc = req.emr_rc;
-			goto fail1;
+			goto fail2;
 		}
 
 		mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
@@ -420,18 +425,20 @@ efx_mcdi_sensor_info(
 		if ((page != (npages - 1)) &&
 		    ((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
 			rc = EINVAL;
-			goto fail2;
+			goto fail3;
 		}
 		sensor_maskp[page] = mask;
 	}
 
 	if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
 		rc = EINVAL;
-		goto fail3;
+		goto fail4;
 	}
 
 	return (0);
 
+fail4:
+	EFSYS_PROBE(fail4);
 fail3:
 	EFSYS_PROBE(fail3);
 fail2:
-- 
2.7.4

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

* Re: [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support Andrew Rybchenko
@ 2017-11-27 19:58   ` Ferruh Yigit
  2017-11-28 10:17     ` Andrew Rybchenko
  0 siblings, 1 reply; 21+ messages in thread
From: Ferruh Yigit @ 2017-11-27 19:58 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Mark Spender, stable

On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
> From: Mark Spender <mspender@solarflare.com>
> 

What has been fixed here?
If you can provide more details I can amend the commit later.

> Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Mark Spender <mspender@solarflare.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  drivers/net/sfc/base/efx_lic.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/net/sfc/base/efx_lic.c
> index de25c5c..cfff51a 100644
> --- a/drivers/net/sfc/base/efx_lic.c
> +++ b/drivers/net/sfc/base/efx_lic.c
> @@ -498,7 +498,7 @@ efx_lic_v1v2_find_key(
>  	return (found);
>  
>  fail1:
> -	EFSYS_PROBE(fail1);
> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>  
>  	return (B_FALSE);
>  }
> @@ -540,7 +540,7 @@ efx_lic_v1v2_validate_key(
>  fail2:
>  	EFSYS_PROBE(fail2);
>  fail1:
> -	EFSYS_PROBE(fail1);
> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>  
>  	return (B_FALSE);
>  }
> @@ -1158,7 +1158,7 @@ efx_lic_v3_validate_key(
>  fail2:
>  	EFSYS_PROBE(fail2);
>  fail1:
> -	EFSYS_PROBE(fail1);
> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>  
>  	return (B_FALSE);
>  }
> 

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

* Re: [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues Andrew Rybchenko
@ 2017-11-27 19:58   ` Ferruh Yigit
  2017-11-28 11:49     ` Andrew Rybchenko
  0 siblings, 1 reply; 21+ messages in thread
From: Ferruh Yigit @ 2017-11-27 19:58 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Andy Moreton, stable

On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
> From: Andy Moreton <amoreton@solarflare.com>
> 

PREfast seems a static analysis tool. Can you please give more detail about
fixed issue itself. "fix PREfast issue" is not informative about what has been
fixed.

If you can send the details I can amend the commit.

Thanks,
ferruh

> Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Moreton <amoreton@solarflare.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  drivers/net/sfc/base/efx.h     | 12 ++++++------
>  drivers/net/sfc/base/efx_phy.c |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
> index 834eea0..ca0f945 100644
> --- a/drivers/net/sfc/base/efx.h
> +++ b/drivers/net/sfc/base/efx.h
> @@ -913,13 +913,13 @@ efx_phy_media_type_get(
>  	__in		efx_nic_t *enp,
>  	__out		efx_phy_media_type_t *typep);
>  
> -extern					efx_rc_t
> +extern	__checkReturn		efx_rc_t
>  efx_phy_module_get_info(
> -	__in				efx_nic_t *enp,
> -	__in				uint8_t dev_addr,
> -	__in				uint8_t offset,
> -	__in				uint8_t len,
> -	__out_bcount(len)		uint8_t *data);
> +	__in			efx_nic_t *enp,
> +	__in			uint8_t dev_addr,
> +	__in			uint8_t offset,
> +	__in			uint8_t len,
> +	__out_bcount(len)	uint8_t *data);
>  
>  #if EFSYS_OPT_PHY_STATS
>  
> diff --git a/drivers/net/sfc/base/efx_phy.c b/drivers/net/sfc/base/efx_phy.c
> index 752cd52..c81a91c 100644
> --- a/drivers/net/sfc/base/efx_phy.c
> +++ b/drivers/net/sfc/base/efx_phy.c
> @@ -296,7 +296,7 @@ efx_phy_media_type_get(
>  		*typep = epp->ep_fixed_port_type;
>  }
>  
> -	__checkReturn	efx_rc_t
> +	__checkReturn		efx_rc_t
>  efx_phy_module_get_info(
>  	__in			efx_nic_t *enp,
>  	__in			uint8_t dev_addr,
> 

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

* Re: [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled
  2017-11-16  8:04 ` [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled Andrew Rybchenko
@ 2017-11-27 19:59   ` Ferruh Yigit
  0 siblings, 0 replies; 21+ messages in thread
From: Ferruh Yigit @ 2017-11-27 19:59 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Vijay Srivastava, stable

On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
> From: Vijay Srivastava <vijays@solarflare.com>
> 
> Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
> Medford.
> 
> Fixes: b1d06c75e32c ("net/sfc/base: import PHY LEDs control")
> Fixes: 0a7864349106 ("net/sfc/base: import PHY statistics")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Welcome Vijay!

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

* Re: [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support
  2017-11-27 19:58   ` Ferruh Yigit
@ 2017-11-28 10:17     ` Andrew Rybchenko
  2017-11-28 21:38       ` Ferruh Yigit
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-28 10:17 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Mark Spender, stable

On 11/27/2017 10:58 PM, Ferruh Yigit wrote:
> On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
>> From: Mark Spender <mspender@solarflare.com>
>>
> What has been fixed here?
> If you can provide more details I can amend the commit later.

EFSYS_PROBE1 takes one typed value (in addition to the probe name),
whereas EFSYS_PROBE has just the probe name.

Which to use is determined by the probe name – “fail1” probes are
expected to include the function result.

Thanks,
Andrew.

>> Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Mark Spender <mspender@solarflare.com>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>   drivers/net/sfc/base/efx_lic.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/net/sfc/base/efx_lic.c
>> index de25c5c..cfff51a 100644
>> --- a/drivers/net/sfc/base/efx_lic.c
>> +++ b/drivers/net/sfc/base/efx_lic.c
>> @@ -498,7 +498,7 @@ efx_lic_v1v2_find_key(
>>   	return (found);
>>   
>>   fail1:
>> -	EFSYS_PROBE(fail1);
>> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>>   
>>   	return (B_FALSE);
>>   }
>> @@ -540,7 +540,7 @@ efx_lic_v1v2_validate_key(
>>   fail2:
>>   	EFSYS_PROBE(fail2);
>>   fail1:
>> -	EFSYS_PROBE(fail1);
>> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>>   
>>   	return (B_FALSE);
>>   }
>> @@ -1158,7 +1158,7 @@ efx_lic_v3_validate_key(
>>   fail2:
>>   	EFSYS_PROBE(fail2);
>>   fail1:
>> -	EFSYS_PROBE(fail1);
>> +	EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
>>   
>>   	return (B_FALSE);
>>   }
>>

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

* Re: [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues
  2017-11-27 19:58   ` Ferruh Yigit
@ 2017-11-28 11:49     ` Andrew Rybchenko
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-28 11:49 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Andy Moreton, stable

On 11/27/2017 10:58 PM, Ferruh Yigit wrote:
> On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
>> From: Andy Moreton <amoreton@solarflare.com>
>>
> PREfast seems a static analysis tool. Can you please give more detail about
> fixed issue itself. "fix PREfast issue" is not informative about what has been
> fixed.
>
> If you can send the details I can amend the commit.

Add missing annotation that function return value should not be
ignored. Fix alignment.

Thanks,
Andrew.

>
> Thanks,
> ferruh
>
>> Fixes: 19b64c6ac35f ("net/sfc/base: import libefx base")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Andy Moreton <amoreton@solarflare.com>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>   drivers/net/sfc/base/efx.h     | 12 ++++++------
>>   drivers/net/sfc/base/efx_phy.c |  2 +-
>>   2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
>> index 834eea0..ca0f945 100644
>> --- a/drivers/net/sfc/base/efx.h
>> +++ b/drivers/net/sfc/base/efx.h
>> @@ -913,13 +913,13 @@ efx_phy_media_type_get(
>>   	__in		efx_nic_t *enp,
>>   	__out		efx_phy_media_type_t *typep);
>>   
>> -extern					efx_rc_t
>> +extern	__checkReturn		efx_rc_t
>>   efx_phy_module_get_info(
>> -	__in				efx_nic_t *enp,
>> -	__in				uint8_t dev_addr,
>> -	__in				uint8_t offset,
>> -	__in				uint8_t len,
>> -	__out_bcount(len)		uint8_t *data);
>> +	__in			efx_nic_t *enp,
>> +	__in			uint8_t dev_addr,
>> +	__in			uint8_t offset,
>> +	__in			uint8_t len,
>> +	__out_bcount(len)	uint8_t *data);
>>   
>>   #if EFSYS_OPT_PHY_STATS
>>   
>> diff --git a/drivers/net/sfc/base/efx_phy.c b/drivers/net/sfc/base/efx_phy.c
>> index 752cd52..c81a91c 100644
>> --- a/drivers/net/sfc/base/efx_phy.c
>> +++ b/drivers/net/sfc/base/efx_phy.c
>> @@ -296,7 +296,7 @@ efx_phy_media_type_get(
>>   		*typep = epp->ep_fixed_port_type;
>>   }
>>   
>> -	__checkReturn	efx_rc_t
>> +	__checkReturn		efx_rc_t
>>   efx_phy_module_get_info(
>>   	__in			efx_nic_t *enp,
>>   	__in			uint8_t dev_addr,
>>

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

* Re: [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support
  2017-11-28 10:17     ` Andrew Rybchenko
@ 2017-11-28 21:38       ` Ferruh Yigit
  2017-11-29  9:51         ` Andrew Rybchenko
  0 siblings, 1 reply; 21+ messages in thread
From: Ferruh Yigit @ 2017-11-28 21:38 UTC (permalink / raw)
  To: Andrew Rybchenko, dev; +Cc: Mark Spender, stable

On 11/28/2017 2:17 AM, Andrew Rybchenko wrote:
> On 11/27/2017 10:58 PM, Ferruh Yigit wrote:
>> On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
>>> From: Mark Spender <mspender@solarflare.com>
>>>
>> What has been fixed here?
>> If you can provide more details I can amend the commit later.
> 
> EFSYS_PROBE1 takes one typed value (in addition to the probe name),
> whereas EFSYS_PROBE has just the probe name.
> 
> Which to use is determined by the probe name – “fail1” probes are
> expected to include the function result.

Commits are amended with shared updates and pushed, this and other ones.

Thanks,
ferruh

> 
> Thanks,
> Andrew.
> 
>>> Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Mark Spender <mspender@solarflare.com>
>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
<...>

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

* Re: [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support
  2017-11-28 21:38       ` Ferruh Yigit
@ 2017-11-29  9:51         ` Andrew Rybchenko
  0 siblings, 0 replies; 21+ messages in thread
From: Andrew Rybchenko @ 2017-11-29  9:51 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Mark Spender, stable

On 11/29/2017 12:38 AM, Ferruh Yigit wrote:
> On 11/28/2017 2:17 AM, Andrew Rybchenko wrote:
>> On 11/27/2017 10:58 PM, Ferruh Yigit wrote:
>>> On 11/16/2017 12:04 AM, Andrew Rybchenko wrote:
>>>> From: Mark Spender <mspender@solarflare.com>
>>>>
>>> What has been fixed here?
>>> If you can provide more details I can amend the commit later.
>> EFSYS_PROBE1 takes one typed value (in addition to the probe name),
>> whereas EFSYS_PROBE has just the probe name.
>>
>> Which to use is determined by the probe name – “fail1” probes are
>> expected to include the function result.
> Commits are amended with shared updates and pushed, this and other ones.

Ferruh, many thanks for review and your notes/questions.

> Thanks,
> ferruh
>
>> Thanks,
>> Andrew.
>>
>>>> Fixes: 05fce2ce8451 ("net/sfc/base: import libefx licensing")
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: Mark Spender <mspender@solarflare.com>
>>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> <...>

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

end of thread, other threads:[~2017-11-29  9:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1510819481-6809-1-git-send-email-arybchenko@solarflare.com>
2017-11-16  8:03 ` [dpdk-stable] [PATCH 03/53] net/sfc/base: fix result code in MCDI NVRAM update finish Andrew Rybchenko
2017-11-16  8:03 ` [dpdk-stable] [PATCH 11/53] net/sfc/base: fix check in NVRAM validate Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 15/53] net/sfc/base: fix PreFAST issues Andrew Rybchenko
2017-11-27 19:58   ` Ferruh Yigit
2017-11-28 11:49     ` Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 34/53] net/sfc/base: fix build issue with PHY LED control enabled Andrew Rybchenko
2017-11-27 19:59   ` Ferruh Yigit
2017-11-16  8:04 ` [dpdk-stable] [PATCH 41/53] net/sfc/base: fix diagnostics support build without Siena Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 42/53] net/sfc/base: fix probes in licensing support Andrew Rybchenko
2017-11-27 19:58   ` Ferruh Yigit
2017-11-28 10:17     ` Andrew Rybchenko
2017-11-28 21:38       ` Ferruh Yigit
2017-11-29  9:51         ` Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 43/53] net/sfc/base: fix warnings from VS2015 C compiler (C4310) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 44/53] net/sfc/base: fix warnings from VS2015 C compiler (C4244) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 45/53] net/sfc/base: fix warnings from VS2015 C compiler (C4245) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 46/53] net/sfc/base: fix warnings from VS2015 C compiler (C4100) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 47/53] net/sfc/base: fix warnings from VS2015 C compiler (C4189) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 48/53] net/sfc/base: fix warnings from VS2015 C compiler (C4057) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 49/53] net/sfc/base: fix warnings from VS2015 C compiler (C4214) Andrew Rybchenko
2017-11-16  8:04 ` [dpdk-stable] [PATCH 52/53] net/sfc/base: fix PreFAST static analysis warning (C6001) Andrew Rybchenko

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