dfc: TCP pure acks

Detects TCP pure acks so they can be put in the dedicated TX queues
even if they contain various options.

Change-Id: I6a9b714ccb58616ff49a150467d33a348d88ec64
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2020-06-09 15:38:15 -07:00 committed by Sean Tranchetti
parent a8eb2ce9b5
commit ee6187ea2e

View File

@ -17,6 +17,7 @@
#include <linux/rtnetlink.h>
#include <uapi/linux/rtnetlink.h>
#include <net/pkt_sched.h>
#include <net/tcp.h>
#include "qmi_rmnet_i.h"
#include <trace/events/dfc.h>
#include <linux/module.h>
@ -891,16 +892,14 @@ void qmi_rmnet_burst_fc_check(struct net_device *dev,
}
EXPORT_SYMBOL(qmi_rmnet_burst_fc_check);
static bool qmi_rmnet_is_tcp_ack(struct sk_buff *skb)
static bool _qmi_rmnet_is_tcp_ack(struct sk_buff *skb)
{
unsigned int len = skb->len;
switch (skb->protocol) {
/* TCPv4 ACKs */
case htons(ETH_P_IP):
if ((ip_hdr(skb)->protocol == IPPROTO_TCP) &&
(ip_hdr(skb)->ihl == 5) &&
(len == 40 || len == 52) &&
(ntohs(ip_hdr(skb)->tot_len) - (ip_hdr(skb)->ihl << 2) ==
tcp_hdr(skb)->doff << 2) &&
((tcp_flag_word(tcp_hdr(skb)) &
cpu_to_be32(0x00FF0000)) == TCP_FLAG_ACK))
return true;
@ -909,7 +908,8 @@ static bool qmi_rmnet_is_tcp_ack(struct sk_buff *skb)
/* TCPv6 ACKs */
case htons(ETH_P_IPV6):
if ((ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) &&
(len == 60 || len == 72) &&
(ntohs(ipv6_hdr(skb)->payload_len) ==
(tcp_hdr(skb)->doff) << 2) &&
((tcp_flag_word(tcp_hdr(skb)) &
cpu_to_be32(0x00FF0000)) == TCP_FLAG_ACK))
return true;
@ -919,6 +919,19 @@ static bool qmi_rmnet_is_tcp_ack(struct sk_buff *skb)
return false;
}
static inline bool qmi_rmnet_is_tcp_ack(struct sk_buff *skb)
{
/* Locally generated TCP acks */
if (skb_is_tcp_pure_ack(skb))
return true;
/* Forwarded */
if (unlikely(_qmi_rmnet_is_tcp_ack(skb)))
return true;
return false;
}
static int qmi_rmnet_get_queue_sa(struct qos_info *qos, struct sk_buff *skb)
{
struct rmnet_flow_map *itm;