netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com,
	yotamg@mellanox.com, ogerlitz@mellanox.com
Subject: Re: [patch net 2/2] mlxsw: pci: Correctly determine if descriptor queue is full
Date: Mon, 7 Mar 2016 17:04:59 +0300	[thread overview]
Message-ID: <56DD8A8B.8000705@cogentembedded.com> (raw)
In-Reply-To: <1457339092-2878-3-git-send-email-jiri@resnulli.us>

Hello.

On 3/7/2016 11:24 AM, Jiri Pirko wrote:

> From: Ido Schimmel <idosch@mellanox.com>
>
> The descriptor queues for sending (SDQs) and receiving (RDQs) packets
> are managed by two counters - producer and consumer - which are both
> 16-bit in size. A queue is considered full when the difference between
> the two equals the queue's maximum number of descriptors.
>
> However, if the producer counter overflows, then it's possible for the
> full queue check to fail, as it doesn't take the overflow into account.
> In such a case, descriptors already passed to the device - but for which
> a completion has yet to be posted - will be overwritten, thereby causing
> undefined behavior. The above can be achieved under heavy load (~30
> netperf instances).
>
> Fix that by casting the substraction result to u16, preventing it from

    Subtraction.

> being treated as a signed integer.
>
> Fixes: eda6500a987a ("mlxsw: Add PCI bus implementation")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

[...]

MBR, Sergei

  reply	other threads:[~2016-03-07 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  8:24 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2016-03-07  8:24 ` [patch net 1/2] mlxsw: spectrum: Always decrement bridge's ref count Jiri Pirko
2016-03-07  8:24 ` [patch net 2/2] mlxsw: pci: Correctly determine if descriptor queue is full Jiri Pirko
2016-03-07 14:04   ` Sergei Shtylyov [this message]
2016-03-07 14:12     ` Ido Schimmel

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=56DD8A8B.8000705@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=eladr@mellanox.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=yotamg@mellanox.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).