mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hariprasad Kelam <hkelam@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <kuba@kernel.org>, <davem@davemloft.net>, <sgoutham@marvell.com>,
	<gakula@marvell.com>, <jerinj@marvell.com>,
	<lcherian@marvell.com>, <sbhatta@marvell.com>,
	<hkelam@marvell.com>, <naveenm@marvell.com>,
	<edumazet@google.com>, <pabeni@redhat.com>
Subject: [net-next PatchV2 4/4] octeontx2-af: print error message incase of invalid pf mapping
Date: Fri, 25 Aug 2023 16:10:22 +0530	[thread overview]
Message-ID: <20230825104022.16288-5-hkelam@marvell.com> (raw)
In-Reply-To: <20230825104022.16288-1-hkelam@marvell.com>

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 4e3aec7bdbee..f2b1edf1bb43 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


  parent reply	other threads:[~2023-08-25 10:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 10:40 [net-next PatchV2 0/4] octeontx2-af: misc MAC block changes Hariprasad Kelam
2023-08-25 10:40 ` [net-next PatchV2 1/4] octeontx2-af: CN10KB: Add USGMII LMAC mode Hariprasad Kelam
2023-08-25 10:40 ` [net-next PatchV2 2/4] octeontx2-af: Don't treat lack of CGX interfaces as error Hariprasad Kelam
2023-08-25 10:40 ` [net-next PatchV2 3/4] octeontx2-af: Add validation of lmac Hariprasad Kelam
2023-08-25 10:40 ` Hariprasad Kelam [this message]
2023-08-28  9:10 ` [net-next PatchV2 0/4] octeontx2-af: misc MAC block changes patchwork-bot+netdevbpf

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=20230825104022.16288-5-hkelam@marvell.com \
    --to=hkelam@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /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

all inboxes | Powered by JetHome®