mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-28 00:19:36 +00:00

Introduce the 'data direct' driver for a ConnectX-8 Data Direct device. The 'data direct' driver functions as the affiliated DMA device for one or more capable mlx5_ib devices. This DMA device, as the name suggests, is used exclusively for DMA operations. It can be considered a DMA engine managed by a PF/VF, lacking network capabilities and having minimal overall capabilities. Consequently, the DMA NIC PF will not be exposed to or directly used by software applications. The driver will not have any direct interface or interaction with the firmware (no command interface, no capabilities, etc.). It will operate solely over PCI to enable its DMA functionality. Registration and un-registration of the driver are handled as part of the mlx5_ib initialization and exit processes, as the mlx5_ib devices will effectively be its clients. The driver will serve as the DMA device for accessing another PCI device to achieve optimal performance (both on the same NUMA node, P2P access, etc.). Upon probing, it will read its VUID over PCI to handle mlx5_ib device registrations with the same VUID. Upon removal, it will notify its clients to allow them to clean up the resources that were mmaped with its DMA device. Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Link: https://patch.msgid.link/b77edecfd476c3f445da96ab6aef499ae47b2829.1722512548.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
24 lines
567 B
C
24 lines
567 B
C
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
|
|
/*
|
|
* Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved
|
|
*/
|
|
|
|
#ifndef _MLX5_IB_DATA_DIRECT_H
|
|
#define _MLX5_IB_DATA_DIRECT_H
|
|
|
|
struct mlx5_ib_dev;
|
|
|
|
struct mlx5_data_direct_dev {
|
|
struct device *device;
|
|
struct pci_dev *pdev;
|
|
char *vuid;
|
|
struct list_head list;
|
|
};
|
|
|
|
int mlx5_data_direct_ib_reg(struct mlx5_ib_dev *ibdev, char *vuid);
|
|
void mlx5_data_direct_ib_unreg(struct mlx5_ib_dev *ibdev);
|
|
int mlx5_data_direct_driver_register(void);
|
|
void mlx5_data_direct_driver_unregister(void);
|
|
|
|
#endif
|