From patchwork Mon Jan 4 01:43:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dillow X-Patchwork-Id: 70533 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0426iOf029601 for ; Mon, 4 Jan 2010 02:06:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691Ab0ADCGo (ORCPT ); Sun, 3 Jan 2010 21:06:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751658Ab0ADCGo (ORCPT ); Sun, 3 Jan 2010 21:06:44 -0500 Received: from smtp.knology.net ([24.214.63.101]:55734 "EHLO smtp.knology.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751414Ab0ADCGn (ORCPT ); Sun, 3 Jan 2010 21:06:43 -0500 Received: (qmail 14991 invoked by uid 0); 4 Jan 2010 01:43:55 -0000 Received: from unknown (HELO shed.thedillows.org) (207.98.218.89) by smtp1.knology.net with SMTP; 4 Jan 2010 01:43:55 -0000 Received: from obelisk.thedillows.org (obelisk.thedillows.org [192.168.0.10]) by shed.thedillows.org (8.14.3/8.14.3) with ESMTP id o041hs8c023261; Sun, 3 Jan 2010 20:43:54 -0500 Received: from obelisk.thedillows.org (localhost [127.0.0.1]) by obelisk.thedillows.org (8.14.3/8.14.3) with ESMTP id o041hrOU020394; Sun, 3 Jan 2010 20:43:53 -0500 Received: (from dad@localhost) by obelisk.thedillows.org (8.14.3/8.14.3/Submit) id o041hrFK020393; Sun, 3 Jan 2010 20:43:53 -0500 X-Authentication-Warning: obelisk.thedillows.org: dad set sender to dave@thedillows.org using -f From: David Dillow To: Bart Van Assche Cc: linux-rdma@vger.kernel.org, Roland Dreier , Chris Worley , David Dillow Subject: [RFC PATCH 3/3] IB/srp: export req_limit via sysfs Date: Sun, 3 Jan 2010 20:43:37 -0500 Message-Id: <1262569417-20341-3-git-send-email-dave@thedillows.org> X-Mailer: git-send-email 1.6.5.2 In-Reply-To: <1262568846.13289.4.camel@obelisk.thedillows.org> References: <1262568846.13289.4.camel@obelisk.thedillows.org> In-Reply-To: <1262568846.13289.4.camel@obelisk.thedillows.org> References: <1262568846.13289.4.camel@obelisk.thedillows.org> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index c0a5ccb..c68d8d6 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1620,6 +1620,18 @@ static ssize_t show_zero_req_lim(struct device *dev, return sprintf(buf, "%d\n", target->zero_req_lim); } +static ssize_t show_req_lim(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct srp_target_port *target = host_to_target(class_to_shost(dev)); + + if (target->state == SRP_TARGET_DEAD || + target->state == SRP_TARGET_REMOVED) + return -ENODEV; + + return sprintf(buf, "%d\n", target->req_lim); +} + static ssize_t show_local_ib_port(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1642,6 +1654,7 @@ static DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); +static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL); static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); @@ -1653,6 +1666,7 @@ static struct device_attribute *srp_host_attrs[] = { &dev_attr_pkey, &dev_attr_dgid, &dev_attr_orig_dgid, + &dev_attr_req_lim, &dev_attr_zero_req_lim, &dev_attr_local_ib_port, &dev_attr_local_ib_device,