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=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 A090BC11F68 for ; Wed, 30 Jun 2021 06:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8369961D0B for ; Wed, 30 Jun 2021 06:29:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbhF3GcZ (ORCPT ); Wed, 30 Jun 2021 02:32:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:43126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbhF3GcX (ORCPT ); Wed, 30 Jun 2021 02:32:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B354861459; Wed, 30 Jun 2021 06:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625034595; bh=7okMDfPJvuf4xALqZkt0/Ib+PKZ5zUye1p/vGQTvVzY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MDkWhrgCWo/ElLUGgWRWMpMXvIfkWj01IYdHjO0pPaK/yhIFDyycPXCKGNOlypeoI 9sJaRM5xXvo+YQa22zCNFkNIveI1XJkTI7RkKlVT53DpcyAZClZ1FzptULpBoHIzCO uidzhZM3ak/r/9PT/DuHXQjfvQyO+ZqEaP0wFJh4WDTaf4bKan9Afw+0u4c+WplSh6 un0LYGX82NAZUyzbqwUw7dPYWWR/Ymy5JN33IGpL4NU6HLbarcHmAcCcZCTN7GMleK YEV8ir0DA7sGyOKkk1QmKgHehHHsaavj/lcjeRuFvkJaTrGN0PvJhQKftdQUG4a2Uc XPKSd1/SfNfQA== Date: Wed, 30 Jun 2021 09:29:51 +0300 From: Leon Romanovsky To: Christoph Hellwig Cc: Doug Ledford , Jason Gunthorpe , Maor Gottlieb , Dennis Dalessandro , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Mike Marciniszyn , Yishai Hadas , Zhu Yanjun Subject: Re: [PATCH rdma-next v1 1/2] lib/scatterlist: Fix wrong update of orig_nents Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 06:59:11AM +0100, Christoph Hellwig wrote: > On Tue, Jun 29, 2021 at 11:40:01AM +0300, Leon Romanovsky wrote: > > 2. Add a new field total_nents to reflect the total number of entries > > in the table. This is required for the release flow (sg_free_table). > > This filed should be used internally only by scatterlist. > > No, please don't bloat the common structure. Somehow we need to store that total_nents value and our internal proposal was to wrap sg_table with another private structure that is visible in lib/scatterlist.c only. Something like that: struct sg_table_private { struct sg_table table; unsigned int total_nents; }; But it looks awkward. > > > + /* The fields below should be used internally only by > > + * scatterlist implementation. > > + */ > > And this is not the way kernel comments work. It is netdev style. Thanks