diff options
author | Felix Fietkau <nbd@nbd.name> | 2024-04-23 12:37:05 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2024-04-26 06:31:27 +0200 |
commit | b5c53848c3792355a2dd4ff0e06bf4d230e1f5fb (patch) | |
tree | bb3f8be813c482d0fe9b531c59cbeb63f3afd144 /target/linux/generic/hack-6.1 | |
parent | 98834a4c3f81c6e4f20329ff266f9bd85731d114 (diff) |
kernel: improve GRO performance
For packets not belonging to a local socket, use fraglist GRO instead of
regular GRO. This make segmenting packets very cheap and avoids the need for
selectively disabling GRO
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/hack-6.1')
-rw-r--r-- | target/linux/generic/hack-6.1/600-net-enable-fraglist-GRO-by-default.patch | 24 | ||||
-rw-r--r-- | target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch | 8 |
2 files changed, 28 insertions, 4 deletions
diff --git a/target/linux/generic/hack-6.1/600-net-enable-fraglist-GRO-by-default.patch b/target/linux/generic/hack-6.1/600-net-enable-fraglist-GRO-by-default.patch new file mode 100644 index 0000000000..51f990039c --- /dev/null +++ b/target/linux/generic/hack-6.1/600-net-enable-fraglist-GRO-by-default.patch @@ -0,0 +1,24 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Tue, 23 Apr 2024 12:35:21 +0200 +Subject: [PATCH] net: enable fraglist GRO by default + +This can significantly improve performance for packet forwarding/bridging + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/include/linux/netdev_features.h ++++ b/include/linux/netdev_features.h +@@ -242,10 +242,10 @@ static inline int find_next_netdev_featu + #define NETIF_F_UPPER_DISABLES NETIF_F_LRO + + /* changeable features with no special hardware requirements */ +-#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) ++#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO | NETIF_F_GRO_FRAGLIST) + + /* Changeable features with no special hardware requirements that defaults to off. */ +-#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD) ++#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_UDP_FWD) + + #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ + NETIF_F_HW_VLAN_CTAG_RX | \ diff --git a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch index 8652e090e1..bf286523d6 100644 --- a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> const struct header_ops *header_ops; unsigned char operstate; -@@ -2206,6 +2213,10 @@ struct net_device { +@@ -2204,6 +2211,10 @@ struct net_device { struct mctp_dev __rcu *mctp_ptr; #endif @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -3046,6 +3046,10 @@ static inline int pskb_trim(struct sk_bu +@@ -3045,6 +3045,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -3195,16 +3199,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -3194,16 +3198,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -152,7 +152,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> { --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c -@@ -171,6 +171,12 @@ __be16 eth_type_trans(struct sk_buff *sk +@@ -159,6 +159,12 @@ __be16 eth_type_trans(struct sk_buff *sk const struct ethhdr *eth; skb->dev = dev; |