From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <mkalderon@marvell.com>, <aelior@marvell.com>
Subject: [PATCH net-next 2/2] qed: Fix Config attribute frame format.
Date: Wed, 11 Sep 2019 04:42:51 -0700 [thread overview]
Message-ID: <20190911114251.7013-3-skalluru@marvell.com> (raw)
In-Reply-To: <20190911114251.7013-1-skalluru@marvell.com>
MFW associates the entity id to a config attribute instead of assigning
one entity id for all the config attributes.
This patch incorporates driver changes to link entity id to a config id
attribute.
Fixes: 0dabbe1bb3a4 ("qed: Add driver API for flashing the config attributes.")
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 | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 38c0ec3..2ce7009 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -2240,12 +2240,13 @@ static int qed_nvm_flash_image_validate(struct qed_dev *cdev,
/* Binary file format -
* /----------------------------------------------------------------------\
* 0B | 0x5 [command index] |
- * 4B | Entity ID | Reserved | Number of config attributes |
- * 8B | Config ID | Length | Value |
+ * 4B | Number of config attributes | Reserved |
+ * 4B | Config ID | Entity ID | Length |
+ * 4B | 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.
+ * There can be several cfg_id-entity_id-Length-Value sets as specified by
+ * 'Number of config attributes'.
*
* The API parses config attributes from the user provided buffer and flashes
* them to the respective NVM path using Management FW inerface.
@@ -2265,18 +2266,17 @@ static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
/* NVM CFG ID attribute header */
*data += 4;
- entity_id = **data;
- *data += 2;
count = *((u16 *)*data);
- *data += 2;
+ *data += 4;
DP_VERBOSE(cdev, NETIF_MSG_DRV,
- "Read config ids: entity id %02x num _attrs = %0d\n",
- entity_id, count);
+ "Read config ids: num_attrs = %0d\n", count);
/* NVM CFG ID attributes */
for (i = 0; i < count; i++) {
cfg_id = *((u16 *)*data);
*data += 2;
+ entity_id = **data;
+ (*data)++;
len = **data;
(*data)++;
memcpy(buf, *data, len);
@@ -2286,7 +2286,8 @@ static int qed_nvm_flash_cfg_write(struct qed_dev *cdev, const u8 **data)
QED_NVM_CFG_SET_FLAGS;
DP_VERBOSE(cdev, NETIF_MSG_DRV,
- "cfg_id = %d len = %d\n", cfg_id, len);
+ "cfg_id = %d entity = %d len = %d\n", cfg_id,
+ entity_id, len);
rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags,
buf, len);
if (rc) {
--
1.8.3.1
next prev parent reply other threads:[~2019-09-11 11:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 11:42 [PATCH net-next 0/2] qed* Fix series Sudarsana Reddy Kalluru
2019-09-11 11:42 ` [PATCH net-next 1/2] qed*: Fix size of config attribute dump Sudarsana Reddy Kalluru
2019-09-11 11:42 ` Sudarsana Reddy Kalluru [this message]
2019-09-11 14:15 ` [PATCH net-next 0/2] qed* Fix series David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190911114251.7013-3-skalluru@marvell.com \
--to=skalluru@marvell.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=mkalderon@marvell.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).