netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
	netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 4/5] ibmveth: Add support for Large Receive Offload
Date: Tue, 21 Apr 2015 13:59:30 -0500	[thread overview]
Message-ID: <55369E12.4060509@linux.vnet.ibm.com> (raw)
In-Reply-To: <1429048822.7346.53.camel@edumazet-glaptop2.roam.corp.google.com>

On 04/14/2015 05:00 PM, Eric Dumazet wrote:
> On Tue, 2015-04-14 at 15:35 -0500, Thomas Falcon wrote:
>> Enables receiving large packets from other LPARs. These packets
>> have a -1 IP header checksum, so we must recalculate to have
>> a valid checksum.
>>
>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
>> ---
>>  drivers/net/ethernet/ibm/ibmveth.c | 15 ++++++++++++++-
>>  1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
>> index 08970c7..05eaca6a 100644
>> --- a/drivers/net/ethernet/ibm/ibmveth.c
>> +++ b/drivers/net/ethernet/ibm/ibmveth.c
>> @@ -1092,6 +1092,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
>>  	struct net_device *netdev = adapter->netdev;
>>  	int frames_processed = 0;
>>  	unsigned long lpar_rc;
>> +	struct iphdr *iph;
>>  
>>  restart_poll:
>>  	while (frames_processed < budget) {
>> @@ -1134,8 +1135,20 @@ restart_poll:
>>  			skb_put(skb, length);
>>  			skb->protocol = eth_type_trans(skb, netdev);
>>  
>> -			if (csum_good)
>> +			if (csum_good) {
>>  				skb->ip_summed = CHECKSUM_UNNECESSARY;
>> +				if (be16_to_cpu(skb->protocol) == ETH_P_IP) {
>> +					skb_set_network_header(skb, 0);
>> +					skb_set_transport_header(skb, sizeof(struct iphdr));
>> +					iph = ip_hdr(skb);
>> +
>> +					/* If the IP checksum is not offloaded and if the packet
>> +					 *  is large send, the checksum must be rebuilt.
>> +					 */
>> +					if (iph->check == 0xffff)
>> +						iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
>
> How can this possibly work ?
>
> Normally you would have to set iph->check to 0 before calling
> ip_fast_csum(), as done in ip_send_check()
I don't have an answer for why I weren't seeing any problems while testing this, but I'll go back and set iph->check to zero and retest.  Thanks for noticing this.
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  reply	other threads:[~2015-04-21 18:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 20:35 [PATCH 1/5] ibmveth: change rx buffer default allocation for CMO Thomas Falcon
2015-04-14 20:35 ` [PATCH 2/5] ibmveth: Add support for TSO Thomas Falcon
2015-04-14 20:35 ` [PATCH 3/5] ibmveth: Add GRO support Thomas Falcon
2015-04-14 20:35 ` [PATCH 4/5] ibmveth: Add support for Large Receive Offload Thomas Falcon
2015-04-14 22:00   ` Eric Dumazet
2015-04-21 18:59     ` Thomas Falcon [this message]
2015-04-14 20:35 ` [PATCH 5/5] ibmveth: Add ethtool statistics for tx and rx large packets Thomas Falcon
2015-04-14 20:53 ` [PATCH 1/5] ibmveth: change rx buffer default allocation for CMO David Miller

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=55369E12.4060509@linux.vnet.ibm.com \
    --to=tlfalcon@linux.vnet.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.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 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).