~timg-tpi/ubuntu/+source/linux/+git/focal:focal-mana-net-driver-SF00310147

Last commit made on 2021-10-20
Get this branch:
git clone -b focal-mana-net-driver-SF00310147 https://git.launchpad.net/~timg-tpi/ubuntu/+source/linux/+git/focal
Only Tim Gardner can upload to this branch. If you are Tim Gardner please log in for upload directions.

Branch merges

Branch information

Name:
focal-mana-net-driver-SF00310147
Repository:
lp:~timg-tpi/ubuntu/+source/linux/+git/focal

Recent commits

bc4974d... by Haiyang Zhang

net: mana: Fix error handling in mana_create_rxq()

BugLink: https://bugs.launchpad.net/bugs/1947859

Fix error handling in mana_create_rxq() when
cq->gdma_id >= gc->max_num_cqs.

Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Haiyang Zhang <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Jakub Kicinski <email address hidden>
(cherry picked from commit be0499369d6376e70b5b80bbced94c0c32d508b1)
Signed-off-by: Tim Gardner <email address hidden>

9e9f608... by Len Baker <email address hidden>

net: mana: Prefer struct_size over open coded arithmetic

BugLink: https://bugs.launchpad.net/bugs/1947859

As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

So, use the struct_size() helper to do the arithmetic instead of the
argument "size + count * size" in the kzalloc() function.

[1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Signed-off-by: Len Baker <email address hidden>
Reviewed-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit f11ee2ad25b22c2ee587045dd6999434375532f7)
Signed-off-by: Tim Gardner <email address hidden>

ccda268... by Haiyang Zhang

net: mana: Add WARN_ON_ONCE in case of CQE read overflow

BugLink: https://bugs.launchpad.net/bugs/1947859

This is not an expected case normally.
Add WARN_ON_ONCE in case of CQE read overflow, instead of failing
silently.

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit c1a3e9f98dde4782290d2c4871e42b7e76ad5593)
Signed-off-by: Tim Gardner <email address hidden>

d5be193... by Haiyang Zhang

net: mana: Add support for EQ sharing

BugLink: https://bugs.launchpad.net/bugs/1947859

The existing code uses (1 + #vPorts * #Queues) MSIXs, which may exceed
the device limit.

Support EQ sharing, so that multiple vPorts (NICs) can share the same
set of MSIXs.

And, report the EQ-sharing capability bit to the host, which means the
host can potentially offer more vPorts and queues to the VM.

Also update the resource limit checking and error handling for better
robustness.

Now, we support up to 256 virtual ports per VF (it was 16/VF), and
support up to 64 queues per vPort (it was 16).

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 1e2d0824a9c3de5371a46601aac0c14af5c0a50a)
Signed-off-by: Tim Gardner <email address hidden>

9480c07... by Haiyang Zhang

net: mana: Move NAPI from EQ to CQ

BugLink: https://bugs.launchpad.net/bugs/1947859

The existing code has NAPI threads polling on EQ directly. To prepare
for EQ sharing among vPorts, move NAPI from EQ to CQ so that one EQ
can serve multiple CQs from different vPorts.

The "arm bit" is only set when CQ processing is completed to reduce
the number of EQ entries, which in turn reduce the number of interrupts
on EQ.

Signed-off-by: Haiyang Zhang <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit e1b5683ff62e7b328317aec08869495992053e9d)
Signed-off-by: Tim Gardner <email address hidden>

a8a7547... by tititou

net: mana: Fix a memory leak in an error handling path in 'mana_create_txq()'

BugLink: https://bugs.launchpad.net/bugs/1947859

If this test fails we must free some resources as in all the other error
handling paths of this function.

Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Signed-off-by: Christophe JAILLET <email address hidden>
Reviewed-by: Dexuan Cui <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit b90788459cd6d140171b046f0b37fad341ade0a3)
Signed-off-by: Tim Gardner <email address hidden>

01b871d... by "Gustavo A. R. Silva" <email address hidden>

net: mana: Use struct_size() in kzalloc()

BugLink: https://bugs.launchpad.net/bugs/1947859

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows
that, in the worst scenario, could lead to heap overflows.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit ea89c862f01e02ec459932c7c3113fa37aedd09a)
Signed-off-by: Tim Gardner <email address hidden>

4021739... by Tim Gardner

UBUNTU: Ubuntu-azure-5.4.0-1062.65

Signed-off-by: Tim Gardner <email address hidden>

343c9d1... by Tim Gardner

UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1946370
Properties: no-test-build
Signed-off-by: Tim Gardner <email address hidden>

1ad5325... by Tim Gardner

UBUNTU: Start new release

Ignore: yes
Signed-off-by: Tim Gardner <email address hidden>