Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1257834lqb; Thu, 30 May 2024 05:27:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFUV/cW5QE9zMHAVOklUg2su0/5zLy4hSXUgKJ9pALQCEf0s/kNQmufv4HLILBZQHuP+efYypzJvVMo1cxODjC/e4tQX9342obJM0G2A== X-Google-Smtp-Source: AGHT+IGh7b8/2+vS3+5LF+1j2dCFkV3Jc07/azxHtMvgVtpFjQGyF3uwNonX4tnq4W0UrFX8/3Pu X-Received: by 2002:a17:906:7f01:b0:a62:821d:5df0 with SMTP id a640c23a62f3a-a65e8e406femr130415466b.26.1717072040072; Thu, 30 May 2024 05:27:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717072040; cv=pass; d=google.com; s=arc-20160816; b=S2Eh6ZhJOucgig9prS7N2dLJ0JF/hdyEj6zvR+LK1dsq36hPCwhW3KydwL95YfjKkJ jREo/ZfP5dUFcO8P32VeSlNjFzmgi774T8zt8yfiUYpOk4SoYogP0gKaF8clEiYc4U6M rnkx5I6me5suByTOYTwrIwZ++qoJBzRel2A7EzNgz4/XYADxNH7Bska8JNJqxfoO5Pb7 t7Aw2veITeEyjDJWhRGn+ZyVLRr7WvuSzOu19FedMxWBQr5zwWYOvI8n6q7lhvEzTCh1 iNT12XjIycqHub8FLdIs0ViSlc0WxZ1JT/CgRbIKjyNkIrYtYgt8MILOwR6lNFPs9FZb FjTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TLL4+PI9m+gKUlb5vXXkSEHtuOv17Z74UbZi/p+Au0E=; fh=d4wIfaetamdO7U55Di7IonJD6ChhfoQu9LIV/bKlos8=; b=bM4scrLUd/5IZCIj/6hrp0rFovNV5xSPA4pkqR6O8NQVBiG/ItFHo21DNxnPWA0JEi 92g3UZkqE5JAjVVHoIhjNrVopf7/NavMGC4waat/v8+ZfkklXONuBEQV0MJTiJ9LfKvI QcyAx+ZLpKT+mywCBW1t8GsyCRcOdZqxmsFKz2vk3vAlbJioA3Mr8LBRv38Waki4SKGX CGyv2dxztP7mWYkuQf41bwf+oPPy4kXpeSLUajvsnl9CvKg7KbP0N7G7oGUyruXCpafv oLOfr8HWQvII6/WsfutwbVzwtd8Vew1W7J2eA0j+6t1rOV3nSL+qxYz2UcrV8UtXvClj P8Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CbEMDhZb; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-wireless+bounces-8312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a66e9322077si14271666b.77.2024.05.30.05.27.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 05:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CbEMDhZb; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-wireless+bounces-8312-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C8A3E1F23534 for ; Thu, 30 May 2024 12:27:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ABC818307E; Thu, 30 May 2024 12:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="CbEMDhZb" X-Original-To: linux-wireless@vger.kernel.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74B29183074; Thu, 30 May 2024 12:26:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717071978; cv=none; b=IyuHhgWtK9NSqfdhn6Zq4iUQIwXy8zBHf9wyNyuuVDywa72Wd4+5b4sJiX/SiWRZooQ3El2BoCTvDx3XspKdUFVaE2PV1sA3cu+w0S9wkjrKkoSxRYRjeuVpZPaZ1Sqv+CI2jpR9TJdz12PxzYFCyRON8jKsawtQDNajPx/pZpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717071978; c=relaxed/simple; bh=fbw5/ISy9x/5eLVR6YcFxlLwCyJIGhqNQiUbGdDLPHY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=EVh635cR4nsK28XiaGxYKxxsn5FYCXrqdel6CIfOuvGdd3O5YR+Qek5k6gLfZkUKoTZYz4XZFaO46KfZY2mYXz7cvw3oTLKldwZKeadSY5AtfQ/7grseo6E8a27xJtzY0cVQnCLw6AvxeCLusrrlVHgVkGT+i+ixvK3i7s7RQE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=CbEMDhZb; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44UCQ1cK098230; Thu, 30 May 2024 07:26:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717071961; bh=TLL4+PI9m+gKUlb5vXXkSEHtuOv17Z74UbZi/p+Au0E=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=CbEMDhZbvEjoxH/COAvDFETjhRqgBxyXzGQx1fUxXtIdOJcv1XNVpHveZ9YeLgCos LfkSatkAoae34uziPJV+/mzsbliCLAxiU+kZRk/gorg+a8GpJI60NgQyBb0YRK8fB/ sbZcIqH0Lcw1uSn0szWSrvomqbUawXWKt5D4arbg= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44UCQ1jZ032220 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 May 2024 07:26:01 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 30 May 2024 07:26:01 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 30 May 2024 07:26:01 -0500 Received: from [137.167.6.219] (lt5cg1094w5k.dhcp.ti.com [137.167.6.219]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44UCPxAf072533; Thu, 30 May 2024 07:26:00 -0500 Message-ID: Date: Thu, 30 May 2024 15:25:59 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH wireless-next 6/8] wifi: wlcore: add pn16 support To: "Russell King (Oracle)" CC: Kalle Valo , Johannes Berg , , References: Content-Language: en-US From: "Nemanov, Michael" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 5/30/2024 11:20 AM, Russell King (Oracle) wrote: [...] > > The original code was > tx_lnk_free_pkts = > status->counters.tx_lnk_free_pkts[i]; > diff = (tx_lnk_free_pkts - > lnk->prev_freed_pkts) & 0xff; > > if (diff == 0) > continue; > > I > wonder if comparing tx_lnk_free_pkts to 0 was added intentionally? > This is > monotonously incremented counter so 0 is not significant, > unlike the diff. > Have I missed something? You are... While you're > correct about the original code, your quote is somewhat incomplete. + > if ( (isSta == true) && (i == wlvifSta->sta.hlid) && > (test_bit(WLVIF_FLAG_STA_AUTHORIZED, &wlvifSta->flags)) && > (status->counters.tx_lnk_free_pkts[i] > 0) ) ... + } + if ( (isAp == > true) && (test_bit(i, &wlvifAp->ap.sta_hlid_map[0])) && > (test_bit(WLVIF_FLAG_AP_STARTED, &wlvifAp->flags)) && > (wlvifAp->inconn_count == 0) && (status->counters.tx_lnk_free_pkts[i] > > 0) ) ... + } } Sorry, considered only the diff with base branch, not the original patch. > Note that both of these if() conditions can only be executed if the > final condition in each is true. Both check for the same thing, which > is: status->counters.tx_lnk_free_pkts[i] > 0 In my patch, > tx_lnk_free_pkts is status->counters.tx_lnk_free_pkts. Therefore, > there is no point in evaluating either of these excessively long if() > conditions in the original code when tx_lnk_free_pkts is less than > zero or zero - and thus the logic between TI's original patch and my > change is preserved. Whether that condition in the original patch is > correct or not is the subject of that FIXME comment - I believe TI's > code is incorrect, since it is possible that tx_lnk_free_pkts, which > is a u8 that is incremented by the number of free packets, will hit > zero at some point just as a matter of one extra packet being freed > when the counter was 255. Moving it out of those two if() statements > makes the issue very obvious. It would be nice to get a view from TI > on whether the original patch is actually correct in this regard. I > believe TI's original patch is buggy. After consulting with the author I do not believe it is buggy. It was the most painless way to prevent issues with the recovery flow. Indeed there will be case where tx_lnk_free_pkts is 0 again in which case the internal counters will not be updated. This was considered OK as this is usually a transient state and the counter will advance eventually. For the unlikely case where FW crashed just after update was skipped, well, there will be a small rollback in the PN after recovery which means a few frames will get lost. This as considered acceptable. Michael.