RDMA/mana_ib: Fix a bug when the PF indicates more entries for registering memory on first packet
When registering memory in a large chunk that doesn't fit into a single PF
message, the PF may return GDMA_STATUS_MORE_ENTRIES on the first message if
there are more messages needed for registering more chunks.
Fix the VF to make it process the correct return code.
Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Link: https://<email address hidden>
Signed-off-by: Long Li <email address hidden>
Signed-off-by: Jason Gunthorpe <email address hidden>
(cherry picked from commit 89d42b8c85b4c67d310c5ccaf491acbf71a260c3)
Signed-off-by: Tim Gardner <email address hidden>
After calling irq_set_affinity_and_hint(), the cpumask pointer is
saved in desc->affinity_hint, and will be used later when reading
/proc/irq/<num>/affinity_hint. So the cpumask variable needs to be
persistent. Otherwise, we are accessing freed memory when reading
the affinity_hint file.
Also, need to clear affinity_hint before free_irq(), otherwise there
is a one-time warning and stack trace during module unloading:
RDMA/mana_ib: Prevent array underflow in mana_ib_create_qp_raw()
The "port" comes from the user and if it is zero then the:
ndev = mc->ports[port - 1];
assignment does an out of bounds read. I have changed the if
statement to fix this and to mirror how it is done in
mana_ib_create_qp_rss().
Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Signed-off-by: Dan Carpenter <email address hidden>
Link: https://lore.kernel.org/r/Y8/3Vn8qx00kE9Kk@kili
Acked-by: Long Li <email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(cherry picked from commit 563ca0e9eab8acc8a1309e8b440108ff8d23e951)
Signed-off-by: Tim Gardner <email address hidden>
272d753...
by
Leon Romanovsky <email address hidden>
RDMA/mana: Remove redefinition of basic u64 type
gdma_obj_handle_t is no more than redefinition of basic
u64 type. Remove such obfuscation.
Link: https://lore.kernel.org/<email address hidden>
Acked-by: Long Li <email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(cherry picked from commit 3574cfdca28543e2e8db649297cd6659ea8e4bb8)
Signed-off-by: Tim Gardner <email address hidden>
RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter
Add a RDMA VF driver for Microsoft Azure Network Adapter (MANA).
Co-developed-by: Ajay Sharma <email address hidden>
Signed-off-by: Ajay Sharma <email address hidden>
Reviewed-by: Dexuan Cui <email address hidden>
Signed-off-by: Long Li <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(backported from commit 0266a177631d4c6b963b5b12dd986a8c5abdbf06)
[rtg - minor context adjustments]
Signed-off-by: Tim Gardner <email address hidden>
3428bb4...
by
Nathan Huckleberry <email address hidden>
net: mana: Fix return type of mana_start_xmit()
The ndo_start_xmit field in net_device_ops is expected to be of type
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev).
The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition. A new
warning in clang will catch this at compile time:
drivers/net/ethernet/microsoft/mana/mana_en.c:382:21: error: incompatible function pointer types initializing 'netdev_tx_t (*)(struct sk_buff *, struct net_device *)' (aka 'enum netdev_tx (*)(struct sk_buff *, struct net_device *)') with an expression of type 'int (struct sk_buff *, struct net_device *)' [-Werror,-Wincompatible-function-pointer-types-strict] .ndo_start_xmit = mana_start_xmit, ^~~~~~~~~~~~~~~
1 error generated.
The return type of mana_start_xmit should be changed from int to
netdev_tx_t.
Reported-by: Dan Carpenter <email address hidden>
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Link: https://github.com/ClangBuiltLinux/linux/issues/1750
Signed-off-by: Nathan Huckleberry <email address hidden>
Reviewed-by: Dexuan Cui <email address hidden>
[nathan: Rebase on net-next and resolve conflicts
Add note about new clang warning]
Signed-off-by: Nathan Chancellor <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Paolo Abeni <email address hidden>
(cherry picked from commit 0c9ef08a4d0fd6c5e6000597b506235d71a85a61)
Signed-off-by: Tim Gardner <email address hidden>
net: mana: Define data structures for protection domain and memory registration
The MANA hardware support protection domain and memory registration for use
in RDMA environment. Add those definitions and expose them for use by the
RDMA driver.
Signed-off-by: Ajay Sharma <email address hidden>
Signed-off-by: Long Li <email address hidden>
Link: https://<email address hidden>
Reviewed-by: Dexuan Cui <email address hidden>
Acked-by: Haiyang Zhang <email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(cherry picked from commit 28c66cfa45388af1126985d1114e0ed762eb2abd)
Signed-off-by: Tim Gardner <email address hidden>
net: mana: Define and process GDMA response code GDMA_STATUS_MORE_ENTRIES
When doing memory registration, the PF may respond with
GDMA_STATUS_MORE_ENTRIES to indicate a follow request is needed. This is
not an error and should be processed as expected.
Signed-off-by: Ajay Sharma <email address hidden>
Reviewed-by: Dexuan Cui <email address hidden>
Signed-off-by: Long Li <email address hidden>
Link: https://<email address hidden>
Acked-by: Haiyang Zhang <email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(cherry picked from commit de372f2a9ca7ada2698ecac7df8f02407cd98fa0)
Signed-off-by: Tim Gardner <email address hidden>
The number of maximum SGl entries should be computed from the maximum
WQE size for the intended queue type and the corresponding OOB data
size. This guarantees the hardware queue can successfully queue requests
up to the queue depth exposed to the upper layer.
Reviewed-by: Dexuan Cui <email address hidden>
Signed-off-by: Long Li <email address hidden>
Link: https://<email address hidden>
Acked-by: Haiyang Zhang <email address hidden>
Signed-off-by: Leon Romanovsky <email address hidden>
(cherry picked from commit aa56549792fb348892fbbae67f6f0c71bb750b65)
Signed-off-by: Tim Gardner <email address hidden>