lkml.org 
[lkml]   [2011]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v5] net: add Faraday FTMAC100 10/100 Ethernet driver
    From
    Date
    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/

    \
     
     \ /
      Last update: 2011-01-24 16:11    [W:0.023 / U:30.480 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site