Re: [PATCH v1 2/3] Bluetooth: Add tx/rx counters to track iso packets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kiran,

On Fri, Jul 26, 2024 at 6:30 AM Kiran K <kiran.k@xxxxxxxxx> wrote:
>
> Add counters in hci_dev_stats to track iso tx and rx packets.
>
> Signed-off-by: Kiran K <kiran.k@xxxxxxxxx>
> ---
>  include/net/bluetooth/hci_sock.h | 2 ++
>  net/bluetooth/hci_core.c         | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/include/net/bluetooth/hci_sock.h b/include/net/bluetooth/hci_sock.h
> index 13e8cd4414a1..98991a11844a 100644
> --- a/include/net/bluetooth/hci_sock.h
> +++ b/include/net/bluetooth/hci_sock.h
> @@ -101,6 +101,8 @@ struct hci_dev_stats {
>         __u32 acl_rx;
>         __u32 sco_tx;
>         __u32 sco_rx;
> +       __u32 iso_tx;
> +       __u32 iso_rx;
>         __u32 byte_rx;
>         __u32 byte_tx;
>  };
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 8a4ebd93adfc..b0d40b62238b 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -3858,6 +3858,8 @@ static void hci_isodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
>         bt_dev_dbg(hdev, "len %d handle 0x%4.4x flags 0x%4.4x", skb->len,
>                    handle, flags);
>
> +       hdev->stat.iso_rx++;
> +
>         hci_dev_lock(hdev);
>         conn = hci_conn_hash_lookup_handle(hdev, handle);
>         hci_dev_unlock(hdev);
> --
> 2.40.1

This breaks HCIGETDEVINFO since it changes its size, not really sure
how ioctl-tester pass it but perhaps it is not really checking the
size, anyway that's why Ive left it unchanged since otherwise we have
to break ioctl APIs which are considered deprecated anyway.

-- 
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux