[syslinux:lwip] pxe: lwip: busy-wait if transmit is blocked for buffers

syslinux-bot for H. Peter Anvin hpa at zytor.com
Fri Apr 22 20:05:33 PDT 2011


Commit-ID:  c3ea33593e32cb7ebc76f2eec93c87da284bed9d
Gitweb:     http://syslinux.zytor.com/commit/c3ea33593e32cb7ebc76f2eec93c87da284bed9d
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Fri, 11 Sep 2009 15:46:43 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Tue, 12 Apr 2011 14:40:52 -0700

pxe: lwip: busy-wait if transmit is blocked for buffers

If we can't send a packet because of insufficient buffers, simply
busy-wait and keep trying.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/lwip/src/netif/undiif.c |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/core/lwip/src/netif/undiif.c b/core/lwip/src/netif/undiif.c
index 69f2d76..9ff004c 100644
--- a/core/lwip/src/netif/undiif.c
+++ b/core/lwip/src/netif/undiif.c
@@ -138,8 +138,6 @@ low_level_output(struct netif *netif, struct pbuf *p)
   pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
 #endif
 
-  memset(&pxe, 0, sizeof pxe);
-
   r = pkt_buf;
   for (q = p; q != NULL; q = q->next) {
     /* Send the data from the pbuf to the interface, one pbuf at a
@@ -149,15 +147,19 @@ low_level_output(struct netif *netif, struct pbuf *p)
     r += q->len;
   }
 
-  pxe.xmit.Protocol = 0;	/* XXX: P_UNKNOWN: MAC layer */
-  pxe.xmit.XmitFlag = !memcmp(pkt_buf, eth_broadcast, sizeof eth_broadcast);
-  pxe.xmit.DestAddr = FAR_PTR(pkt_buf);
-  pxe.xmit.TBD = FAR_PTR(&pxe.tbd);
-  pxe.tbd.ImmedLength = r - pkt_buf;
-  pxe.tbd.Xmit = FAR_PTR(pkt_buf);
-  pxe.tbd.DataBlkCount = 0;
-
-  pxe_call(PXENV_UNDI_TRANSMIT, &pxe.xmit);
+  do {
+      memset(&pxe, 0, sizeof pxe);
+
+      pxe.xmit.Protocol = 0;	/* XXX: P_UNKNOWN: MAC layer */
+      pxe.xmit.XmitFlag = !memcmp(pkt_buf, eth_broadcast, sizeof eth_broadcast);
+      pxe.xmit.DestAddr = FAR_PTR(pkt_buf);
+      pxe.xmit.TBD = FAR_PTR(&pxe.tbd);
+      pxe.tbd.ImmedLength = r - pkt_buf;
+      pxe.tbd.Xmit = FAR_PTR(pkt_buf);
+      pxe.tbd.DataBlkCount = 0;
+
+      pxe_call(PXENV_UNDI_TRANSMIT, &pxe.xmit);
+  } while (pxe.xmit.Status == PXENV_STATUS_OUT_OF_RESOURCES);
 
 #if ETH_PAD_SIZE
   pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */



More information about the Syslinux-commits mailing list