Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jul 2016 07:44:04 GMT
From:      vincenzo@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r305713 - soc2016/vincenzo/head/sys/dev/netmap
Message-ID:  <201607040744.u647i4nH051010@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607040744.u647i4nH051010>