Skip to contentSkip to conversation

i40e: Register multi-function device to provide RDMA

PATCH New Shiraz Saleem 1 participant 1 message Sep 11, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Register multi-function device to provide RDMA

From: Mustafa Ismail <[email protected]>

Register multi-function devices (MFD) for the RDMA platform function (irdma) driver to bind to. It realizes a single RDMA driver capable of working with multiple LAN drivers over multi-generation Intel HW supporting RDMA. There is also no load ordering dependencies between i40e and irdma.

Summary of changes:
* Support to add/remove MFD devices
* Add 2 new client ops.
* i40e_client_device_register() which is called during RDMA probe() per PF. Validate client drv OPs and schedule service task to call open()
* i40e_client_device_unregister() called during RDMA remove() per PF. Call client close() and release_qvlist.
* The global register/unregister calls exported for i40iw are retained until i40iw is removed from the kernel.

---
 drivers/net/ethernet/intel/Kconfig            |   1 +
 drivers/net/ethernet/intel/i40e/i40e.h        |   1 +
 drivers/net/ethernet/intel/i40e/i40e_client.c | 147 +++++++++++++++++++++++---
 drivers/net/ethernet/intel/i40e/i40e_client.h |  21 ++++
 4 files changed, 155 insertions(+), 15 deletions(-)
drivers/net/ethernet/intel/Kconfig +1 -0
index 154e2e8..5d4603c 100644
@@ -241,6 +241,7 @@ config I40E
 	tristate "Intel(R) Ethernet Controller XL710 Family support"
 	imply PTP_1588_CLOCK
 	depends on PCI
+	select MFD_CORE
 	---help---
 	  This driver supports Intel(R) Ethernet Controller XL710 Family of
 	  devices.  For more information on how to identify your adapter, go
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
index 84bd069..034abc7 100644
@@ -656,6 +656,7 @@ struct i40e_pf {
 	u16 last_sw_conf_valid_flags;
 	/* List to keep previous DDP profiles to be rolled back in the future */
 	struct list_head ddp_old_prof;
+	int peer_idx;
 };
 
 /**
drivers/net/ethernet/intel/i40e/i40e_client.c +132 -15

215 lines not on this page · raw message

drivers/net/ethernet/intel/i40e/i40e_client.h +21 -0
index 72994ba..9167946 100644
@@ -4,6 +4,11 @@
 #ifndef _I40E_CLIENT_H_
 #define _I40E_CLIENT_H_
 
+#include <linux/mfd/core.h>
+
+#define I40E_PEER_RDMA_NAME	"i40e_rdma"
+#define I40E_PEER_RDMA_ID	PLATFORM_DEVID_AUTO
+
 #define I40E_CLIENT_STR_LENGTH 10
 
 /* Client interface version should be updated anytime there is a change in the
@@ -80,6 +85,7 @@ struct i40e_params {
 
 /* Structure to hold Lan device info for a client device */
 struct i40e_info {
+	struct platform_device *platform_dev;
 	struct i40e_client_version version;
 	u8 lanmac[6];
 	struct net_device *netdev;
@@ -97,6 +103,7 @@ struct i40e_info {
 	struct i40e_qvlist_info *qvlist_info;
 	struct i40e_params params;
 	struct i40e_ops *ops;
+	struct i40e_client *client;
 
 	u16 msix_count;	 /* number of msix vectors*/
 	/* Array down below will be dynamically allocated based on msix_count */
@@ -132,6 +139,11 @@ struct i40e_ops {
 			       struct i40e_client *client,
 			       bool is_vf, u32 vf_id,
 			       u32 flag, u32 valid_flag);
+
+	int (*client_device_register)(struct i40e_info *ldev);
+
+	void (*client_device_unregister)(struct i40e_info *ldev);
+
 };
 
 struct i40e_client_ops {
@@ -200,4 +212,13 @@ static inline bool i40e_client_is_registered(struct i40e_client *client)
 int i40e_register_client(struct i40e_client *client);
 int i40e_unregister_client(struct i40e_client *client);
 
+#define ASSIGN_PEER_INFO						\
+{									\
+	{ .name = I40E_PEER_RDMA_NAME, .id = I40E_PEER_RDMA_ID },	\
+}
+
+struct i40e_peer_dev_platform_data {
+	struct i40e_info *ldev;
+};
+
 #endif /* _I40E_CLIENT_H_ */
Signature · 1 line
1.8.3.1