Re: [2.6 patch] e1000_main.c: fix inline compile errors

From: Denis Vlasenko
Date: Thu Jul 15 2004 - 04:16:56 EST


On Thursday 15 July 2004 00:01, Adrian Bunk wrote:
> /**
> + * e1000_rx_checksum - Receive Checksum Offload for 82543
> + * @adapter: board private structure
> + * @rx_desc: receive descriptor
> + * @sk_buff: socket buffer with received data
> + **/
> +
> +static inline void
> +e1000_rx_checksum(struct e1000_adapter *adapter,
> + struct e1000_rx_desc *rx_desc,
> + struct sk_buff *skb)
> +{
> + /* 82543 or newer only */
> + if((adapter->hw.mac_type < e1000_82543) ||
> + /* Ignore Checksum bit is set */
> + (rx_desc->status & E1000_RXD_STAT_IXSM) ||
> + /* TCP Checksum has not been calculated */
> + (!(rx_desc->status & E1000_RXD_STAT_TCPCS))) {
> + skb->ip_summed = CHECKSUM_NONE;
> + return;
> + }
> +
> + /* At this point we know the hardware did the TCP checksum */
> + /* now look at the TCP checksum error bit */
> + if(rx_desc->errors & E1000_RXD_ERR_TCPE) {
> + /* let the stack verify checksum errors */
> + skb->ip_summed = CHECKSUM_NONE;
> + adapter->hw_csum_err++;
> + } else {
> + /* TCP checksum is good */
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> + adapter->hw_csum_good++;
> + }
> +}
> +
> +/**
> * e1000_clean_rx_irq - Send received data up the network stack,
> * @adapter: board private structure
> **/

As you go thru them, consider removing inline keyword for
such large functions.


> @@ -2580,41 +2616,6 @@
> return E1000_SUCCESS;
> }
>
> -/**
> - * e1000_rx_checksum - Receive Checksum Offload for 82543
> - * @adapter: board private structure
> - * @rx_desc: receive descriptor
> - * @sk_buff: socket buffer with received data
> - **/
> -
> -static inline void
> -e1000_rx_checksum(struct e1000_adapter *adapter,
> - struct e1000_rx_desc *rx_desc,
> - struct sk_buff *skb)
> -{
> - /* 82543 or newer only */
> - if((adapter->hw.mac_type < e1000_82543) ||
> - /* Ignore Checksum bit is set */
> - (rx_desc->status & E1000_RXD_STAT_IXSM) ||
> - /* TCP Checksum has not been calculated */
> - (!(rx_desc->status & E1000_RXD_STAT_TCPCS))) {
> - skb->ip_summed = CHECKSUM_NONE;
> - return;
> - }
> -
> - /* At this point we know the hardware did the TCP checksum */
> - /* now look at the TCP checksum error bit */
> - if(rx_desc->errors & E1000_RXD_ERR_TCPE) {
> - /* let the stack verify checksum errors */
> - skb->ip_summed = CHECKSUM_NONE;
> - adapter->hw_csum_err++;
> - } else {
> - /* TCP checksum is good */
> - skb->ip_summed = CHECKSUM_UNNECESSARY;
> - adapter->hw_csum_good++;
> - }
> -}
> -

--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/