From: Suman Ghosh <sumang@marvell.com>
To: <sgoutham@marvell.com>, <gakula@marvell.com>,
<sbhatta@marvell.com>, <hkelam@marvell.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <lcherian@marvell.com>,
<jerinj@marvell.com>
Cc: Suman Ghosh <sumang@marvell.com>
Subject: [net PATCH 1/3] octeontx2-pf: Update PFC configuration
Date: Tue, 8 Aug 2023 16:57:06 +0530 [thread overview]
Message-ID: <20230808112708.3179218-2-sumang@marvell.com> (raw)
In-Reply-To: <20230808112708.3179218-1-sumang@marvell.com>
As of now we are creating/deleting Tx schedulers when user is
setting PFC on/off. The problem is if we have a running traffic on
the interface and as we are updating the sq->smq mapping on the fly,
we might loose completion interrupt for some packets. As a result of
that a watchdog reset is hit from BQL.
This patch solves the issue by simply calling interface off/on APIs
which will reconfigure all the queues. We might loss the running traffic
momentarily but that should be fine.
Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support")
Signed-off-by: Suman Ghosh <sumang@marvell.com>
---
.../net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c
index ccaf97bb1ce0..d54edfa8fcc9 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c
@@ -406,6 +406,7 @@ static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc)
static int otx2_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc)
{
struct otx2_nic *pfvf = netdev_priv(dev);
+ bool if_up = netif_running(dev);
int err;
/* Save PFC configuration to interface */
@@ -426,14 +427,9 @@ static int otx2_dcbnl_ieee_setpfc(struct net_device *dev, struct ieee_pfc *pfc)
if (err)
return err;
- /* Request Per channel Bpids */
- if (pfc->pfc_en)
- otx2_nix_config_bp(pfvf, true);
-
- err = otx2_pfc_txschq_update(pfvf);
- if (err) {
- dev_err(pfvf->dev, "%s failed to update TX schedulers\n", __func__);
- return err;
+ if (if_up) {
+ otx2_stop(dev);
+ otx2_open(dev);
}
return 0;
--
2.25.1
next prev parent reply other threads:[~2023-08-08 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 11:27 [net PATCH 0/3] Fix PFC related issues Suman Ghosh
2023-08-08 11:27 ` Suman Ghosh [this message]
2023-08-08 11:27 ` [net PATCH 2/3] octeontx2-pf: Fix PFC TX scheduler free Suman Ghosh
2023-08-08 22:15 ` Jakub Kicinski
2023-08-08 11:27 ` [net PATCH 3/3] octeontx2-af: CN10KB: fix PFC configuration Suman Ghosh
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=20230808112708.3179218-2-sumang@marvell.com \
--to=sumang@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).