Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1232673pxu; Sat, 24 Oct 2020 04:44:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzTdZpDtTjaV0klEEjLAgSpKr5v1efGoSBcpGArXRbigxTmkjpBNSg0CkOsfUN9n73+oNz X-Received: by 2002:a17:906:1c0f:: with SMTP id k15mr6228204ejg.343.1603539866070; Sat, 24 Oct 2020 04:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603539866; cv=none; d=google.com; s=arc-20160816; b=uF/4bh1YI9AFmoarqMc2fWWeVu9/7kwiwN0zPgkVoK1RWE5oGUqrWoNcr0SFyG+tZQ v1zYLbJaXKLjVPOkIhmlahrtB8uZV83RrNXn2qFg2rogRlKGuzGXWT9z9VI72PZVXbEL IBt7x1erdlmH1BV+tCko/+QK1jvAnkPrE+c34HwuyoAfsjQkNcq19UFrggj7ZaMLllUs cMGfCH5nYLjPs2RaUsmGZvWdrWQyGuZwQlDgOwgUqnL9s5zuVOSNCwWEGsMcRVZdKR5S LXVF/M2y/w6cdknEAYzhvvWuF7Gw2d/+fZdIAI4pp1VB56baagz2K3YgjJYd0mkHRNTl e1lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Yaf4hp9BPKh1U43TdO5JWb8wLksG3zrb2CDhclhvvNM=; b=dVDl1Pu3xjqPXRueSy53eJjzvYNNfk51AvnKoyx/uLgOCXt1gMt/ALQohj0JDhFl7g +MjBwNCFtcybJeph/olO+9aldiTmFl0okwRLDwUPnR5IQgE+ZJNF3dFh9Uc4zFleKaig BIZAjBPurgzIiYpEmOZpdwj3MtPERHusYW7/Dih1aCjZx+0P6KJhG1po5yU2evrpV8bW nJMiJhRIoDhW/irwZC1WIjf7ajtblJw1FSyW+oWh7OS68KKOAzyqahTWdwziVuKcZmyc 10DLAh3ytPEE14NxNnwCFvfr427lp60KY1zCiVs3iNQEqZ0r6e8LzEKctB84KCyhw2s2 nSYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si357947edr.36.2020.10.24.04.44.04; Sat, 24 Oct 2020 04:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759879AbgJXHgZ (ORCPT + 99 others); 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.