lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 21 Apr 2015 13:59:30 -0500
From:	Thomas Falcon <tlfalcon@...ux.vnet.ibm.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	Brian King <brking@...ux.vnet.ibm.com>, netdev@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 4/5] ibmveth: Add support for Large Receive Offload

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@...ux.vnet.ibm.com>
>> Signed-off-by: Thomas Falcon <tlfalcon@...ux.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@...ts.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists