All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Hayes Wang <hayeswang@realtek.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net/usb/r8152: enable tx checksum
Date: Tue, 13 Aug 2013 18:39:36 +0400	[thread overview]
Message-ID: <520A4528.6020609@cogentembedded.com> (raw)
In-Reply-To: <1376378913-879-2-git-send-email-hayeswang@realtek.com>

Hello.

On 08/13/2013 11:28 AM, Hayes Wang wrote:

> Enable tx checksum.

> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
>   drivers/net/usb/r8152.c | 63 +++++++++++++++++++++++++++++++++++++++++++++----
>   1 file changed, 58 insertions(+), 5 deletions(-)

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index c6c5aa2..5d9d949 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
[...]
> @@ -964,6 +971,51 @@ err1:
>   	return -ENOMEM;
>   }
>
> +static void
> +r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, struct sk_buff *skb)
> +{
[...]
> +		if (ip_protocol == IPPROTO_TCP) {
> +			opts2 |= TCP_CS;
> +			opts2 |= (skb_transport_offset(skb) & 0x7fff) << 17;
> +		} else if (ip_protocol == IPPROTO_UDP) {
> +			opts2 |= UDP_CS;
> +		} else
> +			WARN_ON_ONCE(1);

    Stange, why *else if* branch has {} and *else* don't. It should, according 
to Documentation/CodingStyle.

> +
> +		desc->opts2 = cpu_to_le32(opts2);
> +	}
> +}
> +

WBR, Sergei


  reply	other threads:[~2013-08-13 14:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  7:28 [PATCH net-next 1/3] net/usb/r8152: support aggregation Hayes Wang
2013-08-13  7:28 ` [PATCH net-next 2/3] net/usb/r8152: enable tx checksum Hayes Wang
2013-08-13 14:39   ` Sergei Shtylyov [this message]
2013-08-13  7:28 ` [PATCH net-next 3/3] net/usb/r8152: enable interrupt transfer Hayes Wang
2013-08-13  8:49 ` [PATCH net-next 1/3] net/usb/r8152: support aggregation Oliver Neukum
2013-08-13  8:49   ` Oliver Neukum
2013-08-13 12:32   ` hayeswang
2013-08-13 15:17     ` Oliver Neukum
2013-08-13 23:41       ` David Miller
2013-08-14  3:02         ` hayeswang
2013-08-14 12:54 ` [PATCH net-next v2 " Hayes Wang
2013-08-14 12:54   ` Hayes Wang
2013-08-14 12:54   ` [PATCH net-next v2 2/3] net/usb/r8152: enable tx checksum Hayes Wang
2013-08-15  8:34     ` David Miller
2013-08-14 12:54   ` [PATCH net-next v2 3/3] net/usb/r8152: enable interrupt transfer Hayes Wang
2013-08-15  8:35     ` David Miller
2013-08-15  8:34   ` [PATCH net-next v2 1/3] net/usb/r8152: support aggregation David Miller
2013-08-15 12:26   ` Francois Romieu
2013-08-16  3:44     ` hayeswang
2013-08-16  5:54       ` Francois Romieu

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=520A4528.6020609@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.