History log of /dpdk/drivers/common/mlx5/linux/mlx5_glue.c (Results 1 – 25 of 25)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v24.07-rc2, v24.07-rc1
# 27595cd8 15-Apr-2024 Tyler Retzlaff <roretzla@linux.microsoft.com>

drivers: move alignment attribute on types for MSVC

Move location of __rte_aligned(a) to new conventional location. The new
placement between {struct,union} and the tag allows the desired
alignment

drivers: move alignment attribute on types for MSVC

Move location of __rte_aligned(a) to new conventional location. The new
placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for both C and C++. Additionally, it avoids confusion by Doxygen
when generating documentation.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>

show more ...


Revision tags: v24.03, v24.03-rc4, v24.03-rc3, v24.03-rc2, v24.03-rc1, v23.11, v23.11-rc4, v23.11-rc3, v23.11-rc2, v23.11-rc1, v23.07, v23.07-rc4, v23.07-rc3, v23.07-rc2, v23.07-rc1
# 42f113c5 24-May-2023 Erez Ferber <erezf@nvidia.com>

common/mlx5: adjust fork call with new kernel API

While doing process fork() the operating system remaps all the parent
process's memory to the address space of the child process and activates
the C

common/mlx5: adjust fork call with new kernel API

While doing process fork() the operating system remaps all the parent
process's memory to the address space of the child process and activates
the Copy-on-Write mechanics - it duplicates physical pages once memory
writing happens in the child process. Sometimes memory duplication is
not allowed - for example, if the page contains hardware queue
descriptors. To handle similar issues the rdma-core library should be
prepared for forking.

The ibv_fork_init() prepares the library to track all the related memory
and prevent it from forking using madvise() system API. This approach
allows fork, but not all the memory is forked to the child process and,
application should care not to touch pages where the parent application
allocated the rdma-core objects.

The newer kernels propose an option of copy-on-fork for DMA pages and
tracking all the memory and disabling it for the forking is no longer
needed. The new API routine ibv_is_fork_initialized() should be involved
to decide if library initialization for forking is required.

Fixes: 0e83b8e536c1 ("net/mlx5: move rdma-core calls to separate file")
Cc: stable@dpdk.org

Signed-off-by: Erez Ferber <erezf@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

show more ...


Revision tags: v23.03, v23.03-rc4, v23.03-rc3
# be8476dd 20-Mar-2023 Hamdan Igbaria <hamdani@nvidia.com>

net/mlx5/hws: support dest root table action

Add support for dest root table action creation.
This support will allow to redirect the packets to
the kernel from non root tables.

Signed-off-by: Hamd

net/mlx5/hws: support dest root table action

Add support for dest root table action creation.
This support will allow to redirect the packets to
the kernel from non root tables.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v23.03-rc2, v23.03-rc1, v22.11, v22.11-rc4, v22.11-rc3, v22.11-rc2
# dfceca7e 20-Oct-2022 Alex Vesker <valex@nvidia.com>

common/mlx5: add glue functions for hardware steering

Add missing glue support for the HWS mlx5dr layer.
The new glue functions are needed for mlx5dv to create
matcher and action, which are used as

common/mlx5: add glue functions for hardware steering

Add missing glue support for the HWS mlx5dr layer.
The new glue functions are needed for mlx5dv to create
matcher and action, which are used as the kernel root
table as well as for capabilities query like device
name and port info.

Signed-off-by: Alex Vesker <valex@nvidia.com>

show more ...


# 80f998da 19-Oct-2022 Michael Savisko <michaelsav@nvidia.com>

common/mlx5: add send to kernel flow action

Add new glue callback dr_create_flow_action_send_to_kernel.
Default callback invokes mlx5dv_dr_action_create_dest_root_table().

Add static inline mlx5_fl

common/mlx5: add send to kernel flow action

Add new glue callback dr_create_flow_action_send_to_kernel.
Default callback invokes mlx5dv_dr_action_create_dest_root_table().

Add static inline mlx5_flow_os_create_flow_action_send_to_kernel(),
which calls dr_create_flow_action_send_to_kernel glue callback.

Define HAVE_MLX5DV_DR_ACTION_CREATE_DEST_ROOT_TABLE macro if function
mlx5dv_dr_action_create_dest_root_table exists in infiniband/mlx5dv.h

Signed-off-by: Michael Savisko <michaelsav@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v22.11-rc1, v22.07, v22.07-rc4, v22.07-rc3, v22.07-rc2, v22.07-rc1, v22.03, v22.03-rc4, v22.03-rc3, v22.03-rc2
# 0777921a 24-Feb-2022 Michael Baum <michaelba@nvidia.com>

common/mlx5: glue device and PD import

Add support for rdma-core API to import device.
The API gets ibv_context file descriptor and returns an ibv_context
pointer that is associated with the given f

common/mlx5: glue device and PD import

Add support for rdma-core API to import device.
The API gets ibv_context file descriptor and returns an ibv_context
pointer that is associated with the given file descriptor.
Add also support for rdma-core API to import PD.
The API gets ibv_context and PD handle and returns a protection domain
(PD) that is associated with the given handle in the given context.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v22.03-rc1, v21.11, v21.11-rc4, v21.11-rc3
# 6ebd062e 09-Nov-2021 Michael Baum <michaelba@nvidia.com>

common/mlx5: glue MR registration with IOVA

Add support for rdma-core API to register IOVA MR.
The API gets the process VA, size, and IOVA and returns a memory region
with space pointed by a specifi

common/mlx5: glue MR registration with IOVA

Add support for rdma-core API to register IOVA MR.
The API gets the process VA, size, and IOVA and returns a memory region
with space pointed by a specific IOVA.

So any access in this MR should come with an address that is relative to
the IOVA specified in the API.

Fixes: cc07a42da250 ("vdpa/mlx5: prepare memory regions")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v21.11-rc2, v21.11-rc1, v21.08, v21.08-rc4, v21.08-rc3, v21.08-rc2, v21.08-rc1
# 0fd928bb 07-Jul-2021 Viacheslav Ovsiienko <viacheslavo@nvidia.com>

common/mlx5: fix compatibility with OFED port query API

The compilation flag HAVE_MLX5DV_DR_DEVX_PORT depends on presence
of mlx5dv_query_devx_port routine in rdma-core library.

The mlx5dv_query_de

common/mlx5: fix compatibility with OFED port query API

The compilation flag HAVE_MLX5DV_DR_DEVX_PORT depends on presence
of mlx5dv_query_devx_port routine in rdma-core library.

The mlx5dv_query_devx_port routine exists only in OFED versions
of rdma-core library and is being planned to be removed and replaced
with Upstream compatible mlx5dv_query_port.

As mlx5dv_query_devx_port is being removed all the dependencies on
the HAVE_MLX5DV_DR_DEVX_PORT compilation flag are reconsidered.

The new compilation flag HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT is for
backward compatibility with older OFED versions.

Fixes: 6cfe84fbe7b1 ("net/mlx5: fix port action for LAG")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


# d0cf77e8 07-Jul-2021 Viacheslav Ovsiienko <viacheslavo@nvidia.com>

common/mlx5: use new port query API if available

In order to get E-Switch vport identifiers the mlx5 PMD relies
on two approaches:
[a] use port query API if it is provided by rdma-core library
[

common/mlx5: use new port query API if available

In order to get E-Switch vport identifiers the mlx5 PMD relies
on two approaches:
[a] use port query API if it is provided by rdma-core library
[b] otherwise, deduce vport ids from the related VF index
The latter is not reliable and may not work with newer kernel
drivers and in some configurations (LAG), causing E-Switch
malfunction. Hence, engaging the port query API is highly
desirable.

Depending on rdma-core version the port query API is:
- very old OFED versions have no query API (approach [b])
- rdma-core OFED < 5.5 provides mlx5dv_query_devx_port,
HAVE_MLX5DV_DR_DEVX_PORT flag is defined (approach [a])
- rdma-core OFED >= 5.5 has mlx5dv_query_port, flag
HAVE_MLX5DV_DR_DEVX_PORT_V35 is defined (approach [a])
- future OFED versions might remove mlx5dv_query_devx_port
and HAVE_MLX5DV_DR_DEVX_PORT will not be defined
- Upstream rdma-core < v35 has no port query API (approach [b])
- Upstream rdma-core >= v35 has mlx5dv_query_port, flag
HAVE_MLX5DV_DR_DEVX_PORT_V35 is defined (approach [a])

In order to support the new mlx5dv_query_port routine, the
conditional compilation flag HAVE_MLX5DV_DR_DEVX_PORT_V35
is introduced by this patch. The flag HAVE_MLX5DV_DR_DEVX_PORT
is kept for compatibility with previous rdma-core versions.

Despite this patch is not a bugfix (it follows the introduced API
variation in underlying library), it resolves the compatibility
issue and is highly desired to be ported to DPDK LTS.

Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


# e39226bd 06-Jul-2021 Jiawei Wang <jiaweiw@nvidia.com>

net/mlx5: control flow rules with identical pattern

In order to allow\disallow configuring rules with identical
patterns, the new device argument 'allow_duplicate_pattern'
is introduced.
If allow, t

net/mlx5: control flow rules with identical pattern

In order to allow\disallow configuring rules with identical
patterns, the new device argument 'allow_duplicate_pattern'
is introduced.
If allow, these rules be inserted successfully and only the
first rule take affect.
If disallow, the first rule will be inserted and other rules
be rejected.

The default is to allow.
Set it to 0 if disallow, for example:
-a <PCI_BDF>,allow_duplicate_pattern=0

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v21.05, v21.05-rc4, v21.05-rc3, v21.05-rc2, v21.05-rc1
# a38d22ed 15-Apr-2021 Haifei Luo <haifeil@nvidia.com>

common/mlx5: add functions for single flow dump

Add mlx5 APIs for single flow dump feature

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


# 75a9a73d 25-Feb-2021 Matan Azrad <matan@nvidia.com>

common/mlx5/linux: add glue function to query WQ

When Rx queue is created by VERBS API ibv_create_wq there is a dedicated
rdma-core API to query an information about this WQ(Work Queue).

VERBS WQ q

common/mlx5/linux: add glue function to query WQ

When Rx queue is created by VERBS API ibv_create_wq there is a dedicated
rdma-core API to query an information about this WQ(Work Queue).

VERBS WQ querying is needed for PMD cases which combine VERBS objects
with DevX objects.

Next feature to use this glue function is the HW queue counters.

Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

show more ...


Revision tags: v21.02, v21.02-rc4, v21.02-rc3, v21.02-rc2, v21.02-rc1, v20.11, v20.11-rc5
# a2999c7b 18-Nov-2020 Dekel Peled <dekelp@nvidia.com>

common/mlx5: move to formal ASO action API

Existing code uses the previous API offered by rdma-core in order
to create ASO Flow Hit action.

A general API is now formally released, to create ASO act

common/mlx5: move to formal ASO action API

Existing code uses the previous API offered by rdma-core in order
to create ASO Flow Hit action.

A general API is now formally released, to create ASO action of any
type. This patch moves the MLX5 PMD code to use the formal API.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


Revision tags: v20.11-rc4, v20.11-rc3, v20.11-rc2
# 5ffb9f73 01-Nov-2020 Dekel Peled <dekelp@nvidia.com>

common/mlx5: add glue function to create flow hit action

Add glue function to create the flow hit action using DV API,
if rdma-core support exists.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Ac

common/mlx5: add glue function to create flow hit action

Add glue function to create the flow hit action using DV API,
if rdma-core support exists.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


# cdb034a8 27-Oct-2020 Ophir Munk <ophirmu@nvidia.com>

common/mlx5/linux: replace malloc and free in glue

This commit replaces mlx5_malloc and mlx5_free calls with Linux calls
malloc and free in file mlx5_glue.c.
The current mlx5_malloc calls have no fl

common/mlx5/linux: replace malloc and free in glue

This commit replaces mlx5_malloc and mlx5_free calls with Linux calls
malloc and free in file mlx5_glue.c.
The current mlx5_malloc calls have no flags, alignment or socket
selection, so they are equivalent to calling malloc. Rdma-core itself
is using malloc. When using mlx5_malloc the glue library is dependent
on common_mlx5 library which must be compiled first. Not doing so and
in case ibverbs_link=dlopen will result in compilation failure:
mlx5_glue.c: undefined reference to `mlx5_malloc'.
To make all of this simpler and remove the common_mlx5 dependency - this
commit does the alloc/free replacements.

Fixes: 66914d19d135 ("common/mlx5: convert control path memory to unified malloc")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

show more ...


# 6e0cd74a 27-Oct-2020 Bing Zhao <bingz@nvidia.com>

common/mlx5: add glue function for domain sync

In rdma-core, the "mlx5dv_dr_domain_sync" function was already
provided. It is used to flush the rule submission queue. The wrapper
function in the glu

common/mlx5: add glue function for domain sync

In rdma-core, the "mlx5dv_dr_domain_sync" function was already
provided. It is used to flush the rule submission queue. The wrapper
function in the glue layer is added for using this.
It only supports DR flows right now the same as domain creating and
destroying functions.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

show more ...


Revision tags: v20.11-rc1
# 4d23dd35 13-Oct-2020 Jiawei Wang <jiaweiw@nvidia.com>

common/mlx5: add glue function for mirroring

The new DR destination array action is supported since the
rdma-core version v32.

Destination array action is used group DR actions to a single action,

common/mlx5: add glue function for mirroring

The new DR destination array action is supported since the
rdma-core version v32.

Destination array action is used group DR actions to a single action,
And it can be used for mirroring packet and forward to every
destination (port or queue) in the array.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

show more ...


# a3def854 13-Oct-2020 Jiawei Wang <jiaweiw@nvidia.com>

common/mlx5: add glue for sample action

The new DR sample action is supported since OFED version
5.1.2 or rdma-core version v32.

MLX5 PMD adds the rdma-core command in glue to create this action.

common/mlx5: add glue for sample action

The new DR sample action is supported since OFED version
5.1.2 or rdma-core version v32.

MLX5 PMD adds the rdma-core command in glue to create this action.

Sample action is used for creating the sample object to implement
the sampling/mirroring function.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

show more ...


Revision tags: v20.08, v20.08-rc4, v20.08-rc3, v20.08-rc2, v20.08-rc1
# 66914d19 28-Jun-2020 Suanming Mou <suanmingm@mellanox.com>

common/mlx5: convert control path memory to unified malloc

This commit allocates the control path objects memory from the unified
malloc function.

These objects are all used during the instances in

common/mlx5: convert control path memory to unified malloc

This commit allocates the control path objects memory from the unified
malloc function.

These objects are all used during the instances initialize, it will not
affect the data path.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

show more ...


# 79a7e409 16-Jul-2020 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

common/mlx5: prepare support of packet pacing

This patch prepares the common part of the mlx5 PMDs to
support packet send scheduling on mbuf timestamps:

- the DevX routine to query the packet pac

common/mlx5: prepare support of packet pacing

This patch prepares the common part of the mlx5 PMDs to
support packet send scheduling on mbuf timestamps:

- the DevX routine to query the packet pacing HCA capabilities
- packet pacing Send Queue attributes support
- the hardware related definitions

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

show more ...


Revision tags: v20.05, v20.05-rc4
# 43e73483 24-May-2020 Thomas Monjalon <thomas@monjalon.net>

devtools: forbid variable declaration inside for

Some compilers raise an error when declaring a variable
in the middle of a function. This is a C99 allowance.
Even if DPDK switches globally to C99 o

devtools: forbid variable declaration inside for

Some compilers raise an error when declaring a variable
in the middle of a function. This is a C99 allowance.
Even if DPDK switches globally to C99 or C11 standard,
the coding rules are for declarations at the beginning
of a block:
http://doc.dpdk.org/guides/contributing/coding_style.html#local-variables

This coding style is enforced by adding a check of
the common patterns like "for (int i;"

The occurrences of the checked pattern are fixed:
'for *(\(char\|u\?int\|unsigned\|s\?size_t\)'
In the file dpaa2_sparser.c, the fix is to remove the unused macros.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# ed5d2365 24-Jun-2020 Michael Baum <michaelba@mellanox.com>

common/mlx5: fix code arrangement in tag allocation

Flow tag action is supported only when the driver has DR or DV support.
The tag allocation is adjusted to the modes DV or DR.

In case both DR and

common/mlx5: fix code arrangement in tag allocation

Flow tag action is supported only when the driver has DR or DV support.
The tag allocation is adjusted to the modes DV or DR.

In case both DR and DV are not supported in the system, the driver
handles static code for error report.
This error code, wrongly, was compiled when DV is supported while in
this case it cannot be accessed at all.

Ignore the aforementioned static error code in case of DV by
preprocessor commands rearrangement.

Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

show more ...


# d4d85aa6 23-Jun-2020 Shiri Kuzin <shirik@mellanox.com>

common/mlx5: add default miss action

Add dv_create_action_default_miss wrapper function
for the action added to the rdma-core
MLX5DV_FLOW_ACTION_DEFAULT_MISS.

When a packet matches MLX5DV_FLOW_ACTI

common/mlx5: add default miss action

Add dv_create_action_default_miss wrapper function
for the action added to the rdma-core
MLX5DV_FLOW_ACTION_DEFAULT_MISS.

When a packet matches MLX5DV_FLOW_ACTION_DEFAULT_MISS
action it is steered to the default miss of the verbs
steering domain.

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

show more ...


# bebee850 01-Jun-2020 Suanming Mou <suanmingm@mellanox.com>

common/mlx5: add memory reclaim glue function

While flow destroyed, rdma-core may still cache some resources for more
efficiently flow recreate. In case the peak time that millions of flows
created

common/mlx5: add memory reclaim glue function

While flow destroyed, rdma-core may still cache some resources for more
efficiently flow recreate. In case the peak time that millions of flows
created and destroyed, the cached resources will be very huge.

Currently, rdma-core provides the new function to configure the flow
resources not to be cached. Add the memory reclaim function to avoid
too many resources be cached.

This is the first patch for the memory reclaim. A new devarg will be
added to PMD to support the reclaim can be configured.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

show more ...


# 72f75660 01-Jun-2020 Ophir Munk <ophirmu@mellanox.com>

common/mlx5: move glue files under Linux directory

The glue file mlx5_glue.c is based on Linux specifics APIs.
Move it (including file mlx5_glue.h) to common/mlx5/linux directory.

Signed-off-by: Op

common/mlx5: move glue files under Linux directory

The glue file mlx5_glue.c is based on Linux specifics APIs.
Move it (including file mlx5_glue.h) to common/mlx5/linux directory.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

show more ...