Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp411640pxv; Thu, 24 Jun 2021 10:35:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd7wPUAPh0IC07ikmOLr4Arv9/M93CvQgoLZrISc4n7gy0iipxcgXZLQOSINU3HGWfsGkC X-Received: by 2002:a17:907:9d1:: with SMTP id bx17mr6465964ejc.322.1624556108396; Thu, 24 Jun 2021 10:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624556108; cv=none; d=google.com; s=arc-20160816; b=zDQIU1ueHX7ggDkCNa3gWAvYxS5ss63ZErKdej/8TGKEEtN8Tg8JF2kHGfmZmt1MGP SLqMrllgk77aDBVG9d782+nHYRzsq7vnrtt5rjWLnZSuhwIxTb0EmNoA8zPtoDJNLqWi MLF9I/tqU3vqQPK4ujR0rb+uXZh7Cq4bwjr2lx1D65fMIGcbFOMoDkj38Scw0f9QlGEJ 1KbHTwrp7RoU2GOFDs17Ha6biF7Vfx5q16eDeDo+9p8Zzx/o04qM+s+uZnUL5rtQmEww Uqm5IjEO2qUWackkwxM8ph7Xi0ndJDZ89lU1UNPeiiZTDLuV9zp1LeW73zrqa1UEaC34 KAWA== 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 :ironport-sdr:ironport-sdr; bh=OcQu5wvyoeQyXGE9ivyaxI8dyasjxhMOi3N4+gnkG2c=; b=lHSfVSQWOP+EyCOd1m1FPiao4J5dzy9wieYwPonboFYdsTilYs2ur4TmxxXlmDxMH0 cgI+LfqUH/2LgmNhE7w7MYxO+QJNJmna3DEXjsTIGpAt6nHWDr/44vFfVYmH6IfKkTVK coLnM7TdhWLYTmBUG1gowsQgq5MgTe75kcZf+CduYGV3uqA80uR3H5LcEr/e1ULXvF2h cCrb60CZXNmaJ5DqKyVydrlUlUV7Oa6XBceec0jSVYJ17LUatzXFB3dK2Lv50qQ1Ac63 dm4PJjqm4LKRFv8fMC3iIoTOvprxAZreck7MRi+31euMm+NAVQjhZbb9B0l88PepG0Mv 3ugg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si3130695ejk.343.2021.06.24.10.34.43; Thu, 24 Jun 2021 10:35:08 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbhFXRfh (ORCPT + 99 others); Thu, 24 Jun 2021 13:35:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:50610 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhFXRfg (ORCPT ); Thu, 24 Jun 2021 13:35:36 -0400 IronPort-SDR: fRtc21APspthfnf+ujFHn+Z7r8s/hPFczoRqrRYMbVKCqitlo5zmbwXv3weoMNyXC6BE/eK0Ri FyBJWdBdhulw== X-IronPort-AV: E=McAfee;i="6200,9189,10025"; a="205697915" X-IronPort-AV: E=Sophos;i="5.83,296,1616482800"; d="scan'208";a="205697915" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2021 10:33:17 -0700 IronPort-SDR: T6QP3XGN0GQuKz7CwDHdgLZdYc95SClxGqWxQZA7qhlHbbtFltF92CQTLciwnWNeGWyRBYphVO gmQpbDbrMwuA== X-IronPort-AV: E=Sophos;i="5.83,296,1616482800"; d="scan'208";a="455151445" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2021 10:33:17 -0700 Date: Thu, 24 Jun 2021 10:33:16 -0700 From: Ira Weiny To: Bernard Metzler Cc: Jason Gunthorpe , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Faisal Latif , Shiraz Saleem , Kamal Heib , linux-rdma , linux-kernel Subject: Re: [PATCH V3] RDMA/siw: Convert siw_tx_hdt() to kmap_local_page() Message-ID: <20210624173316.GA2799309@iweiny-DESK2.sc.intel.com> References: <20210623221543.2799198-1-ira.weiny@intel.com> <20210622203432.2715659-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 03:45:55PM +0000, Bernard Metzler wrote: > > >@@ -593,7 +601,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, > >struct socket *s) > > } else { > > rv = kernel_sendmsg(s, &msg, iov, seg + 1, > > hdr_len + data_len + trl_len); > >- siw_unmap_pages(page_array, kmap_mask); > >+ siw_unmap_pages(iov, kmap_mask, seg+1); > > seg+1 is one to many, since the last segment references the iWarp > trailer (CRC). There are 2 reason for this multi-segment processing > in the transmit path. (1) efficiency and (2) MTU based packet framing. > The iov contains the complete iWarp frame with header, (potentially > multiple) data fragments, and the CRC. It gets pushed to TCP in one > go, praying for iWarp framing stays intact (which most time works). > So the code can collect data form multiple SGE's of a WRITE or > SEND and tries putting those into one frame, if MTU allows, and > adds header and trailer. > > The last segment (seg + 1) references the CRC, which is never kmap'ed. siw_unmap_pages() take a length and seg is the index... But ok so a further optimization... Fair enough. > > I'll try the code next days, but it looks good otherwise! I believe this will work though. Ira > Thanks very much! > > } > > if (rv < (int)hdr_len) { > > /* Not even complete hdr pushed or negative rv */ > >-- > >2.28.0.rc0.12.gb6a658bd00c9 > > > >