mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ed Cashin <ecashin@coraid.com>
To: akpm@linux-foundation.org
Cc: ecashin@coraid.com, linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] aoe: "payload" sysfs file exports per-AoE-command data transfer size
Date: Wed, 17 Oct 2012 18:53:31 -0700	[thread overview]
Message-ID: <d79aad28cf58962d1565c8dcf2b449b005b450ec.1350524227.git.ecashin@coraid.com> (raw)
In-Reply-To: <cover.1350524227.git.ecashin@coraid.com>

The userland aoetools package includes an "aoe-stat" command that
can display a "payload size" column when the aoe driver exports
this information.  Users can quickly see what amount of user data
is transferred inside each AoE command on the network, network
headers excluded.

Signed-off-by: Ed Cashin <ecashin@coraid.com>
---
 drivers/block/aoe/aoeblk.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index d5aa3b8..56736cd 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -98,6 +98,14 @@ static ssize_t aoedisk_show_fwver(struct device *dev,
 
 	return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
 }
+static ssize_t aoedisk_show_payload(struct device *dev,
+				    struct device_attribute *attr, char *page)
+{
+	struct gendisk *disk = dev_to_disk(dev);
+	struct aoedev *d = disk->private_data;
+
+	return snprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt);
+}
 
 static DEVICE_ATTR(state, S_IRUGO, aoedisk_show_state, NULL);
 static DEVICE_ATTR(mac, S_IRUGO, aoedisk_show_mac, NULL);
@@ -106,12 +114,14 @@ static struct device_attribute dev_attr_firmware_version = {
 	.attr = { .name = "firmware-version", .mode = S_IRUGO },
 	.show = aoedisk_show_fwver,
 };
+static DEVICE_ATTR(payload, S_IRUGO, aoedisk_show_payload, NULL);
 
 static struct attribute *aoe_attrs[] = {
 	&dev_attr_state.attr,
 	&dev_attr_mac.attr,
 	&dev_attr_netif.attr,
 	&dev_attr_firmware_version.attr,
+	&dev_attr_payload.attr,
 	NULL,
 };
 
-- 
1.7.1


  parent reply	other threads:[~2012-10-18  1:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  1:43 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
2012-10-18  1:43 ` [PATCH 1/9] aoe: describe the behavior of the "err" character device Ed Cashin
2012-10-18  1:45 ` [PATCH 2/9] aoe: print warning regarding a common reason for dropped transmits Ed Cashin
2012-10-18  1:47 ` [PATCH 3/9] aoe: update cap on outstanding commands based on config query response Ed Cashin
2012-10-18  1:49 ` [PATCH 4/9] aoe: support the forgetting (flushing) of a user-specified AoE target Ed Cashin
2012-10-18  1:51 ` [PATCH 5/9] aoe: support larger I/O requests via aoe_maxsectors module param Ed Cashin
2012-10-18  1:53 ` Ed Cashin [this message]
2012-10-18  1:55 ` [PATCH 7/9] aoe: cleanup: remove unused ata_scnt function Ed Cashin
2012-10-18  1:57 ` [PATCH 8/9] aoe: whitespace cleanup Ed Cashin
2012-10-18  1:59 ` [PATCH 9/9] aoe: update driver-internal version number to 60 Ed Cashin
  -- strict thread matches above, loose matches on Subject: below --
2012-10-16  1:40 [PATCH 0/9] aoe: various enhancements and cleanup from v50 to v60 Ed Cashin
2012-10-16  1:50 ` [PATCH 6/9] aoe: "payload" sysfs file exports per-AoE-command data transfer size Ed Cashin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d79aad28cf58962d1565c8dcf2b449b005b450ec.1350524227.git.ecashin@coraid.com \
    --to=ecashin@coraid.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®