[PATCH] leon, greth: 10/100 MAC enable TX BD interrupt

Daniel Hellstrom daniel at gaisler.com
Fri Aug 24 13:32:41 UTC 2018


Missed to enable interrupt per TX descriptor. Could lead to TX buffer
starvation.

Does not affect the GBit code.
---
 bsps/sparc/shared/net/greth.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bsps/sparc/shared/net/greth.c b/bsps/sparc/shared/net/greth.c
index eafcb99..b2d2569 100644
--- a/bsps/sparc/shared/net/greth.c
+++ b/bsps/sparc/shared/net/greth.c
@@ -868,23 +868,23 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
             if ((m = m->m_next) == NULL)
                     break;
     }
-    
+
     m_freem (n);
-    
+
     /* don't send long packets */
 
     if (len <= GRETH_MAXBUF_LEN) {
             if (dp->tx_ptr < dp->txbufs-1) {
-                    dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | len;
+                    dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_IRQ |
+                                                  GRETH_TXD_ENABLE | len;
             } else {
-                    dp->txdesc[dp->tx_ptr].ctrl = 
+                    dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_IRQ |
                             GRETH_TXD_WRAP | GRETH_TXD_ENABLE | len;
             }
             dp->tx_ptr = (dp->tx_ptr + 1) % dp->txbufs;
             SPIN_LOCK_IRQ(&dp->devlock, flags);
             dp->regs->ctrl = dp->regs->ctrl | GRETH_CTRL_TXEN;
             SPIN_UNLOCK_IRQ(&dp->devlock, flags);
-            
     }
 
     return 0;
-- 
2.7.4




More information about the devel mailing list