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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Jun 2007 16:23:19 -0700
From:	"Ron Mercer" <ron.mercer@...gic.com>
To:	"Jeff Garzik" <jgarzik@...ox.com>
Cc:	<netdev@...r.kernel.org>
Subject: RE: [PATCH 2/3] qla3xxx: cleanup checksum offload code

Jeff,
You've already appled patch 1/3 in Stephen's series.  I tested this one
(2/3) and it looks good.  I can resubmit this if you want.
Regards, Ron Mercer

> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@...ux-foundation.org] 
> Sent: Wednesday, May 30, 2007 2:23 PM
> To: Jeff Garzik; Linux Driver
> Cc: netdev@...r.kernel.org
> Subject: [PATCH 2/3] qla3xxx: cleanup checksum offload code
> 
> The code for checksum is more complex than needed when 
> dealing with VLAN's;
> the higher layers already pass down the location of the IP header.
> 
> Compile tested only, no hardware available.
> 
> Signed-off-by: Stephen Hemminger <shemminger@...ux-foundation.org>
> 
> ---
>  drivers/net/qla3xxx.c |   37 +++++++++++--------------------------
>  1 file changed, 11 insertions(+), 26 deletions(-)
> 
> --- a/drivers/net/qla3xxx.c	2007-05-30 14:09:25.000000000 -0700
> +++ b/drivers/net/qla3xxx.c	2007-05-30 14:09:31.000000000 -0700
> @@ -2433,37 +2433,22 @@ static int ql_get_seg_count(struct ql3_a
>  	return -1;
>  }
>  
> -static void ql_hw_csum_setup(struct sk_buff *skb,
> +static void ql_hw_csum_setup(const struct sk_buff *skb,
>  			     struct ob_mac_iocb_req *mac_iocb_ptr)
>  {
> -	struct ethhdr *eth;
> -	struct iphdr *ip = NULL;
> -	u8 offset = ETH_HLEN;
> -
> -	eth = (struct ethhdr *)(skb->data);
> -
> -	if (eth->h_proto == __constant_htons(ETH_P_IP)) {
> -		ip = (struct iphdr *)&skb->data[ETH_HLEN];
> -	} else if (eth->h_proto == htons(ETH_P_8021Q) &&
> -		   ((struct vlan_ethhdr *)skb->data)->
> -		   h_vlan_encapsulated_proto == 
> __constant_htons(ETH_P_IP)) {
> -		ip = (struct iphdr *)&skb->data[VLAN_ETH_HLEN];
> -		offset = VLAN_ETH_HLEN;
> -	}
> -
> -	if (ip) {
> -		if (ip->protocol == IPPROTO_TCP) {
> -			mac_iocb_ptr->flags1 |= 
> OB_3032MAC_IOCB_REQ_TC | 
> +	const struct iphdr *ip = ip_hdr(skb);
> +
> +	mac_iocb_ptr->ip_hdr_off = skb_network_offset(skb);
> +	mac_iocb_ptr->ip_hdr_len = ip->ihl;
> +
> +	if (ip->protocol == IPPROTO_TCP) {
> +		mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_TC |
>  			OB_3032MAC_IOCB_REQ_IC;
> -			mac_iocb_ptr->ip_hdr_off = offset;
> -			mac_iocb_ptr->ip_hdr_len = ip->ihl;
> -		} else if (ip->protocol == IPPROTO_UDP) {
> -			mac_iocb_ptr->flags1 |= 
> OB_3032MAC_IOCB_REQ_UC | 
> +	} else {
> +		mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_UC |
>  			OB_3032MAC_IOCB_REQ_IC;
> -			mac_iocb_ptr->ip_hdr_off = offset;
> -			mac_iocb_ptr->ip_hdr_len = ip->ihl;
> -		}
>  	}
> +
>  }
>  
>  /*
> 
> -- 
> Stephen Hemminger <shemminger@...ux-foundation.org>
> 
> 
-
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