Messages in this thread | | | Subject | Re: [PATCH v5] net: add Faraday FTMAC100 10/100 Ethernet driver | From | Eric Dumazet <> | Date | Mon, 24 Jan 2011 16:07:42 +0100 |
| |
Le lundi 24 janvier 2011 à 20:39 +0800, Po-Yu Chuang a écrit : > From: Po-Yu Chuang <ratbert@faraday-tech.com>
> +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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |