Commit b1977bfb authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by David S. Miller

ftgmac100: Drop support for fragmented receive

We don't support jumbo frames, we will never receive a
fragmented packet, the RX buffer is always big enough,
if not then it's a runaway packet that can be dropped.

So take out the loop that handles such things in
ftgmac100_rx_packet() which will help with subsequent
simplifications and improvements to the RX path
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c06f73fb
...@@ -534,13 +534,19 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed) ...@@ -534,13 +534,19 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
struct net_device *netdev = priv->netdev; struct net_device *netdev = priv->netdev;
struct ftgmac100_rxdes *rxdes; struct ftgmac100_rxdes *rxdes;
struct sk_buff *skb; struct sk_buff *skb;
bool done = false; struct page *page;
unsigned int size;
dma_addr_t map;
rxdes = ftgmac100_rx_locate_first_segment(priv); rxdes = ftgmac100_rx_locate_first_segment(priv);
if (!rxdes) if (!rxdes)
return false; return false;
if (unlikely(ftgmac100_rx_packet_error(priv, rxdes))) { /* We don't support segmented rx frames, so drop these
* along with packets with errors.
*/
if (unlikely(!ftgmac100_rxdes_last_segment(rxdes) ||
ftgmac100_rx_packet_error(priv, rxdes))) {
ftgmac100_rx_drop_packet(priv); ftgmac100_rx_drop_packet(priv);
return true; return true;
} }
...@@ -567,10 +573,7 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed) ...@@ -567,10 +573,7 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
(ftgmac100_rxdes_is_udp(rxdes) && !ftgmac100_rxdes_udpcs_err(rxdes))) (ftgmac100_rxdes_is_udp(rxdes) && !ftgmac100_rxdes_udpcs_err(rxdes)))
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
do { map = ftgmac100_rxdes_get_dma_addr(rxdes);
dma_addr_t map = ftgmac100_rxdes_get_dma_addr(rxdes);
struct page *page = ftgmac100_rxdes_get_page(priv, rxdes);
unsigned int size;
dma_unmap_page(priv->dev, map, RX_BUF_SIZE, DMA_FROM_DEVICE); dma_unmap_page(priv->dev, map, RX_BUF_SIZE, DMA_FROM_DEVICE);
...@@ -581,14 +584,10 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed) ...@@ -581,14 +584,10 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
skb->data_len += size; skb->data_len += size;
skb->truesize += PAGE_SIZE; skb->truesize += PAGE_SIZE;
if (ftgmac100_rxdes_last_segment(rxdes))
done = true;
ftgmac100_alloc_rx_page(priv, rxdes, GFP_ATOMIC); ftgmac100_alloc_rx_page(priv, rxdes, GFP_ATOMIC);
ftgmac100_rx_pointer_advance(priv); ftgmac100_rx_pointer_advance(priv);
rxdes = ftgmac100_current_rxdes(priv); rxdes = ftgmac100_current_rxdes(priv);
} while (!done);
/* Small frames are copied into linear part of skb to free one page */ /* Small frames are copied into linear part of skb to free one page */
if (skb->len <= 128) { if (skb->len <= 128) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment