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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 85D17C433E2 for ; Mon, 14 Sep 2020 06:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CB7820756 for ; Mon, 14 Sep 2020 06:19:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m5zMQqKA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbgINGTH (ORCPT ); Mon, 14 Sep 2020 02:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgINGTB (ORCPT ); Mon, 14 Sep 2020 02:19:01 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423FCC06174A; Sun, 13 Sep 2020 23:18:57 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id o16so4919078pjr.2; Sun, 13 Sep 2020 23:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MYPgJwOB3wumsWdm8PpM5P24nVAroSIX0XmTHErtiN8=; b=m5zMQqKAG7mE5eqF77oB/b+ELIhxJkB11rPryu9vgZLGbo7a1hjoJPuvEC46eeAbUb TvORpGMCWlzy78ABjT1P8r37FE7fDcjlIRp3EyDUNtuk5fq/U/c5lbVDOdA3NK5Y4ucD 65f+xAFfoO4sbKoTuikmMNgGMxj8FKtoa05l7gyBS0KQAsW8rZNwELD7uyMW930xwSxK BxSt1RQ2vNiQQcwlMGr2Iobk1FBirbaqaHv0GuZDKwIX23s3o0S/twXEw5hVBrPtiYAT +1WX+naMwoWrE14C5dLRsD/N9Grk/QAgGFYLVdND9VyqROiLmtEwI8VAzWJZKWOU0F7z Ts2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MYPgJwOB3wumsWdm8PpM5P24nVAroSIX0XmTHErtiN8=; b=Qmzyo6JXLg3JG/I3niXWVkxEfsqVyLJ1F1ODNs24vDEM2mUu6+PZzNpVe53dQ1FbGZ 5FPEeWDN+uJ1vU3rHv0KnDgsTP6+OQ918JTpgFJW8d8tnEOM9nbauzgiuPbb3GL5o3ax v1oeIU8aqOYkJhfHm0BZW6M2lcI4zjfWlIl6hMK0AjweHapn1O29edexo7OHYiMT8eIy Qmk7cRxGtRDcMZPCv9u7iwUdbRRVeLGHp3VdpL9cYU5fsbu6tbjwysTzL44vdW+zbFSl K2sVuaWsOsN+j3MsaEuUVQxvDzWhLKamwu+l26NguCXeFx2mB/6K7YOdDKcXz6tk1Xyf V+hg== X-Gm-Message-State: AOAM533KL5atjmgZiPpCE617PLQ7XXB6tLNUXO8aeIuOJL9CeSaxCMvL kYO5hdfp67cTJOBDBuFshdHQA2C5X1nzf1Bf6lKjhoPk X-Google-Smtp-Source: ABdhPJyEN20m5tXqOxy4gIhmp00NE75m2DyLIIl8otL6PZ8wLltOCahP2WCtfHH9VdmpvmESJEu6iu48pwOkmLq1X8I= X-Received: by 2002:a17:90b:816:: with SMTP id bk22mr12784047pjb.66.1600064336828; Sun, 13 Sep 2020 23:18:56 -0700 (PDT) MIME-Version: 1.0 References: <20200903000658.89944-1-xie.he.0141@gmail.com> <20200904151441.27c97d80@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: From: Xie He Date: Sun, 13 Sep 2020 23:18:46 -0700 Message-ID: Subject: Re: [PATCH net v2] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices To: =?UTF-8?Q?Krzysztof_Ha=C5=82asa?= Cc: Jakub Kicinski , Krzysztof Halasa , "David S. Miller" , Linux Kernel Network Developers , LKML , Martin Schiller , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 13, 2020 at 10:26 PM Krzysztof Ha=C5=82asa wr= ote: > > Xie He writes: > > > The HDLC device is not actually prepending any header when it is used > > with this driver. When the PVC device has prepended its header and > > handed over the skb to the HDLC device, the HDLC device just hands it > > over to the hardware driver for transmission without prepending any > > header. > > That's correct. IIRC: > - Cisco and PPP modes add 4 bytes > - Frame Relay adds 4 (specific protocols - mostly IPv4) or 10 (general > case) bytes. There is that pvcX->hdlcX transition which adds nothing > (the header is already in place when the packet leaves pvcX device). > - Raw mode adds nothing (IPv4 only, though it could be modified for > both IPv4/v6 easily) > - Ethernet (hdlc_raw_eth.c) adds normal Ethernet header. Thank you for the nice summary! I just realized that we can indeed support both IPv4/v6 in hdlc_raw. Both IPv4 and v6 packets have a version field in the header, so we can use it to distinguish v4 and v6 packets on receiving. We can introduce it as a new feature some time.