History log of /dpdk/drivers/net/mlx5/mlx5_ethdev.c (Results 101 – 125 of 249)
Revision Date Author Comments
# 53e5a82f 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: update install/uninstall event handlers

We are implementing the support for multiport Infiniband device
with representors attached to these multiple ports. Asynchronous
device event notifi

net/mlx5: update install/uninstall event handlers

We are implementing the support for multiport Infiniband device
with representors attached to these multiple ports. Asynchronous
device event notifications (link status change, removal event, etc.)
should be shared between ports. We are going to implement shared
event handler and this patch introduces appropriate device
structure changes and updated event handler install and uninstall
routines.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# f048f3d4 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: switch to the shared IB device context

The code is updated to use the shared IB device context and
device handles. The IB device context is shared between
reprentors created over the singl

net/mlx5: switch to the shared IB device context

The code is updated to use the shared IB device context and
device handles. The IB device context is shared between
reprentors created over the single multiport IB device. All
Verbs and DevX objects will be created within this shared context.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# d485cdca 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: switch to the shared context IB attributes

The code is updated to use the shared IB device attributes,
located in the shared IB context. It saves some memory if
there are representors crea

net/mlx5: switch to the shared context IB attributes

The code is updated to use the shared IB device attributes,
located in the shared IB context. It saves some memory if
there are representors created over the single Infiniband
device with multiple ports.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 9c0a9eed 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: switch to the names in the shared IB context

The IB device names are moved from device private data
to the shared context, code involving the names is updated.
The IB port index treatment

net/mlx5: switch to the names in the shared IB context

The IB device names are moved from device private data
to the shared context, code involving the names is updated.
The IB port index treatment is added where it is relevant.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# e505508a 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: modify get ifindex routine for multiport IB

There is the routine mlx5_nl_ifindex() returning the
network interface index associated with Infiniband device.
We are going to support multipor

net/mlx5: modify get ifindex routine for multiport IB

There is the routine mlx5_nl_ifindex() returning the
network interface index associated with Infiniband device.
We are going to support multiport IB devices, now function
takes the IB port as argument and returns ifindex associated
with tuple <IB device, IB port>

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 299d7dc2 27-Mar-2019 Viacheslav Ovsiienko <viacheslavo@mellanox.com>

net/mlx5: add representor recognition on Linux 5.x

The master device and VF representors were distinguished by
presence of port name, master device did not have one. The new Linux
kernels starting f

net/mlx5: add representor recognition on Linux 5.x

The master device and VF representors were distinguished by
presence of port name, master device did not have one. The new Linux
kernels starting from 5.0 provide the port name for master device
and the implemented representor recognizing method does not work.
The new recognizing method is based on querying the VF number,
has been created on the base of the device.

The IFLA_NUM_VF attribute is returned by kernel if IFLA_EXT_MASK
attribute is specified in the Netlink request message.

Also the presence check of device symlink in device sysfs folder
is added to distinguish representors with sysfs based method.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# e3bcaf3a 21-Mar-2019 Ali Alnubani <alialnu@mellanox.com>

net/mlx5: add missing return value check

This patch fixes the build failure with message:
drivers/net/mlx5/mlx5_ethdev.c: In function ‘mlx5_sysfs_switch_info’:
drivers/net/mlx5/mlx5_ethdev.c:138

net/mlx5: add missing return value check

This patch fixes the build failure with message:
drivers/net/mlx5/mlx5_ethdev.c: In function ‘mlx5_sysfs_switch_info’:
drivers/net/mlx5/mlx5_ethdev.c:1381:3:
error: ignoring return value of ‘fscanf’, declared with attribute
warn_unused_result [-Werror=unused-result]
fscanf(file, "%s", port_name);
^

Which reproduces on Ubuntu 16.04 LTS with
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609.

Fixes: b2f3a3810125 ("net/mlx5: support new representor naming format")

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Dekel Peled <dekelp@mellanox.com>

show more ...


# b2f3a381 17-Mar-2019 Dekel Peled <dekelp@mellanox.com>

net/mlx5: support new representor naming format

Kernel update [1] introduce new format of representors names.
This patch implements RFC [2], updating MLX5 PMD to support the new
format, while mainta

net/mlx5: support new representor naming format

Kernel update [1] introduce new format of representors names.
This patch implements RFC [2], updating MLX5 PMD to support the new
format, while maintaining support of the existing format.

[1] https://github.com/torvalds/linux/commit/c12ecc2
[2] http://mails.dpdk.org/archives/dev/2019-March/125676.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# dbeba4cf 21-Feb-2019 Thomas Monjalon <thomas@monjalon.net>

net/mlx: prefix private structure

The private structure stored in rte_eth_dev->data->dev_private
was named "struct priv".
In order to ease code browsing, the structure is renamed
"struct mlx[45]_pri

net/mlx: prefix private structure

The private structure stored in rte_eth_dev->data->dev_private
was named "struct priv".
In order to ease code browsing, the structure is renamed
"struct mlx[45]_priv".

Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# 714bf46e 06-Feb-2019 Thomas Monjalon <thomas@monjalon.net>

net/mlx: support firmware version query

The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added f

net/mlx: support firmware version query

The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added for mlx4 and mlx5.
Both functions are copying the same ibverbs field fw_ver
which is retrieved when calling ibv_query_device[_ex]()
during the port probing.

It is tested with command "drvinfo" of examples/ethtool/.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 5d7b673d 04-Oct-2018 Anatoly Burakov <anatoly.burakov@intel.com>

mk: build with _GNU_SOURCE defined by default

We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and d

mk: build with _GNU_SOURCE defined by default

We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

show more ...


# a1883178 14-Oct-2018 Thomas Monjalon <thomas@monjalon.net>

net/mlx5: remove useless driver name comparison

The function mlx5_dev_to_port_id() is returning all the ports
associated to a rte_device.
It was comparing driver names while already comparing rte_de

net/mlx5: remove useless driver name comparison

The function mlx5_dev_to_port_id() is returning all the ports
associated to a rte_device.
It was comparing driver names while already comparing rte_device pointers.
If two devices are the same, they will have the same driver.
So the useless driver name comparison is removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 7dd7be29 08-Oct-2018 Shahaf Shuler <shahafs@mellanox.com>

net/mlx5: always use representor ifindex for ioctl

In the current code, on some cases the representor ethdev is using the
PF interface to query some link status information or pause parameters.

It

net/mlx5: always use representor ifindex for ioctl

In the current code, on some cases the representor ethdev is using the
PF interface to query some link status information or pause parameters.

It was done because in previous kernel versions there was no support
from the kernel for the representor info.

Using the PF i/f for such ioctl is error prone and not always working
because:
* On some cases there is no PF at all, only representors (e.g Bluefield
with host representors)
* Query the up/down status from representor and link status from PF
is in-consist
* PF link is down doesn't necessarily means representor is down.
* setting different pause configuration for the PF and the
representors will result on undefined behaviour

Making the code cleaner and more robust by using only the representor
i/f for the ioctl. whatever the kernel will provide on this query will
be used. No need to do W.A. for kernel missing functionality.

Note:
1. Setting pause parameters will obviously won't work on representors
2. Old kernel will not report all the possible representor info

Fixes: 2b7302638898 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 7bc47fb8 19-Sep-2018 Xueming Li <xuemingl@mellanox.com>

net/mlx5: fix representor port link status

Current code uses PF links status for representor port, not the
representor interface itself.
This caused wrong representor port link status when toggling

net/mlx5: fix representor port link status

Current code uses PF links status for representor port, not the
representor interface itself.
This caused wrong representor port link status when toggling
interface up or down.

Fixes: 2b7302638898 ("net/mlx5: probe all port representors")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# 3f8cb05d 25-Jul-2018 Adrien Mazarguil <adrien.mazarguil@6wind.com>

net/mlx5: fix invalid network interface index

Network interface indices being unsigned, an invalid index or error is
normally expressed through a zero value (see if_nametoindex()).

mlx5_ifindex() h

net/mlx5: fix invalid network interface index

Network interface indices being unsigned, an invalid index or error is
normally expressed through a zero value (see if_nametoindex()).

mlx5_ifindex() has a signed return type for negative values in case of
error. Since mlx5_nl.c does not check for errors, these may be fed back as
invalid interfaces indices to subsequent system calls. This usage would
have been correct if mlx5_ifindex() returned a zero value instead.

This patch makes mlx5_ifindex() unsigned for convenience.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# f872b4b9 24-Jul-2018 Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

net/mlx5: fix representors detection

On systems where the required Netlink commands are not supported but
Mellanox OFED is installed, representors information must be retrieved
through sysfs.

Fixes

net/mlx5: fix representors detection

On systems where the required Netlink commands are not supported but
Mellanox OFED is installed, representors information must be retrieved
through sysfs.

Fixes: 26c08b979d26 ("net/mlx5: add port representor awareness")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 79d09892 15-Jul-2018 Moti Haimovsky <motih@mellanox.com>

net/mlx5: fix build with old kernels

This commit fixes compilation errors due to missing definitions
found when compiling mlx5 PMD from DPDK 17.11-LTS on Ubuntu 12.4
with kernel 3.15.

Fixes: 75ef62

net/mlx5: fix build with old kernels

This commit fixes compilation errors due to missing definitions
found when compiling mlx5 PMD from DPDK 17.11-LTS on Ubuntu 12.4
with kernel 3.15.

Fixes: 75ef62a94301 ("net/mlx5: fix link speed capability information")
Fixes: 5bfc9fc112dd ("net/mlx5: use static assert for compile-time sanity checks")
Cc: stable@dpdk.org

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# c388a2f6 12-Jul-2018 Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

net/mlx5: use a macro for the RSS key size

ConnectX 4-5 support only 40 bytes of RSS key, using a compiled size
hash key is not necessary.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.co

net/mlx5: use a macro for the RSS key size

ConnectX 4-5 support only 40 bytes of RSS key, using a compiled size
hash key is not necessary.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# 2b730263 10-Jul-2018 Adrien Mazarguil <adrien.mazarguil@6wind.com>

net/mlx5: probe all port representors

Probe existing port representors in addition to their master device and
associate them automatically.

To avoid collision between Ethernet devices, they are nam

net/mlx5: probe all port representors

Probe existing port representors in addition to their master device and
associate them automatically.

To avoid collision between Ethernet devices, they are named as follows:

- "{DBDF}" for master/switch devices.
- "{DBDF}_representor_{rep}" with "rep" starting from 0 for port
representors.

(Patch based on prior work from Yuanhan Liu)

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Reviewed-by: Xueming Li <xuemingl@mellanox.com>

show more ...


# 9083982c 10-Jul-2018 Adrien Mazarguil <adrien.mazarguil@6wind.com>

net/mlx5: drop useless support for several Verbs ports

Unlike mlx4 from which this capability was inherited, mlx5 devices expose
exactly one Verbs port per PCI bus address. Each physical port gets
a

net/mlx5: drop useless support for several Verbs ports

Unlike mlx4 from which this capability was inherited, mlx5 devices expose
exactly one Verbs port per PCI bus address. Each physical port gets
assigned its own bus address with a single Verbs port.

While harmless, this code requires an extra loop that would get in the way
of subsequent refactoring.

No functional impact.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

show more ...


# f264c798 27-Jun-2018 Adrien Mazarguil <adrien.mazarguil@6wind.com>

net/mlx5: fix invalid error check

Since its return type is unsigned, if_nametoindex() returns 0 in case of
error, never -1.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")

net/mlx5: fix invalid error check

Since its return type is unsigned, if_nametoindex() returns 0 in case of
error, never -1.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

show more ...


# 0ace586d 26-May-2018 Xueming Li <xuemingl@mellanox.com>

net/mlx5: fix memory region cache init

MR cache init takes place on the device configuration.
When the device is re-configured multiple times, for example when
changing the number of queue on the fl

net/mlx5: fix memory region cache init

MR cache init takes place on the device configuration.
When the device is re-configured multiple times, for example when
changing the number of queue on the flight, deadlock can happen.

This patch moved MR cache init from device configuration function to
probe function to make sure init only once.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# e89c15b6 24-May-2018 Adrien Mazarguil <adrien.mazarguil@6wind.com>

net/mlx5: fix crash when configure is not called

Although uncommon, applications may destroy a device immediately after
probing it without going through dev_configure() first.

This patch addresses

net/mlx5: fix crash when configure is not called

Although uncommon, applications may destroy a device immediately after
probing it without going through dev_configure() first.

This patch addresses a crash which occurs when mlx5_dev_close() calls
mlx5_mr_release() due to an uninitialized entry in the private structure.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


# 7d6bf6b8 09-May-2018 Yongseok Koh <yskoh@mellanox.com>

net/mlx5: add Multi-Packet Rx support

Multi-Packet Rx Queue (MPRQ a.k.a Striding RQ) can further save PCIe
bandwidth by posting a single large buffer for multiple packets. Instead of
posting a buffe

net/mlx5: add Multi-Packet Rx support

Multi-Packet Rx Queue (MPRQ a.k.a Striding RQ) can further save PCIe
bandwidth by posting a single large buffer for multiple packets. Instead of
posting a buffer per a packet, one large buffer is posted in order to
receive multiple packets on the buffer. A MPRQ buffer consists of multiple
fixed-size strides and each stride receives one packet.

Rx packet is mem-copied to a user-provided mbuf if the size of Rx packet is
comparatively small, or PMD attaches the Rx packet to the mbuf by external
buffer attachment - rte_pktmbuf_attach_extbuf(). A mempool for external
buffers will be allocated and managed by PMD.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>

show more ...


# 974f1e7e 09-May-2018 Yongseok Koh <yskoh@mellanox.com>

net/mlx5: add new memory region support

This is the new design of Memory Region (MR) for mlx PMD, in order to:
- Accommodate the new memory hotplug model.
- Support non-contiguous Mempool.

There ar

net/mlx5: add new memory region support

This is the new design of Memory Region (MR) for mlx PMD, in order to:
- Accommodate the new memory hotplug model.
- Support non-contiguous Mempool.

There are multiple layers for MR search.

L0 is to look up the last-hit entry which is pointed by mr_ctrl->mru (Most
Recently Used). If L0 misses, L1 is to look up the address in a fixed-sized
array by linear search. L0/L1 is in an inline function -
mlx5_mr_lookup_cache().

If L1 misses, the bottom-half function is called to look up the address
from the bigger local cache of the queue. This is L2 - mlx5_mr_addr2mr_bh()
and it is not an inline function. Data structure for L2 is the Binary Tree.

If L2 misses, the search falls into the slowest path which takes locks in
order to access global device cache (priv->mr.cache) which is also a B-tree
and caches the original MR list (priv->mr.mr_list) of the device. Unless
the global cache is overflowed, it is all-inclusive of the MR list. This is
L3 - mlx5_mr_lookup_dev(). The size of the L3 cache table is limited and
can't be expanded on the fly due to deadlock. Refer to the comments in the
code for the details - mr_lookup_dev(). If L3 is overflowed, the list will
have to be searched directly bypassing the cache although it is slower.

If L3 misses, a new MR for the address should be created -
mlx5_mr_create(). When it creates a new MR, it tries to register adjacent
memsegs as much as possible which are virtually contiguous around the
address. This must take two locks - memory_hotplug_lock and
priv->mr.rwlock. Due to memory_hotplug_lock, there can't be any
allocation/free of memory inside.

In the free callback of the memory hotplug event, freed space is searched
from the MR list and corresponding bits are cleared from the bitmap of MRs.
This can fragment a MR and the MR will have multiple search entries in the
caches. Once there's a change by the event, the global cache must be
rebuilt and all the per-queue caches will be flushed as well. If memory is
frequently freed in run-time, that may cause jitter on dataplane processing
in the worst case by incurring MR cache flush and rebuild. But, it would be
the least probable scenario.

To guarantee the most optimal performance, it is highly recommended to use
an EAL option - '--socket-mem'. Then, the reserved memory will be pinned
and won't be freed dynamically. And it is also recommended to configure
per-lcore cache of Mempool. Even though there're many MRs for a device or
MRs are highly fragmented, the cache of Mempool will be much helpful to
reduce misses on per-queue caches anyway.

'--legacy-mem' is also supported.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

show more ...


12345678910