lkml.org 
[lkml]   [2018]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next] net: ti: fix return type of ndo_start_xmit function
From
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 26 Sep 2018 17:09:51 +0800

> @@ -1290,7 +1291,7 @@ static int netcp_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> dev_warn(netcp->ndev_dev, "padding failed (%d), packet dropped\n",
> ret);
> tx_stats->tx_dropped++;
> - return ret;
> + return NETDEV_TX_BUSY;
> }
> skb->len = NETCP_MIN_PACKET_SIZE;
> }
> @@ -1298,7 +1299,6 @@ static int netcp_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> desc = netcp_tx_map_skb(skb, netcp);
> if (unlikely(!desc)) {
> netif_stop_subqueue(ndev, subqueue);
> - ret = -ENOBUFS;
> goto drop;
> }
>
> @@ -1319,7 +1319,7 @@ static int netcp_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> if (desc)
> netcp_free_tx_desc_chain(netcp, desc, sizeof(*desc));
> dev_kfree_skb(skb);
> - return ret;
> + return NETDEV_TX_BUSY;
> }

These conversions are not correct.

If the driver frees the SKB you must not return NETDEV_TX_BUSY.

NETDEV_TX_BUSY tells the caller that the driver could not process the
packet and that it should reqeueu up the SKB and try again later when
there is more TX queue room.

\
 
 \ /
  Last update: 2018-09-26 19:18    [W:0.056 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site