From patchwork Fri Apr 6 09:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 132904 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp541704ljb; Fri, 6 Apr 2018 02:23:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+7UAV0YChevSuOdmKhYBxNbR4TP3SaO+3tO04PbX/hIMxm5rs+RIPCHb1zX3TeWwT+VXZM X-Received: by 2002:a17:902:a508:: with SMTP id s8-v6mr27068902plq.216.1523006630912; Fri, 06 Apr 2018 02:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523006630; cv=none; d=google.com; s=arc-20160816; b=MJtI57Cxz2QdXZhn7XFsFa9iLpuFv6bB1bAb8XhQvTpIcc4gM88MuHFlbc/U4On4kG qe4Mlclc8t79eVM6a1r3nClX/z93bmTroHcckQtr1flEZoEbrEhPiGSJWNj2iPKIDIuG q8EHH0zSR3oufZ8KPmrWUOylrwQGkpJxWxy3NxpYFIq78WNzCWKEDCJo9P74MAXUiM+Q c024qfKpm+cDD+Th78nt1bHjx61CAaPvED5rYydFpucXh0f8Stpv+az/UBkntHeqO0gc KV9Z93XY+NQhwqhQBEUC8SEq00mhAZgZHnTQax9QhlbZs5norrkro2I5YUKhh5yG+tQ6 jeOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=CQK/exwTMZQUKEni5RueAj6WtgHri7PUuwmRKJEhWME=; b=Ps2ME4ORO5qtsAwPHzYoVdAcBEu0gg7kP8j+RHIu6p+nnDBRcCDi9wMLUAPOgaUQIX qrQwocplXsjhrSVq73QDW4o7MjmuGTFZnaDpc/6AYLc8jN25khN6INM8SHix5cRwmg+s beffdtT3o5Np49bkro678Ln6uQ0UjDQlOoLAfDobEKFuUEEgG03+aKmefkhQr4UzH25D Pm6wmnGwUV4j801lWs64XS4Z6s8SYDSf2FNdKKxsRHZ60HAjzb/j9YipR/HJR8iJ/kQv efebKbZgsd8nxQ6biGtDz43oEgFvr4k3qnSMC9srYWhlzTNQX5Kk6KgADT2BXsdzQKID pwag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Rwlr8Rgu; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e98-v6si1902430plb.273.2018.04.06.02.23.50; Fri, 06 Apr 2018 02:23:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Rwlr8Rgu; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbeDFJXu (ORCPT + 1 other); Fri, 6 Apr 2018 05:23:50 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33674 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbeDFJXt (ORCPT ); Fri, 6 Apr 2018 05:23:49 -0400 Received: by mail-wr0-f193.google.com with SMTP id z73so919024wrb.0 for ; Fri, 06 Apr 2018 02:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=s9Htp57Nl85gARA5vkf/ia4moz3M5IEEu7zaQUJWAck=; b=Rwlr8Rgu9HFM8O781TKgLG1ZmKSiPhBcVcIcIv5HtE/RTN2HVD5vO+gLIt/L+6Qyz2 K2zR2u0l8ktw9/Tal9GTdfic8NYjyzXHkzJVVq5Qh8WYAJAOJFqYxOxDpCObdUOA8LRQ esx8hAVD/m+xfMtUQwpVx23VurdHk03VH6iCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=s9Htp57Nl85gARA5vkf/ia4moz3M5IEEu7zaQUJWAck=; b=e7K8wDxF/H57kp9NBOU9XeuivEA4Fn+M8fUiWW/upMHHLzVWphTFuqMmkc++4MOITe ifQd0WPYhLuOTI+zxzM/Ov21a/Qj6LYkIgO2glR/DcZePWD+45beEnP6vRu9zEmJwpaH +W1Y24mMbnxxygYMq2PMuF4WUQsupjZCZLTbLB4bJNEKF4OUMrWbQEzP0iXpexVipmDk VsexDKok+BtTCRTXZm1Uc6h5plIJBeoGKMmV1VYmQR8fuUwc4NPRejd09e4u2/kTmneX Uzpekx4eAOIQJqI2fU1exhtm9ophhAnpclmHiAZYRPO5YdTIvXRNQG37NtKiBI6BIDnS zTVQ== X-Gm-Message-State: AElRT7GM+o2BwFvdNBjzfIXWDdrpymY3dY+rTHnX7NUrXpENBM4lRWXC 4oDFBjp+6Hx7vaew/M5gd2axpGWUte/G5Q== X-Received: by 10.223.133.209 with SMTP id 17mr18299913wru.143.1523006627859; Fri, 06 Apr 2018 02:23:47 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home ([2a01:cb19:8349:a800:9c6b:8bb7:fe7e:2911]) by smtp.gmail.com with ESMTPSA id b34sm17524331wra.21.2018.04.06.02.23.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Apr 2018 02:23:47 -0700 (PDT) From: Loic Poulain To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, bjorn.andersson@linaro.org, Loic Poulain Subject: [PATCH] Bluetooth: btqcomsmd: Fix rx/tx stats Date: Fri, 6 Apr 2018 11:23:45 +0200 Message-Id: <1523006625-17257-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org HCI RX/TX byte counters were only incremented when sending ACL packets. To reflect the real HCI traffic, we need to increment these counters on HCI events and HCI commands as well. Increment error counter on rpmsg errors. Signed-off-by: Loic Poulain --- drivers/bluetooth/btqcomsmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index 2c9a5fc..7df3eed 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -65,6 +65,7 @@ static int btqcomsmd_cmd_callback(struct rpmsg_device *rpdev, void *data, { struct btqcomsmd *btq = priv; + btq->hdev->stat.byte_rx += count; return btqcomsmd_recv(btq->hdev, HCI_EVENT_PKT, data, count); } @@ -76,12 +77,21 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb) switch (hci_skb_pkt_type(skb)) { case HCI_ACLDATA_PKT: ret = rpmsg_send(btq->acl_channel, skb->data, skb->len); + if (ret) { + hdev->stat.err_tx++; + break; + } hdev->stat.acl_tx++; hdev->stat.byte_tx += skb->len; break; case HCI_COMMAND_PKT: ret = rpmsg_send(btq->cmd_channel, skb->data, skb->len); + if (ret) { + hdev->stat.err_tx++; + break; + } hdev->stat.cmd_tx++; + hdev->stat.byte_tx += skb->len; break; default: ret = -EILSEQ;