From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by mail.toke.dk (Postfix) with ESMTPS id 609DEA1B2FD for ; Fri, 21 Jul 2023 00:03:00 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=K1+jILZp Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-57059e6f9c7so22715987b3.0 for ; Thu, 20 Jul 2023 15:03:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689890578; x=1690495378; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=206RntJl5N4S3vyqz152CXiY4g52GnK3+N2rFMZD3P0=; b=K1+jILZpfkoO5Im0HytBfUxM8f/T2D2oeCcTa465luZQc4AJcA82UvxtwIgErC7U5h F1OJqlPCdIxpTJhkA/6rX0c/lqmn/KA35KppVsJScvOyHkrVdQTt0S2lEbpqLPOZJ23L PzqW3uZlT/FeXlKfEGFH9vpWxwhOsKq4x9rx4x8ZYif+i1XO/R7CWgQmWqjzkWADMKiN uJzwlumLqrS0kDj1T4FIQKzRA6Z8hcsICigUrDcvvpAyE6EJT3KDH0pO8+81z5J61+NB B/fRSjL6R92cu7QklMNwqdeOea4B7H1fCf6rlWyf/z0OUTG9Z8nbEFZDfeEmhONs7cbC vr1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689890578; x=1690495378; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=206RntJl5N4S3vyqz152CXiY4g52GnK3+N2rFMZD3P0=; b=fMGOgeKuyt90FCEdLVNnr+iXwb0vz1nx6BZ+azzKOslSk56RiCVN2cRmOXclO05sIR Rv+m1qNYN1t/iwAKzM3Qrslj5tjxaUnlpgJX2EneHkhK+UcD5/+P+E9HKQMcjjhiv3kP 1EuImfGvRyqpkORAChxPQ3rNfWdt39qNMU+sYrZSLG5sZAiZhF5ZYje+TTMuYzh9e2o8 sChI1ID/rP3RBYk7Z8GORCGDGSARDVFLenc9bLYmN9ML6jsCObYYUxV2MMJysY9A19Df n8qEXWZLX51afdvLnU0Ih3+mPgc0poisDOYphIfeWYBupPHb5CjXDC6oqmfokLaggJIo bnAQ== X-Gm-Message-State: ABy/qLZCPuzkN42R5M0l5XabAKWMYwnFkPLPrzy61DmNcLGOsFVkeNra HJZVER+CaR2KICrczmHxNeog3ds= X-Google-Smtp-Source: APBJJlGm4vXVIxoGX5PWiF+DOWtPFnx7UP3a09t0TTvXwG763koFsoHomxnwaRChpn0H98yPlIe6Q9I= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a81:b652:0:b0:56d:19ce:416c with SMTP id h18-20020a81b652000000b0056d19ce416cmr91956ywk.0.1689890578683; Thu, 20 Jul 2023 15:02:58 -0700 (PDT) Date: Thu, 20 Jul 2023 15:02:57 -0700 In-Reply-To: <20230719183734.21681-19-larysa.zaremba@intel.com> Mime-Version: 1.0 References: <20230719183734.21681-1-larysa.zaremba@intel.com> <20230719183734.21681-19-larysa.zaremba@intel.com> Message-ID: From: Stanislav Fomichev To: Larysa Zaremba Content-Type: text/plain; charset="utf-8" Message-ID-Hash: OY2DN4ULW7T6IZ4EW4TDOLFSPHKI3EZP X-Message-ID-Hash: OY2DN4ULW7T6IZ4EW4TDOLFSPHKI3EZP X-MailFrom: 3Eq-5ZAMKCYMzkmnvvnsl.jvt4kw-opu0z4kw-wyvqlj0.ul0@flex--sdf.bounces.google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, Jesper Dangaard Brouer X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 18/21] net: make vlan_get_tag() return -ENODATA instead of -EINVAL List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 07/19, Larysa Zaremba wrote: > __vlan_hwaccel_get_tag() is used in veth XDP hints implementation, > its return value (-EINVAL if skb is not VLAN tagged) is passed to bpf code, > but XDP hints specification requires drivers to return -ENODATA, if a hint > cannot be provided for a particular packet. > > Solve this inconsistency by changing error return value of > __vlan_hwaccel_get_tag() from -EINVAL to -ENODATA, do the same thing to > __vlan_get_tag(), because this function is supposed to follow the same > convention. This, in turn, makes -ENODATA the only non-zero value > vlan_get_tag() can return. We can do this with no side effects, because > none of the users of the 3 above-mentioned functions rely on the exact > value. > > Suggested-by: Jesper Dangaard Brouer > Signed-off-by: Larysa Zaremba Acked-by: Stanislav Fomichev > --- > include/linux/if_vlan.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h > index 6ba71957851e..fb35d7dd77a2 100644 > --- a/include/linux/if_vlan.h > +++ b/include/linux/if_vlan.h > @@ -540,7 +540,7 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) > struct vlan_ethhdr *veth = skb_vlan_eth_hdr(skb); > > if (!eth_type_vlan(veth->h_vlan_proto)) > - return -EINVAL; > + return -ENODATA; > > *vlan_tci = ntohs(veth->h_vlan_TCI); > return 0; > @@ -561,7 +561,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, > return 0; > } else { > *vlan_tci = 0; > - return -EINVAL; > + return -ENODATA; > } > } > > -- > 2.41.0 >