Re: [PATCH net-next 1/2] net, tc: Make tc-related drop reason more flexible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux