linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	Jay Cliburn <jcliburn@gmail.com>,
	Chris Snook <chris.snook@gmail.com>,
	Rasesh Mody <rmody@marvell.com>,
	Sudarsana Kalluru <skalluru@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	Christian Benvenuti <benve@cisco.com>,
	Govindarajulu Varadarajan <_govind@gmx.com>,
	Parvi Kaustubhi <pkaustub@cisco.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Guo-Fu Tseng <cooldavid@cooldavid.org>,
	Shannon Nelson <snelson@pensando.io>,
	Pensando Drivers <drivers@pensando.io>,
	Timur Tabi <timur@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Sasha Levin <sashal@kernel.org>, Ronak Doshi <doshir@vmware.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	intel-wired-lan <intel-wired-lan@lists.osuosl.org>,
	linux-hyperv@vger.kernel.org,
	Linux USB Mailing List <linux-usb@vger.kernel.org>
Subject: Re: [PATCH net-next 1/3] net: core: add helper tcp_v6_gso_csum_prep
Date: Tue, 18 Feb 2020 19:53:48 +0100	[thread overview]
Message-ID: <f349d932-582c-96f9-fa7a-b76c615adb96@gmail.com> (raw)
In-Reply-To: <CAKgT0UeUEcoKZsRnxzftMA4tc2chasmW+sWQkP11hVLbdYTYxA@mail.gmail.com>

On 18.02.2020 19:25, Alexander Duyck wrote:
> On Mon, Feb 17, 2020 at 1:41 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>
>> Several network drivers for chips that support TSO6 share the same code
>> for preparing the TCP header. A difference is that some reset the
>> payload_len whilst others don't do this. Let's factor out this common
>> code to a new helper.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  include/net/ip6_checksum.h | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
>> index 7bec95df4..ef0130023 100644
>> --- a/include/net/ip6_checksum.h
>> +++ b/include/net/ip6_checksum.h
>> @@ -76,6 +76,18 @@ static inline void __tcp_v6_send_check(struct sk_buff *skb,
>>         }
>>  }
>>
>> +static inline void tcp_v6_gso_csum_prep(struct sk_buff *skb,
>> +                                       bool clear_payload_len)
>> +{
>> +       struct ipv6hdr *ipv6h = ipv6_hdr(skb);
>> +       struct tcphdr *th = tcp_hdr(skb);
>> +
>> +       if (clear_payload_len)
>> +               ipv6h->payload_len = 0;
>> +
>> +       th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
>> +}
>> +
>>  #if IS_ENABLED(CONFIG_IPV6)
>>  static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
>>  {
> 
> So functionally I believe this is correct. The only piece I have a
> question about is if we should just force the clear_payload_len as
> always being the case since the value should either be
> ignored/overwritten in any GSO case anyway.
> 
I also thought about this and just wasn't sure whether this functional
change may break any driver. But yes, then let's change it this way.
Breaking down the series into smaller patches makes it easier to
revert an individual patch in case of a problem.

> Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> 
Thanks for the review.

  reply	other threads:[~2020-02-18 18:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 21:39 [PATCH net-next 0/3] net: core: add helper tcp_v6_gso_csum_prep Heiner Kallweit
2020-02-17 21:40 ` [PATCH net-next 1/3] " Heiner Kallweit
2020-02-18 18:25   ` Alexander Duyck
2020-02-18 18:53     ` Heiner Kallweit [this message]
2020-02-17 21:40 ` [PATCH net-next 2/3] r8169: use new " Heiner Kallweit
2020-02-18 18:37   ` Alexander Duyck
2020-02-18 18:45     ` Heiner Kallweit
2020-02-17 21:42 ` [PATCH net-next 3/3] net: " Heiner Kallweit
2020-02-18 18:34   ` Alexander Duyck
2020-02-18 18:54     ` Heiner Kallweit

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=f349d932-582c-96f9-fa7a-b76c615adb96@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=_govind@gmx.com \
    --cc=alexander.duyck@gmail.com \
    --cc=benve@cisco.com \
    --cc=chris.snook@gmail.com \
    --cc=cooldavid@cooldavid.org \
    --cc=davem@davemloft.net \
    --cc=doshir@vmware.com \
    --cc=drivers@pensando.io \
    --cc=haiyangz@microsoft.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=jcliburn@gmail.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pkaustub@cisco.com \
    --cc=pv-drivers@vmware.com \
    --cc=rmody@marvell.com \
    --cc=sashal@kernel.org \
    --cc=skalluru@marvell.com \
    --cc=snelson@pensando.io \
    --cc=sthemmin@microsoft.com \
    --cc=timur@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 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).