netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ram Pai <linuxram@us.ibm.com>
To: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Sathya Perla <sathya.perla@emulex.com>,
	Subramanian Seetharaman <subbu.seetharaman@emulex.com>
Subject: Re: [PATCH net-next-2.6 2/7] be2net: Checksum field valid only for TCP/UDP
Date: Thu, 10 Mar 2011 16:05:09 -0800	[thread overview]
Message-ID: <20110311000509.GA28596@ram-laptop> (raw)
In-Reply-To: <79e10ac8-3f25-4ee2-9a0d-08d39cd9fe9c@exht1.ad.emulex.com>

On Mon, Mar 07, 2011 at 06:38:16PM +0530, Padmanabh Ratnakar wrote:
> L4 checksum field is valid only for TCP/UDP packets in Lancer
> 
> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com>
> ---
>  drivers/net/benet/be_main.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
> index bf34434..ac7ae21 100644
> --- a/drivers/net/benet/be_main.c
> +++ b/drivers/net/benet/be_main.c
> @@ -865,14 +865,17 @@ static void be_rx_stats_update(struct be_rx_obj *rxo,
> 
>  static inline bool csum_passed(struct be_eth_rx_compl *rxcp)
>  {
> -	u8 l4_cksm, ipv6, ipcksm;
> +	u8 l4_cksm, ipv6, ipcksm, tcpf, udpf;
> 
>  	l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp);
>  	ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp);
>  	ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp);
> +	tcpf = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp);
> +	udpf = AMAP_GET_BITS(struct amap_eth_rx_compl, udpf, rxcp);
> 
> -	/* Ignore ipcksm for ipv6 pkts */
> -	return l4_cksm && (ipcksm || ipv6);
> +	/* L4 checksum is not reliable for non TCP/UDP packets.
> +	 * Also ignore ipcksm for ipv6 pkts */
> +	return (tcpf || udpf) && l4_cksm && (ipcksm || ipv6);

Is it invalid for non-Lancer too ?  if not, then should'nt the
above condition be applied only for lancer?

RP

  reply	other threads:[~2011-03-11  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 13:08 [PATCH net-next-2.6 2/7] be2net: Checksum field valid only for TCP/UDP Padmanabh Ratnakar
2011-03-11  0:05 ` Ram Pai [this message]
2011-03-11 10:04   ` Padmanabh.Ratnakar

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=20110311000509.GA28596@ram-laptop \
    --to=linuxram@us.ibm.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=padmanabh.ratnakar@emulex.com \
    --cc=sathya.perla@emulex.com \
    --cc=subbu.seetharaman@emulex.com \
    /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).