Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1129339pxk; Fri, 2 Oct 2020 01:33:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygtQ5xYjNkKpT8m+Yz1WwJB4CwWsC64yvICkT5ts0Dp3VxeB9qmCAa8yh9nx++y6gI9YaY X-Received: by 2002:a17:906:e216:: with SMTP id gf22mr1143142ejb.2.1601627599435; Fri, 02 Oct 2020 01:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601627599; cv=none; d=google.com; s=arc-20160816; b=vFFyGLHZbL+5rADS+B5YsaSaC7IVzfc5i7wzhK3Xk2n7JmjXEmOfYWHMyHk1EYq+l4 t2+J1iil6aVP5gFFNe0XXgdMkzzwsRo3UzTn1qhMkt3084Aj7hLcld13qwdYBBJis2la 5VMMF1834iMUfqRBP2RrmDlEliNjVW4HtEbRyrxHQZ6bXMBV8v1jB+4VmAdv/P0x3AGZ 4YWPfzOH6sI/vSEJNDYff7Nuw24Xk3uBCiT+Rq3eRCsu5zO1ZbKhGgEwqOVrnxK7o1hh yuOm73BQ+83cbC4Bv2gqG8lVZFURlWE5vd/DB/kyEWUHhlRbtoZVi2E3j15pv26gDVn8 pqhg== 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=EiMJAR8FkprhXpGpK173nTDW5MokIg6PAPOR2nQMaWI=; b=M3hQi8r/W9wFEYb4Js0Y3CSPYAf/s/SjNXts+oN8nRKC5kd58IiMgmD+SNMXcrz4y5 QV89F3mzDYIOwlM/pOvUiBmUC/HFT+4DDu0R6oqP+X/8YLhMiLUxJfLtdqlVvww2Ezij 7sCUAVJDPd8SPzDszFNQcma3VOb5CnRHRj3DncIJUkpBaqIsDnYfwsL7vO2Vd7J2H4wf TYaGCf8iMM4p5hlXsWVu1opjM6QqjFqOw7wCilFmQi47HLY5b20rqj95iJtcwhHwyClS aHruMEysqILcg4G3H7H7nKpF30dJez422IaZHlFWE1/H1EIsfOJxicfqV/aM3Lo1tNWM Du+g== 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 l10si529646edn.260.2020.10.02.01.32.56; Fri, 02 Oct 2020 01:33:19 -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 S2387778AbgJBI2y (ORCPT + 99 others); Fri, 2 Oct 2020 04:28:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:50386 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387739AbgJBI2g (ORCPT ); Fri, 2 Oct 2020 04:28:36 -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 E8BF0AF1A; Fri, 2 Oct 2020 08:28:34 +0000 (UTC) From: Coly Li To: davem@davemloft.net, 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 , Lee Duncan , "Martin K . Petersen" , Vasily Averin , Cong Wang , Mike Christie , Chris Leech , Christoph Hellwig , Hannes Reinecke Subject: [PATCH v10 6/7] scsi: libiscsi: use sendpage_ok() in iscsi_tcp_segment_map() Date: Fri, 2 Oct 2020 16:27:33 +0800 Message-Id: <20201002082734.13925-7-colyli@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002082734.13925-1-colyli@suse.de> References: <20201002082734.13925-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 Reviewed-by: Lee Duncan Acked-by: Martin K. Petersen Cc: Vasily Averin Cc: Cong Wang Cc: Mike Christie 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