netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next Patch 0/5] octeontx2-af: misc MAC block changes
@ 2023-08-17 11:23 Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 1/5] octeontx2-af: CN10KB: Add USGMII LMAC mode Hariprasad Kelam
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

This series of patches adds recent changes added in MAC (CGX/RPM) block.

Patch1: Adds new LMAC mode supported by CN10KB silicon

Patch2: In a scenario where system boots with no cgx devices, currently
        AF driver treats this as error as a result no interfaces will work.
        This patch relaxes this check, such that non cgx mapped netdev
        devices will work.

Patch3: This patch adds required lmac validation in MAC block APIs.

Patch4: This patch replaces generic error codes with driver specific error
        codes for better debugging.

Patch5: Prints error message incase, no netdev is mapped with given
        cgx,lmac pair.


Hariprasad Kelam (4):
  octeontx2-af: CN10KB: Add USGMII LMAC mode
  octeontx2-af: Add validation of lmac
  octeontx2-af: replace generic error codes
  octeontx2-af: print error message incase of invalid pf mapping

Sunil Goutham (1):
  octeontx2-af: Don't treat lack of CGX interfaces as error

 .../net/ethernet/marvell/octeontx2/af/cgx.c   | 11 +++++--
 .../net/ethernet/marvell/octeontx2/af/cgx.h   |  1 +
 .../ethernet/marvell/octeontx2/af/rvu_cgx.c   | 31 +++++++++++--------
 3 files changed, 27 insertions(+), 16 deletions(-)

--
2.17.1

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

* [net-next Patch 1/5] octeontx2-af: CN10KB: Add USGMII LMAC mode
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
@ 2023-08-17 11:23 ` Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 2/5] octeontx2-af: Don't treat lack of CGX interfaces as error Hariprasad Kelam
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

Upon physical link change, firmware reports to the kernel about the
change along with the details like speed, lmac_type_id, etc.
Kernel derives lmac_type based on lmac_type_id received from firmware.

This patch extends current lmac list with new USGMII mode supported
by CN10KB RPM block.

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 1 +
 drivers/net/ethernet/marvell/octeontx2/af/cgx.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
index 988383e20bb8..9392ef95a245 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
@@ -55,6 +55,7 @@ static const char *cgx_lmactype_string[LMAC_MODE_MAX] = {
 	[LMAC_MODE_50G_R] = "50G_R",
 	[LMAC_MODE_100G_R] = "100G_R",
 	[LMAC_MODE_USXGMII] = "USXGMII",
+	[LMAC_MODE_USGMII] = "USGMII",
 };
 
 /* CGX PHY management internal APIs */
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.h b/drivers/net/ethernet/marvell/octeontx2/af/cgx.h
index 574114179688..6f7d1dee5830 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.h
@@ -110,6 +110,7 @@ enum LMAC_TYPE {
 	LMAC_MODE_50G_R		= 8,
 	LMAC_MODE_100G_R	= 9,
 	LMAC_MODE_USXGMII	= 10,
+	LMAC_MODE_USGMII	= 11,
 	LMAC_MODE_MAX,
 };
 
-- 
2.17.1


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

* [net-next Patch 2/5] octeontx2-af: Don't treat lack of CGX interfaces as error
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 1/5] octeontx2-af: CN10KB: Add USGMII LMAC mode Hariprasad Kelam
@ 2023-08-17 11:23 ` Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 3/5] octeontx2-af: Add validation of lmac Hariprasad Kelam
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

From: Sunil Goutham <sgoutham@marvell.com>

Don't treat lack of CGX LMACs on the system as a error.
Instead ignore it so that LBK VFs are created and can be used.

Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index b3f766b970ca..4e3aec7bdbee 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -345,7 +345,7 @@ int rvu_cgx_init(struct rvu *rvu)
 	rvu->cgx_cnt_max = cgx_get_cgxcnt_max();
 	if (!rvu->cgx_cnt_max) {
 		dev_info(rvu->dev, "No CGX devices found!\n");
-		return -ENODEV;
+		return 0;
 	}
 
 	rvu->cgx_idmap = devm_kzalloc(rvu->dev, rvu->cgx_cnt_max *
-- 
2.17.1


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

* [net-next Patch 3/5] octeontx2-af: Add validation of lmac
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 1/5] octeontx2-af: CN10KB: Add USGMII LMAC mode Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 2/5] octeontx2-af: Don't treat lack of CGX interfaces as error Hariprasad Kelam
@ 2023-08-17 11:23 ` Hariprasad Kelam
  2023-08-17 11:23 ` [net-next Patch 4/5] octeontx2-af: replace generic error codes Hariprasad Kelam
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

With the addition of new MAC blocks like CN10K RPM and CN10KB
RPM_USX, LMACs are noncontiguous. Though in most of the functions,
lmac validation checks exist but in few functions they are missing.
This patch adds the same.

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
index 9392ef95a245..e06f77ad6106 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
@@ -232,6 +232,9 @@ int cgx_lmac_addr_set(u8 cgx_id, u8 lmac_id, u8 *mac_addr)
 	int index, id;
 	u64 cfg;
 
+	if (!lmac)
+		return -ENODEV;
+
 	/* access mac_ops to know csr_offset */
 	mac_ops = cgx_dev->mac_ops;
 
@@ -550,15 +553,16 @@ void cgx_lmac_promisc_config(int cgx_id, int lmac_id, bool enable)
 {
 	struct cgx *cgx = cgx_get_pdata(cgx_id);
 	struct lmac *lmac = lmac_pdata(lmac_id, cgx);
-	u16 max_dmac = lmac->mac_to_index_bmap.max;
 	struct mac_ops *mac_ops;
+	u16 max_dmac;
 	int index, i;
 	u64 cfg = 0;
 	int id;
 
-	if (!cgx)
+	if (!cgx || !lmac)
 		return;
 
+	max_dmac = lmac->mac_to_index_bmap.max;
 	id = get_sequence_id_of_lmac(cgx, lmac_id);
 
 	mac_ops = cgx->mac_ops;
@@ -731,7 +735,7 @@ int cgx_get_fec_stats(void *cgxd, int lmac_id, struct cgx_fec_stats_rsp *rsp)
 	int corr_reg, uncorr_reg;
 	struct cgx *cgx = cgxd;
 
-	if (!cgx || lmac_id >= cgx->lmac_count)
+	if (!is_lmac_valid(cgx, lmac_id))
 		return -ENODEV;
 
 	if (cgx->lmac_idmap[lmac_id]->link_info.fec == OTX2_FEC_NONE)
-- 
2.17.1


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

* [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
                   ` (2 preceding siblings ...)
  2023-08-17 11:23 ` [net-next Patch 3/5] octeontx2-af: Add validation of lmac Hariprasad Kelam
@ 2023-08-17 11:23 ` Hariprasad Kelam
  2023-08-19  2:50   ` Jakub Kicinski
  2023-08-17 11:23 ` [net-next Patch 5/5] octeontx2-af: print error message incase of invalid pf mapping Hariprasad Kelam
  2023-08-18 10:55 ` [net-next Patch 0/5] octeontx2-af: misc MAC block changes Simon Horman
  5 siblings, 1 reply; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

currently, if any netdev is not mapped to the MAC block(cgx/rpm)
requests MAC feature, AF driver returns a generic error like -EPERM.
This patch replaces generic error codes with driver-specific error
codes for better debugging

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 .../ethernet/marvell/octeontx2/af/rvu_cgx.c   | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index 4e3aec7bdbee..c96a94303a54 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -600,7 +600,7 @@ int rvu_mbox_handler_cgx_mac_addr_set(struct rvu *rvu,
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	if (rvu_npc_exact_has_match_table(rvu))
 		return rvu_npc_exact_mac_addr_set(rvu, req, rsp);
@@ -621,7 +621,7 @@ int rvu_mbox_handler_cgx_mac_addr_add(struct rvu *rvu,
 	int rc = 0;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	if (rvu_npc_exact_has_match_table(rvu))
 		return rvu_npc_exact_mac_addr_add(rvu, req, rsp);
@@ -644,7 +644,7 @@ int rvu_mbox_handler_cgx_mac_addr_del(struct rvu *rvu,
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	if (rvu_npc_exact_has_match_table(rvu))
 		return rvu_npc_exact_mac_addr_del(rvu, req, rsp);
@@ -690,7 +690,7 @@ int rvu_mbox_handler_cgx_mac_addr_get(struct rvu *rvu,
 	u64 cfg;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 
@@ -709,7 +709,7 @@ int rvu_mbox_handler_cgx_promisc_enable(struct rvu *rvu, struct msg_req *req,
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	/* Disable drop on non hit rule */
 	if (rvu_npc_exact_has_match_table(rvu))
@@ -728,7 +728,7 @@ int rvu_mbox_handler_cgx_promisc_disable(struct rvu *rvu, struct msg_req *req,
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	/* Disable drop on non hit rule */
 	if (rvu_npc_exact_has_match_table(rvu))
@@ -798,7 +798,7 @@ static int rvu_cgx_config_linkevents(struct rvu *rvu, u16 pcifunc, bool en)
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 
@@ -836,7 +836,7 @@ int rvu_mbox_handler_cgx_get_linkinfo(struct rvu *rvu, struct msg_req *req,
 	pf = rvu_get_pf(req->hdr.pcifunc);
 
 	if (!is_pf_cgxmapped(rvu, pf))
-		return -ENODEV;
+		return LMAC_AF_ERR_PF_NOT_MAPPED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 
@@ -897,7 +897,7 @@ static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PF_NOT_MAPPED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 	mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
@@ -1100,7 +1100,7 @@ int rvu_mbox_handler_cgx_set_fec_param(struct rvu *rvu,
 	u8 cgx_id, lmac_id;
 
 	if (!is_pf_cgxmapped(rvu, pf))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	if (req->fec == OTX2_FEC_OFF)
 		req->fec = OTX2_FEC_NONE;
@@ -1119,7 +1119,7 @@ int rvu_mbox_handler_cgx_get_aux_link_info(struct rvu *rvu, struct msg_req *req,
 		return LMAC_AF_ERR_FIRMWARE_DATA_NOT_MAPPED;
 
 	if (!is_pf_cgxmapped(rvu, pf))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 
@@ -1144,7 +1144,7 @@ int rvu_mbox_handler_cgx_set_link_mode(struct rvu *rvu,
 	void *cgxd;
 
 	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc))
-		return -EPERM;
+		return LMAC_AF_ERR_PERM_DENIED;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_idx, &lmac);
 	cgxd = rvu_cgx_pdata(cgx_idx, rvu);
-- 
2.17.1


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

* [net-next Patch 5/5] octeontx2-af: print error message incase of invalid pf mapping
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
                   ` (3 preceding siblings ...)
  2023-08-17 11:23 ` [net-next Patch 4/5] octeontx2-af: replace generic error codes Hariprasad Kelam
@ 2023-08-17 11:23 ` Hariprasad Kelam
  2023-08-18 10:55 ` [net-next Patch 0/5] octeontx2-af: misc MAC block changes Simon Horman
  5 siblings, 0 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-17 11:23 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, gakula, jerinj, lcherian, sbhatta, hkelam,
	naveenm, edumazet, pabeni

During AF driver initialization, it creates a mapping between pf to
cgx,lmac pair. Whenever there is a physical link change, using this
mapping driver forwards the message to the associated netdev.

This patch prints error message incase of cgx,lmac pair is not
associated with any pf netdev.

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index c96a94303a54..8845d50c5b78 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -236,6 +236,11 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu)
 
 	linfo = &event->link_uinfo;
 	pfmap = cgxlmac_to_pfmap(rvu, event->cgx_id, event->lmac_id);
+	if (!pfmap) {
+		dev_err(rvu->dev, "CGX port%d:%d not mapped with PF\n",
+			event->cgx_id, event->lmac_id);
+		return;
+	}
 
 	do {
 		pfid = find_first_bit(&pfmap,
-- 
2.17.1


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

* Re: [net-next Patch 0/5] octeontx2-af: misc MAC block changes
  2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
                   ` (4 preceding siblings ...)
  2023-08-17 11:23 ` [net-next Patch 5/5] octeontx2-af: print error message incase of invalid pf mapping Hariprasad Kelam
@ 2023-08-18 10:55 ` Simon Horman
  5 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-08-18 10:55 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: netdev, linux-kernel, kuba, davem, sgoutham, gakula, jerinj,
	lcherian, sbhatta, naveenm, edumazet, pabeni

On Thu, Aug 17, 2023 at 04:53:52PM +0530, Hariprasad Kelam wrote:
> This series of patches adds recent changes added in MAC (CGX/RPM) block.
> 
> Patch1: Adds new LMAC mode supported by CN10KB silicon
> 
> Patch2: In a scenario where system boots with no cgx devices, currently
>         AF driver treats this as error as a result no interfaces will work.
>         This patch relaxes this check, such that non cgx mapped netdev
>         devices will work.
> 
> Patch3: This patch adds required lmac validation in MAC block APIs.
> 
> Patch4: This patch replaces generic error codes with driver specific error
>         codes for better debugging.
> 
> Patch5: Prints error message incase, no netdev is mapped with given
>         cgx,lmac pair.
> 
> 
> Hariprasad Kelam (4):
>   octeontx2-af: CN10KB: Add USGMII LMAC mode
>   octeontx2-af: Add validation of lmac
>   octeontx2-af: replace generic error codes
>   octeontx2-af: print error message incase of invalid pf mapping
> 
> Sunil Goutham (1):
>   octeontx2-af: Don't treat lack of CGX interfaces as error

For series,

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-17 11:23 ` [net-next Patch 4/5] octeontx2-af: replace generic error codes Hariprasad Kelam
@ 2023-08-19  2:50   ` Jakub Kicinski
  2023-08-20  4:12     ` Hariprasad Kelam
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2023-08-19  2:50 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: netdev, linux-kernel, davem, sgoutham, gakula, jerinj, lcherian,
	sbhatta, naveenm, edumazet, pabeni

On Thu, 17 Aug 2023 16:53:56 +0530 Hariprasad Kelam wrote:
> currently, if any netdev is not mapped to the MAC block(cgx/rpm)
> requests MAC feature, AF driver returns a generic error like -EPERM.
> This patch replaces generic error codes with driver-specific error
> codes for better debugging

The custom error codes are not liked upstream, they make much harder
for people who don't work on the driver to refactor it.

If you want debugging isn't it better to add a tracepoint to the
checks?
-- 
pw-bot: cr

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

* Re: [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-19  2:50   ` Jakub Kicinski
@ 2023-08-20  4:12     ` Hariprasad Kelam
  2023-08-24  5:41       ` Hariprasad Kelam
  0 siblings, 1 reply; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-20  4:12 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, Sunil Kovvuri Goutham, Geethasowjanya Akula,
	Jerin Jacob Kollanukkaran, Linu Cherian, Subbaraya Sundeep Bhatta,
	Naveen Mamindlapalli, edumazet@google.com, pabeni@redhat.com



> ----------------------------------------------------------------------
> On Thu, 17 Aug 2023 16:53:56 +0530 Hariprasad Kelam wrote:
> > currently, if any netdev is not mapped to the MAC block(cgx/rpm)
> > requests MAC feature, AF driver returns a generic error like -EPERM.
> > This patch replaces generic error codes with driver-specific error
> > codes for better debugging
> 
> The custom error codes are not liked upstream, they make much harder for
> people who don't work on the driver to refactor it.
> 
> If you want debugging isn't it better to add a tracepoint to the checks?

Hari>>  These error codes are added in AF mailbox handlers, user space tools like ethool ,tc won't see these since these are between pf netdev and AF. During netdev driver probe/open calls, it requests AF driver to configure different hardware blocks MAC/network etc. If there is any error instead of getting EPERM, we will get block specific error codes like LMAC_AF_ERR_INVALID_PARAM, NIX_AF_ERR_PARAM etc.

Thanks,
Hariprasad k
> --
> pw-bot: cr

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

* RE: [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-20  4:12     ` Hariprasad Kelam
@ 2023-08-24  5:41       ` Hariprasad Kelam
  2023-08-24 15:19         ` Jakub Kicinski
  0 siblings, 1 reply; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-24  5:41 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, Sunil Kovvuri Goutham, Geethasowjanya Akula,
	Jerin Jacob Kollanukkaran, Linu Cherian, Subbaraya Sundeep Bhatta,
	Naveen Mamindlapalli, edumazet@google.com, pabeni@redhat.com



> -----Original Message-----
> From: Hariprasad Kelam
> Sent: Sunday, August 20, 2023 9:42 AM
> To: Jakub Kicinski <kuba@kernel.org>
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> davem@davemloft.net; Sunil Kovvuri Goutham <sgoutham@marvell.com>;
> Geethasowjanya Akula <gakula@marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Linu Cherian <lcherian@marvell.com>; Subbaraya
> Sundeep Bhatta <sbhatta@marvell.com>; Naveen Mamindlapalli
> <naveenm@marvell.com>; edumazet@google.com; pabeni@redhat.com
> Subject: Re: [net-next Patch 4/5] octeontx2-af: replace generic error codes
> 
> 
> 
> > ----------------------------------------------------------------------
> > On Thu, 17 Aug 2023 16:53:56 +0530 Hariprasad Kelam wrote:
> > > currently, if any netdev is not mapped to the MAC block(cgx/rpm)
> > > requests MAC feature, AF driver returns a generic error like -EPERM.
> > > This patch replaces generic error codes with driver-specific error
> > > codes for better debugging
> >
> > The custom error codes are not liked upstream, they make much harder
> > for people who don't work on the driver to refactor it.
> >
> > If you want debugging isn't it better to add a tracepoint to the checks?
> 
> Hari>>  These error codes are added in AF mailbox handlers, user space tools
> like ethool ,tc won't see these since these are between pf netdev and AF.
> During netdev driver probe/open calls, it requests AF driver to configure
> different hardware blocks MAC/network etc. If there is any error instead of
> getting EPERM, we will get block specific error codes like
> LMAC_AF_ERR_INVALID_PARAM, NIX_AF_ERR_PARAM etc.

Jakub,
Any comments here?

> 
> Thanks,
> Hariprasad k
> > --
> > pw-bot: cr

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

* Re: [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-24  5:41       ` Hariprasad Kelam
@ 2023-08-24 15:19         ` Jakub Kicinski
  2023-08-25  7:20           ` Hariprasad Kelam
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2023-08-24 15:19 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, Sunil Kovvuri Goutham, Geethasowjanya Akula,
	Jerin Jacob Kollanukkaran, Linu Cherian, Subbaraya Sundeep Bhatta,
	Naveen Mamindlapalli, edumazet@google.com, pabeni@redhat.com

On Thu, 24 Aug 2023 05:41:01 +0000 Hariprasad Kelam wrote:
> > > The custom error codes are not liked upstream, they make much harder
> > > for people who don't work on the driver to refactor it.
> > >
> > > If you want debugging isn't it better to add a tracepoint to the checks?  
> >   
> > Hari>>  These error codes are added in AF mailbox handlers, user space tools  
> > like ethool ,tc won't see these since these are between pf netdev and AF.
> > During netdev driver probe/open calls, it requests AF driver to configure
> > different hardware blocks MAC/network etc. If there is any error instead of
> > getting EPERM, we will get block specific error codes like
> > LMAC_AF_ERR_INVALID_PARAM, NIX_AF_ERR_PARAM etc.  
> 
> Jakub,
> Any comments here?

Please learn how to use email correctly.

Hari>>

Makes the entire line rendered as a quote in many email clients,
because the gt than sign is a quote marker.

You should also wrap your lines.

If you want to return the block which failed to the caller you can 
do that, but not instead of the error code.

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

* Re: [net-next Patch 4/5] octeontx2-af: replace generic error codes
  2023-08-24 15:19         ` Jakub Kicinski
@ 2023-08-25  7:20           ` Hariprasad Kelam
  0 siblings, 0 replies; 12+ messages in thread
From: Hariprasad Kelam @ 2023-08-25  7:20 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, Sunil Kovvuri Goutham, Geethasowjanya Akula,
	Jerin Jacob Kollanukkaran, Linu Cherian, Subbaraya Sundeep Bhatta,
	Naveen Mamindlapalli, edumazet@google.com, pabeni@redhat.com



> On Thu, 24 Aug 2023 05:41:01 +0000 Hariprasad Kelam wrote:
> > > > The custom error codes are not liked upstream, they make much
> > > > harder for people who don't work on the driver to refactor it.
> > > >
> > > > If you want debugging isn't it better to add a tracepoint to the checks?
> > >
> > > Hari>>  These error codes are added in AF mailbox handlers, user
> > > Hari>> space tools
> > > like ethool ,tc won't see these since these are between pf netdev and
> AF.
> > > During netdev driver probe/open calls, it requests AF driver to
> > > configure different hardware blocks MAC/network etc. If there is any
> > > error instead of getting EPERM, we will get block specific error
> > > codes like LMAC_AF_ERR_INVALID_PARAM, NIX_AF_ERR_PARAM etc.
> >
> > Jakub,
> > Any comments here?
> 
> Please learn how to use email correctly.
> 
> Hari>>
> 
> Makes the entire line rendered as a quote in many email clients, because the
> gt than sign is a quote marker.

   ACK
> 
> You should also wrap your lines.
> 
> If you want to return the block which failed to the caller you can do that, but
> not instead of the error code.

Ok, will remove this patch from the series.

Thanks,
Hariprasad k

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

end of thread, other threads:[~2023-08-25  7:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 11:23 [net-next Patch 0/5] octeontx2-af: misc MAC block changes Hariprasad Kelam
2023-08-17 11:23 ` [net-next Patch 1/5] octeontx2-af: CN10KB: Add USGMII LMAC mode Hariprasad Kelam
2023-08-17 11:23 ` [net-next Patch 2/5] octeontx2-af: Don't treat lack of CGX interfaces as error Hariprasad Kelam
2023-08-17 11:23 ` [net-next Patch 3/5] octeontx2-af: Add validation of lmac Hariprasad Kelam
2023-08-17 11:23 ` [net-next Patch 4/5] octeontx2-af: replace generic error codes Hariprasad Kelam
2023-08-19  2:50   ` Jakub Kicinski
2023-08-20  4:12     ` Hariprasad Kelam
2023-08-24  5:41       ` Hariprasad Kelam
2023-08-24 15:19         ` Jakub Kicinski
2023-08-25  7:20           ` Hariprasad Kelam
2023-08-17 11:23 ` [net-next Patch 5/5] octeontx2-af: print error message incase of invalid pf mapping Hariprasad Kelam
2023-08-18 10:55 ` [net-next Patch 0/5] octeontx2-af: misc MAC block changes Simon Horman

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