lede/target/linux/generic/backport-5.4/901-v6.10-backport-net-device-path.patch
lovehackintosh e32969d6bc
Kernel: bump to 5.4.228, 5.10.160, 5.15.84 (#10656)
* kernel: bump 5.10 to 5.10.160

No patches affected by this update.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>

* kernel: bump 5.15 to 5.15.84

Signed-off-by: John Audia <therealgraysky@proton.me>

* kernel: bump 5.4 to 5.4.228

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
Co-authored-by: John Audia <therealgraysky@proton.me>
2022-12-20 23:13:01 +08:00

74 lines
1.5 KiB
Diff

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -835,6 +835,61 @@ typedef u16 (*select_queue_fallback_t)(s
struct sk_buff *skb,
struct net_device *sb_dev);
+enum net_device_path_type {
+ DEV_PATH_ETHERNET = 0,
+ DEV_PATH_VLAN,
+ DEV_PATH_BRIDGE,
+ DEV_PATH_PPPOE,
+ DEV_PATH_DSA,
+ DEV_PATH_MTK_WDMA,
+};
+
+struct net_device_path {
+ enum net_device_path_type type;
+ const struct net_device *dev;
+ union {
+ struct {
+ u16 id;
+ __be16 proto;
+ u8 h_dest[ETH_ALEN];
+ } encap;
+ struct {
+ enum {
+ DEV_PATH_BR_VLAN_KEEP,
+ DEV_PATH_BR_VLAN_TAG,
+ DEV_PATH_BR_VLAN_UNTAG,
+ DEV_PATH_BR_VLAN_UNTAG_HW,
+ } vlan_mode;
+ u16 vlan_id;
+ __be16 vlan_proto;
+ } bridge;
+ struct {
+ int port;
+ u16 proto;
+ } dsa;
+ struct {
+ u8 wdma_idx;
+ u8 queue;
+ u16 wcid;
+ u8 bss;
+ } mtk_wdma;
+ };
+};
+
+#define NET_DEVICE_PATH_STACK_MAX 5
+#define NET_DEVICE_PATH_VLAN_MAX 2
+
+struct net_device_path_ctx {
+ const struct net_device *dev;
+ u8 daddr[ETH_ALEN];
+
+ int num_vlans;
+ struct {
+ u16 id;
+ __be16 proto;
+ } vlan[NET_DEVICE_PATH_VLAN_MAX];
+};
+
enum tc_setup_type {
TC_SETUP_QDISC_MQPRIO,
TC_SETUP_CLSU32,
@@ -1441,6 +1496,8 @@ struct net_device_ops {
u32 flags);
int (*ndo_xsk_wakeup)(struct net_device *dev,
u32 queue_id, u32 flags);
+ int (*ndo_fill_forward_path)(struct net_device_path_ctx *ctx,
+ struct net_device_path *path);
struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
};