From patchwork Thu Jun 18 00:09:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6632111 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0CC19F358 for ; Thu, 18 Jun 2015 00:12:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5C20207E8 for ; Thu, 18 Jun 2015 00:12:10 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D264206A1 for ; Thu, 18 Jun 2015 00:11:59 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6C4C31828FA; Wed, 17 Jun 2015 17:11:59 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 4D64A1828C6 for ; Wed, 17 Jun 2015 17:11:58 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 17 Jun 2015 17:11:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,636,1427785200"; d="scan'208";a="712952852" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.23.232.36]) by orsmga001.jf.intel.com with ESMTP; 17 Jun 2015 17:11:58 -0700 Subject: [ndctl PATCH 1/6] ndctl: quiet ndctl_cmd command debug From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 17 Jun 2015 20:09:18 -0400 Message-ID: <20150618000917.13255.56633.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150618000139.13255.82894.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150618000139.13255.82894.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For large transfers we drop the per-partial transfer messages in favor of one summary message per command. Signed-off-by: Dan Williams --- lib/libndctl.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/libndctl.c b/lib/libndctl.c index 08d394fef59d..468c0853e024 100644 --- a/lib/libndctl.c +++ b/lib/libndctl.c @@ -1905,29 +1905,32 @@ static int do_cmd(int fd, int ioctl_cmd, struct ndctl_cmd *cmd) return rc; } - for (offset = 0; offset < iter->total_xfer; offset += iter->max_xfer) { if (iter->dir == WRITE) memcpy(iter->data, iter->total_buf + offset, iter->max_xfer); *(cmd->iter.offset) = offset; rc = ioctl(fd, ioctl_cmd, cmd->cmd_buf); - dbg(ctx, "bus: %d dimm: %#x cmd: %s offset: %d status: %d fw: %d (%s)\n", - bus->id, cmd->dimm - ? ndctl_dimm_get_handle(cmd->dimm) : 0, - name, offset, rc, *(cmd->firmware_status), - rc < 0 ? strerror(errno) : "success"); if (rc) - return rc; + break; if (iter->dir == READ) memcpy(iter->total_buf + offset, iter->data, iter->max_xfer); - if (*(cmd->firmware_status)) - return iter->total_xfer - offset; + if (*(cmd->firmware_status)) { + rc = iter->total_xfer - offset; + break; + } } - return 0; + dbg(ctx, "bus: %d dimm: %#x cmd: %s total: %d max_xfer: %d status: %d fw: %d (%s)\n", + bus->id, + cmd->dimm ? ndctl_dimm_get_handle(cmd->dimm) : 0, + name, iter->total_xfer, iter->max_xfer, rc, + *(cmd->firmware_status), + rc < 0 ? strerror(errno) : "success"); + + return rc; } NDCTL_EXPORT int ndctl_cmd_submit(struct ndctl_cmd *cmd)