Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 30AB311C8B for ; Mon, 10 Jul 2023 18:04:10 +0000 (UTC) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57C618D for ; Mon, 10 Jul 2023 11:04:06 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-766fd5f9536so336619885a.3 for ; Mon, 10 Jul 2023 11:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1689012246; x=1691604246; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BT8anRcoBomkCL3eLhDuSMG7VrJUf8etAybJpx2cUmQ=; b=P3qkNZJyr3B9iPQ6tzo+Oph7KFNgQR48WP4GUaBG7LO2uQevnfZqahEoF65sPAugnn MNhWEMJae9jMmX7YMUOhnYiRDETA0ZxJsxaJ3VfekaJodPQ0XE7/CMmAauDvYrE75B7W e6Reiouu8KjXUJZm8YbqiHVuOqgKFmIz9g/N3BOq4+MfXFB+VobVN9UMSj1yq/bM+FvH 2vmlEzf/kW7afVr8b6ghNyN0dOyVHo4CIbT0AOP08KVkn04tBq6MnrtyGey8uRxlttek mfECNBxhrEl971vEGY6ftU/fY4U3a2UcgpcCRczCcddHUAy7XCE4ihu65DPMtVkNd2IB CQBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689012246; x=1691604246; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BT8anRcoBomkCL3eLhDuSMG7VrJUf8etAybJpx2cUmQ=; b=l/yXhS1Gi8oWAwKIUEr1wpieZOn7XAq1vGstKtP1zF5NehyM4Q8nBp/+1Ra+i+0dlk 6Eavm0blPtYXvI5z7YNI1Mla3gp6CEWTmPRxrIw9UwdNdNGDh5jPezGi4yRFT3lx/i4a JEePo4q0KLZFicTm4PbVOyKtJ6WQGOv00zdsCK78p3kDSxIzEZUZC+FEPYw+4TUC8PT9 reaBhcJm5c/4FQ5tRdReA0mSejQOSekBkRqNwoRqAhNMx/MRPyUL8SexGeD2HEX0JE2O rZ2bGD5/XZGlVxm1/d5ILGK5nCkqDNRKwzEa21zFHGMjr5WIShxqsXWjpLECBvHwZkpn O5qQ== X-Gm-Message-State: ABy/qLZQDEYLQdvGd643/Q3SqqPntPdPCw8z+dHzx+APD7TUNz/LA1Ae ZZLTfwn92grSxmiZWuqKDq9P+w== X-Google-Smtp-Source: APBJJlEkdizBr7UJSHKmwk1Pw53s9bGXZHen90PgCZoTRA4bGUaUV/2iylwD9yRi/UQu94OEzqbZDw== X-Received: by 2002:a0c:e108:0:b0:628:6879:ee48 with SMTP id w8-20020a0ce108000000b006286879ee48mr11363899qvk.50.1689012246035; Mon, 10 Jul 2023 11:04:06 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-25-194.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.25.194]) by smtp.gmail.com with ESMTPSA id r17-20020a0c8b91000000b006360931c12fsm65717qva.96.2023.07.10.11.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 11:04:05 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qIvEy-0004U3-Vv; Mon, 10 Jul 2023 15:04:04 -0300 Date: Mon, 10 Jul 2023 15:04:04 -0300 From: Jason Gunthorpe To: Haiyang Zhang Cc: Alexander Lobakin , Souradeep Chakrabarti , souradeep chakrabarti , KY Srinivasan , "wei.liu@kernel.org" , Dexuan Cui , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , Long Li , Ajay Sharma , "leon@kernel.org" , "cai.huoqing@linux.dev" , "ssengar@linux.microsoft.com" , "vkuznets@redhat.com" , "tglx@linutronix.de" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [EXTERNAL] Re: [PATCH V4 net] net: mana: Fix MANA VF unload when host is unresponsive Message-ID: References: <1688374171-10534-1-git-send-email-schakrabarti@linux.microsoft.com> <83ef6401-8736-8416-c898-2fbbb786726e@intel.com> <7e316b51-be46-96db-84cb-addd28d90b0f@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Thu, Jul 06, 2023 at 01:54:35PM +0000, Haiyang Zhang wrote: > > This waiting loop is needed to let the pending Tx packets be sent. If > > they weren't sent in 1 second, it most likely makes no sense already > > whether they will be sent at all or not -- the destination host won't > > wait for them for so long. > > You say that it may happen only in case of HW issue. If so, I assume you > > need to fix it some way, e.g. do a HW reset or so? If so, why bother > > waiting for Tx completions if Tx is hung? You free all skbs later either > > way, so there are no leaks. > > At that point, we don't actually care if the pending packets are sent or not. > But if we free the queues too soon, and the HW is slow for unexpected > reasons, a delayed completion notice will DMA into the freed memory and > cause corruption. That's why we have a longer waiting time. Aieiiie that is a horrible HW design to not have a strong fence of DMA. "just wait and hope the HW doesn't UAF the kernel with DMA" is really awful. Jason