Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1817966rwb; Fri, 28 Jul 2023 15:54:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdYDDmGfEshWhBVjLS/EEC+9zMH6qPZpwSBMt+SSGuthyxgPbj3azQDgVFTTRi4mnGwj8N X-Received: by 2002:adf:e60e:0:b0:313:fd52:af37 with SMTP id p14-20020adfe60e000000b00313fd52af37mr2795871wrm.4.1690584866635; Fri, 28 Jul 2023 15:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690584866; cv=none; d=google.com; s=arc-20160816; b=izdM5m+22RXkrzLutWInmMDI+RZAg5MGlMrCTs4/MtmJSaczRjHxyODtlwbi+AFWQh LWakqbPb7sahKKoGMlw9AiBxHfIbM131sNoWpl8f+Fe4pMjAJiWsG0s44P9/ZLdGFmGc ldGcT2iZVpHF6So62/v9aP+cf16RaEVX0+63nI2DtBGrg02D9m5MY06ELuHcEOGQs3R/ JcR9wjOHVpOTuXyRgOlVKa4OyZrEJf9hsP4ON08ajw/QoHor5YZmwo1te6lK8bzDZM0P s9YUnN+CY/VEeH2BoxzqJwQRmvKq1XIgUMflK0MjPm1KQQp3KTQJvCHSE1J2YRk1bsPy fYMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kp/DcLh5WO3tRYY+x0GV4ZFX6NbomSTB3aO/vJlAm5w=; fh=V2LL5OuZUBGeSu6TXDWykcThOoazTGUpkln19rrO2KM=; b=huGvwW67UFEzFnb/8sFGCnUTdZ3LVn+kOs6g4wDZg2ByphCWk923ob5eSZkww0YY5M xRMXfN4gSNz01wWUJNoHpejH4s37cfTPSqpuQJMCKog3BquHAEFZ0sqtTrJzjJLUBT4O 1O2El/6BhhhIusjCWsddqkD77DucFupJbnFNgcFfTTjfT6PbG68E7TKXNbrfsQcUfn7Z 7dYpNBh+V1ZSxTlLPdtitZPKtwiwkfUjvFwi6zBPwQMpxalxkCVvQlg3QO+m13aR4aMy dSF0Zxef3CJwRLM5+1zh9Pi4iqIah250tJv+Q4IawfoOuPS7jdF4dC2sI5ugqrkoTq/X NVmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TQqL+5Uq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a17090608c500b0099b7211b2c2si2898492eje.706.2023.07.28.15.54.02; Fri, 28 Jul 2023 15:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TQqL+5Uq; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233708AbjG1Wm5 (ORCPT + 99 others); Fri, 28 Jul 2023 18:42:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233478AbjG1Wm4 (ORCPT ); Fri, 28 Jul 2023 18:42:56 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 108384495 for ; Fri, 28 Jul 2023 15:42:56 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-686be28e1a8so1858206b3a.0 for ; Fri, 28 Jul 2023 15:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690584175; x=1691188975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kp/DcLh5WO3tRYY+x0GV4ZFX6NbomSTB3aO/vJlAm5w=; b=TQqL+5Uq9RycNTJVfTHIiusD5SytAfByhkBxSMSbCD33OVJ6ADXsFFjUQoCj55gyRQ rTELET/8ktt+2XEu/pMmB2s1aoMpOJQfQiX05FEJgmXu5SIF+wU2BFBNtWa2mQxa2WZv aRQM1zYMV9lwKC6Lmbvcr0s5lZ4/Wp6qwRgoT9w42QUqLnLP9n3G4lXK3Xl1AuZYihe/ Pzq/UBUBKEtWbngTh+9m3XtbUQAT19RccBe6qhaWyZBj3ruMR/O/FqT3CJURT5YUTXGA jDfc6b7z4+tS7tSrxNvn2EuayYXDOXbbo/Bghr3ApMd5fXlZwt4vWuE+0JMge7oed8Sx q6Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690584175; x=1691188975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kp/DcLh5WO3tRYY+x0GV4ZFX6NbomSTB3aO/vJlAm5w=; b=fqpHyn7310V+ZeyO+6nOfI0mdjGdkuBvwr4YHIelY68zA5+nKVa6K4x/CimlmdMNzu 87WuLo7w9HtPeQljzcBsOPvs+KeLtMQsjS4s3wMCVuzrl/AEykj3WQJQD5ppp5nNWlgp 4wvXw3AiW72ZsCFOgOe3kTnsg+9TK7lCYcVKBr9FWv0rea8vUs6oWkyf70fruQ24Frw0 RQlt8cOWtxHS2jAn9P8gCWR4KxWSJ42heghlLpMSbIeSif5jIx3zX/EMzTh/6w5rTmTo 2JKEy/V0nGJt4WjQGLjP5p1XGIXb8gi9PsG6Y1SfmiVjs6PdIJommh7QUOpxvDCh8awf MPEw== X-Gm-Message-State: ABy/qLaZq0SVeGDhEzV4cvNSXPaT1o4nRFOsV/wsprY36wf2ix24Pmqo Ye/brc6ztcOsjiPsh74pAFkKWfFzV7w= X-Received: by 2002:a05:6a00:8c9:b0:682:a6bd:e952 with SMTP id s9-20020a056a0008c900b00682a6bde952mr3348102pfu.6.1690584174834; Fri, 28 Jul 2023 15:42:54 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-236-201-58.hsd1.or.comcast.net. [71.236.201.58]) by smtp.gmail.com with ESMTPSA id x41-20020a056a000be900b0068703879d3esm2731041pfu.113.2023.07.28.15.42.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 15:42:53 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v5 4/7] monitor: Fix not dequeing TX packet properly Date: Fri, 28 Jul 2023 15:42:44 -0700 Message-ID: <20230728224247.102057-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728224247.102057-1-luiz.dentz@gmail.com> References: <20230728224247.102057-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz num_completed_packets_evt contain a count for how many packets have been completed per handle. --- monitor/packet.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitor/packet.c b/monitor/packet.c index b905080edc60..badc9b9c7785 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -10406,6 +10406,7 @@ static void num_completed_packets_evt(struct timeval *tv, uint16_t index, for (i = 0; i < evt->num_handles; i++) { uint16_t handle; uint16_t count; + int j; if (!util_iov_pull_le16(&iov, &handle)) break; @@ -10415,9 +10416,10 @@ static void num_completed_packets_evt(struct timeval *tv, uint16_t index, if (!util_iov_pull_le16(&iov, &count)) break; - print_field("Count: %d", le16_to_cpu(evt->count)); + print_field("Count: %d", count); - packet_dequeue_tx(tv, handle); + for (j = 0; j < count; j++) + packet_dequeue_tx(tv, handle); } if (iov.iov_len) -- 2.41.0