Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 2015 06:04:24 +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: r291924 - in head/sys/dev/sfxge: . common
Message-ID:  <201512070604.tB764OMt018226@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Mon Dec  7 06:04:24 2015
New Revision: 291924
URL: https://svnweb.freebsd.org/changeset/base/291924

Log:
  sfxge: switch to TxQ creation specific flags
  
  It is better do not mix TxQ creation and receive event flags since only
  checksum flags are applicable to TxQ.
  Also it will allow to add a new TxQ creation specific flags.
  
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after: 2    days
  Differential Revision: https://reviews.freebsd.org/D4389

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_tx.c
  head/sys/dev/sfxge/common/hunt_tx.c
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/common/efx.h
==============================================================================
--- head/sys/dev/sfxge/common/efx.h	Mon Dec  7 06:01:14 2015	(r291923)
+++ head/sys/dev/sfxge/common/efx.h	Mon Dec  7 06:04:24 2015	(r291924)
@@ -2028,6 +2028,9 @@ efx_tx_fini(
 
 #define	EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
 
+#define	EFX_TXQ_CKSUM_IPV4	0x0001
+#define	EFX_TXQ_CKSUM_TCPUDP	0x0002
+
 extern	__checkReturn	efx_rc_t
 efx_tx_qcreate(
 	__in		efx_nic_t *enp,

Modified: head/sys/dev/sfxge/common/efx_tx.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_tx.c	Mon Dec  7 06:01:14 2015	(r291923)
+++ head/sys/dev/sfxge/common/efx_tx.c	Mon Dec  7 06:04:24 2015	(r291924)
@@ -921,9 +921,9 @@ falconsiena_tx_qcreate(
 
 	EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_NON_IP_DROP_DIS, 1);
 	EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_IP_CHKSM_DIS,
-	    (flags & EFX_CKSUM_IPV4) ? 0 : 1);
+	    (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1);
 	EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_TCP_CHKSM_DIS,
-	    (flags & EFX_CKSUM_TCPUDP) ? 0 : 1);
+	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1);
 
 	EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_DESC_PTR_TBL,
 	    etp->et_index, &oword, B_TRUE);

Modified: head/sys/dev/sfxge/common/hunt_tx.c
==============================================================================
--- head/sys/dev/sfxge/common/hunt_tx.c	Mon Dec  7 06:01:14 2015	(r291923)
+++ head/sys/dev/sfxge/common/hunt_tx.c	Mon Dec  7 06:04:24 2015	(r291924)
@@ -90,8 +90,10 @@ efx_mcdi_init_txq(
 
 	MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS,
 	    INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
-	    INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_CKSUM_IPV4) ? 0 : 1,
-	    INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_CKSUM_TCPUDP) ? 0 : 1,
+	    INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
+	    (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
+	    INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
+	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
 	    INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
 	    INIT_TXQ_IN_CRC_MODE, 0,
 	    INIT_TXQ_IN_FLAG_TIMESTAMP, 0);
@@ -210,8 +212,10 @@ hunt_tx_qcreate(
 	EFX_POPULATE_QWORD_4(desc,
 	    ESF_DZ_TX_DESC_IS_OPT, 1,
 	    ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
-	    ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_CKSUM_TCPUDP) ? 1 : 0,
-	    ESF_DZ_TX_OPTION_IP_CSUM, (flags & EFX_CKSUM_IPV4) ? 1 : 0);
+	    ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
+	    ESF_DZ_TX_OPTION_IP_CSUM,
+	    (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0);
 
 	EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
 	hunt_tx_qpush(etp, *addedp, 0);

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c	Mon Dec  7 06:01:14 2015	(r291923)
+++ head/sys/dev/sfxge/sfxge_tx.c	Mon Dec  7 06:04:24 2015	(r291924)
@@ -1439,10 +1439,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, 
 		flags = 0;
 		break;
 	case SFXGE_TXQ_IP_CKSUM:
-		flags = EFX_CKSUM_IPV4;
+		flags = EFX_TXQ_CKSUM_IPV4;
 		break;
 	case SFXGE_TXQ_IP_TCP_UDP_CKSUM:
-		flags = EFX_CKSUM_IPV4 | EFX_CKSUM_TCPUDP;
+		flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP;
 		break;
 	default:
 		KASSERT(0, ("Impossible TX queue"));



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