From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 665433B2A4 for ; Fri, 3 Jul 2020 23:24:47 -0400 (EDT) Received: by mail-pf1-x444.google.com with SMTP id s26so1028496pfm.4 for ; Fri, 03 Jul 2020 20:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5mjtDkLPbbWqz1WxWI3jz9F4TwIMnJE4lHWgCmjcrT8=; b=nwHd6oTzcZMCVUpmO+3djqT5VfjpG88BpEeYSXy1zd+7ldo5YYdTRXoKWuZQpwNiwb DHh+v4V4JT15uxorZFJ+matMI4Lmo3Aqn407PtlLvx5rPQsawEo7lYwcZ8Fkxy286yKC RBjqOYDMqj+1UaA6FhsTrPs0i7wfIJ8uG/8MuoNhNkIITYdAl1URdgCPrNxvY7oY4a7c nvP4g9nAS13K6RjtoDXHfUmsxdU0wmseyyXGhdmmCg8G334gq0y/kJi8kN/nP1grbKQN enHw9qM6WZBM/+z4H1NUNHUjNakAkThkvsIeW69F/mtJx67Y2oLb6ar+2H1SsIo3Z2kw 6mNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5mjtDkLPbbWqz1WxWI3jz9F4TwIMnJE4lHWgCmjcrT8=; b=ZGIV0wTgI5CjKOe7mOpZPHlx+dpbG96/LNUJ4MAEPTU8qPVCSmW83N/Zze9P7I5hFf Xxg3dgvwqVa6fh3ywqeGB4BnAEREtMJ9P1OKEo1VaGLDBtx7nwO8V2rP1N8QVRHXdkRD wu8ueOs5EEOKK37X1nyDDANB3lMIP504ICtFuBl8ZwPDy0rvgAlA1zAbbjBMaZ4uNHVg PESg1Oj29C7LgCoYiXn4LrWDx8okEn4EZ/44P1C27L2E32s7+qFwuIhaNtG+h1Oe+E+a cJgWwzLUKeZkdDKj+0HSzfoTNBcKSR+UrDTuZUqKuyLnNt6yUlTAzam7ZC9aF5IS6cg8 HvGw== X-Gm-Message-State: AOAM531PNo2JF8OlNT3HNS2AN+oPnq2UCeGbPGouBm7pnYfyGqI3/PW8 ww8wG3qzGaexaKZ7m5vQoGo= X-Google-Smtp-Source: ABdhPJyxeU4S+oHmZU8ojh+tfKt8pancEU7IwdoBsEHkLyX0q/GWjEylWDF1ceooCk04EEgYVlhsQQ== X-Received: by 2002:a63:4144:: with SMTP id o65mr31231619pga.8.1593833086574; Fri, 03 Jul 2020 20:24:46 -0700 (PDT) Received: from [192.168.1.18] (i223-218-245-204.s42.a013.ap.plala.or.jp. [223.218.245.204]) by smtp.googlemail.com with ESMTPSA id l22sm11744906pjq.20.2020.07.03.20.24.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 20:24:45 -0700 (PDT) To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= Cc: davem@davemloft.net, netdev@vger.kernel.org, bpf@vger.kernel.org, cake@lists.bufferbloat.net, Davide Caratti , Jiri Pirko , Jamal Hadi Salim , Cong Wang , Roman Mashak , Lawrence Brakmo , Ilya Ponetayev References: <20200703202643.12919-1-toke@redhat.com> From: Toshiaki Makita Message-ID: Date: Sat, 4 Jul 2020 12:24:41 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200703202643.12919-1-toke@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 04 Jul 2020 06:33:14 -0400 Subject: Re: [Cake] [PATCH net v3] sched: consistently handle layer3 header accesses in the presence of VLANs X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2020 03:24:47 -0000 On 2020/07/04 5:26, Toke Høiland-Jørgensen wrote: ... > +/* A getter for the SKB protocol field which will handle VLAN tags consistently > + * whether VLAN acceleration is enabled or not. > + */ > +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan) > +{ > + unsigned int offset = skb_mac_offset(skb) + sizeof(struct ethhdr); > + __be16 proto = skb->protocol; > + > + if (!skip_vlan) > + /* VLAN acceleration strips the VLAN header from the skb and > + * moves it to skb->vlan_proto > + */ > + return skb_vlan_tag_present(skb) ? skb->vlan_proto : proto; > + > + while (eth_type_vlan(proto)) { > + struct vlan_hdr vhdr, *vh; > + > + vh = skb_header_pointer(skb, offset, sizeof(vhdr), &vhdr); > + if (!vh) > + break; > + > + proto = vh->h_vlan_encapsulated_proto; > + offset += sizeof(vhdr); > + } Why don't you use __vlan_get_protocol() here? It looks quite similar. Is there any problem with using that? Toshiaki Makita