Leon Romanovsky
6512f11d38
RDMA/mlx5: Return an error if copy_to_user fails
...
In theoretical event, the ib_copy_to_udata() can fail, so return -EFAULT
error to the user, so he will destroy the QP.
Fixes: 50aec2c313
("RDMA/mlx5: Return ECE data after modify QP")
Link: https://lore.kernel.org/r/20200602125548.172654-2-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-03 15:45:01 -03:00
Jason Gunthorpe
4d12c04caa
RDMA: Remove 'max_map_per_fmr'
...
Now that FMR support is gone, this attribute can be deleted from all
places.
Link: https://lore.kernel.org/r/13-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com
Reviewed-by: Max Gurtovoy <maxg@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-02 20:32:54 -03:00
Gal Pressman
d29d58e772
RDMA/mlx5: Remove FMR leftovers
...
Remove a few leftovers from FMR functionality which are no longer used.
Link: https://lore.kernel.org/r/5-v3-f58e6669d5d3+2cf-fmr_removal_jgg@mellanox.com
Signed-off-by: Gal Pressman <galpress@amazon.com >
Signed-off-by: Max Gurtovoy <maxg@mellanox.com >
Acked-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-02 20:32:53 -03:00
David S. Miller
1806c13dc2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
...
xdp_umem.c had overlapping changes between the 64-bit math fix
for the calculation of npgs and the removal of the zerocopy
memory type which got rid of the chunk_size_nohdr member.
The mlx5 Kconfig conflict is a case where we just take the
net-next copy of the Kconfig entry dependency as it takes on
the ESWITCH dependency by one level of indirection which is
what the 'net' conflicting change is trying to ensure.
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-31 17:48:46 -07:00
Saeed Mahameed
971ae1ed03
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
...
net/mlx5: Add ability to read and write ECE options
net/mlx5: Add support for RDMA TX FT headers modifying
net/mlx5: Move iseg access helper routines close to mlx5_core driver
net/mlx5: Cleanup mlx5_ifc_fte_match_set_misc2_bits
net/mlx5: Add support in forward to namespace
{IB/net}/mlx5: Simplify don't trap code
net/mlx5: Replace zero-length array with flexible-array
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com >
2020-05-29 14:38:57 -07:00
Mark Zhang
802dcc7fc5
RDMA/mlx5: Support TX port affinity for VF drivers in LAG mode
...
The mlx5 VF driver doesn't set QP tx port affinity because it doesn't know
if the lag is active or not, since the "lag_active" works only for PF
interfaces. In this case for VF interfaces only one lag is used which
brings performance issue.
Add a lag_tx_port_affinity CAP bit; When it is enabled and
"num_lag_ports > 1", then driver always set QP tx affinity, regardless
of lag state.
Link: https://lore.kernel.org/r/20200527055014.355093-1-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-29 15:15:30 -03:00
Leon Romanovsky
50aec2c313
RDMA/mlx5: Return ECE data after modify QP
...
After users sets the ECE option, FW will return the agreed/supported bits
through an output structures of modify QP stages for regular QPs or
through create QP for the DCT.
Link: https://lore.kernel.org/r/20200526115440.205922-9-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
5f62a521ff
RDMA/mlx5: Set ECE options during modify QP
...
The most common way to set ECE option will be during modify QP command in
INIT2RTR, RTR2RTS and RTS2RTS stages, so update mlx5 to support it.
The new bit in the comp_mask is needed to mark that kernel supports ECE
and can receive data instead of "reserved" field in the struct
mlx5_ib_modify_qp.
Link: https://lore.kernel.org/r/20200526115440.205922-8-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
f18e26af6a
RDMA/mlx5: Convert modify QP to use MLX5_SET macros
...
Instead of hand crafted mlx5_qp_context and mlx5_qp_path use common
MLX5_SET() macros.
Link: https://lore.kernel.org/r/20200526115440.205922-7-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
70bd7fb876
RDMA/mlx5: Remove manually crafted QP context the query call
...
As a preparation to removal hand crafted mlx5_qp_context, convert
query_qp_attr() to use proper MLX5_GET() macros.
Link: https://lore.kernel.org/r/20200526115440.205922-6-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
64bae2d455
RDMA/mlx5: Use direct modify QP implementation
...
As a preparation to removal hand crafted mlx5_qp_context, convert counter
code to use mlx5_cmd_exec_in() directly.
Link: https://lore.kernel.org/r/20200526115440.205922-5-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
e383085c24
RDMA/mlx5: Set ECE options during QP create
...
Allow users to ask creation of QPs with specific ECE options. Such early
set even before RDMA-CM connection is established is useful if user knows
exactly which option he needs.
Link: https://lore.kernel.org/r/20200526115440.205922-4-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Leon Romanovsky
3e09a427ae
RDMA/mlx5: Get ECE options from FW during create QP
...
Supported ECE options are returned from FW in the create_qp phase and zero
means that field is not valid. Such default value allows us to reuse
reserved field without worries about comp_mask.
Update create QP API to return ECE options.
Link: https://lore.kernel.org/r/20200526115440.205922-3-leon@kernel.org
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:07:49 -03:00
Jason Gunthorpe
e4fdf7625b
Merge branch 'mellanox/mlx5-next' into rdma.git for/next
...
From the mlx5-next branch at
git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
Required for dependencies in following patches
* branch 'mellanox/mlx5-next':
net/mlx5: Add ability to read and write ECE options
net/mlx5: Add support for RDMA TX FT headers modifying
net/mlx5: Move iseg access helper routines close to mlx5_core driver
net/mlx5: Cleanup mlx5_ifc_fte_match_set_misc2_bits
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 16:01:17 -03:00
Mark Zhang
d246a30615
IB/mlx5: Fix DEVX support for MLX5_CMD_OP_INIT2INIT_QP command
...
The commit citied in the Fixes line wasn't complete and solved
only part of the problems. Update the mlx5_ib to properly support
MLX5_CMD_OP_INIT2INIT_QP command in the DEVX, that is required when
modify the QP tx_port_affinity.
Fixes: 819f7427ba
("RDMA/mlx5: Add init2init as a modify command")
Link: https://lore.kernel.org/r/20200527135703.482501-1-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-27 15:53:21 -03:00
Maor Gottlieb
189277f381
RDMA/mlx5: Fix NULL pointer dereference in destroy_prefetch_work
...
q_deferred_work isn't initialized when creating an explicit ODP memory
region. This can lead to a NULL pointer dereference when user performs
asynchronous prefetch MR. Fix it by initializing q_deferred_work for
explicit ODP.
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [#1 ] SMP PTI
CPU: 4 PID: 6074 Comm: kworker/u16:6 Not tainted 5.7.0-rc1-for-upstream-perf-2020-04-17_07-03-39-64 #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
Workqueue: events_unbound mlx5_ib_prefetch_mr_work [mlx5_ib]
RIP: 0010:__wake_up_common+0x49/0x120
Code: 04 89 54 24 0c 89 4c 24 08 74 0a 41 f6 01 04 0f 85 8e 00 00 00 48 8b 47 08 48 83 e8 18 4c 8d 67 08 48 8d 50 18 49 39 d4 74 66 <48> 8b 70 18 31 db 4c 8d 7e e8 eb 17 49 8b 47 18 48 8d 50 e8 49 8d
RSP: 0000:ffffc9000097bd88 EFLAGS: 00010082
RAX: ffffffffffffffe8 RBX: ffff888454cd9f90 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000003 RDI: ffff888454cd9f90
RBP: ffffc9000097bdd0 R08: 0000000000000000 R09: ffffc9000097bdd0
R10: 0000000000000000 R11: 0000000000000001 R12: ffff888454cd9f98
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000003
FS: 0000000000000000(0000) GS:ffff88846fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000044c19e002 CR4: 0000000000760ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
__wake_up_common_lock+0x7a/0xc0
destroy_prefetch_work+0x5a/0x60 [mlx5_ib]
mlx5_ib_prefetch_mr_work+0x64/0x80 [mlx5_ib]
process_one_work+0x15b/0x360
worker_thread+0x49/0x3d0
kthread+0xf5/0x130
? rescuer_thread+0x310/0x310
? kthread_bind+0x10/0x10
ret_from_fork+0x1f/0x30
Fixes: de5ed007a0
("IB/mlx5: Fix implicit ODP race")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200521072504.567406-1-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-21 20:51:50 -03:00
Jason Gunthorpe
0ac8903cbb
RDMA/core: Allow the ioctl layer to abort a fully created uobject
...
While creating a uobject every create reaches a point where the uobject is
fully initialized. For ioctls that go on to copy_to_user this means they
need to open code the destruction of a fully created uobject - ie the
RDMA_REMOVE_DESTROY sort of flow.
Open coding this creates bugs, eg the CQ does not properly flush the
events list when it does its error unwind.
Provide a uverbs_finalize_uobj_create() function which indicates that the
uobject is fully initialized and that abort should call to destroy_hw to
destroy the uobj->object and related.
Methods can call this function if they go on to have error cases after
setting uobj->object. Once done those error cases can simply do return,
without an error unwind.
Link: https://lore.kernel.org/r/20200519072711.257271-2-leon@kernel.org
Signed-off-by: Yishai Hadas <yishaih@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-21 20:10:46 -03:00
Jason Gunthorpe
eafd47fc20
Merge tag 'v5.7-rc6' into rdma.git for-next
...
Linux 5.7-rc6
Conflict in drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
resolved by deleting dr_cq_event, matching how netdev resolved it.
Required for dependencies in the following patches.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-21 17:08:27 -03:00
Aharon Landau
819f7427ba
RDMA/mlx5: Add init2init as a modify command
...
Missing INIT2INIT entry in the list of modify commands caused DEVX
applications to be unable to modify_qp for this transition state. Add the
MLX5_CMD_OP_INIT2INIT_QP opcode to the list of allowed DEVX opcodes.
Fixes: e662e14d80
("IB/mlx5: Add DEVX support for modify and query commands")
Link: https://lore.kernel.org/r/20200513095550.211345-1-leon@kernel.org
Signed-off-by: Aharon Landau <aharonl@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 21:02:12 -03:00
Michael Guralnik
ecf814e0e1
net/mlx5: Add support for RDMA TX FT headers modifying
...
Support adding header modifying actions to the RDMA TX flow table.
Signed-off-by: Michael Guralnik <michaelgur@mellanox.com >
Reviewed-by: Mark Bloch <markb@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com >
2020-05-18 09:21:46 -07:00
Shay Drory
daeee97690
RDMA/mlx5: Update mlx5_ib driver name
...
Current description doesn't include new devices, change it by updating to
have more generic description and remove DRIVER_NAME and DRIVER_VERSION
defines.
Link: https://lore.kernel.org/r/20200513095304.210240-1-leon@kernel.org
Signed-off-by: Shay Drory <shayd@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-17 20:40:20 -03:00
Leon Romanovsky
59dde4d19c
RDMA/mlx5: Fix query_srq_cmd() function
...
The output buffer used in mlx5_cmd_exec_inout() was wrongly changed from
pre-allocated srq_out pointer to an input "out" point. That leads to
unpredictable results in the get_srqc() call later.
Fixes: 31578defe4
("RDMA/mlx5: Update mlx5_ib to use new cmd interface")
Link: https://lore.kernel.org/r/20200513100809.246315-1-leon@kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-13 16:01:50 -03:00
Daria Velikovsky
f29de9eee7
RDMA/mlx5: Add support for drop action in DV steering
...
When drop action is used the matching packet will stop processing in
steering and will be dropped. This functionality will allow users to drop
matching packets.
Link: https://lore.kernel.org/r/20200504054227.271486-1-leon@kernel.org
Signed-off-by: Daria Velikovsky <daria@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-13 15:58:54 -03:00
Maor Gottlieb
8c112a5f29
RDMA/mlx5: Add support in steering default miss
...
User can configure default miss rule in order to skip matching in the user
domain and forward the packet to the kernel steering domain. When user
requests a default miss rule, we add steering rule to forward the traffic
to the next namespace.
Link: https://lore.kernel.org/r/20200504053012.270689-5-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-13 15:55:41 -03:00
Maor Gottlieb
b9019507aa
RDMA/mlx5: Refactor DV create flow
...
Move part of the code that get the destinations into function so the code
will be more readable. In addition change the variables definition to be
in reversed christmas tree.
Link: https://lore.kernel.org/r/20200504053012.270689-4-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Mark Zhang <markz@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-13 15:55:40 -03:00
Jason Gunthorpe
10c2615513
Merge branch 'mellanox/mlx5-next' into rdma.git for/next
...
From the mlx5-next branch at
git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
Required for dependencies in following patches
* branch 'mellanox/mlx5-next':
net/mlx5: Add support in forward to namespace
{IB/net}/mlx5: Simplify don't trap code
net/mlx5: Replace zero-length array with flexible-array
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-13 15:54:19 -03:00
Maor Gottlieb
14c129e301
{IB/net}/mlx5: Simplify don't trap code
...
The fs_core already supports creation of rules with multiple
actions/destinations. Refactor fs_core to handle the case
when don't trap rule is created with destination. Adapt the
calling code in the driver.
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Mark Zhang <markz@mellanox.com >
Reviewed-by: Mark Bloch <markb@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
2020-05-13 18:56:18 +03:00
Colin Ian King
52c81f47f0
RDMA/mlx5: Remove duplicated assignment to variable rcqe_sz
...
The variable rcqe_sz is being unnecessarily assigned twice, fix this by
removing one of the duplicates.
Fixes: 8bde2c509e
("RDMA/mlx5: Update all DRIVER QP places to use QP subtype")
Link: https://lore.kernel.org/r/20200507151610.52636-1-colin.king@canonical.com
Addresses-Coverity: ("Evaluation order violation")
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Acked-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-07 21:02:58 -03:00
David S. Miller
3793faad7b
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
...
Conflicts were all overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-06 22:10:13 -07:00
Mark Bloch
42caf9cb59
RDMA/mlx5: Allow only raw Ethernet QPs when RoCE isn't enabled
...
When operating in switchdev mode or using devlink to disable RoCE
only raw Ethernet QPs are allowed to be created.
When in switchdev mode this can lead to passing an invalid port number
as part of the modify qp firmware cmd and will lead to a syndrome
reported back to the user, such as:
* mlx5_cmd_check:803:(pid 50148): RST2INIT_QP(0x502) op_mod(0x0) failed,
status bad parameter(0x3), syndrome (0x177405).
Internal UD QP might be used to test for write combining support (even if
externally we report RoCE as disabled) check for that specific flag and
allow is specifically.
Fixes: b5ca15ad7e
("IB/mlx5: Add proper representors support")
Link: https://lore.kernel.org/r/20200506071602.7177-3-leon@kernel.org
Signed-off-by: Mark Bloch <markb@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:52:01 -03:00
Mark Bloch
8d93efb8c5
RDMA/mlx5: Assign profile before calling stages
...
Assign the profile to the IB device before executing stages. This will
allow to check which profile is being used from within a stage.
Link: https://lore.kernel.org/r/20200506071602.7177-2-leon@kernel.org
Signed-off-by: Mark Bloch <markb@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:52:01 -03:00
Leon Romanovsky
029e88fd1e
RDMA/mlx5: Move all WR logic from qp.c to separate file
...
Split qp.c by removing all WR logic to separate file.
Link: https://lore.kernel.org/r/20200506065513.4668-4-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:42:45 -03:00
Max Gurtovoy
6671cde83d
RDMA/mlx5: Refactor mlx5_post_send() to improve readability
...
Add small helpers in order to avoid code duplication and improve code
readability. Decrease the amount of code in the gigantic post_send
function and divide it to readable methods that will help in code
maintenance in the future.
Link: https://lore.kernel.org/r/20200506065513.4668-3-leon@kernel.org
Signed-off-by: Max Gurtovoy <maxg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:42:45 -03:00
Leon Romanovsky
31578defe4
RDMA/mlx5: Update mlx5_ib to use new cmd interface
...
Reuse newly introduced mlx5_cmd_exec_in() and mlx5_cmd_exec_inout() to
reduce code duplication in mlx5_ib module.
Link: https://lore.kernel.org/r/20200506065513.4668-2-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:42:45 -03:00
Mark Zhang
5ac55dfc6d
RDMA/mlx5: Set UDP source port based on the grh.flow_label
...
Calculate UDP source port based on the grh.flow_label. If grh.flow_label
is not valid, we will use minimal supported UDP source port.
Link: https://lore.kernel.org/r/20200504051935.269708-6-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 16:51:44 -03:00
Mark Zhang
2b880b2e5e
RDMA/mlx5: Define RoCEv2 udp source port when set path
...
Calculate and set UDP source port based on the flow label. If flow label
is not defined in GRH then calculate it based on lqpn/rqpn.
Link: https://lore.kernel.org/r/20200504051935.269708-4-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 16:51:44 -03:00
Maor Gottlieb
cfc1a89e44
RDMA/mlx5: Set lag tx affinity according to slave
...
The patch sets the lag tx affinity of the data QPs and the GSI QPs
according to the LAG xmit slave.
For GSI QPs, in case the link layer is Ethenet (RoCE) we create two GSI
QPs, one for each physical port. When the driver selects the GSI QP, it
will consider the port affinity result. For connected QPs, the driver
sets the affinity of the xmit slave.
The above, ensures that RC QP and it's corresponding GSI QP will transmit
from the same physical port.
Link: https://lore.kernel.org/r/20200430192146.12863-17-maorg@mellanox.com
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-02 20:19:54 -03:00
Maor Gottlieb
5163b2743a
RDMA/mlx5: Refactor affinity related code
...
Move affinity related code in modify qp to function. It's a preparation
for next patch the extend the affinity calculation to consider the xmit
slave.
Link: https://lore.kernel.org/r/20200430192146.12863-16-maorg@mellanox.com
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Reviewed-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-02 20:19:54 -03:00
Maor Gottlieb
fa5d010c56
RDMA: Group create AH arguments in struct
...
Following patch adds additional argument to the create AH function, so it
make sense to group ah_attr and flags arguments in struct.
Link: https://lore.kernel.org/r/20200430192146.12863-13-maorg@mellanox.com
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Acked-by: Devesh Sharma <devesh.sharma@broadcom.com >
Acked-by: Gal Pressman <galpress@amazon.com >
Acked-by: Weihang Li <liweihang@huawei.com >
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-02 20:19:53 -03:00
Aharon Landau
0eacc574aa
RDMA/mlx5: Verify that QP is created with RQ or SQ
...
RAW packet QP and underlay QP must be created with either
RQ or SQ, check that.
Fixes: e126ba97db
("mlx5: Add driver for Mellanox Connect-IB adapters")
Link: https://lore.kernel.org/r/20200427154636.381474-37-leon@kernel.org
Signed-off-by: Aharon Landau <aharonl@mellanox.com >
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:46 -03:00
Leon Romanovsky
968f0b6f9c
RDMA/mlx5: Consolidate into special function all create QP calls
...
Finish separation to blocks of mlx5_ib_create_qp() functions,
so all internal create QP implementation are located in one place.
Link: https://lore.kernel.org/r/20200427154636.381474-36-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:46 -03:00
Leon Romanovsky
6367da46d3
RDMA/mlx5: Remove redundant destroy QP call
...
After major refactoring in create QP flow, it is no needed to call
to destroy QP in XRC_TGT flow.
Link: https://lore.kernel.org/r/20200427154636.381474-35-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:46 -03:00
Leon Romanovsky
08d5397660
RDMA/mlx5: Copy response to the user in one place
...
Update all the places in create QP flows to copy response
to the user in one place.
Link: https://lore.kernel.org/r/20200427154636.381474-34-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:46 -03:00
Leon Romanovsky
6f2cf76e6e
RDMA/mlx5: Handle udate outlen checks in one place
...
Place in one function all udata size checks. This will allow
us move ib_copy_to_udata() in general place and ensure that
it will be performed after call to the FW.
Link: https://lore.kernel.org/r/20200427154636.381474-33-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:45 -03:00
Leon Romanovsky
5d6fffed1c
RDMA/mlx5: Promote RSS RAW QP flags check to higher level
...
Move check that user didn't supplied RSS RAW QP unsupported
command flags to the function that checks all such flags.
Link: https://lore.kernel.org/r/20200427154636.381474-32-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:45 -03:00
Leon Romanovsky
f78d358cec
RDMA/mlx5: Group all create QP parameters to simplify in-kernel interfaces
...
The amount of parameters passed in and out between internal mlx5
create QP functions is too large to easily follow the flow. Change
it by grouping all create QP parameter into one structure.
Link: https://lore.kernel.org/r/20200427154636.381474-31-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:45 -03:00
Leon Romanovsky
747c519cdb
RDMA/mlx5: Reduce amount of duplication in QP destroy
...
Delete both PD argument and checks if udata was provided, in favour
of unified destroy QP functions.
Link: https://lore.kernel.org/r/20200427154636.381474-30-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:45 -03:00
Leon Romanovsky
98fc1126c4
RDMA/mlx5: Separate to user/kernel create QP flows
...
The kernel and user create QP flows have very little common code,
separate them to simplify the future work of creating per-type
create_*_qp() functions.
Link: https://lore.kernel.org/r/20200427154636.381474-29-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:44 -03:00
Leon Romanovsky
04bcc1c2d0
RDMA/mlx5: Separate XRC_TGT QP creation from common flow
...
XRC_TGT QP doesn't fail into kernel or user flow separation. It is
initiated by the user, but is created through in-kernel verbs flow
and doesn't have PD and udata in similar way to kernel QPs.
So let's separate creation of that QP type from the common flow.
Link: https://lore.kernel.org/r/20200427154636.381474-28-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:44 -03:00
Leon Romanovsky
21aad80b17
RDMA/mlx5: Globally parse DEVX UID
...
Remove duplication in parsing of DEVX UID.
Link: https://lore.kernel.org/r/20200427154636.381474-27-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-04-30 18:45:44 -03:00