diff options
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-drv.c')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 29554992215a..2349ea970255 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c | |||
@@ -1465,7 +1465,7 @@ static int xgbe_set_features(struct net_device *netdev, | |||
1465 | { | 1465 | { |
1466 | struct xgbe_prv_data *pdata = netdev_priv(netdev); | 1466 | struct xgbe_prv_data *pdata = netdev_priv(netdev); |
1467 | struct xgbe_hw_if *hw_if = &pdata->hw_if; | 1467 | struct xgbe_hw_if *hw_if = &pdata->hw_if; |
1468 | unsigned int rxcsum, rxvlan, rxvlan_filter; | 1468 | netdev_features_t rxcsum, rxvlan, rxvlan_filter; |
1469 | 1469 | ||
1470 | rxcsum = pdata->netdev_features & NETIF_F_RXCSUM; | 1470 | rxcsum = pdata->netdev_features & NETIF_F_RXCSUM; |
1471 | rxvlan = pdata->netdev_features & NETIF_F_HW_VLAN_CTAG_RX; | 1471 | rxvlan = pdata->netdev_features & NETIF_F_HW_VLAN_CTAG_RX; |
@@ -1598,7 +1598,8 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) | |||
1598 | struct skb_shared_hwtstamps *hwtstamps; | 1598 | struct skb_shared_hwtstamps *hwtstamps; |
1599 | unsigned int incomplete, error, context_next, context; | 1599 | unsigned int incomplete, error, context_next, context; |
1600 | unsigned int len, put_len, max_len; | 1600 | unsigned int len, put_len, max_len; |
1601 | int received = 0; | 1601 | unsigned int received = 0; |
1602 | int packet_count = 0; | ||
1602 | 1603 | ||
1603 | DBGPR("-->xgbe_rx_poll: budget=%d\n", budget); | 1604 | DBGPR("-->xgbe_rx_poll: budget=%d\n", budget); |
1604 | 1605 | ||
@@ -1608,7 +1609,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) | |||
1608 | 1609 | ||
1609 | rdata = XGBE_GET_DESC_DATA(ring, ring->cur); | 1610 | rdata = XGBE_GET_DESC_DATA(ring, ring->cur); |
1610 | packet = &ring->packet_data; | 1611 | packet = &ring->packet_data; |
1611 | while (received < budget) { | 1612 | while (packet_count < budget) { |
1612 | DBGPR(" cur = %d\n", ring->cur); | 1613 | DBGPR(" cur = %d\n", ring->cur); |
1613 | 1614 | ||
1614 | /* First time in loop see if we need to restore state */ | 1615 | /* First time in loop see if we need to restore state */ |
@@ -1662,7 +1663,7 @@ read_again: | |||
1662 | if (packet->errors) | 1663 | if (packet->errors) |
1663 | DBGPR("Error in received packet\n"); | 1664 | DBGPR("Error in received packet\n"); |
1664 | dev_kfree_skb(skb); | 1665 | dev_kfree_skb(skb); |
1665 | continue; | 1666 | goto next_packet; |
1666 | } | 1667 | } |
1667 | 1668 | ||
1668 | if (!context) { | 1669 | if (!context) { |
@@ -1677,7 +1678,7 @@ read_again: | |||
1677 | } | 1678 | } |
1678 | 1679 | ||
1679 | dev_kfree_skb(skb); | 1680 | dev_kfree_skb(skb); |
1680 | continue; | 1681 | goto next_packet; |
1681 | } | 1682 | } |
1682 | memcpy(skb_tail_pointer(skb), rdata->skb->data, | 1683 | memcpy(skb_tail_pointer(skb), rdata->skb->data, |
1683 | put_len); | 1684 | put_len); |
@@ -1694,7 +1695,7 @@ read_again: | |||
1694 | 1695 | ||
1695 | /* Stray Context Descriptor? */ | 1696 | /* Stray Context Descriptor? */ |
1696 | if (!skb) | 1697 | if (!skb) |
1697 | continue; | 1698 | goto next_packet; |
1698 | 1699 | ||
1699 | /* Be sure we don't exceed the configured MTU */ | 1700 | /* Be sure we don't exceed the configured MTU */ |
1700 | max_len = netdev->mtu + ETH_HLEN; | 1701 | max_len = netdev->mtu + ETH_HLEN; |
@@ -1705,7 +1706,7 @@ read_again: | |||
1705 | if (skb->len > max_len) { | 1706 | if (skb->len > max_len) { |
1706 | DBGPR("packet length exceeds configured MTU\n"); | 1707 | DBGPR("packet length exceeds configured MTU\n"); |
1707 | dev_kfree_skb(skb); | 1708 | dev_kfree_skb(skb); |
1708 | continue; | 1709 | goto next_packet; |
1709 | } | 1710 | } |
1710 | 1711 | ||
1711 | #ifdef XGMAC_ENABLE_RX_PKT_DUMP | 1712 | #ifdef XGMAC_ENABLE_RX_PKT_DUMP |
@@ -1739,6 +1740,9 @@ read_again: | |||
1739 | 1740 | ||
1740 | netdev->last_rx = jiffies; | 1741 | netdev->last_rx = jiffies; |
1741 | napi_gro_receive(&pdata->napi, skb); | 1742 | napi_gro_receive(&pdata->napi, skb); |
1743 | |||
1744 | next_packet: | ||
1745 | packet_count++; | ||
1742 | } | 1746 | } |
1743 | 1747 | ||
1744 | /* Check if we need to save state before leaving */ | 1748 | /* Check if we need to save state before leaving */ |
@@ -1752,9 +1756,9 @@ read_again: | |||
1752 | rdata->state.error = error; | 1756 | rdata->state.error = error; |
1753 | } | 1757 | } |
1754 | 1758 | ||
1755 | DBGPR("<--xgbe_rx_poll: received = %d\n", received); | 1759 | DBGPR("<--xgbe_rx_poll: packet_count = %d\n", packet_count); |
1756 | 1760 | ||
1757 | return received; | 1761 | return packet_count; |
1758 | } | 1762 | } |
1759 | 1763 | ||
1760 | static int xgbe_poll(struct napi_struct *napi, int budget) | 1764 | static int xgbe_poll(struct napi_struct *napi, int budget) |