Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Manoj Vishwanathan <manojvishy@google.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
	 Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, Willem de Bruijn <willemb@google.com>,
	Manoj Vishwanathan <manojvishy@google.com>,
	linux-kernel@vger.kernel.org,
	google-lan-reviews@googlegroups.com
Subject: [Intel-wired-lan] [PATCH v1 5/5] idpf: warn on possible ctlq overflow
Date: Tue, 13 Aug 2024 18:27:47 +0000	[thread overview]
Message-ID: <20240813182747.1770032-6-manojvishy@google.com> (raw)
In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com>

From: Willem de Bruijn <willemb@google.com>

The virtchannel control queue is lossy to avoid deadlock. Ensure that
no losses occur in practice. Detect a full queue, when overflows may
have happened.

In practice, virtchnl is synchronous currenty and messages generally
take a single slot. Using up anywhere near the full ring is not
expected.

Tested: Running several traffic tests and no logs seen in the dmesg

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Manoj Vishwanathan <manojvishy@google.com>
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 07239afb285e..1852836d81e4 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -218,6 +218,15 @@ static int idpf_mb_clean(struct idpf_adapter *adapter)
 	if (err)
 		goto err_kfree;
 
+	/* Warn if messages may have been dropped */
+	if (num_q_msg == IDPF_DFLT_MBX_Q_LEN) {
+		static atomic_t mbx_full = ATOMIC_INIT(0);
+		int cnt;
+
+		cnt = atomic_inc_return(&mbx_full);
+		net_warn_ratelimited("%s: ctlq full (%d)\n", __func__, cnt);
+	}
+
 	for (i = 0; i < num_q_msg; i++) {
 		if (!q_msg[i])
 			continue;
-- 
2.46.0.76.ge559c4bf1a-goog


  parent reply	other threads:[~2024-08-13 18:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 18:27 [Intel-wired-lan] [PATCH v1 0/5] IDPF Virtchnl fixes Manoj Vishwanathan
2024-08-13 18:27 ` [Intel-wired-lan] [PATCH v1 1/5] idpf: address an rtnl lock splat in tx timeout recovery path Manoj Vishwanathan
2024-08-13 18:27 ` [Intel-wired-lan] [PATCH v1 2/5] idpf: Acquire the lock before accessing the xn->salt Manoj Vishwanathan
2024-08-13 18:27 ` [Intel-wired-lan] [PATCH v1 3/5] idpf: convert workqueues to unbound Manoj Vishwanathan
2024-08-13 18:27 ` [Intel-wired-lan] [PATCH v1 4/5] idpf: more info during virtchnl transaction time out Manoj Vishwanathan
2024-08-13 19:28   ` Paul Menzel
2024-08-13 18:27 ` Manoj Vishwanathan [this message]
2024-08-13 19:19   ` [Intel-wired-lan] [PATCH v1 5/5] idpf: warn on possible ctlq overflow Willem de Bruijn
2024-08-15 22:55 ` [Intel-wired-lan] [PATCH v1 0/5] IDPF Virtchnl fixes Tony Nguyen

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=20240813182747.1770032-6-manojvishy@google.com \
    --to=manojvishy@google.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=google-lan-reviews@googlegroups.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=willemb@google.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