Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2018 07:11:05 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341327 - head/sys/dev/sfxge
Message-ID:  <201811300711.wAU7B5R6084752@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Nov 30 07:11:05 2018
New Revision: 341327
URL: https://svnweb.freebsd.org/changeset/base/341327

Log:
  sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped
  
  Early processing of a packet on transmit may change last seen
  VLAN TCI in the queue context. If such a packet is eventually
  dropped, last seen VLAN TCI must be set to its previous value.
  
  Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:      1 week
  Differential Revision:  https://reviews.freebsd.org/D18288

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c	Fri Nov 30 07:10:54 2018	(r341326)
+++ head/sys/dev/sfxge/sfxge_tx.c	Fri Nov 30 07:11:05 2018	(r341327)
@@ -361,6 +361,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
 	int rc;
 	int i;
 	int eop;
+	uint16_t hw_vlan_tci_prev;
 	int vlan_tagged;
 
 	KASSERT(!txq->blocked, ("txq->blocked"));
@@ -412,6 +413,8 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
 
 	used_map = &stmp->map;
 
+	hw_vlan_tci_prev = txq->hw_vlan_tci;
+
 	vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf);
 	if (vlan_tagged) {
 		sfxge_next_stmp(txq, &stmp);
@@ -463,6 +466,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
 	return (0);
 
 reject_mapped:
+	txq->hw_vlan_tci = hw_vlan_tci_prev;
 	bus_dmamap_unload(txq->packet_dma_tag, *used_map);
 reject:
 	/* Drop the packet on the floor. */



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