summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2016-03-07 15:15:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:25:51 +0200
commit0a8b5f3fac581ff4a04f5db57ccc79b2de5f7259 (patch)
tree072430198947012cd00b600bf44367a15823cf9c /tools/perf/scripts/python/export-to-postgresql.py
parent15aeb6325d5930f46fb705175ae46c81f848dcbb (diff)
mlxsw: pci: Correctly determine if descriptor queue is full
commit 5091730d7795ccb21eb880699b5194730641c70b upstream. 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 subtraction result to u16, preventing it from 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> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions