[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140304.163242.1756502150027525045.davem@davemloft.net>
Date: Tue, 04 Mar 2014 16:32:42 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: hayeswang@...ltek.com
Cc: netdev@...r.kernel.org, nic_swsd@...ltek.com,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH net-next 07/12] r8152: support rx checksum
From: Hayes Wang <hayeswang@...ltek.com>
Date: Tue, 4 Mar 2014 20:00:59 +0800
> @@ -1453,11 +1491,19 @@ static void rx_bottom(struct r8152 *tp)
> pkt_len -= CRC_SIZE;
> rx_data += sizeof(struct rx_desc);
>
> + checksum = r8152_rx_csum(tp, rx_desc);
> + if (checksum == RTL_CHECKSUM_FAIL) {
> + stats->rx_errors++;
> + goto find_next_rx;
> + }
> +
It is not for the driver to make this policy decision and drop the
packet. It is not a device RX error event.
In fact you do not know what corrupted the checksum, or even if
the device verified it correctly. Anything is possible.
You must therefore still pass the packet up into the networking
stack using CHECKSUM_NONE, and let the protocols double-check
the checksum(s) in software and bump the appropriate statistic
counter if the checksum is really bad.
This allows allows network taps to see the packet, so that the
administrator can analyze the situation.
--
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