Thread (22 messages) 22 messages, 7 authors, 2023-07-12

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: add drop action

From: Ilya Maximets <i.maximets@ovn.org>
Date: 2023-07-07 16:03:57

On 7/7/23 17:29, Ilya Maximets wrote:
On 7/7/23 17:00, Jakub Kicinski wrote:
quoted
On Fri, 7 Jul 2023 12:30:38 +0200 Ilya Maximets wrote:
quoted
A wild idea:  How about we do not define actual reasons?  i.e. define a
subsystem and just call kfree_skb_reason(skb, SUBSYSTEM | value), where
'value' is whatever userspace gives as long as it is within a subsystem
range?
That already exists, right? Johannes added it in the last release for WiFi.
I'm not sure.  The SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE behaves similarly
to that on a surface.  However, looking closer, any value that can be passed
into ieee80211_rx_handlers_result() and ends up in the kfree_skb_reason() is
kind of defined in net/mac80211/drop.h, unless I'm missing something (very
possible, because I don't really know wifi code).

The difference, I guess, is that for openvswitch values will be provided by
the userpsace application via netlink interface.  It'll be just a number not
defined anywhere in the kernel.  Only the subsystem itself will be defined
in order to occupy the range.  Garbage in, same garbage out, from the kernel's
perspective.
To be clear, I think, not defining them in this particular case is better.
Definition of every reason that userspace can come up with will add extra
uAPI maintenance cost/issues with no practical benefits.  Values are not
going to be used for anything outside reporting a drop reason and subsystem
offset is not part of uAPI anyway.
Best regards, Ilya Maximets.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help