socsvn commit: r305713 - soc2016/vincenzo/head/sys/dev/netmap

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Mon Jul 4 07:44:05 UTC 2016


Author: vincenzo
Date: Mon Jul  4 07:44:03 2016
New Revision: 305713
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305713

Log:
   freebsd: ptnet_transmit: support VLAN encapsulation

Modified:
  soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c

Modified: soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
==============================================================================
--- soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Mon Jul  4 07:43:54 2016	(r305712)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Mon Jul  4 07:44:03 2016	(r305713)
@@ -1327,6 +1327,15 @@
 
 	DBG(device_printf(sc->dev, "transmit %p\n", m));
 
+	/* Insert 802.1Q header if needed. */
+	if (m->m_flags & M_VLANTAG) {
+		m = ether_vlanencap(m, m->m_pkthdr.ether_vtag);
+		if (m == NULL) {
+			return ENOBUFS;
+		}
+		m->m_flags &= ~M_VLANTAG;
+	}
+
 	/* Get the flow-id if available. */
 	queue_idx = (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) ?
 		    m->m_pkthdr.flowid : curcpu;


More information about the svn-soc-all mailing list