netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <pabeni@redhat.com>
Cc: <davem@davemloft.net>, <donald.hunter@redhat.com>,
	<edumazet@google.com>, <horms@kernel.org>, <kuba@kernel.org>,
	<kuni1840@gmail.com>, <kuniyu@amazon.com>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next 06/11] af_unix: Set drop reason in unix_stream_sendmsg().
Date: Thu, 16 Jan 2025 13:09:32 +0900	[thread overview]
Message-ID: <20250116040932.96265-1-kuniyu@amazon.com> (raw)
In-Reply-To: <eb30b164-7f86-46bf-a5d3-0f8bda5e9398@redhat.com>

From: Paolo Abeni <pabeni@redhat.com>
Date: Wed, 15 Jan 2025 16:12:59 +0100
> On 1/15/25 2:52 PM, Donald Hunter wrote:
> > On Tue, 14 Jan 2025 at 20:05, Jakub Kicinski <kuba@kernel.org> wrote:
> >>
> >> On Sun, 12 Jan 2025 13:08:05 +0900 Kuniyuki Iwashima wrote:
> >>> @@ -2249,14 +2265,13 @@ static int queue_oob(struct socket *sock, struct msghdr *msg, struct sock *other
> >>>  static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
> >>>                              size_t len)
> >>>  {
> >>> +     enum skb_drop_reason reason;
> >>
> >> I feel like we should draw the line somewhere for the reason codes.
> >> We started with annotating packet drops in the stack, which are
> >> otherwise hard to notice, we don't even have counters for all of them.
> >> But at this point we're annotating sendmsg() errors? The fact we free
> >> an skb on the error path seems rather coincidental for a sendmsg error.
> >> IOW aren't we moving from packet loss annotation into general tracing
> >> territory here?
> >>
> >> If there is no ambiguity and application will get an error from a system
> >> call I'd just use consume_skb().
> >>
> >> I'm probably the most resistant to the drop reason codes, so I defer
> >> to Paolo / Eric for the real judgment...
> > 
> > For what it's worth, I agree that there's no need to annotate a drop
> > reason for sendmsg failures that return error codes to the caller.
> > That's why my original patch proposal just changed them to use
> > consume_skb(). I did misrepresent the cases as "happy path" but I
> > really meant that from the perspective of "no send initiated, so no
> > drop reason".
> > 
> > https://lore.kernel.org/netdev/20241116094236.28786-1-donald.hunter@gmail.com/
> 
> I also agree with Jakub with a slightly different reasoning. IMHO drop
> reason goal is to let user-space easily understand where/why skbs are
> dropped. If the drop reason reflects a syscall error code, the
> user-space already has all the info.
> 
> IIRC the general guidance agreed upon in the last Netconf was to add
> drop reasons when we can't distinguish multiple kind of drops within the
> same function. IMHO such guidance fits with not using drop reason in
> this specific case: as said we can discriminate the errors via the
> syscall error code.

Thanks for the feedback, all!

I'll change kfree_skb() to consume_skb() in

  * unix_stream_connect()
  * unix_stream_sendmsg()
  * queue_oob()
  * unix_dgram_sendmsg()

where we can distinguish what happened from errno.

  reply	other threads:[~2025-01-16  4:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-12  4:07 [PATCH v2 net-next 00/11] af_unix: Set skb drop reason in every kfree_skb() path Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 01/11] net: dropreason: Gather SOCKET_ drop reasons Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 02/11] af_unix: Set drop reason in unix_release_sock() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 03/11] af_unix: Set drop reason in unix_sock_destructor() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 04/11] af_unix: Set drop reason in __unix_gc() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 05/11] af_unix: Set drop reason in unix_stream_connect() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 06/11] af_unix: Set drop reason in unix_stream_sendmsg() Kuniyuki Iwashima
2025-01-15  1:05   ` Jakub Kicinski
2025-01-15 13:52     ` Donald Hunter
2025-01-15 15:12       ` Paolo Abeni
2025-01-16  4:09         ` Kuniyuki Iwashima [this message]
2025-01-12  4:08 ` [PATCH v2 net-next 07/11] af_unix: Set drop reason in queue_oob() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 08/11] af_unix: Set drop reason in manage_oob() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 09/11] af_unix: Set drop reason in unix_stream_read_skb() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 10/11] af_unix: Set drop reason in unix_dgram_disconnected() Kuniyuki Iwashima
2025-01-12  4:08 ` [PATCH v2 net-next 11/11] af_unix: Set drop reason in unix_dgram_sendmsg() Kuniyuki Iwashima
2025-01-15 17:38 ` [PATCH v2 net-next 00/11] af_unix: Set skb drop reason in every kfree_skb() path Joe Damato
2025-01-16  4:19   ` Kuniyuki Iwashima

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=20250116040932.96265-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).