Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5153785pxb; Mon, 15 Feb 2021 10:56:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKPw7Epq5pIgauilFvxo5Z04gy2X5ZODYMsMccivt2sWmFejnNoVZ6kTd24lMuK+cv/Dxq X-Received: by 2002:a05:6402:c04:: with SMTP id co4mr3602131edb.224.1613415397451; Mon, 15 Feb 2021 10:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613415397; cv=none; d=google.com; s=arc-20160816; b=kBx0UfNcN2oOJkPdtDO+rzyES+M5Rj/LbWRM+LqWupkR2SOBvIc4g3PsrZ/lhbjCGT 2emwOmzlupgs1Z3LanIVS2CqAH2TxcDjo6wBtge/ZYPMddVyLbbNeDqsX16XvbawTey0 FGIyhBSljbHt6Rkk/QgvB42kFcQ1RAsJA1hblQFtkZFo/HAunRu5QmbiLNY9rHhDOTO8 FB5fIYZU8qt/cLLqOLjrO08Yd8z7bdNvYz09YEr3fUXHUwPAf0Al+b8ThWqOGwWA33UQ ZDEuTx37ohxQ+8nsF8cO0p2OJNW31KcwIUkKKFKT/BqV5cfADfg6H2uKBwsSUb0eFcsz PEaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6pKfCDiI9U4YcduWPEG9PvXXoUOIWScDef+xqfqmvzI=; b=Jnk+nR6i+H1r/WagvR3yfOVqOpzb2oCTBJy+OdsaTCR24ugmiRPIehRiC+e1wvAESF aXW8WaCE+VSHBHicGH2Tg7+j1+fT4mcRU7xUAKHRoef04L9zLhMJNQgS1lGiOEh1UTj0 lsEtRHSFatK7oabsLPaHtJReU4lompigyx7/QoRZTmTgHX3SKqmA09sfJcWhRSTzQgEa TMSpbf5ZOgb32Q2o/ZTYyUq1s2R80vDvXD1ioVltg4ZoqoiDQWIiMVzuchHeO+w449fc wgxEaZ2KgmITTkTqTSoR1gseVlbdZpmG4Y9fN3I8uCx/WTlx/GMnmC4w4FUXXdiogXiN kUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tppWbswE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc41si12225279ejc.381.2021.02.15.10.56.13; Mon, 15 Feb 2021 10:56:37 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tppWbswE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbhBOSz1 (ORCPT + 99 others); Mon, 15 Feb 2021 13:55:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbhBOSzZ (ORCPT ); Mon, 15 Feb 2021 13:55:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8153B64E31; Mon, 15 Feb 2021 18:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613415284; bh=eo/4Fc82BsHSHFe3I6vwWIYa3nQLkkClzzx7vCGgZSs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tppWbswEkgV5Gzo7DB2+3AcEp7Rpd4v5bXyMABw+pmjdDBRMmOaHZvNXGXtL63n2C CMLKP+DMLzr77zDre3x48Io3F3dJnnxh9Fz0cgxtHQ+So+G1UxYqrqBdnp98H8AWAN ZUd86V93kIMOao6HixmADZrToW9RzzdSOTEF8ijCmNQRb6Kv63CswhjkflcKqFn7OL 122qQ5XptSMCcjk0317K1EUcgbT1Uy1c/KGqCTnGTiJsIlM48zd3cF3v7lWovv16Lh exqkxmwWEALFOP/6K8sejW9rlqDZTP3hajPhISc/n6CuJy7oiTaZANQwJ5BlWEJGlm pEbr1A90Dnt2A== Date: Mon, 15 Feb 2021 20:54:40 +0200 From: Leon Romanovsky To: Xie He Cc: "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML , Martin Schiller , Krzysztof Halasa Subject: Re: [PATCH net-next RFC v3] net: hdlc_x25: Queue outgoing LAPB frames Message-ID: References: <20210215072703.43952-1-xie.he.0141@gmail.com> 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 Mon, Feb 15, 2021 at 09:23:32AM -0800, Xie He wrote: > On Mon, Feb 15, 2021 at 1:25 AM Leon Romanovsky wrote: > > > > > + /* When transmitting data: > > > + * first we'll remove a pseudo header of 1 byte, > > > + * then the LAPB module will prepend an LAPB header of at most 3 bytes. > > > + */ > > > + dev->needed_headroom = 3 - 1; > > > > 3 - 1 = 2 > > > > Thanks > > Actually this is intentional. It makes the numbers more meaningful. > > The compiler should automatically generate the "2" so there would be > no runtime penalty. If you want it intentional, write it in the comment. /* When transmitting data, we will need extra 2 bytes headroom, * which are 3 bytes of LAPB header minus one byte of pseudo header. */ dev->needed_headroom = 2;