From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7502C2D0A3 for ; Sat, 24 Oct 2020 07:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA7FD20936 for ; Sat, 24 Oct 2020 07:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759883AbgJXHgZ (ORCPT ); Sat, 24 Oct 2020 03:36:25 -0400 Received: from verein.lst.de ([213.95.11.211]:57807 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759874AbgJXHgZ (ORCPT ); Sat, 24 Oct 2020 03:36:25 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id A6AAA68AFE; Sat, 24 Oct 2020 09:36:21 +0200 (CEST) Date: Sat, 24 Oct 2020 09:36:21 +0200 From: Christoph Hellwig To: Sagi Grimberg Cc: zhenwei pi , kbusch@kernel.org, hch@lst.de, axboe@fb.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] nvme-rdma: handle nvme completion data length Message-ID: <20201024073621.GA28151@lst.de> References: <20201023065910.1358586-1-pizhenwei@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 11:01:40AM -0700, Sagi Grimberg wrote: >> + /* received data length checking */ >> + if (unlikely(wc->byte_len < len)) { >> + /* zero bytes message could be ignored */ >> + if (!wc->byte_len) { >> + nvme_rdma_post_recv(queue, qe); >> + return; >> + } > > Nothing in the spec defines zero-length messages, hence we cannot > support something that is not standard. If your array needs this, > please submit a TPAR to the NVMe TWG. We'll still need sanity checking instead of the recount underflow, I think tearing down the connection here and kicking off error recovery is probably the best idea.