netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Victor Nogueira <victor@mojatatu.com>
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	daniel@iogearbox.net, dcaratti@redhat.com,
	netdev@vger.kernel.org, kernel@mojatatu.com
Subject: Re: [PATCH net-next v3 2/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs
Date: Mon, 11 Dec 2023 18:25:34 -0800	[thread overview]
Message-ID: <20231211182534.09392034@kernel.org> (raw)
In-Reply-To: <20231205205030.3119672-3-victor@mojatatu.com>

On Tue,  5 Dec 2023 17:50:29 -0300 Victor Nogueira wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 4b84b72ebae8..f38c928a34aa 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3753,6 +3753,8 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
>  
>  	qdisc_calculate_pkt_len(skb, q);
>  
> +	tcf_set_drop_reason(skb, SKB_DROP_REASON_QDISC_DROP);
> +
>  	if (q->flags & TCQ_F_NOLOCK) {
>  		if (q->flags & TCQ_F_CAN_BYPASS && nolock_qdisc_is_empty(q) &&
>  		    qdisc_run_begin(q)) {
> @@ -3782,7 +3784,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
>  no_lock_out:
>  		if (unlikely(to_free))
>  			kfree_skb_list_reason(to_free,
> -					      SKB_DROP_REASON_QDISC_DROP);
> +					      tcf_get_drop_reason(to_free));
>  		return rc;
>  	}
>  
> @@ -3837,7 +3839,8 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
>  	}
>  	spin_unlock(root_lock);
>  	if (unlikely(to_free))
> -		kfree_skb_list_reason(to_free, SKB_DROP_REASON_QDISC_DROP);
> +		kfree_skb_list_reason(to_free,
> +				      tcf_get_drop_reason(to_free));

You stuff the drop reason into every skb but then only use the one from
the head? Herm. __qdisc_drop() only uses the next pointer can't we
overload the prev pointer to carry the drop reason. That means only
storing it if we already plan to drop the packet.

BTW I lack TC knowledge but struct tc_skb_cb is even more clsact
specific today than tcf_result. And reserving space for drop reason
in a state structure seems odd. Maybe that's just me.

  parent reply	other threads:[~2023-12-12  2:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 20:50 [PATCH net-next v3 0/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs Victor Nogueira
2023-12-05 20:50 ` [PATCH net-next v3 1/3] net: sched: Move drop_reason to struct tc_skb_cb Victor Nogueira
2023-12-05 21:17   ` Daniel Borkmann
2023-12-11 13:37   ` Simon Horman
2023-12-05 20:50 ` [PATCH net-next v3 2/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs Victor Nogueira
2023-12-05 21:20   ` Daniel Borkmann
2023-12-11 13:38   ` Simon Horman
2023-12-12  2:25   ` Jakub Kicinski [this message]
2023-12-12 16:27     ` Jamal Hadi Salim
2023-12-12 16:57       ` Eric Dumazet
2023-12-12 17:16         ` Jamal Hadi Salim
2023-12-13 18:36           ` Jamal Hadi Salim
2023-12-13 21:08             ` Jakub Kicinski
2023-12-14 15:31               ` Jamal Hadi Salim
2023-12-14 17:18                 ` Taehee Yoo
2023-12-15 14:42                   ` Jamal Hadi Salim
2023-12-14 18:01                 ` Jakub Kicinski
2023-12-05 20:50 ` [PATCH net-next v3 3/3] net: sched: Add initial TC error skb drop reasons Victor Nogueira
2023-12-11 13:38   ` Simon Horman
2023-12-12  2:30   ` Jakub Kicinski
2023-12-13 18:25     ` Victor Nogueira

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=20231211182534.09392034@kernel.org \
    --to=kuba@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).