Re: [PATCH net-next 07/12] r8152: support rx checksum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hayes Wang <hayeswang@xxxxxxxxxxx>
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 linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux