From patchwork Fri Feb 15 17:10:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiraz Saleem X-Patchwork-Id: 10815567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAA5817D5 for ; Fri, 15 Feb 2019 17:12:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B7512FC7F for ; Fri, 15 Feb 2019 17:12:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FE682FCB0; Fri, 15 Feb 2019 17:12:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 368C22FC7F for ; Fri, 15 Feb 2019 17:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728538AbfBORLl (ORCPT ); Fri, 15 Feb 2019 12:11:41 -0500 Received: from mga14.intel.com ([192.55.52.115]:20585 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbfBORLj (ORCPT ); Fri, 15 Feb 2019 12:11:39 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2019 09:11:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,373,1544515200"; d="scan'208";a="134635668" Received: from ssaleem-mobl4.amr.corp.intel.com ([10.122.129.109]) by orsmga002.jf.intel.com with ESMTP; 15 Feb 2019 09:11:37 -0800 From: Shiraz Saleem To: dledford@redhat.com, jgg@ziepe.ca, davem@davemloft.net Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, mustafa.ismail@intel.com, jeffrey.t.kirsher@intel.com, Shiraz Saleem Subject: [RFC v1 01/19] net/i40e: Add peer register/unregister to struct i40e_netdev_priv Date: Fri, 15 Feb 2019 11:10:48 -0600 Message-Id: <20190215171107.6464-2-shiraz.saleem@intel.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20190215171107.6464-1-shiraz.saleem@intel.com> References: <20190215171107.6464-1-shiraz.saleem@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Expose the register/unregister function pointers in the struct i40e_netdev_priv which is accesible via the netdev_priv() interface in the RDMA driver. On a netdev notification in the RDMA driver, the appropriate LAN driver register/unregister functions are invoked from the struct i40e_netdev_priv structure, This is done in order to support single RDMA driver to work with multiple LAN drivers over multi-generation Intel HW supporting RDMA Signed-off-by: Shiraz Saleem Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_client.h | 10 ++++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 8de9085..7bc6316 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -795,6 +795,7 @@ struct i40e_vsi { } ____cacheline_internodealigned_in_smp; struct i40e_netdev_priv { + struct idc_srv_provider prov_callbacks; struct i40e_vsi *vsi; }; diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h index 72994ba..70ddb76 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.h +++ b/drivers/net/ethernet/intel/i40e/i40e_client.h @@ -44,6 +44,16 @@ enum i40e_client_instance_state { #define I40E_QUEUE_TYPE_PE_AEQ 0x80 #define I40E_QUEUE_INVALID_IDX 0xFFFF +#define IDC_SIGNATURE 0x494e54454c494443ULL /* INTELIDC */ +struct idc_srv_provider { + u64 signature; + u16 maj_ver; + u16 min_ver; + u8 rsvd[4]; + int (*reg_peer_driver)(struct i40e_client *client); + int (*unreg_peer_driver)(struct i40e_client *client); +}; + struct i40e_qv_info { u32 v_idx; /* msix_vector */ u16 ceq_idx; diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index f52e2c4..114ff0e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -12243,6 +12243,13 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) np = netdev_priv(netdev); np->vsi = vsi; + np->prov_callbacks.signature = IDC_SIGNATURE; + np->prov_callbacks.maj_ver = I40E_CLIENT_VERSION_MAJOR; + np->prov_callbacks.min_ver = I40E_CLIENT_VERSION_MINOR; + memset(np->prov_callbacks.rsvd, 0, sizeof(np->prov_callbacks.rsvd)); + np->prov_callbacks.reg_peer_driver = i40e_register_client; + np->prov_callbacks.unreg_peer_driver = i40e_unregister_client; + hw_enc_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |