aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c5
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h1
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c55
3 files changed, 7 insertions, 54 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 10d0a5ec9add..96fa9a4cafdf 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2885,9 +2885,8 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
2885 if ((cqe_errv & 2885 if ((cqe_errv &
2886 (NES_NIC_ERRV_BITS_IPV4_CSUM_ERR | NES_NIC_ERRV_BITS_TCPUDP_CSUM_ERR | 2886 (NES_NIC_ERRV_BITS_IPV4_CSUM_ERR | NES_NIC_ERRV_BITS_TCPUDP_CSUM_ERR |
2887 NES_NIC_ERRV_BITS_IPH_ERR | NES_NIC_ERRV_BITS_WQE_OVERRUN)) == 0) { 2887 NES_NIC_ERRV_BITS_IPH_ERR | NES_NIC_ERRV_BITS_WQE_OVERRUN)) == 0) {
2888 if (nesvnic->rx_checksum_disabled == 0) { 2888 if (nesvnic->netdev->features & NETIF_F_RXCSUM)
2889 rx_skb->ip_summed = CHECKSUM_UNNECESSARY; 2889 rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
2890 }
2891 } else 2890 } else
2892 nes_debug(NES_DBG_CQ, "%s: unsuccessfully checksummed TCP or UDP packet." 2891 nes_debug(NES_DBG_CQ, "%s: unsuccessfully checksummed TCP or UDP packet."
2893 " errv = 0x%X, pkt_type = 0x%X.\n", 2892 " errv = 0x%X, pkt_type = 0x%X.\n",
@@ -2897,7 +2896,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
2897 if ((cqe_errv & 2896 if ((cqe_errv &
2898 (NES_NIC_ERRV_BITS_IPV4_CSUM_ERR | NES_NIC_ERRV_BITS_IPH_ERR | 2897 (NES_NIC_ERRV_BITS_IPV4_CSUM_ERR | NES_NIC_ERRV_BITS_IPH_ERR |
2899 NES_NIC_ERRV_BITS_WQE_OVERRUN)) == 0) { 2898 NES_NIC_ERRV_BITS_WQE_OVERRUN)) == 0) {
2900 if (nesvnic->rx_checksum_disabled == 0) { 2899 if (nesvnic->netdev->features & NETIF_F_RXCSUM) {
2901 rx_skb->ip_summed = CHECKSUM_UNNECESSARY; 2900 rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
2902 /* nes_debug(NES_DBG_CQ, "%s: Reporting successfully checksummed IPv4 packet.\n", 2901 /* nes_debug(NES_DBG_CQ, "%s: Reporting successfully checksummed IPv4 packet.\n",
2903 nesvnic->netdev->name); */ 2902 nesvnic->netdev->name); */
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index d2abe07133a5..91594116f947 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -1245,7 +1245,6 @@ struct nes_vnic {
1245 u8 next_qp_nic_index; 1245 u8 next_qp_nic_index;
1246 u8 of_device_registered; 1246 u8 of_device_registered;
1247 u8 rdma_enabled; 1247 u8 rdma_enabled;
1248 u8 rx_checksum_disabled;
1249 u32 lro_max_aggr; 1248 u32 lro_max_aggr;
1250 struct net_lro_mgr lro_mgr; 1249 struct net_lro_mgr lro_mgr;
1251 struct net_lro_desc lro_desc[NES_MAX_LRO_DESCRIPTORS]; 1250 struct net_lro_desc lro_desc[NES_MAX_LRO_DESCRIPTORS];
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index e96b8fb5d44c..d2e67c4e3228 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1093,34 +1093,6 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = {
1093}; 1093};
1094#define NES_ETHTOOL_STAT_COUNT ARRAY_SIZE(nes_ethtool_stringset) 1094#define NES_ETHTOOL_STAT_COUNT ARRAY_SIZE(nes_ethtool_stringset)
1095 1095
1096/**
1097 * nes_netdev_get_rx_csum
1098 */
1099static u32 nes_netdev_get_rx_csum (struct net_device *netdev)
1100{
1101 struct nes_vnic *nesvnic = netdev_priv(netdev);
1102
1103 if (nesvnic->rx_checksum_disabled)
1104 return 0;
1105 else
1106 return 1;
1107}
1108
1109
1110/**
1111 * nes_netdev_set_rc_csum
1112 */
1113static int nes_netdev_set_rx_csum(struct net_device *netdev, u32 enable)
1114{
1115 struct nes_vnic *nesvnic = netdev_priv(netdev);
1116
1117 if (enable)
1118 nesvnic->rx_checksum_disabled = 0;
1119 else
1120 nesvnic->rx_checksum_disabled = 1;
1121 return 0;
1122}
1123
1124 1096
1125/** 1097/**
1126 * nes_netdev_get_sset_count 1098 * nes_netdev_get_sset_count
@@ -1598,19 +1570,10 @@ static int nes_netdev_set_settings(struct net_device *netdev, struct ethtool_cmd
1598} 1570}
1599 1571
1600 1572
1601static int nes_netdev_set_flags(struct net_device *netdev, u32 flags)
1602{
1603 return ethtool_op_set_flags(netdev, flags, ETH_FLAG_LRO);
1604}
1605
1606
1607static const struct ethtool_ops nes_ethtool_ops = { 1573static const struct ethtool_ops nes_ethtool_ops = {
1608 .get_link = ethtool_op_get_link, 1574 .get_link = ethtool_op_get_link,
1609 .get_settings = nes_netdev_get_settings, 1575 .get_settings = nes_netdev_get_settings,
1610 .set_settings = nes_netdev_set_settings, 1576 .set_settings = nes_netdev_set_settings,
1611 .get_tx_csum = ethtool_op_get_tx_csum,
1612 .get_rx_csum = nes_netdev_get_rx_csum,
1613 .get_sg = ethtool_op_get_sg,
1614 .get_strings = nes_netdev_get_strings, 1577 .get_strings = nes_netdev_get_strings,
1615 .get_sset_count = nes_netdev_get_sset_count, 1578 .get_sset_count = nes_netdev_get_sset_count,
1616 .get_ethtool_stats = nes_netdev_get_ethtool_stats, 1579 .get_ethtool_stats = nes_netdev_get_ethtool_stats,
@@ -1619,13 +1582,6 @@ static const struct ethtool_ops nes_ethtool_ops = {
1619 .set_coalesce = nes_netdev_set_coalesce, 1582 .set_coalesce = nes_netdev_set_coalesce,
1620 .get_pauseparam = nes_netdev_get_pauseparam, 1583 .get_pauseparam = nes_netdev_get_pauseparam,
1621 .set_pauseparam = nes_netdev_set_pauseparam, 1584 .set_pauseparam = nes_netdev_set_pauseparam,
1622 .set_tx_csum = ethtool_op_set_tx_csum,
1623 .set_rx_csum = nes_netdev_set_rx_csum,
1624 .set_sg = ethtool_op_set_sg,
1625 .get_tso = ethtool_op_get_tso,
1626 .set_tso = ethtool_op_set_tso,
1627 .get_flags = ethtool_op_get_flags,
1628 .set_flags = nes_netdev_set_flags,
1629}; 1585};
1630 1586
1631 1587
@@ -1727,12 +1683,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1727 netdev->dev_addr[5] = (u8)u64temp; 1683 netdev->dev_addr[5] = (u8)u64temp;
1728 memcpy(netdev->perm_addr, netdev->dev_addr, 6); 1684 memcpy(netdev->perm_addr, netdev->dev_addr, 6);
1729 1685
1730 if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV)) { 1686 netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_IP_CSUM;
1731 netdev->features |= NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM; 1687 if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV))
1732 netdev->features |= NETIF_F_GSO | NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM; 1688 netdev->hw_features |= NETIF_F_TSO;
1733 } else { 1689 netdev->features |= netdev->hw_features;
1734 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 1690 netdev->hw_features |= NETIF_F_LRO;
1735 }
1736 1691
1737 nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d," 1692 nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d,"
1738 " nic_index = %d, logical_port = %d, mac_index = %d.\n", 1693 " nic_index = %d, logical_port = %d, mac_index = %d.\n",