From 6646baf7041214a9d616b55de96315179f112508 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Sat, 4 Apr 2015 22:51:16 +0300 Subject: [PATCH] staging: octeon-ethernet: eliminate USE_HW_TCPUDP_CHECKSUM define HW checksum is always enabled, so delete a redundant define. Signed-off-by: Aaro Koskinen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon/ethernet-defines.h | 6 ------ drivers/staging/octeon/ethernet-tx.c | 2 +- drivers/staging/octeon/ethernet.c | 7 ++----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/staging/octeon/ethernet-defines.h b/drivers/staging/octeon/ethernet-defines.h index de6ae6b..a837d89 100644 --- a/drivers/staging/octeon/ethernet-defines.h +++ b/drivers/staging/octeon/ethernet-defines.h @@ -31,10 +31,6 @@ * Tells the driver to populate the packet buffers with kernel skbuffs. * This allows the driver to receive packets without copying them. It also * means that 32bit userspace can't access the packet buffers. - * USE_HW_TCPUDP_CHECKSUM - * Controls if the Octeon TCP/UDP checksum engine is used for packet - * output. If this is zero, the kernel will perform the checksum in - * software. * USE_ASYNC_IOBDMA * Use asynchronous IO access to hardware. This uses Octeon's asynchronous * IOBDMAs to issue IO accesses without stalling. Set this to zero @@ -61,8 +57,6 @@ #define REUSE_SKBUFFS_WITHOUT_FREE 1 #endif -#define USE_HW_TCPUDP_CHECKSUM 1 - /* Enable Random Early Dropping under load */ #define USE_RED 1 #define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c index 5b9ac1f..94ba85a 100644 --- a/drivers/staging/octeon/ethernet-tx.c +++ b/drivers/staging/octeon/ethernet-tx.c @@ -411,7 +411,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) dont_put_skbuff_in_hw: /* Check if we can use the hardware checksumming */ - if (USE_HW_TCPUDP_CHECKSUM && (skb->protocol == htons(ETH_P_IP)) && + if ((skb->protocol == htons(ETH_P_IP)) && (ip_hdr(skb)->version == 4) && (ip_hdr(skb)->ihl == 5) && ((ip_hdr(skb)->frag_off == 0) || (ip_hdr(skb)->frag_off == htons(1 << 14))) && ((ip_hdr(skb)->protocol == IPPROTO_TCP) diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c index d395bf5..b662e2a 100644 --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -468,11 +468,8 @@ int cvm_oct_common_init(struct net_device *dev) && (always_use_pow || strstr(pow_send_list, dev->name))) priv->queue = -1; - if (priv->queue != -1) { - dev->features |= NETIF_F_SG; - if (USE_HW_TCPUDP_CHECKSUM) - dev->features |= NETIF_F_IP_CSUM; - } + if (priv->queue != -1) + dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; /* We do our own locking, Linux doesn't need to */ dev->features |= NETIF_F_LLTX; -- 2.7.4