[ewg] [PATCH 6/6] nes: remove unnecessary kernel macro #ifdefs

Glenn Grundstrom NetEffect glenn at lists.openfabrics.org
Thu Dec 13 16:57:47 PST 2007


NETIF_F_xxx and HAVE_xxx macro #ifdefs are not needed and
have been removed.

>From Rolands infiniband git tree to update OFED.

Signed-off-by: Glenn Grundstrom <ggrundstrom at neteffect.com>

---

diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 0f50cd5..f196c43 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -357,9 +357,7 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
 	struct nes_device *nesdev = nesvnic->nesdev;
 	struct nes_hw_nic *nesnic = &nesvnic->nic;
 	struct nes_hw_nic_sq_wqe *nic_sqe;
-#ifdef NETIF_F_TSO
 	struct tcphdr *tcph;
-#endif
 	u16 *wqe_fragment_length;
 	u32 wqe_misc;
 	u16 wqe_fragment_index = 1;	/* first fragment (0) is used by copy buffer */
@@ -385,7 +383,6 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		tcph = tcp_hdr(skb);
 		if (1) {
-#ifdef NETIF_F_TSO
 			if (skb_is_gso(skb)) {
 				/* nes_debug(NES_DBG_NIC_TX, "%s: TSO request... seg size = %u\n",
 						netdev->name, skb_is_gso(skb)); */
@@ -395,11 +392,8 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
 						cpu_to_le32(((u32)tcph->doff) |
 						(((u32)(((unsigned char *)tcph) - skb->data)) << 4));
 			} else {
-#endif
 				wqe_misc |= NES_NIC_SQ_WQE_COMPLETION;
-#ifdef NETIF_F_TSO
 			}
-#endif
 		}
 	} else {	/* CHECKSUM_HW */
 		wqe_misc |= NES_NIC_SQ_WQE_DISABLE_CHKSUM | NES_NIC_SQ_WQE_COMPLETION;
@@ -475,7 +469,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 	struct nes_device *nesdev = nesvnic->nesdev;
 	struct nes_hw_nic *nesnic = &nesvnic->nic;
 	struct nes_hw_nic_sq_wqe *nic_sqe;
-#ifdef NETIF_F_TSO
 	struct tcphdr *tcph;
 	/* struct udphdr *udph; */
 #define NES_MAX_TSO_FRAGS 18
@@ -486,7 +479,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 	u32 tso_frag_count;
 	u32 tso_wqe_length;
 	u32 curr_tcp_seq;
-#endif
 	u32 wqe_count=1;
 	u32 send_rc;
 	struct iphdr *iph;
@@ -499,10 +491,8 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 	u16 wqe_fragment_index=1;
 	u16 hoffset;
 	u16 nhoffset;
-#ifdef NETIF_F_TSO
 	u16 wqes_needed;
 	u16 wqes_available;
-#endif
 	u32 old_head;
 	u32 wqe_misc;
 
@@ -532,7 +522,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 	}
 	/* Check if too many fragments */
 	if (unlikely((nr_frags > 4))) {
-#ifdef NETIF_F_TSO
 		if (skb_is_gso(skb)) {
 			nesvnic->segmented_tso_requests++;
 			nesvnic->tso_requests++;
@@ -663,7 +652,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 				nesnic->sq_head &= nesnic->sq_size-1;
 			}
 		} else {
-#endif
 			nesvnic->linearized_skbs++;
 			hoffset = skb_transport_header(skb) - skb->data;
 			nhoffset = skb_network_header(skb) - skb->data;
@@ -675,9 +663,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 				spin_unlock_irqrestore(&nesnic->sq_lock, flags);
 				return NETDEV_TX_OK;
 			}
-#ifdef NETIF_F_TSO
 		}
-#endif
 	} else {
 		send_rc = nes_nic_send(skb, netdev);
 		if (send_rc != NETDEV_TX_OK) {
@@ -802,7 +788,6 @@ static void nes_netdev_tx_timeout(struct net_device *netdev)
 }
 
 
-#ifdef HAVE_SET_MAC_ADDR
 /**
  * nes_netdev_set_mac_address
  */
@@ -845,10 +830,8 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
 	}
 	return 0;
 }
-#endif
 
 
-#ifdef HAVE_MULTICAST
 /**
  * nes_netdev_set_multicast_list
  */
@@ -931,7 +914,6 @@ void nes_netdev_set_multicast_list(struct net_device *netdev)
 		}
 	}
 }
-#endif
 
 
 /**
@@ -1500,14 +1482,11 @@ static struct ethtool_ops nes_ethtool_ops = {
 	.set_tx_csum = ethtool_op_set_tx_csum,
 	.set_rx_csum = nes_netdev_set_rx_csum,
 	.set_sg = ethtool_op_set_sg,
-#ifdef NETIF_F_TSO
 	.get_tso = ethtool_op_get_tso,
 	.set_tso = ethtool_op_set_tso,
-#endif
 };
 
 
-#ifdef NETIF_F_HW_VLAN_TX
 static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 {
 	struct nes_vnic *nesvnic = netdev_priv(netdev);
@@ -1525,7 +1504,6 @@ static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_g
 
 	nes_write_indexed(nesdev, NES_IDX_PCIX_DIAG, u32temp);
 }
-#endif
 
 
 /**
@@ -1561,9 +1539,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
 	netdev->get_stats = nes_netdev_get_stats;
 	netdev->tx_timeout = nes_netdev_tx_timeout;
 	netdev->set_mac_address = nes_netdev_set_mac_address;
-#ifdef HAVE_MULTICAST
 	netdev->set_multicast_list = nes_netdev_set_multicast_list;
-#endif
 	netdev->change_mtu = nes_netdev_change_mtu;
 	netdev->watchdog_timeo = NES_TX_TIMEOUT;
 	netdev->irq = nesdev->pcidev->irq;
@@ -1576,14 +1552,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
 #ifdef NES_NAPI
 	netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
 #endif
-#ifdef NETIF_F_HW_VLAN_TX
 	nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
 	netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
 	netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
-#endif
-#ifdef NETIF_F_LLTX
 	netdev->features |= NETIF_F_LLTX;
-#endif
 
 	/* Fill in the port structure */
 	nesvnic->netdev = netdev;
@@ -1611,12 +1583,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
 	memcpy(netdev->perm_addr, netdev->dev_addr, 6);
 
 	if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV)) {
-#ifdef NETIF_F_TSO
 		netdev->features |= NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM;
-#endif
-#ifdef NETIF_F_GSO
-		netdev->features |= NETIF_F_GSO | NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM;
-#endif
 	} else {
 		netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
 	}



More information about the ewg mailing list