Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06709e96 authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman
Browse files

staging: et131x: on transmit, stop the queue if the next packet will fail



* Currently the tx queue is only stopped when the current packet fails.
Check if the next packet will fail, and stop the queue if so.

* Removed associated item from TODO list in the README.

* Also minor fixup as adapter was being declared as null and immediately set
to a value.

Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 26d19bf6
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,6 @@ driver as they did not build properly at the time.


TODO:
TODO:
	- Use of kmem_cache seems a bit unusual
	- Use of kmem_cache seems a bit unusual
	- It's too late stopping the tx queue when there is no room for the current packet. The condition should be detected for the next packet.


Please send patches to:
Please send patches to:
	Greg Kroah-Hartman <gregkh@suse.de>
	Greg Kroah-Hartman <gregkh@suse.de>
+6 −7
Original line number Original line Diff line number Diff line
@@ -3448,9 +3448,7 @@ static int send_packet(struct sk_buff *skb, struct et131x_adapter *adapter)
int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
{
{
	int status = 0;
	int status = 0;
	struct et131x_adapter *adapter = NULL;
	struct et131x_adapter *adapter = netdev_priv(netdev);

	adapter = netdev_priv(netdev);


	/* Send these packets
	/* Send these packets
	 *
	 *
@@ -5347,6 +5345,11 @@ static void et131x_multicast(struct net_device *netdev)
static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
{
{
	int status = 0;
	int status = 0;
	struct et131x_adapter *adapter = netdev_priv(netdev);

	/* stop the queue if it's getting full */
	if(adapter->tx_ring.used >= NUM_TCB - 1 && !netif_queue_stopped(netdev))
		netif_stop_queue(netdev);


	/* Save the timestamp for the TX timeout watchdog */
	/* Save the timestamp for the TX timeout watchdog */
	netdev->trans_start = jiffies;
	netdev->trans_start = jiffies;
@@ -5357,10 +5360,6 @@ static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
	/* Check status and manage the netif queue if necessary */
	/* Check status and manage the netif queue if necessary */
	if (status != 0) {
	if (status != 0) {
		if (status == -ENOMEM) {
		if (status == -ENOMEM) {
			/* Put the queue to sleep until resources are
			 * available
			 */
			netif_stop_queue(netdev);
			status = NETDEV_TX_BUSY;
			status = NETDEV_TX_BUSY;
		} else {
		} else {
			status = NETDEV_TX_OK;
			status = NETDEV_TX_OK;