Author: jmallett
Date: Mon Nov 19 08:30:29 2012
New Revision: 243264
URL: http://svnweb.freebsd.org/changeset/base/243264

Log:
  Prevent hang on ATCA-7220 when transmitting packets < 60 bytes.

Modified:
  head/sys/mips/cavium/octe/ethernet-tx.c

Modified: head/sys/mips/cavium/octe/ethernet-tx.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-tx.c     Mon Nov 19 08:29:53 2012        
(r243263)
+++ head/sys/mips/cavium/octe/ethernet-tx.c     Mon Nov 19 08:30:29 2012        
(r243264)
@@ -116,6 +116,19 @@ int cvm_oct_xmit(struct mbuf *m, struct 
                }
        }
 
+#ifdef OCTEON_VENDOR_RADISYS
+       /*
+        * The RSYS4GBE will hang if asked to transmit a packet less than 60 
bytes.
+        */
+       if (__predict_false(m->m_pkthdr.len < 60) &&
+           cvmx_sysinfo_get()->board_type == 
CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) {
+               static uint8_t pad[60];
+
+               if (!m_append(m, sizeof pad - m->m_pkthdr.len, pad))
+                       printf("%s: unable to pad small packet.", __func__);
+       }
+#endif
+
        /*
         * If the packet is not fragmented.
         */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to