From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gal Pressman Subject: Re: [RFC v1 04/19] RDMA/irdma: Add driver framework definitions Date: Sun, 24 Feb 2019 17:02:10 +0200 Message-ID: <5215c158-2935-ef45-db49-44caa84e07d3@amazon.com> References: <20190215171107.6464-1-shiraz.saleem@intel.com> <20190215171107.6464-5-shiraz.saleem@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190215171107.6464-5-shiraz.saleem@intel.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org To: Shiraz Saleem , 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 List-Id: linux-rdma@vger.kernel.org On 15-Feb-19 19:10, Shiraz Saleem wrote: > +/* client interface functions */ > +static const struct i40e_client_ops i40e_ops = { > + .open = i40iw_open, > + .close = i40iw_close, > + .l2_param_change = i40iw_l2param_change, > + .virtchnl_receive = NULL, > + .vf_reset = NULL, > + .vf_enable = NULL, > + .vf_capable = NULL NULL assignments are redundant. > +}; > + > diff --git a/drivers/infiniband/hw/irdma/irdma_if.c b/drivers/infiniband/hw/irdma/irdma_if.c > new file mode 100644 > index 0000000..f7b89e9 > --- /dev/null > +++ b/drivers/infiniband/hw/irdma/irdma_if.c > @@ -0,0 +1,430 @@ > +// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB > +/* Copyright (c) 2019, Intel Corporation. */ > + > +#include > +#include > +#include > +#include "main.h" > +#include "ws.h" > +#include "icrdma_hw.h" > + > +void irdma_add_dev_ref(struct irdma_sc_dev *dev) > +{ > + try_module_get(THIS_MODULE); > +} > + > +void irdma_put_dev_ref(struct irdma_sc_dev *dev) > +{ > + module_put(THIS_MODULE); > +} What are these used for? > + > +/** > + * irdma_find_iwdev - find a vsi device given a name > + * @name: name of iwdev > + */ Can't find uses of this function as well. > +struct irdma_device *irdma_find_iwdev(const char *name) > +{ > + struct irdma_handler *hdl; > + struct list_head *pos; > + struct list_head *tmp; > + struct irdma_device *iwdev; > + unsigned long flags; > + > + spin_lock_irqsave(&irdma_handler_lock, flags); > + list_for_each_entry(hdl, &irdma_handlers, list) { > + list_for_each_safe(pos, tmp, &hdl->rf.vsi_dev_list) { > + iwdev = container_of(pos, struct irdma_device, list); > + if (!strcmp(name, iwdev->iwibdev->ibdev.name)) { > + spin_unlock_irqrestore(&irdma_handler_lock, > + flags); > + return iwdev; > + } > + } > + } > + spin_unlock_irqrestore(&irdma_handler_lock, flags); > + > + return NULL; > +} > + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A80CFC43381 for ; Sun, 24 Feb 2019 15:02:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7520420652 for ; Sun, 24 Feb 2019 15:02:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="qzNi+NZn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbfBXPCZ (ORCPT ); Sun, 24 Feb 2019 10:02:25 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:37071 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfBXPCY (ORCPT ); Sun, 24 Feb 2019 10:02:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1551020543; x=1582556543; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=yjl3SQ6S09HNmPHMKvomUub9bP4U9hzKVcVD1NReTrA=; b=qzNi+NZnQu41y9vzD0WEjT8I6xLAAyJtxMGj4YW7kdKAZXrhOZ9VkhVL oSgw5euxh/PC/acsT69hw3YjWhRJDV8QuZ73CceK4XXaspvSb4Qk/GGg6 QNPWvHaWBq3F1GxldOm7ganI9lpbGZJqTa7N+D82gsmS/Y/osntKI/zTI g=; X-IronPort-AV: E=Sophos;i="5.58,407,1544486400"; d="scan'208";a="760357226" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Feb 2019 15:02:21 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id x1OF2IB3055092 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 24 Feb 2019 15:02:20 GMT Received: from EX13D19EUB003.ant.amazon.com (10.43.166.69) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 24 Feb 2019 15:02:19 +0000 Received: from [10.218.62.29] (10.43.160.211) by EX13D19EUB003.ant.amazon.com (10.43.166.69) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 24 Feb 2019 15:02:15 +0000 Subject: Re: [RFC v1 04/19] RDMA/irdma: Add driver framework definitions To: Shiraz Saleem , , , CC: , , , References: <20190215171107.6464-1-shiraz.saleem@intel.com> <20190215171107.6464-5-shiraz.saleem@intel.com> From: Gal Pressman Message-ID: <5215c158-2935-ef45-db49-44caa84e07d3@amazon.com> Date: Sun, 24 Feb 2019 17:02:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190215171107.6464-5-shiraz.saleem@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.160.211] X-ClientProxiedBy: EX13D07UWB004.ant.amazon.com (10.43.161.196) To EX13D19EUB003.ant.amazon.com (10.43.166.69) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 15-Feb-19 19:10, Shiraz Saleem wrote: > +/* client interface functions */ > +static const struct i40e_client_ops i40e_ops = { > + .open = i40iw_open, > + .close = i40iw_close, > + .l2_param_change = i40iw_l2param_change, > + .virtchnl_receive = NULL, > + .vf_reset = NULL, > + .vf_enable = NULL, > + .vf_capable = NULL NULL assignments are redundant. > +}; > + > diff --git a/drivers/infiniband/hw/irdma/irdma_if.c b/drivers/infiniband/hw/irdma/irdma_if.c > new file mode 100644 > index 0000000..f7b89e9 > --- /dev/null > +++ b/drivers/infiniband/hw/irdma/irdma_if.c > @@ -0,0 +1,430 @@ > +// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB > +/* Copyright (c) 2019, Intel Corporation. */ > + > +#include > +#include > +#include > +#include "main.h" > +#include "ws.h" > +#include "icrdma_hw.h" > + > +void irdma_add_dev_ref(struct irdma_sc_dev *dev) > +{ > + try_module_get(THIS_MODULE); > +} > + > +void irdma_put_dev_ref(struct irdma_sc_dev *dev) > +{ > + module_put(THIS_MODULE); > +} What are these used for? > + > +/** > + * irdma_find_iwdev - find a vsi device given a name > + * @name: name of iwdev > + */ Can't find uses of this function as well. > +struct irdma_device *irdma_find_iwdev(const char *name) > +{ > + struct irdma_handler *hdl; > + struct list_head *pos; > + struct list_head *tmp; > + struct irdma_device *iwdev; > + unsigned long flags; > + > + spin_lock_irqsave(&irdma_handler_lock, flags); > + list_for_each_entry(hdl, &irdma_handlers, list) { > + list_for_each_safe(pos, tmp, &hdl->rf.vsi_dev_list) { > + iwdev = container_of(pos, struct irdma_device, list); > + if (!strcmp(name, iwdev->iwibdev->ibdev.name)) { > + spin_unlock_irqrestore(&irdma_handler_lock, > + flags); > + return iwdev; > + } > + } > + } > + spin_unlock_irqrestore(&irdma_handler_lock, flags); > + > + return NULL; > +} > +