-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adrian Moreno says: ==================== openvswitch: add drop reasons There is currently a gap in drop visibility in the openvswitch module. This series tries to improve this by adding a new drop reason subsystem for OVS. Apart from adding a new drop reasson subsystem and some common drop reasons, this series takes Eric's preliminary work [1] on adding an explicit drop action and integrates it into the same subsystem. A limitation of this series is that it does not report upcall errors. The reason is that there could be many sources of upcall drops and the most common one, which is the netlink buffer overflow, cannot be reported via kfree_skb() because the skb is freed in the netlink layer (see [2]). Therefore, using a reason for the rare events and not the common one would be even more misleading. I'd propose we add (in a follow up patch) a tracepoint to better report upcall errors. [1] https://lore.kernel.org/netdev/202306300609.tdRdZscy-lkp@intel.com/T/ [2] commit 1100248 ("openvswitch: Fix double reporting of drops in dropwatch") --- v4 -> v5: - Rebased - Added a helper function to explicitly convert drop reason enum types v3 -> v4: - Changed names of errors following Ilya's suggestions - Moved the ovs-dpctl.py changes from patch 7/7 to 3/7 - Added a test to ensure actions following a drop are rejected rfc2 -> v3: - Rebased on top of latest net-next rfc1 -> rfc2: - Fail when an explicit drop is not the last - Added a drop reason for action errors - Added braces around macros - Dropped patch that added support for masks in ovs-dpctl.py as it's now included in Aaron's series [2]. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
9 changed files
with
226 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* OpenvSwitch drop reason list. | ||
*/ | ||
|
||
#ifndef OPENVSWITCH_DROP_H | ||
#define OPENVSWITCH_DROP_H | ||
#include <linux/skbuff.h> | ||
#include <net/dropreason.h> | ||
|
||
#define OVS_DROP_REASONS(R) \ | ||
R(OVS_DROP_LAST_ACTION) \ | ||
R(OVS_DROP_ACTION_ERROR) \ | ||
R(OVS_DROP_EXPLICIT) \ | ||
R(OVS_DROP_EXPLICIT_WITH_ERROR) \ | ||
R(OVS_DROP_METER) \ | ||
R(OVS_DROP_RECURSION_LIMIT) \ | ||
R(OVS_DROP_DEFERRED_LIMIT) \ | ||
R(OVS_DROP_FRAG_L2_TOO_LONG) \ | ||
R(OVS_DROP_FRAG_INVALID_PROTO) \ | ||
R(OVS_DROP_CONNTRACK) \ | ||
R(OVS_DROP_IP_TTL) \ | ||
/* deliberate comment for trailing \ */ | ||
|
||
enum ovs_drop_reason { | ||
__OVS_DROP_REASON = SKB_DROP_REASON_SUBSYS_OPENVSWITCH << | ||
SKB_DROP_REASON_SUBSYS_SHIFT, | ||
#define ENUM(x) x, | ||
OVS_DROP_REASONS(ENUM) | ||
#undef ENUM | ||
|
||
OVS_DROP_MAX, | ||
}; | ||
|
||
static inline void | ||
ovs_kfree_skb_reason(struct sk_buff *skb, enum ovs_drop_reason reason) | ||
{ | ||
kfree_skb_reason(skb, (u32)reason); | ||
} | ||
|
||
#endif /* OPENVSWITCH_DROP_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.