aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-11-04 23:25:50 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-03-27 00:07:34 +0000
commit1f302afd7350f46ec0fcc4b12b0ad59ac92fe5b6 (patch)
tree7c015f93344ad49d6dbf9888364b65f442d18483 /target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch
parent7829ae4a2f9d37fa66b683d5824e0e3e93bb6c50 (diff)
downloadupstream-1f302afd7350f46ec0fcc4b12b0ad59ac92fe5b6.tar.gz
upstream-1f302afd7350f46ec0fcc4b12b0ad59ac92fe5b6.tar.bz2
upstream-1f302afd7350f46ec0fcc4b12b0ad59ac92fe5b6.zip
generic: 5.15: rework hack patch
Rework hack patch in dir for kernel 5.15. For the specific patch of packet mangeling introduce a new extra_priv_flags as we don't have enough space to add additional flags in priv_flags. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch')
-rw-r--r--target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch25
1 files changed, 18 insertions, 7 deletions
diff --git a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch
index 67808c35f8..e36d829ac5 100644
--- a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch
+++ b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch
@@ -19,22 +19,33 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1618,6 +1618,7 @@ enum netdev_priv_flags {
- IFF_FAILOVER_SLAVE = 1<<28,
- IFF_L3MDEV_RX_HANDLER = 1<<29,
+@@ -1618,6 +1618,10 @@ enum netdev_priv_flags {
IFF_LIVE_RENAME_OK = 1<<30,
-+ IFF_NO_IP_ALIGN = 1<<31,
+ IFF_TX_SKB_NO_LINEAR = 1<<31,
};
++
++enum netdev_extra_priv_flags {
++ IFF_NO_IP_ALIGN = 1<<0,
++};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
+ #define IFF_EBRIDGE IFF_EBRIDGE
@@ -1650,6 +1651,7 @@ enum netdev_priv_flags {
- #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK
+ #define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR
+#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN
/* Specifies the type of the struct net_device::ml_priv pointer */
enum netdev_ml_priv_type {
+@@ -1987,6 +1987,7 @@ enum netdev_priv_flags {
+ /* Read-mostly cache-line for fast-path access */
+ unsigned int flags;
+ unsigned int priv_flags;
++ unsigned int extra_priv_flags;
+ const struct net_device_ops *netdev_ops;
+ int ifindex;
+ unsigned short gflags;
@@ -1990,6 +1992,11 @@ struct net_device {
const struct tlsdev_ops *tlsdev_ops;
#endif
@@ -120,9 +131,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -60,6 +60,7 @@
- #include <linux/prefetch.h>
#include <linux/if_vlan.h>
#include <linux/mpls.h>
+ #include <linux/kcov.h>
+#include <linux/if.h>
#include <net/protocol.h>
@@ -137,7 +148,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
+
+#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+ if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
++ if (dev && (dev->extra_priv_flags & IFF_NO_IP_ALIGN))
+ return skb;
+#endif
+