Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1174573pxk; Fri, 25 Sep 2020 08:04:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpt5BiMnl50X64VYvGGfngRMIvpgImZUYvHXBaKqQ7xC4aendlRqnp+jYEkN1SMsLE2XDt X-Received: by 2002:a17:906:fb15:: with SMTP id lz21mr3067347ejb.185.1601046246340; Fri, 25 Sep 2020 08:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601046246; cv=none; d=google.com; s=arc-20160816; b=WyH9Bk1HKr2XIuxPlSmSd3IzZuP7i3heu38FR66L6yZDSwUIQxroFCrlaWcCKk+BzX F6YzRiWr6GbRjSoVLays4vRkMGQYjulGkW3SGvU/fkaAdscVynus9J+T9Z66tTI1j4Wa gC2PX5AMpuwsTe+0SR6HzgSPn1cgW4uk0UaKXN+5fKF0s0Kf9aDsKFZ+glWrsScapYuD MMK1yvYnCINQc6fhMma3AqWAG6QhNk0pJpDPD5lkVbmDqVl2o2feRJqItzMowLl4OdrQ aWyl7MbMr2+Mtz5/9fUd/Qd2MIQf663/3Vve1G31LQOiD7TruWO8o74e/J1RR09lTeS9 5vjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=M4fA2b9bJjB8M8DBgl/Jx+q9b/T5uuCWTyeE6GhZSEM=; b=cXUouuHJlgscjrBOqkwxCmJD8RK/loUzL/Lh/4fwW7pVtfADnm+KYBd+3WxvQKBL3I c8nUCGiDUtzpJJlimI8E4Ui0QVIridgqSbvm+/G5a2BTCC4JRo71yOzShIUhvi0EJMPr FYP9bI+eJilbVSxPOOTN+yn5HHDLhuEsNGyHG9KJumP8prgOR3fnwMycJC92/SHAHLGC GsPVvTbUrpmWN2R4qJCGcc9ERQSZ24cTmwfWHM48L64JeO4digXWGVDBt6JeNjS078dc LvWzOvRvPh44Asdr6J+eWMrTQ5rh0yGOJ9SBQ2Pvih+cjRDDED5QIoqdAGrXj+dt/Nib 4wFQ== 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 d10si2062989edp.364.2020.09.25.08.03.42; Fri, 25 Sep 2020 08:04:06 -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 S1729476AbgIYPCR (ORCPT + 99 others); Fri, 25 Sep 2020 11:02:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:34644 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729457AbgIYPCP (ORCPT ); Fri, 25 Sep 2020 11:02:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 532C7B011; Fri, 25 Sep 2020 15:02:13 +0000 (UTC) From: Coly Li To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, ceph-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Coly Li , Vasily Averin , Cong Wang , Mike Christie , Lee Duncan , Chris Leech , Christoph Hellwig , Hannes Reinecke Subject: [PATCH v8 6/7] scsi: libiscsi: use sendpage_ok() in iscsi_tcp_segment_map() Date: Fri, 25 Sep 2020 23:01:18 +0800 Message-Id: <20200925150119.112016-7-colyli@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200925150119.112016-1-colyli@suse.de> References: <20200925150119.112016-1-colyli@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In iscsci driver, iscsi_tcp_segment_map() uses the following code to check whether the page should or not be handled by sendpage: if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg))) The "page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg)" part is to make sure the page can be sent to network layer's zero copy path. This part is exactly what sendpage_ok() does. This patch uses use sendpage_ok() in iscsi_tcp_segment_map() to replace the original open coded checks. Signed-off-by: Coly Li Cc: Vasily Averin Cc: Cong Wang Cc: Mike Christie Cc: Lee Duncan Cc: Chris Leech Cc: Christoph Hellwig Cc: Hannes Reinecke --- drivers/scsi/libiscsi_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index 37e5d4e48c2f..83f14b2c8804 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c @@ -128,7 +128,7 @@ static void iscsi_tcp_segment_map(struct iscsi_segment *segment, int recv) * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg))) + if (!recv && sendpage_ok(sg_page(sg))) return; if (recv) { -- 2.26.2