From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 9C48F3B2A4 for ; Fri, 3 Jul 2020 16:16:31 -0400 (EDT) Received: by mail-il1-x141.google.com with SMTP id x9so28212762ila.3 for ; Fri, 03 Jul 2020 13:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=vSkAi5uW/KdoEVuuahqoDhfz418sY3smPqYtLrhlpNE=; b=Ilc3Jvz42ijwqqK+rkc9cXcu3iy6y1GhdMnlD4YG2U1ucdAnCbDyv80vjcEB43rR+k phm1ZWZ3GZKWvP+sP9xRVvecpT7RWpIXQ0gOdzGRfOGI5JMJ8cHIq65SeQc+opTpciOO 4WtKa1tWoBIxP+dHVAbGJ2fszNOlYqcZAJ8//bkUlY9KJ7Uy8gIhuewymgueMZv6Xi3k ffHUEawQjPNaIpjJlxALArX70q+eBnfjiuG0S667GnxZwlB/+AWmuOgPj9uecrlNOqc0 AaXm7BqyUt3sU0Gn58DmTxn1oQoCIjA72+B3pS15WZYuXClCrH1adjVz24bBa5Py4TjG gBEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=vSkAi5uW/KdoEVuuahqoDhfz418sY3smPqYtLrhlpNE=; b=fFltsC61FLqAX2LeptvLflIwbrnX4UUV9FVbSi21lf2cLKLDHe+XfzNP51G0ou7xCo Rzlfse+qCmVSmhBl1mUOb3aomIqVMV6PJCWQl+nYC+6CkpvyqM/jRlyWCbvvKmMLmnY3 6fK1s88rui3I3DaBTwBi1Lv9Lk3pmSt11TfGt4MCMhSj6X819jc1mkMjMd9cCN6QBL1R kcqThrXJOSxxHKQ/wZvPwBf+mh0lRvsBsCoJzY35ZDuZlmr7YjStCwqLY3ollFptNuuo Mkw0ty1dOcurBQ8b7c65cpcsLEkINAtjw+vqDoCZgz8V0Pb3J4b8tT0vSKsHQtWv6uH/ y/qg== X-Gm-Message-State: AOAM532BbQptlGIQOEjDgPZkYnftu9iiLJligzxJ6nuhLbFgipt7FoTN vg/yeB7LquKZ7XT1M39y0f9dag== X-Google-Smtp-Source: ABdhPJywXGBX2FCiru00pDq5eOC4ovaPhHtffqUJ669uhhro61miUkt1/g5Qq8HSmVSDEUvVlEPkfQ== X-Received: by 2002:a92:dc0f:: with SMTP id t15mr17295282iln.218.1593807391142; Fri, 03 Jul 2020 13:16:31 -0700 (PDT) Received: from sevai ([74.127.202.217]) by smtp.gmail.com with ESMTPSA id s5sm3870830ilo.24.2020.07.03.13.16.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2020 13:16:30 -0700 (PDT) From: Roman Mashak To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Cc: davem@davemloft.net, netdev@vger.kernel.org, cake@lists.bufferbloat.net, Davide Caratti , Jiri Pirko , Jamal Hadi Salim , Cong Wang , Ilya Ponetayev References: <20200703152239.471624-1-toke@redhat.com> Date: Fri, 03 Jul 2020 16:16:15 -0400 In-Reply-To: <20200703152239.471624-1-toke@redhat.com> ("Toke \=\?utf-8\?Q\?H\=C3\=B8iland-J\=C3\=B8rgensen\=22's\?\= message of "Fri, 3 Jul 2020 17:22:39 +0200") Message-ID: <85sge82w34.fsf@mojatatu.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 03 Jul 2020 16:20:14 -0400 Subject: Re: [Cake] [PATCH net v2] 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: Fri, 03 Jul 2020 20:16:31 -0000 Toke H=C3=B8iland-J=C3=B8rgensen writes: [...] > +/* A getter for the SKB protocol field which will handle VLAN tags consi= stently > + * whether VLAN acceleration is enabled or not. > + */ > +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_v= lan) > +{ > + unsigned int offset =3D skb_mac_offset(skb) + sizeof(struct ethhdr); > + __be16 proto =3D skb->protocol; > + struct vlan_hdr vhdr, *vh; Nit: you could move vhdr and *vh definitions inside the while loop, because of their inner scope use. > + > + 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)) { > + vh =3D skb_header_pointer(skb, offset, sizeof(vhdr), &vhdr); > + if (!vh) > + break; > + > + proto =3D vh->h_vlan_encapsulated_proto; > + offset +=3D sizeof(vhdr); > + } [...]