path: root/drivers/net/mlx5/mlx5_ethdev.c
AgeCommit message (Collapse)Author
2019-11-20net/mlx5: fix Tx doorbell write memory barrierViacheslav Ovsiienko
As the result of testing it was found that some hosts have the performance penalty imposed by required write memory barrier after doorbell writing. Before 19.08 release there was some heuristics to decide whether write memory barrier should be performed. For the bursts of recommended size (or multiple) it was supposed there were some extra ongoing packets in the next burst and write memory barrier may be skipped (supposed to be performed in the next burst, at least after descriptor writing). This patch restores that behaviour, the devargs tx_db_nc=2 must be specified to engage this performance tuning feature. Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping") Cc: Signed-off-by: Viacheslav Ovsiienko <>
2019-11-20drivers/net: fix RSS hash offload flag if no RSSAndrew Rybchenko
By default RSS hash delivery (offload) is bound to RSS mode and it is incorrect to advertise it as enabled if Rx multi-queue mode has no RSS. Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities") Signed-off-by: Andrew Rybchenko <> Reviewed-by: Ferruh Yigit <>
2019-11-12net/mlx5: set maximum LRO packet sizeDekel Peled
This patch implements use of the API for LRO aggregated packet max size. Rx queue create is updated to use the relevant configuration. Documentation is updated accordingly. Signed-off-by: Dekel Peled <> Acked-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-11-11drivers/net: update Rx RSS hash offload capabilitiesPavan Nikhilesh
Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash delivery. Signed-off-by: Pavan Nikhilesh <> Reviewed-by: Andrew Rybchenko <> Reviewed-by: Hemant Agrawal <> Acked-by: Jerin Jacob <> Acked-by: Ajit Khaparde <> Reviewed-by: Ferruh Yigit <>
2019-11-11net/mlx5: check metadata registers availabilityViacheslav Ovsiienko
The metadata registers reg_c provide support for TAG and SET_TAG features. Although there are 8 registers are available on the current mlx5 devices, some of them can be reserved. The availability should be queried by iterative trial-and-error implemented by mlx5_flow_discover_mreg_c() routine. If reg_c is available, it can be regarded inclusively that the extensive metadata support is possible. E.g. metadata register copy action, supporting 16 modify header actions (instead of 8 by default) preserving register across different domains (FDB and NIC) and so on. Signed-off-by: Yongseok Koh <> Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-11-08net/mlx5: support RSS on hairpinOri Kam
Add support for rss on hairpin queues. Signed-off-by: Ori Kam <> Acked-by: Viacheslav Ovsiienko <>
2019-11-08net/mlx5: get hairpin capabilitiesOri Kam
This commits adds the hairpin get capabilities function. Signed-off-by: Ori Kam <> Acked-by: Viacheslav Ovsiienko <>
2019-10-23net/mlx5: fix DevX event registration timingMatan Azrad
The DevX counter management triggers an asynchronous event to get back the new counters values from the HW. The counter management doesn't trigger 2 parallel events for the same pool, hence, the pool cannot be updated again in the event waiting time. When the port is stopped, the DevX event mechanism wrongly was destroyed what remained all the waiting pools in waiting state forever. As a result, the counters of the stuck pools were never updated again. Separate the DevX interrupt installation from the dev installation and remove the DevX interrupt unregistration\registration from the stop\start operations. Now, the DevX interrupt should be installed in probe and uninstalled in close. Cc: Fixes: f15db67df09c ("net/mlx5: accelerate DV flow counter query") Signed-off-by: Matan Azrad <> Acked-by: Viacheslav Ovsiienko <>
2019-10-23net/mlx5: retry on link update failureMoti Haimovsky
mlx5_link_update immediately returns when called with no-wait parameter and its call for retrieving the link status returns with EAGAIN error. This is too harsh on busy systems where a first call fails with EAGAIN from time to time. This patch adds a (very limited) retry on such cases in order to allow retrieving the link status. Signed-off-by: Moti Haimovsky <> Acked-by: Viacheslav Ovsiienko <>
2019-10-08net/mlx5: fix device scan within switch domainViacheslav Ovsiienko
In LAG configuration the devices in the same switch domain might be spawned on the base of different PCI devices, so we should check all devices backed by mlx5 PMD whether they belong to specified switch domain. When the new devices are being created it is not possible to detect whether the sibling devices created in the current probe() loop belong to the driver, driver field is not filled yet (it will be done on returned success of current probe()). This patch updates the device scanning, allowing extra match on current backing PCI device, is being used to create siblings. Fixes: f7e95215ac7c ("net/mlx5: extend switch domain searching range") Signed-off-by: Viacheslav Ovsiienko <>
2019-10-08net/mlx5: update switch port id in bonding configurationViacheslav Ovsiienko
With bonding configuration multiple PFs may represent the single switching device with multiple ports as representors. To distinguish representors belonging to different PFs we should generated unique port ID. It is proposed to use the PF index in bonding configuration to generate this unique port IDs. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-10-08net/mlx5: extend switch domain searching rangeViacheslav Ovsiienko
With bonding configurations the switch domain may be shared between multiple PCI devices, we should search the switch sibling devices within the entire set of present ethernet devices backed by the mlx5 PMD. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-10-08net/mlx5: elaborate E-Switch port parameters queryViacheslav Ovsiienko
The routine mlx5_port_to_eswitch_info() is elaborated to two ones (get E-Switch port parameters by port and by device pointer) and simplified to returning structure containing all parameters instead of copying. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-10-07net/mlx5: update PCI address retrieving routineViacheslav Ovsiienko
The routine mlx5_ibv_device_to_pci_addr() takes Infiniband device list object, takes the device sysfs path from there and retrieves PCI address. The routine may be implemented in more generic way by taking sysfs path directly as parameter and can be used for getting PCI address of netdevs. The generic routine is renamed to mlx5_dev_to_pci_addr() Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Matan Azrad <>
2019-10-07ethdev: change device info get callback to return intIvan Ilchenko
Change eth_dev_infos_get_t return value from void to int. Make eth_dev_infos_get_t implementations across all drivers to return negative errno values if case of error conditions. Signed-off-by: Ivan Ilchenko <> Signed-off-by: Andrew Rybchenko <> Reviewed-by: Ferruh Yigit <>
2019-09-20net/mlx5: support reading module EEPROM dataDekel Peled
This patch implements ethdev operations get_module_info and get_module_eeprom, to support ethtool commands ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPROM. New functions mlx5_get_module_info() and mlx5_get_module_eeprom() added in mlx5_ethdev.c. Signed-off-by: Dekel Peled <> Acked-by: Viacheslav Ovsiienko <>
2019-08-06net/mlx5: fix link speed info when link is downXiaoyu Min
When the link is down, the link speed returned by ethtool is UINT32_MAX and the link status is 0. In this case, the DPDK ethdev link speed should be set to ETH_SPEED_NUM_NONE. Otherwise since link speed is non-zero but link status is zero, this is an inconsistent situation and -EAGAIN is returned, which is not right. Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") Cc: Signed-off-by: Xiaoyu Min <> Acked-by: Viacheslav Ovsiienko <>
2019-07-29net/mlx5: allow LRO per Rx queueMatan Azrad
Enabling LRO offload per queue makes sense because the user will probably want to allocate different mempool for LRO queues - the LRO mempool mbuf size may be bigger than non LRO mempool. Change the LRO offload to be per queue instead of per port. If one of the queues is with LRO enabled, all the queues will be configured via DevX. If RSS flows direct TCP packets to queues with different LRO enabling, these flows will not be offloaded with LRO. Signed-off-by: Matan Azrad <> Acked-by: Viacheslav Ovsiienko <>
2019-07-29net/mlx5: allow LRO in regular Rx queueMatan Azrad
LRO support was only for MPRQ, hence mprq Rx burst was selected when LRO was configured in the port. The current support for MPRQ is suffering from bad memory utilization since an external mempool is allocated by the PMD for the packets data in addition to the user mempool, besides that, the user may get packet data addresses which were not configured by him. Even though MPRQ has the best performance for packet receiving in the most cases and because of the above facts it is better to remove the automatic MPRQ select when LRO is configured. Move MPRQ to be selected only when the user force it by the PMD arguments including LRO case. Allow LRO offload using the regular RQ with the regular Rx burst function. Signed-off-by: Matan Azrad <> Acked-by: Viacheslav Ovsiienko <>
2019-07-23net/mlx5: check conditions to enable LRODekel Peled
Use DevX API to read device LRO capabilities. Check if LRO is supported and can be enabled. Check if MPRQ is supported and can be used. Enable MPRQ for LRO use if not enabled by user. Added note for mlx5_mprq_enabled(), to emphasize that LRO enables MPRQ. Disable CQE compression and CRC stripping if LRO is enabled. Signed-off-by: Dekel Peled <> Acked-by: Matan Azrad <> Acked-by: Viacheslav Ovsiienko <>
2019-07-23net/mlx5: introduce LRODekel Peled
Add command-line argument to set LRO session timeout. Add LRO settings struct in PMD configuration struct. Add support of LRO offload in port configuration. Add macros and function to check if LRO is supported and enabled. Signed-off-by: Dekel Peled <> Acked-by: Matan Azrad <> Acked-by: Viacheslav Ovsiienko <>
2019-07-23net/mlx5: revert Netlink socket sharingViacheslav Ovsiienko
This reverts commit e28111ac9864af09e826241a915dfff87a9c00ad. The netlink requests are replaced by ifindex caching and not needed anymore. Fixes: e28111ac9864 ("net/mlx5: fix master device Netlink socket sharing") Cc: Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-07-23net/mlx5: cache associated network device indexViacheslav Ovsiienko
The associated device index is retrieved via Netlink request to underlying Infiniband device driver. This network device index is permanent throughout the lifetime of device. We do not spawn the rte_eth_dev ports without associated network device, and if network device is being unbound we get the remove notification message and rte_eth_dev port is also detached. So, we may store the ifindex in mlx5_device_spawn() routine at rte_eth_dev port creation and initialization time and use the cached value further instead of doing actual Netlink request. Reported-by: Stephen Hemminger <> Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-07-23net/mlx5: report max number of mbuf segmentsViacheslav Ovsiienko
This patch fills the tx_desc_lim.nb_seg_max and tx_desc_lim.nb_mtu_seg_max fields of rte_eth_dev_info structure to report thee maximal number of packet segments, requested inline data configuration is taken into account in conservative way. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-07-23net/mlx5: remove Tx implementationViacheslav Ovsiienko
This patch removes the existing Tx datapath code as preparation step before introducing the new implementation. The following entities are being removed: - deprecated devargs support - tx_burst() routines - related PRM definitions - SQ configuration code - Tx routine selection code - incompatible Tx completion code The following devargs are deprecated and ignored: - "txq_inline" is going to be converted to "txq_inline_max" for compatibility issue - "tx_vec_en" - "txqs_max_vec" - "txq_mpw_hdr_dseg_en" - "txq_max_inline_len" is going to be converted to "txq_inline_mpw" for compatibility issue The deprecated devarg keys are recognized by PMD and ignored/converted to the new ones in order not to block device probing. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-07-23net/mlx5: accelerate DV flow counter queryMatan Azrad
All the DV counters are cashed in the PMD memory and are contained in pools which are contained in containers according to the counters allocation type - batch or single. Currently, the flow counter query is done synchronously in pool resolution means that on the user request a FW command is triggered to read all the counters in the pool. A new feature of devX to asynchronously read batch of flow counters allows to accelerate the user query operation. Using the DPDK host thread, the PMD periodically triggers asynchronous query in pool resolution for all the counter pools and an interrupt is triggered by the FW when the values are updated. In the interrupt handler the pool counter values raw data is replaced using a double buffer algorithm (very fast). In the user query, the PMD just returns the last query values from the PMD cache - no system-calls and FW commands are triggered from the user control thread on query operation! More synchronization is added with the host thread: Container resize uses double buffer algorithm. Pools growing in container uses atomic operation. Pool query buffer replace uses a spinlock. Pool minimum devX counter ID uses atomic operation. Signed-off-by: Matan Azrad <> Acked-by: Shahaf Shuler <>
2019-07-05net/mlx5: fix condition for link update fallbackAsaf Penso
mlx5_link_update uses the newer ethtool command ETHTOOL_GLINKSETTINGS to determine interface capabilities but falls back to the older (deprecated) ETHTOOL_GSET command if the new method fails for any reason. The older method only supports reporting of capabilities up to 40G. However, mlx5_link_update_unlocked_gs can return a failure for a number of reasons (including the link being down). Using the older method in cases of transient failure of the method can result in reporting of reduced capabilities to the application. The older method (mlx5_link_update_unlocked_gset) should only be invoked if the newer method returns EOPNOTSUPP. Fixes: 7d2e32f76cfc ("net/mlx5: fix ethtool link setting call order") Cc: Reported-by: Srinivas Narayan <> Signed-off-by: Asaf Penso <> Acked-by: Viacheslav Ovsiienko <>
2019-07-06eal: hide shared memory configAnatoly Burakov
Now that everything that has ever accessed the shared memory config is doing so through the public API's, we can make it internal. Since we're removing quite a few headers from rte_eal_memconfig.h, we need to add them back in places where this header is used. This bumps the ABI, so also change all build files and make update documentation. Signed-off-by: Anatoly Burakov <> Acked-by: Stephen Hemminger <> Acked-by: David Marchand <>
2019-06-14net/mlx5: fix master device Netlink socket sharingViacheslav Ovsiienko
There is the patch [1] that uses master device Netlink socket to retrieve master device link settings. This is not thread safe because this resource may be in use by other call to the master device itself. Using the same Netlink socket concurrently from the multiple threads causes Netlink requests malfunction and must be eliminated. The patch replaces master Netlink socket with the socket from representor device. [1] Fixes: 0333b2f584d9 ("net/mlx5: inherit master link settings for representors") Cc: Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-06-06net/mlx5: fix event handler uninstallViacheslav Ovsiienko
When device is being closed and tries to unregister interrupt callback, there is a chance the handler is still active (called in context of eal_intr_thread_main thread). If so the rte_intr_callback_unregister returns -EAGAIN and keeps the handler registered, causing crash when underlaying resourse is gone away. This race condition may happen if event handling in application takes a long time. We should check the return code of unregistering routine and try again to unregister the handler. The diagnostic messages are shown once a second, while trying to unregister. Fixes: 028b2a28c3cb ("net/mlx5: update event handler for multiport IB devices") Cc: Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-06-06net/mlx5: support reading clockTom Barbette
Implements support for read_clock for the mlx5 driver. mlx5 supports hardware timestamp offload, setting packets timestamp field to the device clock. rte_eth_read_clock allows to read the device's current clock value and therefore compare values on similar time base. See rxtx_callbacks for an example. Signed-off-by: Tom Barbette <> Acked-by: Shahaf Shuler <>
2019-05-12net/mlx5: fix device removal handler for multiportViacheslav Ovsiienko
IBV_EVENT_DEVICE_FATAL event is generated by the driver once for the entire multiport Infiniband device, not for each existing ports. The port index is zero and it causes dropping the device removal event. We should invoke the removal event processing routine for each port we have installed handler for. Fixes: 028b2a28c3cb ("net/mlx5: update event handler for multiport IB devices") Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-05-08net/mlx5: fix init with zero Rx queueDekel Peled
Recent patch [1] added, at the end of mlx5_dev_configure(), a call to mlx5_proc_priv_init(), initializing process_private data of eth_dev. This call is not reached if PMD is started with zero Rx queues. In this case mlx5_dev_configure() returns earlier due to the check: if (rxqs_n == priv->rxqs_n) return 0; In such a scenario, later references to uninitialized process_private data will result in segmentation fault. For example see in function txq_uar_init(). This patch changes the check logic. The following code is executed if (rxqs_n != priv->rxqs_n), and skipped otherwise. Function mlx5_proc_priv_init() is always invoked, to ensure process_private data is initialized. [1] Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap") Cc: Signed-off-by: Dekel Peled <> Acked-by: Yongseok Koh <>
2019-05-03net/mlx5: inherit master link settings for representorsViacheslav Ovsiienko
There are some physical link settings can be queried from Ethernet devices: link status, link speed, speed capabilities, duplex mode, etc. These setting do not make a lot of sense for representors due to missing physical link. The new kernel drivers dropped query for link settings for representors causing the ioctl call to fail. This patch adds some kind of emulation of link settings to PMD - representors inherit the link parameters from the master device. The actual link status (up/down) is retrieved from the representor device. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-04-19net/mlx5: validate Direct Rule E-SwitchOri Kam
Add validation logic for E-Switch using Direct Rules. Signed-off-by: Ori Kam <> Acked-by: Yongseok Koh <>
2019-04-19net/mlx5: support PF representorViacheslav Ovsiienko
On BlueField platform we have the new entity - PF representor. This one represents the PCI PF attached to external host on the side of ARM. The traffic sent by the external host to the NIC via PF will be seem by ARM on this PF representor. This patch refactors port recognizing capability on the base of physical port name. We have two groups of name formats. Legacy name formats are supported by kernels before ver 5.0 (being more precise - before the patch [1]) or before Mellanox OFED 4.6, and new naming formats added by the patch [1]. Legacy naming formats are supported: - missing physical port name (no sysfs/netlink key) at all, master is assumed - decimal digits (for example "12"), representor is assumed, the value is the index of attached VF New naming formats are supported: - "p" followed by decimal digits, for example "p2", master is assumed - "pf" followed by PF index concatenated with "vf" followed by VF index, for example "pf0vf1", representor is assumed. If index of VF is "-1" it is a special case of host PF representor, this representor must be indexed in devargs as 65535, for example representor=[0-3,65535] will allow representors for VF0, VF1, VF2, VF3 and for host PF. Note: do not specify representor=[0-65535], it causes devargs processing error, because number of ports (rte_eth_dev) is limited. Applications should distinguish representors and master devices exclusively by device flag RTE_ETH_DEV_REPRESENTOR and do not rely on switch port_id (mlx5 PMD deduces ones from representor_id) values returned by dev_infos_get() API. [1] Linux-tree: c12ecc23 (Or Gerlitz 2018-04-25 17:32 +0300) "net/mlx5e: Move to use common phys port names for vport representors" Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-04-12net/mlx5: remove device register remapYongseok Koh
UAR (User Access Region) register does not need to be remapped for primary process but it should be remapped only for secondary process. UAR register table is in the process private structure in rte_eth_devices[], (struct mlx5_proc_priv *)rte_eth_devices[port_id].process_private The actual UAR table follows the data structure and the table is used for both Tx and Rx. For Tx, BlueFlame in UAR is used to ring the doorbell. MLX5_TX_BFREG(txq) is defined to get a register for the txq. Processes access its own private data to acquire the register from the UAR table. For Rx, the doorbell in UAR is required in arming CQ event. However, it is a known issue that the register isn't remapped for secondary process. Signed-off-by: Yongseok Koh <>
2019-04-12net/mlx5: fix device probing for old kernel driversViacheslav Ovsiienko
Retrieving network interface index via Netlink fails in case of old ib_core kernel driver installed - mlx5_nl_ifindex() routine fails due to RDMA_NLDEV_ATTR_NDEV_INDEX attribute is not supported by the old driver. The patch allowing to retrieve the network interface index and name via Netlink [1]. So, the problem depends on ib_core module version - 4.16 supports getting ifindex via Netlink, 4.15 does not. This error was ignored in previous versions of MLX5 PMD probing routine. For single device ifindex was retrieved via sysfs and link control was not lost, so problem just was not noticed. In order to support MLX5 PMD functioning over old kernel driver this patch adds ifindex retrieving via sysfs into probing routine. It is worth to note this method works for master/standalone device only. [1] Linux tree: 5b2cc79d (Leon Romanovsky 2018-03-27 20:40:49 +0300 270) Fixes: ad74bc619504 ("net/mlx5: support multiport IB device during probing") Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-04-05net/mlx5: use port sibling iteratorsThomas Monjalon
Iterating over siblings was done with RTE_ETH_FOREACH_DEV() which skips the owned ports. The new iterators RTE_ETH_FOREACH_DEV_SIBLING() and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct. Signed-off-by: Thomas Monjalon <> Tested-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
2019-04-05net/mlx5: replace IPC socket with EAL APIYongseok Koh
Socket API is used for IPC in order for secondary process to acquire Verb command file descriptor. The FD is used to remap UAR address. The multi-process APIs (rte_mp) in EAL are newly introduced. mlx5_socket.c is replaced with mlx5_mp.c, which uses the new APIs. As it is PMD global infrastructure, only one IPC channel is established. All the IPC message types may have port_id in the message if there is need to reference a specific device. Signed-off-by: Yongseok Koh <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: update event handler for multiport IB devicesViacheslav Ovsiienko
This patch modifies asynchronous event handler to support multiport Infiniband devices. Handler queries the event parameters, including event source port index, and invokes the handler for specific devices with appropriate port_id. Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: update install/uninstall event handlersViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: switch to the shared IB device contextViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: switch to the shared context IB attributesViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: switch to the names in the shared IB contextViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: modify get ifindex routine for multiport IBViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: add representor recognition on Linux 5.xViacheslav Ovsiienko
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 <> Acked-by: Shahaf Shuler <>
2019-03-29net/mlx5: add missing return value checkAli Alnubani
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 <> Acked-by: Viacheslav Ovsiienko <> Acked-by: Dekel Peled <>
2019-03-20net/mlx5: support new representor naming formatDekel Peled
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] [2] Signed-off-by: Dekel Peled <> Acked-by: Viacheslav Ovsiienko <> Acked-by: Shahaf Shuler <>
2019-03-01net/mlx: prefix private structureThomas Monjalon
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: Signed-off-by: Thomas Monjalon <> Acked-by: Yongseok Koh <>