All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/2] qed*: Support for NVM config attributes.
@ 2019-07-28  1:55 Sudarsana Reddy Kalluru
  2019-07-28  1:55 ` [PATCH net-next v3 1/2] qed: Add API for configuring NVM attributes Sudarsana Reddy Kalluru
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-28  1:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, mkalderon, aelior

The patch series adds support for managing the NVM config attributes.
Patch (1) adds functionality to update config attributes via MFW.
Patch (2) adds driver interface for updating the config attributes.

Changes from previous versions:
-------------------------------
v3: Removed unused variable.
v2: Removed unused API.

Please consider applying this series to "net-next".

Sudarsana Reddy Kalluru (2):
  qed: Add API for configuring NVM attributes.
  qed: Add driver API for flashing the config attributes.

 drivers/net/ethernet/qlogic/qed/qed_hsi.h  | 17 ++++++++
 drivers/net/ethernet/qlogic/qed/qed_main.c | 65 ++++++++++++++++++++++++++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.c  | 32 +++++++++++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.h  | 20 +++++++++
 include/linux/qed/qed_if.h                 |  1 +
 5 files changed, 135 insertions(+)

-- 
1.8.3.1


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

* [PATCH net-next v3 1/2] qed: Add API for configuring NVM attributes.
  2019-07-28  1:55 [PATCH net-next v3 0/2] qed*: Support for NVM config attributes Sudarsana Reddy Kalluru
@ 2019-07-28  1:55 ` Sudarsana Reddy Kalluru
  2019-07-28  1:55 ` [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes Sudarsana Reddy Kalluru
  2019-07-28  2:13 ` [PATCH net-next v3 0/2] qed*: Support for NVM " David Miller
  2 siblings, 0 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-28  1:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, mkalderon, aelior

The patch adds API for configuring the NVM config attributes using
Management FW (MFW) interfaces.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_hsi.h | 17 ++++++++++++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.c | 32 +++++++++++++++++++++++++++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.h | 20 +++++++++++++++++++
 3 files changed, 69 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_hsi.h b/drivers/net/ethernet/qlogic/qed/qed_hsi.h
index e054f6c..557a12e 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_hsi.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_hsi.h
@@ -12580,6 +12580,8 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_BW_UPDATE_ACK		0x32000000
 #define DRV_MSG_CODE_NIG_DRAIN			0x30000000
 #define DRV_MSG_CODE_S_TAG_UPDATE_ACK		0x3b000000
+#define DRV_MSG_CODE_GET_NVM_CFG_OPTION		0x003e0000
+#define DRV_MSG_CODE_SET_NVM_CFG_OPTION		0x003f0000
 #define DRV_MSG_CODE_INITIATE_PF_FLR            0x02010000
 #define DRV_MSG_CODE_VF_DISABLED_DONE		0xc0000000
 #define DRV_MSG_CODE_CFG_VF_MSIX		0xc0010000
@@ -12748,6 +12750,21 @@ struct public_drv_mb {
 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_EEE		0x00000002
 #define DRV_MB_PARAM_FEATURE_SUPPORT_FUNC_VLINK		0x00010000
 
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ID_SHIFT		0
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ID_MASK		0x0000FFFF
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ALL_SHIFT		16
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ALL_MASK		0x00010000
+#define DRV_MB_PARAM_NVM_CFG_OPTION_INIT_SHIFT		17
+#define DRV_MB_PARAM_NVM_CFG_OPTION_INIT_MASK		0x00020000
+#define DRV_MB_PARAM_NVM_CFG_OPTION_COMMIT_SHIFT	18
+#define DRV_MB_PARAM_NVM_CFG_OPTION_COMMIT_MASK		0x00040000
+#define DRV_MB_PARAM_NVM_CFG_OPTION_FREE_SHIFT		19
+#define DRV_MB_PARAM_NVM_CFG_OPTION_FREE_MASK		0x00080000
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_SEL_SHIFT	20
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_SEL_MASK	0x00100000
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_ID_SHIFT	24
+#define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_ID_MASK	0x0f000000
+
 	u32 fw_mb_header;
 #define FW_MSG_CODE_MASK			0xffff0000
 #define FW_MSG_CODE_UNSUPPORTED                 0x00000000
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index 758702c..89462c4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -3750,3 +3750,35 @@ int qed_mcp_get_ppfid_bitmap(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 
 	return 0;
 }
+
+int qed_mcp_nvm_set_cfg(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
+			u16 option_id, u8 entity_id, u16 flags, u8 *p_buf,
+			u32 len)
+{
+	u32 mb_param = 0, resp, param;
+
+	QED_MFW_SET_FIELD(mb_param, DRV_MB_PARAM_NVM_CFG_OPTION_ID, option_id);
+	if (flags & QED_NVM_CFG_OPTION_ALL)
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_ALL, 1);
+	if (flags & QED_NVM_CFG_OPTION_INIT)
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_INIT, 1);
+	if (flags & QED_NVM_CFG_OPTION_COMMIT)
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_COMMIT, 1);
+	if (flags & QED_NVM_CFG_OPTION_FREE)
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_FREE, 1);
+	if (flags & QED_NVM_CFG_OPTION_ENTITY_SEL) {
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_SEL, 1);
+		QED_MFW_SET_FIELD(mb_param,
+				  DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_ID,
+				  entity_id);
+	}
+
+	return qed_mcp_nvm_wr_cmd(p_hwfn, p_ptt,
+				  DRV_MSG_CODE_SET_NVM_CFG_OPTION,
+				  mb_param, &resp, &param, len, (u32 *)p_buf);
+}
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
index e4f8fe4..83649a8 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
@@ -251,6 +251,12 @@ struct qed_mfw_tlv_generic {
 	struct qed_mfw_tlv_iscsi iscsi;
 };
 
+#define QED_NVM_CFG_OPTION_ALL		BIT(0)
+#define QED_NVM_CFG_OPTION_INIT		BIT(1)
+#define QED_NVM_CFG_OPTION_COMMIT       BIT(2)
+#define QED_NVM_CFG_OPTION_FREE		BIT(3)
+#define QED_NVM_CFG_OPTION_ENTITY_SEL	BIT(4)
+
 /**
  * @brief - returns the link params of the hw function
  *
@@ -1202,4 +1208,18 @@ void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock,
  */
 int qed_mcp_get_ppfid_bitmap(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
 
+/**
+ * @brief Set NVM config attribute value.
+ *
+ * @param p_hwfn
+ * @param p_ptt
+ * @param option_id
+ * @param entity_id
+ * @param flags
+ * @param p_buf
+ * @param len
+ */
+int qed_mcp_nvm_set_cfg(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
+			u16 option_id, u8 entity_id, u16 flags, u8 *p_buf,
+			u32 len);
 #endif
-- 
1.8.3.1


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

* [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes.
  2019-07-28  1:55 [PATCH net-next v3 0/2] qed*: Support for NVM config attributes Sudarsana Reddy Kalluru
  2019-07-28  1:55 ` [PATCH net-next v3 1/2] qed: Add API for configuring NVM attributes Sudarsana Reddy Kalluru
@ 2019-07-28  1:55 ` Sudarsana Reddy Kalluru
  2019-07-29 18:03   ` David Miller
  2019-07-28  2:13 ` [PATCH net-next v3 0/2] qed*: Support for NVM " David Miller
  2 siblings, 1 reply; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-28  1:55 UTC (permalink / raw)
  To: davem; +Cc: netdev, mkalderon, aelior

The patch adds driver interface for reading the NVM config request and
update the attributes on nvm config flash partition.
This API can be used by ethtool flash update command (i.e., ethtool -f) to
update config attributes in the NVM flash parition.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_main.c | 65 ++++++++++++++++++++++++++++++
 include/linux/qed/qed_if.h                 |  1 +
 2 files changed, 66 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 829dd60..54f00d2 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -67,6 +67,8 @@
 #define QED_ROCE_QPS			(8192)
 #define QED_ROCE_DPIS			(8)
 #define QED_RDMA_SRQS                   QED_ROCE_QPS
+#define QED_NVM_CFG_SET_FLAGS		0xE
+#define QED_NVM_CFG_SET_PF_FLAGS	0x1E
 
 static char version[] =
 	"QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n";
@@ -2227,6 +2229,66 @@ static int qed_nvm_flash_image_validate(struct qed_dev *cdev,
 	return 0;
 }
 
+/* Binary file format -
+ *     /----------------------------------------------------------------------\
+ * 0B  |                       0x5 [command index]                            |
+ * 4B  | Entity ID     | Reserved        |  Number of config attributes       |
+ * 8B  | Config ID                       | Length        | Value              |
+ *     |                                                                      |
+ *     \----------------------------------------------------------------------/
+ * There can be several Cfg_id-Length-Value sets as specified by 'Number of...'.
+ * Entity ID - A non zero entity value for which the config need to be updated.
+ */
+static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
+{
+	struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
+	u8 entity_id, len, buf[32];
+	struct qed_ptt *ptt;
+	u16 cfg_id, count;
+	int rc = 0, i;
+	u32 flags;
+
+	ptt = qed_ptt_acquire(hwfn);
+	if (!ptt)
+		return -EAGAIN;
+
+	/* NVM CFG ID attribute header */
+	*data += 4;
+	entity_id = **data;
+	*data += 2;
+	count = *((u16 *)*data);
+	*data += 2;
+
+	DP_VERBOSE(cdev, NETIF_MSG_DRV,
+		   "Read config ids: entity id %02x num _attrs = %0d\n",
+		   entity_id, count);
+	/* NVM CFG ID attributes */
+	for (i = 0; i < count; i++) {
+		cfg_id = *((u16 *)*data);
+		*data += 2;
+		len = **data;
+		(*data)++;
+		memcpy(buf, *data, len);
+		*data += len;
+
+		flags = entity_id ? QED_NVM_CFG_SET_PF_FLAGS :
+			QED_NVM_CFG_SET_FLAGS;
+
+		DP_VERBOSE(cdev, NETIF_MSG_DRV,
+			   "cfg_id = %d len = %d\n", cfg_id, len);
+		rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags,
+					 buf, len);
+		if (rc) {
+			DP_ERR(cdev, "Error %d configuring %d\n", rc, cfg_id);
+			break;
+		}
+	}
+
+	qed_ptt_release(hwfn, ptt);
+
+	return rc;
+}
+
 static int qed_nvm_flash(struct qed_dev *cdev, const char *name)
 {
 	const struct firmware *image;
@@ -2268,6 +2330,9 @@ static int qed_nvm_flash(struct qed_dev *cdev, const char *name)
 			rc = qed_nvm_flash_image_access(cdev, &data,
 							&check_resp);
 			break;
+		case QED_NVM_FLASH_CMD_NVM_CFG_ID:
+			rc = qed_nvm_flash_cfg_write(cdev, &data);
+			break;
 		default:
 			DP_ERR(cdev, "Unknown command %08x\n", cmd_type);
 			rc = -EINVAL;
diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h
index eef02e6..23805ea 100644
--- a/include/linux/qed/qed_if.h
+++ b/include/linux/qed/qed_if.h
@@ -804,6 +804,7 @@ enum qed_nvm_flash_cmd {
 	QED_NVM_FLASH_CMD_FILE_DATA = 0x2,
 	QED_NVM_FLASH_CMD_FILE_START = 0x3,
 	QED_NVM_FLASH_CMD_NVM_CHANGE = 0x4,
+	QED_NVM_FLASH_CMD_NVM_CFG_ID = 0x5,
 	QED_NVM_FLASH_CMD_NVM_MAX,
 };
 
-- 
1.8.3.1


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

* Re: [PATCH net-next v3 0/2] qed*: Support for NVM config attributes.
  2019-07-28  1:55 [PATCH net-next v3 0/2] qed*: Support for NVM config attributes Sudarsana Reddy Kalluru
  2019-07-28  1:55 ` [PATCH net-next v3 1/2] qed: Add API for configuring NVM attributes Sudarsana Reddy Kalluru
  2019-07-28  1:55 ` [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes Sudarsana Reddy Kalluru
@ 2019-07-28  2:13 ` David Miller
  2019-07-29  7:16   ` Sudarsana Reddy Kalluru
  2 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2019-07-28  2:13 UTC (permalink / raw)
  To: skalluru; +Cc: netdev, mkalderon, aelior

From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Date: Sat, 27 Jul 2019 18:55:47 -0700

> The patch series adds support for managing the NVM config attributes.
> Patch (1) adds functionality to update config attributes via MFW.
> Patch (2) adds driver interface for updating the config attributes.
> 
> Changes from previous versions:
> -------------------------------
> v3: Removed unused variable.
> v2: Removed unused API.
> 
> Please consider applying this series to "net-next".

I don't see where an existing ethtool method hooks into and calls this
new NVM code.

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

* RE: [PATCH net-next v3 0/2] qed*: Support for NVM config attributes.
  2019-07-28  2:13 ` [PATCH net-next v3 0/2] qed*: Support for NVM " David Miller
@ 2019-07-29  7:16   ` Sudarsana Reddy Kalluru
  0 siblings, 0 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-29  7:16 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michal Kalderon, Ariel Elior

> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Sunday, July 28, 2019 7:43 AM
> To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Cc: netdev@vger.kernel.org; Michal Kalderon <mkalderon@marvell.com>;
> Ariel Elior <aelior@marvell.com>
> Subject: Re: [PATCH net-next v3 0/2] qed*: Support for NVM config
> attributes.
> 
> From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Date: Sat, 27 Jul 2019 18:55:47 -0700
> 
> > The patch series adds support for managing the NVM config attributes.
> > Patch (1) adds functionality to update config attributes via MFW.
> > Patch (2) adds driver interface for updating the config attributes.
> >
> > Changes from previous versions:
> > -------------------------------
> > v3: Removed unused variable.
> > v2: Removed unused API.
> >
> > Please consider applying this series to "net-next".
> 
> I don't see where an existing ethtool method hooks into and calls this new
> NVM code.
Dave, 
  The new API/functionality is invoked as part of ethtool flash (ethtool -f) implementation.
Example code path:
   ethtool_ops-->flash_device--> qede_flash_device() --> qed_nvm_flash() --> qed_nvm_flash_cfg_write() --> qed_mcp_nvm_set_cfg()
Thanks,
Sudarsana


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

* Re: [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes.
  2019-07-28  1:55 ` [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes Sudarsana Reddy Kalluru
@ 2019-07-29 18:03   ` David Miller
  2019-07-30  3:36     ` Sudarsana Reddy Kalluru
  0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2019-07-29 18:03 UTC (permalink / raw)
  To: skalluru; +Cc: netdev, mkalderon, aelior

From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Date: Sat, 27 Jul 2019 18:55:49 -0700

> @@ -2268,6 +2330,9 @@ static int qed_nvm_flash(struct qed_dev *cdev, const char *name)
>  			rc = qed_nvm_flash_image_access(cdev, &data,
>  							&check_resp);
>  			break;
> +		case QED_NVM_FLASH_CMD_NVM_CFG_ID:
> +			rc = qed_nvm_flash_cfg_write(cdev, &data);
> +			break;
>  		default:
>  			DP_ERR(cdev, "Unknown command %08x\n", cmd_type);

I don't see how any existing portable interface can cause this new code to
actually be used.

You have to explain this to me.

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

* RE: [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes.
  2019-07-29 18:03   ` David Miller
@ 2019-07-30  3:36     ` Sudarsana Reddy Kalluru
  2019-08-05 14:30       ` Ariel Elior
  0 siblings, 1 reply; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-07-30  3:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michal Kalderon, Ariel Elior

> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Monday, July 29, 2019 11:34 PM
> To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Cc: netdev@vger.kernel.org; Michal Kalderon <mkalderon@marvell.com>;
> Ariel Elior <aelior@marvell.com>
> Subject: Re: [PATCH net-next v3 2/2] qed: Add driver API for flashing the
> config attributes.
> 
> From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Date: Sat, 27 Jul 2019 18:55:49 -0700
> 
> > @@ -2268,6 +2330,9 @@ static int qed_nvm_flash(struct qed_dev *cdev,
> const char *name)
> >  			rc = qed_nvm_flash_image_access(cdev, &data,
> >  							&check_resp);
> >  			break;
> > +		case QED_NVM_FLASH_CMD_NVM_CFG_ID:
> > +			rc = qed_nvm_flash_cfg_write(cdev, &data);
> > +			break;

> >  		default:
> >  			DP_ERR(cdev, "Unknown command %08x\n",
> cmd_type);
> 
> I don't see how any existing portable interface can cause this new code to
> actually be used.
> 
> You have to explain this to me.
The API qed_nvm_flash() is used to flash the user provided data (e.g., Management FW) to the required partitions of the adapter. 
   - Format of the input file would be - file signature info, followed by one or more data sets.
   - Each data set is represented with the header followed by its contents. Header captures info such as command name (e.g., FILE_START), data size etc., which specifies how to handle the data.
The API qed_nvm_flash() validates the user provided input file, parses the data sets and handles each accordingly. Here one of the data sets (preferably the last one) could be nvm-attributes page (with cmd-id = QED_NVM_FLASH_CMD_NVM_CHANGE).  

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

* RE: [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes.
  2019-07-30  3:36     ` Sudarsana Reddy Kalluru
@ 2019-08-05 14:30       ` Ariel Elior
  2019-08-12  4:16         ` Sudarsana Reddy Kalluru
  0 siblings, 1 reply; 9+ messages in thread
From: Ariel Elior @ 2019-08-05 14:30 UTC (permalink / raw)
  To: Sudarsana Reddy Kalluru, David Miller; +Cc: netdev, Michal Kalderon

> From: Sudarsana Reddy Kalluru
> Sent: Tuesday, July 30, 2019 6:36 AM
> To: David Miller <davem@davemloft.net>
> 
> > -----Original Message-----
> > From: David Miller <davem@davemloft.net>
> > Sent: Monday, July 29, 2019 11:34 PM
> > To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> > Cc: netdev@vger.kernel.org; Michal Kalderon <mkalderon@marvell.com>;
> > Ariel Elior <aelior@marvell.com>
> > Subject: Re: [PATCH net-next v3 2/2] qed: Add driver API for flashing
> > the config attributes.
> >
> > From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> > Date: Sat, 27 Jul 2019 18:55:49 -0700
> >
> > > @@ -2268,6 +2330,9 @@ static int qed_nvm_flash(struct qed_dev *cdev,
> > const char *name)
> > >  			rc = qed_nvm_flash_image_access(cdev, &data,
> > >  							&check_resp);
> > >  			break;
> > > +		case QED_NVM_FLASH_CMD_NVM_CFG_ID:
> > > +			rc = qed_nvm_flash_cfg_write(cdev, &data);
> > > +			break;
> 
> > >  		default:
> > >  			DP_ERR(cdev, "Unknown command %08x\n",
> > cmd_type);
> >
> > I don't see how any existing portable interface can cause this new
> > code to actually be used.
> >
> > You have to explain this to me.
> The API qed_nvm_flash() is used to flash the user provided data (e.g.,
> Management FW) to the required partitions of the adapter.
>    - Format of the input file would be - file signature info, followed by one or
> more data sets.
>    - Each data set is represented with the header followed by its contents.
> Header captures info such as command name (e.g., FILE_START), data size
> etc., which specifies how to handle the data.
> The API qed_nvm_flash() validates the user provided input file, parses the
> data sets and handles each accordingly. Here one of the data sets (preferably
> the last one) could be nvm-attributes page (with cmd-id =
> QED_NVM_FLASH_CMD_NVM_CHANGE).

This is basically an expansion of our existing ethtool -f implementation.
The management FW has exposed an additional method of configuring
some of the nvram options, and this makes use of that. The new code will
come into use when newer FW files which contain configuration directives
employing this API will be provided to ethtool -f.

thanks,
Ariel


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

* RE: [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes.
  2019-08-05 14:30       ` Ariel Elior
@ 2019-08-12  4:16         ` Sudarsana Reddy Kalluru
  0 siblings, 0 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-08-12  4:16 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Michal Kalderon, Ariel Elior

> -----Original Message-----
> From: Ariel Elior <aelior@marvell.com>
> Sent: Monday, August 5, 2019 8:00 PM
> To: Sudarsana Reddy Kalluru <skalluru@marvell.com>; David Miller
> <davem@davemloft.net>
> Cc: netdev@vger.kernel.org; Michal Kalderon <mkalderon@marvell.com>
> Subject: RE: [PATCH net-next v3 2/2] qed: Add driver API for flashing the
> config attributes.
> 
> > From: Sudarsana Reddy Kalluru
> > Sent: Tuesday, July 30, 2019 6:36 AM
> > To: David Miller <davem@davemloft.net>
> >
> > > -----Original Message-----
> > > From: David Miller <davem@davemloft.net>
> > > Sent: Monday, July 29, 2019 11:34 PM
> > > To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> > > Cc: netdev@vger.kernel.org; Michal Kalderon
> <mkalderon@marvell.com>;
> > > Ariel Elior <aelior@marvell.com>
> > > Subject: Re: [PATCH net-next v3 2/2] qed: Add driver API for
> > > flashing the config attributes.
> > >
> > > From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> > > Date: Sat, 27 Jul 2019 18:55:49 -0700
> > >
> > > > @@ -2268,6 +2330,9 @@ static int qed_nvm_flash(struct qed_dev
> > > > *cdev,
> > > const char *name)
> > > >  			rc = qed_nvm_flash_image_access(cdev, &data,
> > > >  							&check_resp);
> > > >  			break;
> > > > +		case QED_NVM_FLASH_CMD_NVM_CFG_ID:
> > > > +			rc = qed_nvm_flash_cfg_write(cdev, &data);
> > > > +			break;
> >
> > > >  		default:
> > > >  			DP_ERR(cdev, "Unknown command %08x\n",
> > > cmd_type);
> > >
> > > I don't see how any existing portable interface can cause this new
> > > code to actually be used.
> > >
> > > You have to explain this to me.
> > The API qed_nvm_flash() is used to flash the user provided data (e.g.,
> > Management FW) to the required partitions of the adapter.
> >    - Format of the input file would be - file signature info, followed
> > by one or more data sets.
> >    - Each data set is represented with the header followed by its contents.
> > Header captures info such as command name (e.g., FILE_START), data
> > size etc., which specifies how to handle the data.
> > The API qed_nvm_flash() validates the user provided input file, parses
> > the data sets and handles each accordingly. Here one of the data sets
> > (preferably the last one) could be nvm-attributes page (with cmd-id =
> > QED_NVM_FLASH_CMD_NVM_CHANGE).
> 
> This is basically an expansion of our existing ethtool -f implementation.
> The management FW has exposed an additional method of configuring some
> of the nvram options, and this makes use of that. The new code will come
> into use when newer FW files which contain configuration directives
> employing this API will be provided to ethtool -f.
> 
> thanks,
> Ariel

Dave,
    The series appears as "changes requested" in patchwork. Please let us know if any modifications need to be incorporated on this series?

Thanks,
Sudarsana

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

end of thread, other threads:[~2019-08-12  4:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28  1:55 [PATCH net-next v3 0/2] qed*: Support for NVM config attributes Sudarsana Reddy Kalluru
2019-07-28  1:55 ` [PATCH net-next v3 1/2] qed: Add API for configuring NVM attributes Sudarsana Reddy Kalluru
2019-07-28  1:55 ` [PATCH net-next v3 2/2] qed: Add driver API for flashing the config attributes Sudarsana Reddy Kalluru
2019-07-29 18:03   ` David Miller
2019-07-30  3:36     ` Sudarsana Reddy Kalluru
2019-08-05 14:30       ` Ariel Elior
2019-08-12  4:16         ` Sudarsana Reddy Kalluru
2019-07-28  2:13 ` [PATCH net-next v3 0/2] qed*: Support for NVM " David Miller
2019-07-29  7:16   ` Sudarsana Reddy Kalluru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.