Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2019 20:38:56 +0000 (UTC)
From:      Vincenzo Maffione <vmaffione@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r350010 - stable/11/sys/dev/netmap
Message-ID:  <201907152038.x6FKcukE026560@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vmaffione
Date: Mon Jul 15 20:38:56 2019
New Revision: 350010
URL: https://svnweb.freebsd.org/changeset/base/350010

Log:
  MFC r349581
  
  netmap: fix two panics with emulated adapter
  
  This patch fixes 2 panics. The first one is due to the current VNET not
  being set in the emulated adapter transmission path. The second one
  is caused by the M_PKTHDR flag not being set when preallocated mbufs
  are recycled in the transmit path.
  
  Submitted by:   aleksandr.fedorov@itglobal.com
  Reviewed by:    vmaffione
  Differential Revision:  https://reviews.freebsd.org/D20824

Modified:
  stable/11/sys/dev/netmap/netmap_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/netmap/netmap_freebsd.c
==============================================================================
--- stable/11/sys/dev/netmap/netmap_freebsd.c	Mon Jul 15 20:25:49 2019	(r350009)
+++ stable/11/sys/dev/netmap/netmap_freebsd.c	Mon Jul 15 20:38:56 2019	(r350010)
@@ -441,6 +441,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a)
 	m->m_ext.ext_size = len;
 #endif /* __FreeBSD_version >= 1100000 */
 
+	m->m_flags |= M_PKTHDR;
 	m->m_len = m->m_pkthdr.len = len;
 
 	/* mbuf refcnt is not contended, no need to use atomic
@@ -449,7 +450,9 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a)
 	M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
 	m->m_pkthdr.flowid = a->ring_nr;
 	m->m_pkthdr.rcvif = ifp; /* used for tx notification */
+	CURVNET_SET(ifp->if_vnet);
 	ret = NA(ifp)->if_transmit(ifp, m);
+	CURVNET_RESTORE();
 	return ret ? -1 : 0;
 }
 



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