netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Anna Emese Nyiri <annaemesenyiri@gmail.com>
Cc: netdev@vger.kernel.org, fejes@inf.elte.hu, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	willemdebruijn.kernel@gmail.com
Subject: Re: [PATCH net-next v2 0/2] support SO_PRIORITY cmsg
Date: Sun, 3 Nov 2024 18:25:52 +0200	[thread overview]
Message-ID: <ZyekEJHEzJnyX6_j@shredder> (raw)
In-Reply-To: <20241102125136.5030-1-annaemesenyiri@gmail.com>

On Sat, Nov 02, 2024 at 01:51:34PM +0100, Anna Emese Nyiri wrote:
> The changes introduce a new helper function,
> `sk_set_prio_allowed`, which centralizes the logic for validating
> priority settings. This series adds support for the `SO_PRIORITY`
> control message, allowing user-space applications to set socket
> priority via control messages (cmsg).
> 
> Patch Overview:
> Patch 1/2: Introduces `sk_set_prio_allowed` helper function.
> Patch 2/2: Implements support for setting `SO_PRIORITY` via control
> messages.
> 
> v2:
> - Suggested by Willem de Bruijn <willemdebruijn.kernel@gmail.com>
>   introduce "sk_set_prio_allowed" helper to check priority setting
>   capability
> - drop new fields and change sockcm_cookie::priority from "char" to
>   "u32" to match with sk_buff::priority
> - cork->tos value check before priority setting
>   moved from __ip_make_skb() to ip_setup_cork()
> - rebased on net-next
> 
> v1:
> https://lore.kernel.org/all/20241029144142.31382-1-annaemesenyiri@gmail.com/
> 
> Anna Emese Nyiri (2):
>   Introduce sk_set_prio_allowed helper function
>   support SO_PRIORITY cmsg
> 
>  include/net/inet_sock.h |  2 +-
>  include/net/ip.h        |  3 ++-
>  include/net/sock.h      |  4 +++-
>  net/can/raw.c           |  2 +-
>  net/core/sock.c         | 19 ++++++++++++++++---
>  net/ipv4/ip_output.c    |  7 +++++--
>  net/ipv4/raw.c          |  2 +-
>  net/ipv6/ip6_output.c   |  3 ++-
>  net/ipv6/raw.c          |  2 +-
>  net/packet/af_packet.c  |  2 +-
>  10 files changed, 33 insertions(+), 13 deletions(-)

Please consider adding a selftest for this feature. Willem already
extended tools/testing/selftests/net/cmsg_sender.c so that it could be
used to set SO_PRIORITY via setsockopt. You can extend it to set
SO_PRIORITY via cmsg and then use it in a test like
tools/testing/selftests/net/cmsg_so_mark.sh is doing for SO_MARK.

  parent reply	other threads:[~2024-11-03 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 12:51 [PATCH net-next v2 0/2] support SO_PRIORITY cmsg Anna Emese Nyiri
2024-11-02 12:51 ` [PATCH net-next v2 1/2] Introduce sk_set_prio_allowed helper function Anna Emese Nyiri
2024-11-03  1:30   ` Willem de Bruijn
2024-11-02 12:51 ` [PATCH net-next v2 2/2] support SO_PRIORITY cmsg Anna Emese Nyiri
2024-11-03  1:27   ` Willem de Bruijn
2024-11-03 13:39     ` Anna Nyiri
2024-11-03 13:57       ` Willem de Bruijn
2024-11-03 15:41 ` [PATCH net-next v2 0/2] " Jakub Kicinski
2024-11-03 16:25 ` Ido Schimmel [this message]
2024-11-05 14:34   ` Anna Nyiri
2024-11-05 15:01     ` Willem de Bruijn

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=ZyekEJHEzJnyX6_j@shredder \
    --to=idosch@idosch.org \
    --cc=annaemesenyiri@gmail.com \
    --cc=edumazet@google.com \
    --cc=fejes@inf.elte.hu \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@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).