linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Xinming Hu <huxinming820@gmail.com>
Cc: Linux Wireless <linux-wireless@vger.kernel.org>,
	Brian Norris <briannorris@google.com>,
	Dmitry Torokhov <dtor@google.com>,
	rajatja@google.com, Zhiyuan Yang <yangzy@marvell.com>,
	Cathy Luo <cluo@marvell.com>, Xinming Hu <huxm@marvell.com>,
	Ganapathi Bhat <gbhat@marvell.com>
Subject: Re: [PATCH v2 5/6] mwifiex: do not aggregate tcp ack in usb tx aggregation queue
Date: Thu, 18 May 2017 17:33:26 +0300	[thread overview]
Message-ID: <87lgpu5j61.fsf@purkki.adurom.net> (raw)
In-Reply-To: <1493986100-24509-5-git-send-email-huxinming820@gmail.com> (Xinming Hu's message of "Fri, 5 May 2017 12:08:19 +0000")

Xinming Hu <huxinming820@gmail.com> writes:

> From: Xinming Hu <huxm@marvell.com>
>
> Tcp ack should be send as soon to avoid throuput drop during receive tcp
> traffic.
>
> Signed-off-by: Xinming Hu <huxm@marvell.com>
> Signed-off-by: Cathy Luo <cluo@marvell.com>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

[...]

> +static bool is_piggyback_tcp_ack(struct sk_buff *skb)
> +{
> +	struct ethhdr *ethh = NULL;
> +	struct iphdr  *iph = NULL;
> +	struct tcphdr *tcph = NULL;
> +
> +	ethh = (struct ethhdr *)skb->data;
> +	if (ntohs(ethh->h_proto) != ETH_P_IP)
> +		return false;
> +
> +	iph = (struct iphdr *)((u8 *)ethh + sizeof(struct ethhdr));
> +	if (iph->protocol != IPPROTO_TCP)
> +		return false;
> +
> +	tcph = (struct tcphdr *)((u8 *)iph + iph->ihl * 4);
> +	/* Piggyback ack without payload*/
> +	if (*((u8 *)tcph + 13) == 0x10 &&
> +	    ntohs(iph->tot_len) <= (iph->ihl + tcph->doff) * 4) {
> +		return true;
> +	}

It's rather ugly to use magic values (13 and 0x10) like that. Can't you
use some of the existing defines? At least I see TCP_FLAG_ACK and struct
tcphdr::ack being available, so you should even have choises what to
use.

-- 
Kalle Valo

  reply	other threads:[~2017-05-18 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 12:08 [PATCH v2 1/6] mwifiex: use variable interface header length Xinming Hu
2017-05-05 12:08 ` [PATCH v2 2/6] mwifiex: usb: kill urb before free its memory Xinming Hu
2017-05-05 12:08 ` [PATCH v2 3/6] mwifiex: usb: transmit aggregation packets Xinming Hu
2017-05-05 12:08 ` [PATCH v2 4/6] mwifiex: usb: add timer to flush " Xinming Hu
2017-05-05 12:08 ` [PATCH v2 5/6] mwifiex: do not aggregate tcp ack in usb tx aggregation queue Xinming Hu
2017-05-18 14:33   ` Kalle Valo [this message]
2017-05-19  9:05     ` Xinming Hu
2017-05-05 12:08 ` [PATCH v2 6/6] mwifiex: check next packet length for usb tx aggregation Xinming Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgpu5j61.fsf@purkki.adurom.net \
    --to=kvalo@codeaurora.org \
    --cc=briannorris@google.com \
    --cc=cluo@marvell.com \
    --cc=dtor@google.com \
    --cc=gbhat@marvell.com \
    --cc=huxinming820@gmail.com \
    --cc=huxm@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rajatja@google.com \
    --cc=yangzy@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).