From nobody Mon Mar 20 16:08:49 2023 X-Original-To: freebsd-wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PgKRP1nZ4z3yvBL for ; Mon, 20 Mar 2023 16:08:49 +0000 (UTC) (envelope-from misha@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PgKRP1MmYz41R5 for ; Mon, 20 Mar 2023 16:08:49 +0000 (UTC) (envelope-from misha@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679328529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=vTM/tA+YcjeHScirzEYJVrPrAzTPg8WY230tIuCxscA=; b=TuiJQl/MiKtmOVyPzFfB9dPfsGsELaSjxkgzkLHSMkB/aw33wa05xAMkUZuuF+XBKolSXT 8b8Thf1hdShGnQr0G4euIb6ttIEAFyld7X0jtRZ+IbOi+VNEQFcabjE1AQ2QgZPsV7Vghz J5mzA7EtVI6ghXGzBjLFvEzZc9TEjagONWVVmdrprea7k7F9/V6H5ts+9YBWOfCVi0fx/5 /geWYwfmsjRwu96/vZp8St5sSscBcaJ7fNBb8lmaax1Jhu/nIerAdzL/0+TY/naLa3drFx u+hkzrvHikc4+6ekuim4iyIK83INZUf8eQuCq3jIhzg8a6V2dP9oFDoP/K2Jbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679328529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=vTM/tA+YcjeHScirzEYJVrPrAzTPg8WY230tIuCxscA=; b=on73j+3gpbRLTkf7QAYfI78DimNE7/fJQXHu5iwLOgtq0sLMUSIirgaa+twqESYogsOI2Q Q08cKn5mietv0kIXugDOvppnwEAD49uFQU5Y7y9hP5cR9qFKFMiuJbH9fJD+8Ak7pPvC2+ ykGf1ApH+u5LrJTMs5/X7QDV8y0S+L17XytX7HCdwB2yWnCU+JGQqoXn0SLVPlJ9xu97ib vXU/kvalmMChdd2f6TFmhvX+yx2pjKr5O6duVEZQ5hLv984EtNccj6O5DVy/bmHF613gnF SkZR3QnFJNwI9izmxLBde0kwt/ZDf0NiITFgRqx5qqTxxbNXU9sDUasB236tqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679328529; a=rsa-sha256; cv=none; b=uE0aDGCCnmt9NqB7PrJAu/+jdwAGxmQ7eYLCTYSmY9kpEeaf3LO3Lxi9rOQ9U8LoB2ITqs 6e4nQagw0icNRKZNUJu9OpSqtX/bqUphh0tS9wtRMx9nL4s6tFgiFKv4zBw0yRjMAhaUyQ Kw+q20P2f+E+1/Df7Q1/4lteOSi7xq7l1I4py0C6YqY94xqAFWfHmbLldDYch8TY6nH8fb KY8J2dVmVEgdAvp9St5sNqlTVrL2LKAvsVJrr0afUShZzegblW7N2CkOXWO/8WFRap7ynp vzE0XOx8amx5h2JaTAamJPmyTRlzDg/kTJS/HHze1PddG0ae2TW6vnYfJVfh/A== Received: by freefall.freebsd.org (Postfix, from userid 1401) id 1D33111B2; Mon, 20 Mar 2023 16:08:49 +0000 (UTC) Date: Mon, 20 Mar 2023 19:08:49 +0300 From: Mikhail Pchelin To: freebsd-wireless@freebsd.org Subject: 802.11n support for iwm(4): problem with separate BA task Message-ID: List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-ThisMailContainsUnwantedMimeParts: N I'm working on adding 802.11n support for iwm(4), currently AMPDU Rx and MCS0-15 are working, results are the following: https://people.freebsd.org/~misha/iwm1.jpeg While hardware interaction works fine, I found it problematic to handle reboots. My code is based on OpenBSD patch[1], and as in the patch I use separate task for ADDBA/DELBA handling. Every time I get those frames I enqueue a task to synchronously handle it within firmware. The problem is that when I do a reboot I get a panic - I receive a DELBA request, enqueue a task to handle it, but when the code finally firing the iwm_node is already 0xdeadc0de'd. I've tried checking for IWM_FLAG_STOPPED flag, canceling the task in ANY->INIT state transition and in vap_delete method, but still get the panic. I've taken a look at iwn(4) driver and how it handles ADDBA/DELBA - and it handles it in async manner, meaning that we just send needed commands to the hardware and don't check the answer. Is iwn(4) way of doing thing is the right way to do it? Or maybe someone can prompt me how to properly handle DELBA request in sync mode? [1] - https://github.com/openbsd/src/commit/d1ea7b2160ed2eb0df49e1e2db31cabcceb666cb