diff options
author | Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> | 2012-09-20 16:53:27 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-09-30 23:34:53 -0400 |
commit | 48a9956362c27e717a76435d450d906d5f49344a (patch) | |
tree | c410ccf83cb0429834505f79216af7dbff9b18f8 /drivers/infiniband | |
parent | 6ad1be814b106e182d9b12898280d0c115541b72 (diff) |
RDMA/nes: Cosmetic changes
- Remove unnecessary statement "if (1)"
- Refactor a statement (wqe_misc |= NES_NIC_SQ_WQE_COMPLETION) out of
if/else statement, because it is independant of the flow.
- Define netdev->features in one line for clarity.
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_nic.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 1c02ba787536..d0391ac21d9b 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
@@ -385,24 +385,20 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev) | |||
385 | /* bump past the vlan tag */ | 385 | /* bump past the vlan tag */ |
386 | wqe_fragment_length++; | 386 | wqe_fragment_length++; |
387 | /* wqe_fragment_address = (u64 *)&nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX]; */ | 387 | /* wqe_fragment_address = (u64 *)&nic_sqe->wqe_words[NES_NIC_SQ_WQE_FRAG0_LOW_IDX]; */ |
388 | wqe_misc |= NES_NIC_SQ_WQE_COMPLETION; | ||
388 | 389 | ||
389 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 390 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
390 | tcph = tcp_hdr(skb); | 391 | if (skb_is_gso(skb)) { |
391 | if (1) { | 392 | tcph = tcp_hdr(skb); |
392 | if (skb_is_gso(skb)) { | 393 | /* nes_debug(NES_DBG_NIC_TX, "%s: TSO request... is_gso = %u seg size = %u\n", |
393 | /* nes_debug(NES_DBG_NIC_TX, "%s: TSO request... is_gso = %u seg size = %u\n", | 394 | netdev->name, skb_is_gso(skb), skb_shinfo(skb)->gso_size); */ |
394 | netdev->name, skb_is_gso(skb), skb_shinfo(skb)->gso_size); */ | 395 | wqe_misc |= NES_NIC_SQ_WQE_LSO_ENABLE | (u16)skb_shinfo(skb)->gso_size; |
395 | wqe_misc |= NES_NIC_SQ_WQE_LSO_ENABLE | | 396 | set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_LSO_INFO_IDX, |
396 | NES_NIC_SQ_WQE_COMPLETION | (u16)skb_shinfo(skb)->gso_size; | 397 | ((u32)tcph->doff) | |
397 | set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_LSO_INFO_IDX, | 398 | (((u32)(((unsigned char *)tcph) - skb->data)) << 4)); |
398 | ((u32)tcph->doff) | | ||
399 | (((u32)(((unsigned char *)tcph) - skb->data)) << 4)); | ||
400 | } else { | ||
401 | wqe_misc |= NES_NIC_SQ_WQE_COMPLETION; | ||
402 | } | ||
403 | } | 399 | } |
404 | } else { /* CHECKSUM_HW */ | 400 | } else { /* CHECKSUM_HW */ |
405 | wqe_misc |= NES_NIC_SQ_WQE_DISABLE_CHKSUM | NES_NIC_SQ_WQE_COMPLETION; | 401 | wqe_misc |= NES_NIC_SQ_WQE_DISABLE_CHKSUM; |
406 | } | 402 | } |
407 | 403 | ||
408 | set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_TOTAL_LENGTH_IDX, | 404 | set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_TOTAL_LENGTH_IDX, |
@@ -1679,12 +1675,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev, | |||
1679 | netdev->hard_header_len = ETH_HLEN; | 1675 | netdev->hard_header_len = ETH_HLEN; |
1680 | netdev->addr_len = ETH_ALEN; | 1676 | netdev->addr_len = ETH_ALEN; |
1681 | netdev->type = ARPHRD_ETHER; | 1677 | netdev->type = ARPHRD_ETHER; |
1682 | netdev->features = NETIF_F_HIGHDMA; | ||
1683 | netdev->netdev_ops = &nes_netdev_ops; | 1678 | netdev->netdev_ops = &nes_netdev_ops; |
1684 | netdev->ethtool_ops = &nes_ethtool_ops; | 1679 | netdev->ethtool_ops = &nes_ethtool_ops; |
1685 | netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128); | 1680 | netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128); |
1686 | nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n"); | 1681 | nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n"); |
1687 | netdev->features |= NETIF_F_HW_VLAN_TX; | ||
1688 | 1682 | ||
1689 | /* Fill in the port structure */ | 1683 | /* Fill in the port structure */ |
1690 | nesvnic->netdev = netdev; | 1684 | nesvnic->netdev = netdev; |
@@ -1711,11 +1705,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev, | |||
1711 | netdev->dev_addr[5] = (u8)u64temp; | 1705 | netdev->dev_addr[5] = (u8)u64temp; |
1712 | memcpy(netdev->perm_addr, netdev->dev_addr, 6); | 1706 | memcpy(netdev->perm_addr, netdev->dev_addr, 6); |
1713 | 1707 | ||
1714 | netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_IP_CSUM | | 1708 | netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX; |
1715 | NETIF_F_HW_VLAN_RX; | ||
1716 | if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV)) | 1709 | if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV)) |
1717 | netdev->hw_features |= NETIF_F_TSO; | 1710 | netdev->hw_features |= NETIF_F_TSO; |
1718 | netdev->features |= netdev->hw_features; | 1711 | |
1712 | netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX; | ||
1719 | netdev->hw_features |= NETIF_F_LRO; | 1713 | netdev->hw_features |= NETIF_F_LRO; |
1720 | 1714 | ||
1721 | nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d," | 1715 | nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d," |