summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-11-12 23:09:47 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-11-12 23:09:47 -0800
commitca08dc68f33a3313733384489ff55526a89a762f (patch)
tree496af580ac310a418af507754187df8795c88758 /drivers
parent1ac73c7449b812e80b95a381ed71ab714a1d4b33 (diff)
parentb8d5c1c4cc1f3ec617c30f990a9a40113b1c2463 (diff)
downloaddata-kernel-ca08dc68f33a3313733384489ff55526a89a762f.tar.gz
Merge "drivers: rmnet_shs: Disable RPS for ICMP packets"
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/rmnet/shs/rmnet_shs_main.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/drivers/rmnet/shs/rmnet_shs_main.c b/drivers/rmnet/shs/rmnet_shs_main.c
index 2ea09dc..67d2cb1 100755
--- a/drivers/rmnet/shs/rmnet_shs_main.c
+++ b/drivers/rmnet/shs/rmnet_shs_main.c
@@ -161,16 +161,36 @@ int rmnet_shs_is_skb_stamping_reqd(struct sk_buff *skb)
case htons(ETH_P_IP):
if (!ip_is_fragment(ip_hdr(skb)) &&
((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
- (ip_hdr(skb)->protocol == IPPROTO_UDP)))
+ (ip_hdr(skb)->protocol == IPPROTO_UDP))){
ret_val = 1;
-
+ break;
+ }
+ /* RPS logic is skipped if RPS hash is 0 while sw_hash
+ * is set as active and packet is processed on the same
+ * CPU as the initial caller.
+ */
+ if (ip_hdr(skb)->protocol == IPPROTO_ICMP) {
+ skb->hash = 0;
+ skb->sw_hash = 1;
+ }
break;
case htons(ETH_P_IPV6):
if (!(ipv6_hdr(skb)->nexthdr == NEXTHDR_FRAGMENT) &&
((ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) ||
- (ipv6_hdr(skb)->nexthdr == IPPROTO_UDP)))
+ (ipv6_hdr(skb)->nexthdr == IPPROTO_UDP))) {
ret_val = 1;
+ break;
+ }
+
+ /* RPS logic is skipped if RPS hash is 0 while sw_hash
+ * is set as active and packet is processed on the same
+ * CPU as the initial caller.
+ */
+ if (ipv6_hdr(skb)->nexthdr == IPPROTO_ICMP) {
+ skb->hash = 0;
+ skb->sw_hash = 1;
+ }
break;
@@ -187,6 +207,15 @@ int rmnet_shs_is_skb_stamping_reqd(struct sk_buff *skb)
(ip4h->protocol == IPPROTO_TCP ||
ip4h->protocol == IPPROTO_UDP)) {
ret_val = 1;
+ break;
+ }
+ /* RPS logic is skipped if RPS hash is 0 while sw_hash
+ * is set as active and packet is processed on the same
+ * CPU as the initial caller.
+ */
+ if (ip4h->protocol == IPPROTO_ICMP) {
+ skb->hash = 0;
+ skb->sw_hash = 1;
}
break;
@@ -196,8 +225,18 @@ int rmnet_shs_is_skb_stamping_reqd(struct sk_buff *skb)
if (!(ip6h->nexthdr == NEXTHDR_FRAGMENT) &&
((ip6h->nexthdr == IPPROTO_TCP) ||
- (ip6h->nexthdr == IPPROTO_UDP)))
+ (ip6h->nexthdr == IPPROTO_UDP))) {
ret_val = 1;
+ break;
+ }
+ /* RPS logic is skipped if RPS hash is 0 while sw_hash
+ * is set as active and packet is processed on the same
+ * CPU as the initial caller.
+ */
+ if (ip6h->nexthdr == IPPROTO_ICMP) {
+ skb->hash = 0;
+ skb->sw_hash = 1;
+ }
break;