BPF List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: kuba@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org,
	jhs@mojatatu.com, victor@mojatatu.com, martin.lau@linux.dev,
	dxu@dxuuu.xyz
Subject: Re: [PATCH net-next 1/2] net, tc: Make tc-related drop reason more flexible
Date: Sun, 8 Oct 2023 10:27:44 -0700	[thread overview]
Message-ID: <ZSLmkPxB9mHBT52v@pop-os.localdomain> (raw)
In-Reply-To: <20231006190956.18810-1-daniel@iogearbox.net>

On Fri, Oct 06, 2023 at 09:09:55PM +0200, Daniel Borkmann wrote:
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index c7318c73cfd6..90774cb2ac03 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -324,7 +324,6 @@ struct Qdisc_ops {
>  	struct module		*owner;
>  };
>  
> -
>  struct tcf_result {
>  	union {
>  		struct {
> @@ -332,8 +331,8 @@ struct tcf_result {
>  			u32		classid;
>  		};
>  		const struct tcf_proto *goto_tp;
> -
>  	};
> +	enum skb_drop_reason		drop_reason;
>  };
>  
>  struct tcf_chain;
> @@ -667,6 +666,12 @@ static inline int tc_classid_to_hwtc(struct net_device *dev, u32 classid)
>  	return (hwtc < netdev_get_num_tc(dev)) ? hwtc : -EINVAL;
>  }
>  
> +static inline void tc_set_drop_reason(struct tcf_result *res,
> +				      enum skb_drop_reason reason)
> +{
> +	res->drop_reason = reason;
> +}
> +

Since this helper is for TC filters and actions, include/net/pkt_cls.h
is a better place for it?


  parent reply	other threads:[~2023-10-08 17:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 19:09 [PATCH net-next 1/2] net, tc: Make tc-related drop reason more flexible Daniel Borkmann
2023-10-06 19:09 ` [PATCH net-next 2/2] net, tc: Add tc_set_drop_reason for {__,}tcf_classify Daniel Borkmann
2023-10-08 17:27 ` Cong Wang [this message]
2023-10-09  8:11   ` [PATCH net-next 1/2] net, tc: Make tc-related drop reason more flexible Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSLmkPxB9mHBT52v@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dxu@dxuuu.xyz \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=victor@mojatatu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox