netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 net-next 0/9] bnxt_en: devlink param updates
@ 2018-10-04  5:43 Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 1/9] devlink: Add generic parameter ignore_ari Vasundhara Volam
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patchset adds support for 3 generic and 1 driver-specific devlink
parameters. Add documentation for these configuration parameters.

Also, this patchset adds support to return proper error code if
HWRM_NVM_GET/SET_VARIABLE commands return error code
HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED.

v3->v4:
-Remove extra definition of NVM_OFF_HW_TC_OFFLOAD from bnxt_devlink.h
-Remove type information for generic parameters from
devlink-params-bnxt.txt

v2->v3:
-Remove description of generic parameters from devlink-params-bnxt.txt

v1->v2:
-Remove hw_tc_offload parameter.
-Update all patches with Cc of MAINTAINERS.
-Add more description in commit message for device specific parameter.
-Add a new Documentation/networking/devlink-params.txt with some
generic devlink parameters information.
-Add a new Documentation/networking/devlink-params-bnxt.txt with devlink
parameters information that are supported by bnxt_en driver.

Vasundhara Volam (9):
  devlink: Add generic parameter ignore_ari
  devlink: Add generic parameter msix_vec_per_pf_max
  devlink: Add generic parameter msix_vec_per_pf_min
  bnxt_en: Use ignore_ari devlink parameter
  bnxt_en: return proper error when FW returns
    HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED
  bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink
    params.
  bnxt_en: Add a driver specific gre_ver_check devlink parameter.
  devlink: Add Documentation/networking/devlink-params.txt
  devlink: Add Documentation/networking/devlink-params-bnxt.txt

 Documentation/networking/devlink-params-bnxt.txt  | 18 +++++
 Documentation/networking/devlink-params.txt       | 42 +++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 86 +++++++++++++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h |  7 ++
 include/net/devlink.h                             | 12 ++++
 net/core/devlink.c                                | 15 ++++
 6 files changed, 176 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/networking/devlink-params-bnxt.txt
 create mode 100644 Documentation/networking/devlink-params.txt

-- 
1.8.3.1

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

* [PATCH v4 net-next 1/9] devlink: Add generic parameter ignore_ari
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 2/9] devlink: Add generic parameter msix_vec_per_pf_max Vasundhara Volam
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

ignore_ari - Device ignores ARI(Alternate Routing ID) capability,
even when platforms has the support and creates same number of
partitions when platform does not support ARI capability.

Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 include/net/devlink.h | 4 ++++
 net/core/devlink.c    | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index b9b89d6..90d8343 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -362,6 +362,7 @@ enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_MAX_MACS,
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV,
 	DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT,
+	DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -380,6 +381,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_REGION_SNAPSHOT_NAME "region_snapshot_enable"
 #define DEVLINK_PARAM_GENERIC_REGION_SNAPSHOT_TYPE DEVLINK_PARAM_TYPE_BOOL
 
+#define DEVLINK_PARAM_GENERIC_IGNORE_ARI_NAME "ignore_ari"
+#define DEVLINK_PARAM_GENERIC_IGNORE_ARI_TYPE DEVLINK_PARAM_TYPE_BOOL
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
 {									\
 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 8c0ed22..3349a4d 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2675,6 +2675,11 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
 		.name = DEVLINK_PARAM_GENERIC_REGION_SNAPSHOT_NAME,
 		.type = DEVLINK_PARAM_GENERIC_REGION_SNAPSHOT_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI,
+		.name = DEVLINK_PARAM_GENERIC_IGNORE_ARI_NAME,
+		.type = DEVLINK_PARAM_GENERIC_IGNORE_ARI_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)
-- 
1.8.3.1

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

* [PATCH v4 net-next 2/9] devlink: Add generic parameter msix_vec_per_pf_max
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 1/9] devlink: Add generic parameter ignore_ari Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 3/9] devlink: Add generic parameter msix_vec_per_pf_min Vasundhara Volam
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

msix_vec_per_pf_max - This param sets the number of MSIX vectors
that the device requests from the host on driver initialization.
This value is set in the device which is applicable per PF.

Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 include/net/devlink.h | 4 ++++
 net/core/devlink.c    | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index 90d8343..59be17b 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -363,6 +363,7 @@ enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV,
 	DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT,
 	DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI,
+	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -384,6 +385,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_IGNORE_ARI_NAME "ignore_ari"
 #define DEVLINK_PARAM_GENERIC_IGNORE_ARI_TYPE DEVLINK_PARAM_TYPE_BOOL
 
+#define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_NAME "msix_vec_per_pf_max"
+#define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_TYPE DEVLINK_PARAM_TYPE_U32
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
 {									\
 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 3349a4d..ce9fe63 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2680,6 +2680,11 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
 		.name = DEVLINK_PARAM_GENERIC_IGNORE_ARI_NAME,
 		.type = DEVLINK_PARAM_GENERIC_IGNORE_ARI_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
+		.name = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_NAME,
+		.type = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)
-- 
1.8.3.1

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

* [PATCH v4 net-next 3/9] devlink: Add generic parameter msix_vec_per_pf_min
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 1/9] devlink: Add generic parameter ignore_ari Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 2/9] devlink: Add generic parameter msix_vec_per_pf_max Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 4/9] bnxt_en: Use ignore_ari devlink parameter Vasundhara Volam
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

msix_vec_per_pf_min - This param sets the number of minimal MSIX
vectors required for the device initialization. This value is set
in the device which limits MSIX vectors per PF.

Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 include/net/devlink.h | 4 ++++
 net/core/devlink.c    | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/net/devlink.h b/include/net/devlink.h
index 59be17b..361f525 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -364,6 +364,7 @@ enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_REGION_SNAPSHOT,
 	DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI,
 	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
+	DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -388,6 +389,9 @@ enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_NAME "msix_vec_per_pf_max"
 #define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_TYPE DEVLINK_PARAM_TYPE_U32
 
+#define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_NAME "msix_vec_per_pf_min"
+#define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_TYPE DEVLINK_PARAM_TYPE_U32
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
 {									\
 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
diff --git a/net/core/devlink.c b/net/core/devlink.c
index ce9fe63..25d3bfa 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2685,6 +2685,11 @@ static int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info)
 		.name = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_NAME,
 		.type = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MAX_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
+		.name = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_NAME,
+		.type = DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)
-- 
1.8.3.1

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

* [PATCH v4 net-next 4/9] bnxt_en: Use ignore_ari devlink parameter
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (2 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 3/9] devlink: Add generic parameter msix_vec_per_pf_min Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 5/9] bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED Vasundhara Volam
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patch adds support for ignore_ari generic permanent mode
devlink parameter. This parameter is disabled by default. It can be
enabled using devlink param commands.

ignore_ari - If enabled, device ignores ARI(Alternate Routing ID)
capability, even when platforms has the support and creates same number
of partitions when platform does not support ARI capability.

Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 6 ++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 790c684..5173881 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -24,6 +24,8 @@
 static const struct bnxt_dl_nvm_param nvm_params[] = {
 	{DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV, NVM_OFF_ENABLE_SRIOV,
 	 BNXT_NVM_SHARED_CFG, 1},
+	{DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI, NVM_OFF_IGNORE_ARI,
+	 BNXT_NVM_SHARED_CFG, 1},
 };
 
 static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
@@ -108,6 +110,10 @@ static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
 			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
 			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
 			      NULL),
+	DEVLINK_PARAM_GENERIC(IGNORE_ARI,
+			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
+			      NULL),
 };
 
 int bnxt_dl_register(struct bnxt *bp)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
index 2f68dc0..3d07c8f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
@@ -33,6 +33,7 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
 	}
 }
 
+#define NVM_OFF_IGNORE_ARI		164
 #define NVM_OFF_ENABLE_SRIOV		401
 
 enum bnxt_nvm_dir_type {
-- 
1.8.3.1

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

* [PATCH v4 net-next 5/9] bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (3 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 4/9] bnxt_en: Use ignore_ari devlink parameter Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 6/9] bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params Vasundhara Volam
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

Return proper error code when Firmware returns
HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED for HWRM_NVM_GET/SET_VARIABLE
commands.

Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 5173881..dc566fd 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -80,8 +80,12 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
 		memcpy(buf, data_addr, bytesize);
 
 	dma_free_coherent(&bp->pdev->dev, bytesize, data_addr, data_dma_addr);
-	if (rc)
+	if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) {
+		netdev_err(bp->dev, "PF does not have admin privileges to modify NVM config\n");
+		return -EACCES;
+	} else if (rc) {
 		return -EIO;
+	}
 	return 0;
 }
 
-- 
1.8.3.1

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

* [PATCH v4 net-next 6/9] bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params.
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (4 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 5/9] bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 7/9] bnxt_en: Add a driver specific gre_ver_check devlink parameter Vasundhara Volam
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patch adds support for following generic permanent mode
devlink parameters. They can be modified using devlink param
commands.

msix_vec_per_pf_max - This param sets the number of MSIX vectors
that the device requests from the host on driver initialization.
This value is set in the device which limits MSIX vectors per PF.

msix_vec_per_pf_min - This param sets the number of minimal MSIX
vectors required for the device initialization. Value 0 indicates
a default value is selected. This value is set in the device which
limits MSIX vectors per PF.

Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 50 ++++++++++++++++++++++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h |  5 +++
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index dc566fd..de7e74a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -26,6 +26,10 @@
 	 BNXT_NVM_SHARED_CFG, 1},
 	{DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI, NVM_OFF_IGNORE_ARI,
 	 BNXT_NVM_SHARED_CFG, 1},
+	{DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX,
+	 NVM_OFF_MSIX_VEC_PER_PF_MAX, BNXT_NVM_SHARED_CFG, 10},
+	{DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
+	 NVM_OFF_MSIX_VEC_PER_PF_MIN, BNXT_NVM_SHARED_CFG, 7},
 };
 
 static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
@@ -57,8 +61,22 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
 		idx = bp->pf.fw_fid - BNXT_FIRST_PF_FID;
 
 	bytesize = roundup(nvm_param.num_bits, BITS_PER_BYTE) / BITS_PER_BYTE;
-	if (nvm_param.num_bits == 1)
-		buf = &val->vbool;
+	switch (bytesize) {
+	case 1:
+		if (nvm_param.num_bits == 1)
+			buf = &val->vbool;
+		else
+			buf = &val->vu8;
+		break;
+	case 2:
+		buf = &val->vu16;
+		break;
+	case 4:
+		buf = &val->vu32;
+		break;
+	default:
+		return -EFAULT;
+	}
 
 	data_addr = dma_zalloc_coherent(&bp->pdev->dev, bytesize,
 					&data_dma_addr, GFP_KERNEL);
@@ -109,6 +127,26 @@ static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
 	return bnxt_hwrm_nvm_req(bp, id, &req, sizeof(req), &ctx->val);
 }
 
+static int bnxt_dl_msix_validate(struct devlink *dl, u32 id,
+				 union devlink_param_value val,
+				 struct netlink_ext_ack *extack)
+{
+	int max_val;
+
+	if (id == DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX)
+		max_val = BNXT_MSIX_VEC_MAX;
+
+	if (id == DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN)
+		max_val = BNXT_MSIX_VEC_MIN_MAX;
+
+	if (val.vu32 < 0 || val.vu32 > max_val) {
+		NL_SET_ERR_MSG_MOD(extack, "MSIX value is exceeding the range");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct devlink_param bnxt_dl_params[] = {
 	DEVLINK_PARAM_GENERIC(ENABLE_SRIOV,
 			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
@@ -118,6 +156,14 @@ static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
 			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
 			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
 			      NULL),
+	DEVLINK_PARAM_GENERIC(MSIX_VEC_PER_PF_MAX,
+			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
+			      bnxt_dl_msix_validate),
+	DEVLINK_PARAM_GENERIC(MSIX_VEC_PER_PF_MIN,
+			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
+			      bnxt_dl_msix_validate),
 };
 
 int bnxt_dl_register(struct bnxt *bp)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
index 3d07c8f..2bfd082 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
@@ -33,9 +33,14 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
 	}
 }
 
+#define NVM_OFF_MSIX_VEC_PER_PF_MAX	108
+#define NVM_OFF_MSIX_VEC_PER_PF_MIN	114
 #define NVM_OFF_IGNORE_ARI		164
 #define NVM_OFF_ENABLE_SRIOV		401
 
+#define BNXT_MSIX_VEC_MAX	1280
+#define BNXT_MSIX_VEC_MIN_MAX	128
+
 enum bnxt_nvm_dir_type {
 	BNXT_NVM_SHARED_CFG = 40,
 	BNXT_NVM_PORT_CFG,
-- 
1.8.3.1

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

* [PATCH v4 net-next 7/9] bnxt_en: Add a driver specific gre_ver_check devlink parameter.
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (5 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 6/9] bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04  5:43 ` [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt Vasundhara Volam
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patch adds following driver-specific permanent mode boolean
parameter.

gre_ver_check - Generic Routing Encapsulation(GRE) version check
will be enabled in the device. If disabled, device skips version
checking for GRE packets.

Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 24 ++++++++++++++++++++++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h |  1 +
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index de7e74a..8a10e01 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -21,6 +21,11 @@
 #endif /* CONFIG_BNXT_SRIOV */
 };
 
+enum bnxt_dl_param_id {
+	BNXT_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
+	BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK,
+};
+
 static const struct bnxt_dl_nvm_param nvm_params[] = {
 	{DEVLINK_PARAM_GENERIC_ID_ENABLE_SRIOV, NVM_OFF_ENABLE_SRIOV,
 	 BNXT_NVM_SHARED_CFG, 1},
@@ -30,6 +35,8 @@
 	 NVM_OFF_MSIX_VEC_PER_PF_MAX, BNXT_NVM_SHARED_CFG, 10},
 	{DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN,
 	 NVM_OFF_MSIX_VEC_PER_PF_MIN, BNXT_NVM_SHARED_CFG, 7},
+	{BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK, NVM_OFF_DIS_GRE_VER_CHECK,
+	 BNXT_NVM_SHARED_CFG, 1},
 };
 
 static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
@@ -112,9 +119,15 @@ static int bnxt_dl_nvm_param_get(struct devlink *dl, u32 id,
 {
 	struct hwrm_nvm_get_variable_input req = {0};
 	struct bnxt *bp = bnxt_get_bp_from_dl(dl);
+	int rc;
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_VARIABLE, -1, -1);
-	return bnxt_hwrm_nvm_req(bp, id, &req, sizeof(req), &ctx->val);
+	rc = bnxt_hwrm_nvm_req(bp, id, &req, sizeof(req), &ctx->val);
+	if (!rc)
+		if (id == BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK)
+			ctx->val.vbool = !ctx->val.vbool;
+
+	return rc;
 }
 
 static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
@@ -124,6 +137,10 @@ static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
 	struct bnxt *bp = bnxt_get_bp_from_dl(dl);
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_SET_VARIABLE, -1, -1);
+
+	if (id == BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK)
+		ctx->val.vbool = !ctx->val.vbool;
+
 	return bnxt_hwrm_nvm_req(bp, id, &req, sizeof(req), &ctx->val);
 }
 
@@ -164,6 +181,11 @@ static int bnxt_dl_msix_validate(struct devlink *dl, u32 id,
 			      BIT(DEVLINK_PARAM_CMODE_PERMANENT),
 			      bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
 			      bnxt_dl_msix_validate),
+	DEVLINK_PARAM_DRIVER(BNXT_DEVLINK_PARAM_ID_GRE_VER_CHECK,
+			     "gre_ver_check", DEVLINK_PARAM_TYPE_BOOL,
+			     BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+			     bnxt_dl_nvm_param_get, bnxt_dl_nvm_param_set,
+			     NULL),
 };
 
 int bnxt_dl_register(struct bnxt *bp)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
index 2bfd082..5b6b2c7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h
@@ -36,6 +36,7 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
 #define NVM_OFF_MSIX_VEC_PER_PF_MAX	108
 #define NVM_OFF_MSIX_VEC_PER_PF_MIN	114
 #define NVM_OFF_IGNORE_ARI		164
+#define NVM_OFF_DIS_GRE_VER_CHECK	171
 #define NVM_OFF_ENABLE_SRIOV		401
 
 #define BNXT_MSIX_VEC_MAX	1280
-- 
1.8.3.1

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

* [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (6 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 7/9] bnxt_en: Add a driver specific gre_ver_check devlink parameter Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-09  6:21   ` Saeed Mahameed
  2018-10-04  5:43 ` [PATCH v4 net-next 9/9] devlink: Add Documentation/networking/devlink-params-bnxt.txt Vasundhara Volam
  2018-10-04 10:39 ` [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Jiri Pirko
  9 siblings, 1 reply; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patch adds a new file to add information about some of the
generic configuration parameters set via devlink.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 Documentation/networking/devlink-params.txt | 42 +++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/networking/devlink-params.txt

diff --git a/Documentation/networking/devlink-params.txt b/Documentation/networking/devlink-params.txt
new file mode 100644
index 0000000..ae444ff
--- /dev/null
+++ b/Documentation/networking/devlink-params.txt
@@ -0,0 +1,42 @@
+Devlink configuration parameters
+================================
+Following is the list of configuration parameters via devlink interface.
+Each parameter can be generic or driver specific and are device level
+parameters.
+
+Note that the driver-specific files should contain the generic params
+they support to, with supported config modes.
+
+Each parameter can be set in different configuration modes:
+	runtime		- set while driver is running, no reset required.
+	driverinit	- applied while driver initializes, requires restart
+			driver by devlink reload command.
+	permanent	- written to device's non-volatile memory, hard reset
+			required.
+
+Following is the list of parameters:
+====================================
+enable_sriov		[DEVICE, GENERIC]
+			Enable Single Root I/O Virtualisation (SRIOV) in
+			the device.
+			Type: Boolean
+
+ignore_ari		[DEVICE, GENERIC]
+			Ignore Alternative Routing-ID Interpretation (ARI)
+			capability. If enabled, adapter will ignore ARI
+			capability even when platforms has the support
+			enabled and creates same number of partitions when
+			platform does not support ARI.
+			Type: Boolean
+
+msix_vec_per_pf_max	[DEVICE, GENERIC]
+			Provides the maximum number of MSIX interrupts that
+			a device can create. Value is same across all
+			physical functions (PFs) in the device.
+			Type: u32
+
+msix_vec_per_pf_min	[DEVICE, GENERIC]
+			Provides the minimum number of MSIX interrupts required
+			for the device initialization. Value is same across all
+			physical functions (PFs) in the device.
+			Type: u32
-- 
1.8.3.1

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

* [PATCH v4 net-next 9/9] devlink: Add Documentation/networking/devlink-params-bnxt.txt
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (7 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt Vasundhara Volam
@ 2018-10-04  5:43 ` Vasundhara Volam
  2018-10-04 10:39 ` [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Jiri Pirko
  9 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-04  5:43 UTC (permalink / raw)
  To: davem; +Cc: gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

This patch adds a new file to add information about configuration
parameters that are supported by bnxt_en driver via devlink.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
 Documentation/networking/devlink-params-bnxt.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 Documentation/networking/devlink-params-bnxt.txt

diff --git a/Documentation/networking/devlink-params-bnxt.txt b/Documentation/networking/devlink-params-bnxt.txt
new file mode 100644
index 0000000..481aa30
--- /dev/null
+++ b/Documentation/networking/devlink-params-bnxt.txt
@@ -0,0 +1,18 @@
+enable_sriov		[DEVICE, GENERIC]
+			Configuration mode: Permanent
+
+ignore_ari		[DEVICE, GENERIC]
+			Configuration mode: Permanent
+
+msix_vec_per_pf_max	[DEVICE, GENERIC]
+			Configuration mode: Permanent
+
+msix_vec_per_pf_min	[DEVICE, GENERIC]
+			Configuration mode: Permanent
+
+gre_ver_check		[DEVICE, DRIVER-SPECIFIC]
+			Generic Routing Encapsulation (GRE) version check will
+			be enabled in the device. If disabled, device skips
+			version checking for incoming packets.
+			Type: Boolean
+			Configuration mode: Permanent
-- 
1.8.3.1

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

* Re: [PATCH v4 net-next 0/9] bnxt_en: devlink param updates
  2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
                   ` (8 preceding siblings ...)
  2018-10-04  5:43 ` [PATCH v4 net-next 9/9] devlink: Add Documentation/networking/devlink-params-bnxt.txt Vasundhara Volam
@ 2018-10-04 10:39 ` Jiri Pirko
  2018-10-04 20:50   ` David Miller
  9 siblings, 1 reply; 14+ messages in thread
From: Jiri Pirko @ 2018-10-04 10:39 UTC (permalink / raw)
  To: Vasundhara Volam
  Cc: davem, gerlitz.or, michael.chan, netdev, jiri, jakub.kicinski

Thu, Oct 04, 2018 at 07:43:43AM CEST, vasundhara-v.volam@broadcom.com wrote:
>This patchset adds support for 3 generic and 1 driver-specific devlink
>parameters. Add documentation for these configuration parameters.
>
>Also, this patchset adds support to return proper error code if
>HWRM_NVM_GET/SET_VARIABLE commands return error code
>HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED.
>
>v3->v4:
>-Remove extra definition of NVM_OFF_HW_TC_OFFLOAD from bnxt_devlink.h
>-Remove type information for generic parameters from
>devlink-params-bnxt.txt
>
>v2->v3:
>-Remove description of generic parameters from devlink-params-bnxt.txt
>
>v1->v2:
>-Remove hw_tc_offload parameter.
>-Update all patches with Cc of MAINTAINERS.
>-Add more description in commit message for device specific parameter.
>-Add a new Documentation/networking/devlink-params.txt with some
>generic devlink parameters information.
>-Add a new Documentation/networking/devlink-params-bnxt.txt with devlink
>parameters information that are supported by bnxt_en driver.
>
>Vasundhara Volam (9):
>  devlink: Add generic parameter ignore_ari
>  devlink: Add generic parameter msix_vec_per_pf_max
>  devlink: Add generic parameter msix_vec_per_pf_min
>  bnxt_en: Use ignore_ari devlink parameter
>  bnxt_en: return proper error when FW returns
>    HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED
>  bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink
>    params.
>  bnxt_en: Add a driver specific gre_ver_check devlink parameter.
>  devlink: Add Documentation/networking/devlink-params.txt
>  devlink: Add Documentation/networking/devlink-params-bnxt.txt

Looks good to me. For the whole set:
Acked-by: Jiri Pirko <jiri@mellanox.com>

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

* Re: [PATCH v4 net-next 0/9] bnxt_en: devlink param updates
  2018-10-04 10:39 ` [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Jiri Pirko
@ 2018-10-04 20:50   ` David Miller
  0 siblings, 0 replies; 14+ messages in thread
From: David Miller @ 2018-10-04 20:50 UTC (permalink / raw)
  To: jiri
  Cc: vasundhara-v.volam, gerlitz.or, michael.chan, netdev, jiri,
	jakub.kicinski

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 4 Oct 2018 12:39:40 +0200

> Thu, Oct 04, 2018 at 07:43:43AM CEST, vasundhara-v.volam@broadcom.com wrote:
>>This patchset adds support for 3 generic and 1 driver-specific devlink
>>parameters. Add documentation for these configuration parameters.
>>
>>Also, this patchset adds support to return proper error code if
>>HWRM_NVM_GET/SET_VARIABLE commands return error code
>>HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED.
>>
>>v3->v4:
>>-Remove extra definition of NVM_OFF_HW_TC_OFFLOAD from bnxt_devlink.h
>>-Remove type information for generic parameters from
>>devlink-params-bnxt.txt
>>
>>v2->v3:
>>-Remove description of generic parameters from devlink-params-bnxt.txt
>>
>>v1->v2:
>>-Remove hw_tc_offload parameter.
>>-Update all patches with Cc of MAINTAINERS.
>>-Add more description in commit message for device specific parameter.
>>-Add a new Documentation/networking/devlink-params.txt with some
>>generic devlink parameters information.
>>-Add a new Documentation/networking/devlink-params-bnxt.txt with devlink
>>parameters information that are supported by bnxt_en driver.
>>
>>Vasundhara Volam (9):
>>  devlink: Add generic parameter ignore_ari
>>  devlink: Add generic parameter msix_vec_per_pf_max
>>  devlink: Add generic parameter msix_vec_per_pf_min
>>  bnxt_en: Use ignore_ari devlink parameter
>>  bnxt_en: return proper error when FW returns
>>    HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED
>>  bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink
>>    params.
>>  bnxt_en: Add a driver specific gre_ver_check devlink parameter.
>>  devlink: Add Documentation/networking/devlink-params.txt
>>  devlink: Add Documentation/networking/devlink-params-bnxt.txt
> 
> Looks good to me. For the whole set:
> Acked-by: Jiri Pirko <jiri@mellanox.com>

Series applied, thanks.

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

* Re: [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt
  2018-10-04  5:43 ` [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt Vasundhara Volam
@ 2018-10-09  6:21   ` Saeed Mahameed
  2018-10-09  6:47     ` Vasundhara Volam
  0 siblings, 1 reply; 14+ messages in thread
From: Saeed Mahameed @ 2018-10-09  6:21 UTC (permalink / raw)
  To: davem, vasundhara-v.volam
  Cc: netdev, Jiri Pirko, jakub.kicinski, gerlitz.or, michael.chan

On Thu, 2018-10-04 at 11:13 +0530, Vasundhara Volam wrote:
> This patch adds a new file to add information about some of the
> generic configuration parameters set via devlink.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Jiri Pirko <jiri@mellanox.com>
> Cc: Michael Chan <michael.chan@broadcom.com>
> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
> ---
>  Documentation/networking/devlink-params.txt | 42
> +++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 Documentation/networking/devlink-params.txt
> 
> diff --git a/Documentation/networking/devlink-params.txt
> b/Documentation/networking/devlink-params.txt
> new file mode 100644
> index 0000000..ae444ff
> --- /dev/null
> +++ b/Documentation/networking/devlink-params.txt
> @@ -0,0 +1,42 @@
> +Devlink configuration parameters
> +================================
> +Following is the list of configuration parameters via devlink
> interface.
> +Each parameter can be generic or driver specific and are device
> level
> +parameters.
> +
> +Note that the driver-specific files should contain the generic
> params
> +they support to, with supported config modes.
> +
> +Each parameter can be set in different configuration modes:
> +	runtime		- set while driver is running, no reset
> required.
> +	driverinit	- applied while driver initializes, requires
> restart
> +			driver by devlink reload command.
> +	permanent	- written to device's non-volatile memory, hard reset
> +			required.
> +
> +Following is the list of parameters:
> +====================================
> +enable_sriov		[DEVICE, GENERIC]
> +			Enable Single Root I/O Virtualisation (SRIOV)
> in
> +			the device.
> +			Type: Boolean
> +
> +ignore_ari		[DEVICE, GENERIC]
> +			Ignore Alternative Routing-ID Interpretation
> (ARI)
> +			capability. If enabled, adapter will ignore ARI
> +			capability even when platforms has the support
> +			enabled and creates same number of partitions
> when
> +			platform does not support ARI.
> +			Type: Boolean
> +
> +msix_vec_per_pf_max	[DEVICE, GENERIC]
> +			Provides the maximum number of MSIX interrupts
> that
> +			a device can create. Value is same across all
> +			physical functions (PFs) in the device.
> +			Type: u32
> +
> +msix_vec_per_pf_min	[DEVICE, GENERIC]
> +			Provides the minimum number of MSIX interrupts
> required
> +			for the device initialization. Value is same
> across all
> +			physical functions (PFs) in the device.
> +			Type: u32

some parameters can't be dynamic, meaning they can't support all
configuration modes listed above, for example msix min/max can only be
satisfied at driver boot, so runtime configuration doesn't make sense. 
shouldn't we have this documented in here ? i mean which parameters
support which modes ? 

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

* Re: [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt
  2018-10-09  6:21   ` Saeed Mahameed
@ 2018-10-09  6:47     ` Vasundhara Volam
  0 siblings, 0 replies; 14+ messages in thread
From: Vasundhara Volam @ 2018-10-09  6:47 UTC (permalink / raw)
  To: saeedm
  Cc: David Miller, Netdev, Jiri Pirko, jakub.kicinski, gerlitz.or,
	michael.chan

On Tue, Oct 9, 2018 at 11:51 AM Saeed Mahameed <saeedm@mellanox.com> wrote:
>
> On Thu, 2018-10-04 at 11:13 +0530, Vasundhara Volam wrote:
> > This patch adds a new file to add information about some of the
> > generic configuration parameters set via devlink.
> >
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: linux-doc@vger.kernel.org
> > Cc: Jiri Pirko <jiri@mellanox.com>
> > Cc: Michael Chan <michael.chan@broadcom.com>
> > Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
> > ---
> >  Documentation/networking/devlink-params.txt | 42
> > +++++++++++++++++++++++++++++
> >  1 file changed, 42 insertions(+)
> >  create mode 100644 Documentation/networking/devlink-params.txt
> >
> > diff --git a/Documentation/networking/devlink-params.txt
> > b/Documentation/networking/devlink-params.txt
> > new file mode 100644
> > index 0000000..ae444ff
> > --- /dev/null
> > +++ b/Documentation/networking/devlink-params.txt
> > @@ -0,0 +1,42 @@
> > +Devlink configuration parameters
> > +================================
> > +Following is the list of configuration parameters via devlink
> > interface.
> > +Each parameter can be generic or driver specific and are device
> > level
> > +parameters.
> > +
> > +Note that the driver-specific files should contain the generic
> > params
> > +they support to, with supported config modes.
> > +
> > +Each parameter can be set in different configuration modes:
> > +     runtime         - set while driver is running, no reset
> > required.
> > +     driverinit      - applied while driver initializes, requires
> > restart
> > +                     driver by devlink reload command.
> > +     permanent       - written to device's non-volatile memory, hard reset
> > +                     required.
> > +
> > +Following is the list of parameters:
> > +====================================
> > +enable_sriov         [DEVICE, GENERIC]
> > +                     Enable Single Root I/O Virtualisation (SRIOV)
> > in
> > +                     the device.
> > +                     Type: Boolean
> > +
> > +ignore_ari           [DEVICE, GENERIC]
> > +                     Ignore Alternative Routing-ID Interpretation
> > (ARI)
> > +                     capability. If enabled, adapter will ignore ARI
> > +                     capability even when platforms has the support
> > +                     enabled and creates same number of partitions
> > when
> > +                     platform does not support ARI.
> > +                     Type: Boolean
> > +
> > +msix_vec_per_pf_max  [DEVICE, GENERIC]
> > +                     Provides the maximum number of MSIX interrupts
> > that
> > +                     a device can create. Value is same across all
> > +                     physical functions (PFs) in the device.
> > +                     Type: u32
> > +
> > +msix_vec_per_pf_min  [DEVICE, GENERIC]
> > +                     Provides the minimum number of MSIX interrupts
> > required
> > +                     for the device initialization. Value is same
> > across all
> > +                     physical functions (PFs) in the device.
> > +                     Type: u32
>
> some parameters can't be dynamic, meaning they can't support all
> configuration modes listed above, for example msix min/max can only be
> satisfied at driver boot, so runtime configuration doesn't make sense.
> shouldn't we have this documented in here ? i mean which parameters
> support which modes ?
All three configuration modes are not applicable for each parameter.
Driver which uses the parameter, will list the configuration mode used in
that driver and also is updated in individual driver devlink parameter
documentation.

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

end of thread, other threads:[~2018-10-09 14:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04  5:43 [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 1/9] devlink: Add generic parameter ignore_ari Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 2/9] devlink: Add generic parameter msix_vec_per_pf_max Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 3/9] devlink: Add generic parameter msix_vec_per_pf_min Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 4/9] bnxt_en: Use ignore_ari devlink parameter Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 5/9] bnxt_en: return proper error when FW returns HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 6/9] bnxt_en: Use msix_vec_per_pf_max and msix_vec_per_pf_min devlink params Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 7/9] bnxt_en: Add a driver specific gre_ver_check devlink parameter Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 8/9] devlink: Add Documentation/networking/devlink-params.txt Vasundhara Volam
2018-10-09  6:21   ` Saeed Mahameed
2018-10-09  6:47     ` Vasundhara Volam
2018-10-04  5:43 ` [PATCH v4 net-next 9/9] devlink: Add Documentation/networking/devlink-params-bnxt.txt Vasundhara Volam
2018-10-04 10:39 ` [PATCH v4 net-next 0/9] bnxt_en: devlink param updates Jiri Pirko
2018-10-04 20:50   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).