Re: [PATCH v5] net: add Faraday FTMAC100 10/100 Ethernet driver

From: Eric Dumazet
Date: Mon Jan 24 2011 - 10:07:58 EST


Le lundi 24 janvier 2011 Ã 20:39 +0800, Po-Yu Chuang a Ãcrit :
> From: Po-Yu Chuang <ratbert@xxxxxxxxxxxxxxxx>


> +static int ftmac100_xmit(struct ftmac100 *priv, struct sk_buff *skb,
> + dma_addr_t map)
> +{
> + struct net_device *netdev = priv->netdev;
> + struct ftmac100_txdes *txdes;
> + unsigned int len = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;
> +
> + txdes = ftmac100_current_txdes(priv);
> + ftmac100_tx_pointer_advance(priv);
> +
> + /* setup TX descriptor */
> +
> + spin_lock(&priv->tx_lock);
> + ftmac100_txdes_set_skb(txdes, skb);
> + ftmac100_txdes_set_dma_addr(txdes, map);
> +
> + ftmac100_txdes_set_first_segment(txdes);
> + ftmac100_txdes_set_last_segment(txdes);
> + ftmac100_txdes_set_txint(txdes);
> + ftmac100_txdes_set_buffer_size(txdes, len);
> +
> + priv->tx_pending++;
> + if (priv->tx_pending == TX_QUEUE_ENTRIES) {
> + if (net_ratelimit())
> + netdev_info(netdev, "tx queue full\n");

Hmm, I guess you didnt tested your driver with a pktgen flood ;)

This 'netdev_info(netdev, "tx queue full\n");' is not necessary, since
its a pretty normal condition for a driver (to fill its TX ring buffer)

> +
> + netif_stop_queue(netdev);
> + }
> +
> + /* start transmit */
> + ftmac100_txdes_set_dma_own(txdes);
> + spin_unlock(&priv->tx_lock);
> +
> + ftmac100_txdma_start_polling(priv);
> +
> + return NETDEV_TX_OK;
> +}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/