netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quan Nguyen <quan@os.amperecomputing.com>
To: Jeremy Kerr <jk@codeconstruct.com.au>,
	Matt Johnston <matt@codeconstruct.com.au>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	openbmc@lists.ozlabs.org,
	Open Source Submission <patches@amperecomputing.com>
Cc: Phong Vo <phong@os.amperecomputing.com>,
	Thang Nguyen <thang@os.amperecomputing.com>,
	Dung Cao <dung@os.amperecomputing.com>
Subject: Re: [PATCH] mctp i2c: Requeue the packet when arbitration is lost
Date: Thu, 30 Nov 2023 15:39:45 +0700	[thread overview]
Message-ID: <706506b7-a89c-4dfc-b233-be7822eb056e@os.amperecomputing.com> (raw)
In-Reply-To: <473048522551f1cae5273eb4cd31b732d6e33e53.camel@codeconstruct.com.au>



On 30/11/2023 15:03, Jeremy Kerr wrote:
> Hi Quan,
> 
>> If arbitration is lost, __i2c_transfer() returns -EAGAIN and the
>> packet should be resent.
>>
>> Requeue the packet and increase collisions count on this case.
> 
> Are you sure you want to re-queue the packet here? The i2c core would
> have already retried on arbitration loss:
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/i2c/i2c-core-base.c#n2223
> 
> With this change, we would be disregarding the limits in adap->retries
> and/or adap->timeout.
> 

Yes, the __i2c_transfer() does try its best to send the packet but if it 
still fail with -EAGAIN, that means it still unable to win the arbitration.

Without this patch we usually see the error below. The consequence is it 
stop and need the PLDM layer to retry when timed out, which takes time.

"[   61.616210] i2c i2c-3: __i2c_transfer failed -11"

With this commit, we all see the packets go through peacefully just by 
requeueing the packets at MCTP layer and eliminated the need to retry in 
PLDM layer which would need more time.

The result in our test is as below (Note: would needs some addition 
debug print code). I also think it is worth noting that in our setup 
there are multiple Masters.

[73183.511487] i2c i2c-3: Arbitration loss, re-queue the packet
[73192.550519] i2c i2c-3: __i2c_transfer failed -11
[73192.555734] i2c i2c-3: Arbitration loss, re-queue the packet
[73207.250036] i2c i2c-3: __i2c_transfer failed -11
[73207.255247] i2c i2c-3: Arbitration loss, re-queue the packet
[73429.499875] i2c i2c-3: __i2c_transfer failed -11
[73429.505116] i2c i2c-3: Arbitration loss, re-queue the packet
[73504.672065] i2c i2c-3: __i2c_transfer failed -11
[73504.677317] i2c i2c-3: Arbitration loss, re-queue the packet
[73540.762984] i2c i2c-3: __i2c_transfer failed -11
[73540.768242] i2c i2c-3: Arbitration loss, re-queue the packet
[73631.040049] i2c i2c-3: __i2c_transfer failed -11
[73631.045333] i2c i2c-3: Arbitration loss, re-queue the packet
[73648.538967] i2c i2c-3: __i2c_transfer failed -11

Thanks,
- Quan

  reply	other threads:[~2023-11-30  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30  7:52 [PATCH] mctp i2c: Requeue the packet when arbitration is lost Quan Nguyen
2023-11-30  8:03 ` Jeremy Kerr
2023-11-30  8:39   ` Quan Nguyen [this message]
2023-11-30  9:40     ` Jeremy Kerr
2023-12-01  6:31       ` Quan Nguyen
2023-12-01  8:38         ` Jeremy Kerr
2023-12-01 11:47           ` Quan 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=706506b7-a89c-4dfc-b233-be7822eb056e@os.amperecomputing.com \
    --to=quan@os.amperecomputing.com \
    --cc=davem@davemloft.net \
    --cc=dung@os.amperecomputing.com \
    --cc=edumazet@google.com \
    --cc=jk@codeconstruct.com.au \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=pabeni@redhat.com \
    --cc=patches@amperecomputing.com \
    --cc=phong@os.amperecomputing.com \
    --cc=thang@os.amperecomputing.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).