Netdev List
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Cong Wang <xiyou.wangcong@gmail.com>
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: Mon, 9 Oct 2023 10:11:04 +0200	[thread overview]
Message-ID: <ca8d1a59-eb28-5a10-f261-a1b97e4156fc@iogearbox.net> (raw)
In-Reply-To: <ZSLmkPxB9mHBT52v@pop-os.localdomain>

On 10/8/23 7:27 PM, Cong Wang wrote:
> 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?

Makes sense, will move it in a v2 (and also rename into tcf_set_drop_reason).

Thanks,
Daniel

      reply	other threads:[~2023-10-09  8:11 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 ` [PATCH net-next 1/2] net, tc: Make tc-related drop reason more flexible Cong Wang
2023-10-09  8:11   ` Daniel Borkmann [this message]

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=ca8d1a59-eb28-5a10-f261-a1b97e4156fc@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --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 \
    --cc=xiyou.wangcong@gmail.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