Skip to contentSkip to conversation

i40e: Move client header location

PATCH New Shiraz Saleem 3 participants 5 messages Jan 16, 2020 – Jan 18, 2020

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

PATCH 1/2 i40e: Move client header location

From: "Shiraz Saleem" <[email protected]>

Move i40e_client.h to include/linux/net/intel/*
since its shared between i40iw and i40e.

---
 drivers/infiniband/hw/i40iw/Makefile          |   1 -
 drivers/infiniband/hw/i40iw/i40iw.h           |   2 +-
 drivers/net/ethernet/intel/i40e/i40e.h        |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_client.c |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_client.h | 203 --------------------------
 include/linux/net/intel/i40e_client.h         | 203 ++++++++++++++++++++++++++
 6 files changed, 206 insertions(+), 207 deletions(-)
 delete mode 100644 drivers/net/ethernet/intel/i40e/i40e_client.h
 create mode 100644 include/linux/net/intel/i40e_client.h
drivers/infiniband/hw/i40iw/Makefile +0 -1
index 8942f82..34da9eb 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y :=  -I $(srctree)/drivers/net/ethernet/intel/i40e
 
 obj-$(CONFIG_INFINIBAND_I40IW) += i40iw.o
 
drivers/infiniband/hw/i40iw/i40iw.h +1 -1
index 8feec35..f628325 100644
@@ -45,6 +45,7 @@
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/crc32c.h>
+#include <linux/net/intel/i40e_client.h>
 #include <rdma/ib_smi.h>
 #include <rdma/ib_verbs.h>
 #include <rdma/ib_pack.h>
@@ -57,7 +58,6 @@
 #include "i40iw_d.h"
 #include "i40iw_hmc.h"
 
-#include <i40e_client.h>
 #include "i40iw_type.h"
 #include "i40iw_p.h"
 #include <rdma/i40iw-abi.h>
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
index 4833187..05453f55 100644
@@ -38,7 +38,7 @@
 #include <net/xdp_sock.h>
 #include "i40e_type.h"
 #include "i40e_prototype.h"
-#include "i40e_client.h"
+#include <linux/net/intel/i40e_client.h>
 #include <linux/avf/virtchnl.h>
 #include "i40e_virtchnl_pf.h"
 #include "i40e_txrx.h"
drivers/net/ethernet/intel/i40e/i40e_client.c +1 -1
index e81530c..befd301 100644
@@ -3,10 +3,10 @@
 
 #include <linux/list.h>
 #include <linux/errno.h>
+#include <linux/net/intel/i40e_client.h>
 
 #include "i40e.h"
 #include "i40e_prototype.h"
-#include "i40e_client.h"
 
 static const char i40e_client_interface_version_str[] = I40E_CLIENT_VERSION_STR;
 static struct i40e_client *registered_client;
drivers/net/ethernet/intel/i40e/i40e_client.h deleted +0 -203

203 lines not on this page · raw message

include/linux/net/intel/i40e_client.h new file +203 -0

203 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/2 i40e: Register a virtbus device to provide RDMA

Register client virtbus device on the virtbus for the RDMA virtbus driver (irdma) to bind to. It allows to realize a single RDMA driver capable of working with multiple netdev 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 virtbus 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_client.c | 137 ++++++++++++++++++++++----
 include/linux/net/intel/i40e_client.h         |  15 +++
 3 files changed, 133 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/Kconfig +1 -0
index 154e2e8..90d6fb1 100644
@@ -241,6 +241,7 @@ config I40E
 	tristate "Intel(R) Ethernet Controller XL710 Family support"
 	imply PTP_1588_CLOCK
 	depends on PCI
+	select VIRTUAL_BUS
 	---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_client.c +117 -20

217 lines not on this page · raw message

include/linux/net/intel/i40e_client.h +15 -0
index 72994ba..5c81261 100644
@@ -4,6 +4,9 @@
 #ifndef _I40E_CLIENT_H_
 #define _I40E_CLIENT_H_
 
+#include <linux/virtual_bus.h>
+
+#define I40E_PEER_RDMA_NAME	"i40e_rdma"
 #define I40E_CLIENT_STR_LENGTH 10
 
 /* Client interface version should be updated anytime there is a change in the
@@ -84,6 +87,7 @@ struct i40e_info {
 	u8 lanmac[6];
 	struct net_device *netdev;
 	struct pci_dev *pcidev;
+	struct virtbus_device *vdev;
 	u8 __iomem *hw_addr;
 	u8 fid;	/* function id, PF id or VF id */
 #define I40E_CLIENT_FTYPE_PF 0
@@ -97,6 +101,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 */
@@ -107,6 +112,11 @@ struct i40e_info {
 	u32 fw_build;                   /* firmware build number */
 };
 
+struct i40e_virtbus_device {
+	struct virtbus_device vdev;
+	struct i40e_info *ldev;
+};
+
 #define I40E_CLIENT_RESET_LEVEL_PF   1
 #define I40E_CLIENT_RESET_LEVEL_CORE 2
 #define I40E_CLIENT_VSI_FLAG_TCP_ENABLE  BIT(1)
@@ -132,6 +142,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 {
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 i40e: Register a virtbus device to provide RDMA

Quoted 26 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Shiraz Saleem
Sent: Thursday, January 16, 2020 3:06 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Saleem, Shiraz <[email protected]>
Subject: [Intel-wired-lan] [PATCH 2/2] i40e: Register a virtbus device to provide RDMA

Register client virtbus device on the virtbus for the RDMA virtbus driver (irdma) to bind to. It allows to realize a single RDMA driver capable of working with multiple netdev 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 virtbus 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.

Quoted 8 lines
---
 drivers/net/ethernet/intel/Kconfig            |   1 +
 drivers/net/ethernet/intel/i40e/i40e_client.c | 137
++++++++++++++++++++++----
 include/linux/net/intel/i40e_client.h         |  15 +++
 3 files changed, 133 insertions(+), 20 deletions(-)
#3 lore raw

Re: [Intel-wired-lan] [PATCH 2/2] i40e: Register a virtbus device to provide RDMA

In reply to Shiraz Saleem
I love your patch! Yet something to improve:

Hi Shiraz,

I love your patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on linus/master v5.5-rc6 next-20200117] [cannot apply to jkirsher-next-queue/dev-queue]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Shiraz-Saleem/i40e-Move-client-header-location/20200118-033545
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.5.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=parisc

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

In file included from drivers/net/ethernet/intel/i40e/i40e.h:41:0,

                    from drivers/net/ethernet/intel/i40e/i40e_main.c:10:
>> include/linux/net/intel/i40e_client.h:7:10: fatal error: linux/virtual_bus.h: No such file or directory
    #include <linux/virtual_bus.h>
             ^~~~~~~~~~~~~~~~~~~~~

compilation terminated.

vim +7 include/linux/net/intel/i40e_client.h

     6	
   > 7	#include <linux/virtual_bus.h>
     8	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#4 lore raw

PATCH 1/2 i40e: Move client header location

In reply to Shiraz Saleem
Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Shiraz Saleem
Sent: Thursday, January 16, 2020 3:06 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Saleem, Shiraz <[email protected]>
Subject: [Intel-wired-lan] [PATCH 1/2] i40e: Move client header location

From: "Shiraz Saleem" <[email protected]>

Move i40e_client.h to include/linux/net/intel/* since its shared between i40iw and i40e.

Quoted 11 lines
---
 drivers/infiniband/hw/i40iw/Makefile          |   1 -
 drivers/infiniband/hw/i40iw/i40iw.h           |   2 +-
 drivers/net/ethernet/intel/i40e/i40e.h        |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_client.c |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_client.h | 203 --------------------------
 include/linux/net/intel/i40e_client.h         | 203
++++++++++++++++++++++++++
 6 files changed, 206 insertions(+), 207 deletions(-)  delete mode 100644
drivers/net/ethernet/intel/i40e/i40e_client.h
 create mode 100644 include/linux/net/intel/i40e_client.h