mlxsw: pci: Avoid flow control for EMAD packets
authorDanielle Ratson <danieller@nvidia.com>
Wed, 5 Jan 2022 10:22:27 +0000 (12:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Jan 2022 15:01:43 +0000 (15:01 +0000)
commitd43e4271747ace01a27a49a97a397cb4219f6487
treef69abeaad052af478ed58b627988d841fcd0406c
parent7da0694c01681166eebc7dc6130b329f2291c7c4
mlxsw: pci: Avoid flow control for EMAD packets

Locally generated packets ingress the device through its CPU port. When
the CPU port is congested and there are not enough credits in its
headroom buffer, packets can be dropped.

While this might be acceptable for data packets that traverse the
network, configuration packets exchanged between the host and the device
(EMADs) should not be subjected to this flow control.

The "sdq_lp" bit in the SDQ (Send Descriptor Queue) context allows the
host to instruct the device to treat packets sent on this queue as
"local processing" and always process them, regardless of the state of
the CPU port's headroom.

Add the definition of this bit and set it for the dedicated SDQ reserved
for the transmission of EMAD packets. This makes the "local processing"
bit in the WQE (Work Queue Element) redundant, so clear it.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/cmd.h
drivers/net/ethernet/mellanox/mlxsw/pci.c