From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 66789143866 for ; Thu, 16 May 2024 10:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856874; cv=none; b=XEYoW7U8FWmzMiUYKnlvpJvmMXeIHt86TYHvINLNcmxt1Le2oKRKNPxvYW2e0gax2ThS6NsHGHNQJfXYDwuchEZkYTs1MfezXQN+CNATmG4vko4gu6VE5P6YpIgnA6sxN9HGE7ayPYIAcTbHj4PqxLxWVcsl3Qz6cgqjgfJj/Zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715856874; c=relaxed/simple; bh=KB7aQa0qPLpm/ipJghgAyXGc5vPajqhLx8AYm2h8xVo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SbLBtlfec0yMqqoLxkH7zEcvdOzNdhpjsM94vOfSIEwTtfzJwJZ9h0hQGJHbCpsH1yy+Cc6zEO5vDbgk+Tn42Iklb9NfIR0i19cnU0HmjWKwccdIfKiOA3XtiJmtV46KMZVX3j/pDQwtkhsacpMBXQ/sTpMCT/fj4Fo4mTkVTPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Zg+J7Va2; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Zg+J7Va2" X-Envelope-To: mrgolin@amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715856870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OhFx0oe4UpQvXuexQMyN+dtK1sbXdGKKqtWMOERWqJk=; b=Zg+J7Va2OfJJEJTc3W+swo53qgj+DvxH7mqDxzEiRJX2NcfyLtPxaN85q9QI1dQaOjELIc IayPe56FZRGvEenFN21YCEFBVcZpwA0WdiHxQy8OwcqhU0A9/o7z/Loy3Rf5BjUTV9uJxP 5tcpyzmSxCzJRgHxN7XynEYfkyKYczA= X-Envelope-To: jgg@nvidia.com X-Envelope-To: leon@kernel.org X-Envelope-To: linux-rdma@vger.kernel.org X-Envelope-To: sleybo@amazon.com X-Envelope-To: matua@amazon.com X-Envelope-To: firasj@amazon.com X-Envelope-To: yehuday@amazon.com Message-ID: <5f2f0165-c148-4bba-8af9-ded7665ba373@linux.dev> Date: Thu, 16 May 2024 13:54:26 +0300 Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH for-next] RDMA/efa: Properly handle unexpected AQ completions To: Michael Margolin , jgg@nvidia.com, leon@kernel.org, linux-rdma@vger.kernel.org Cc: sleybo@amazon.com, matua@amazon.com, Firas Jahjah , Yehuda Yitschak References: <20240513064630.6247-1-mrgolin@amazon.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Gal Pressman Content-Language: en-US In-Reply-To: <20240513064630.6247-1-mrgolin@amazon.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 13/05/2024 9:46, Michael Margolin wrote: > Do not try to handle admin command completion if it has an unexpected > command id and print a relevant error message. > > Reviewed-by: Firas Jahjah > Reviewed-by: Yehuda Yitschak > Signed-off-by: Michael Margolin > --- > static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq) > { > struct efa_admin_acq_entry *cqe; > u16 queue_size_mask; > - u16 comp_num = 0; > + u16 comp_cmds = 0; > u8 phase; > + int err; > u16 ci; > > queue_size_mask = aq->depth - 1; > @@ -453,10 +456,12 @@ static void efa_com_handle_admin_completion(struct efa_com_admin_queue *aq) > * phase bit was validated > */ > dma_rmb(); > - efa_com_handle_single_admin_completion(aq, cqe); > + err = efa_com_handle_single_admin_completion(aq, cqe); > + if (!err) > + comp_cmds++; I would count the unexpected completions as well. Regardless, I would definitely add a counter to track these (hopefully) rare cases. Whatever you decide: Reviewed-by: Gal Pressman