aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe/t4_netmap.c
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2020-02-05 00:13:15 +0000
committerNavdeep Parhar <np@FreeBSD.org>2020-02-05 00:13:15 +0000
commitf4220a703df6e5331f41bc98e756dd30f213d58d (patch)
tree12afaf4ebc07a773590886e1f3cf5c23032d33d3 /sys/dev/cxgbe/t4_netmap.c
parentba8b75ae016f091dc2be662640db384eb1a97941 (diff)
downloadsrc-f4220a703df6e5331f41bc98e756dd30f213d58d.tar.gz
src-f4220a703df6e5331f41bc98e756dd30f213d58d.zip
cxgbe(4): Add a knob to allow netmap tx traffic to be checksummed by
the hardware. hw.cxgbe.nm_txcsum=1 MFC after: 2 weeks Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=357553
Diffstat (limited to 'sys/dev/cxgbe/t4_netmap.c')
-rw-r--r--sys/dev/cxgbe/t4_netmap.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c
index b70756c7a88e..221ad823eb7f 100644
--- a/sys/dev/cxgbe/t4_netmap.c
+++ b/sys/dev/cxgbe/t4_netmap.c
@@ -110,6 +110,16 @@ static int nm_split_rss = 0;
SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_split_rss, CTLFLAG_RWTUN,
&nm_split_rss, 0, "Split the netmap rx queues into two groups.");
+/*
+ * netmap(4) says "netmap does not use features such as checksum offloading, TCP
+ * segmentation offloading, encryption, VLAN encapsulation/decapsulation, etc."
+ * but this knob can be used to get the hardware to checksum all tx traffic
+ * anyway.
+ */
+static int nm_txcsum = 0;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_txcsum, CTLFLAG_RWTUN,
+ &nm_txcsum, 0, "Enable transmit checksum offloading.");
+
static int
alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong)
{
@@ -696,13 +706,8 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_txq,
cpl->ctrl0 = nm_txq->cpl_ctrl0;
cpl->pack = 0;
cpl->len = htobe16(slot->len);
- /*
- * netmap(4) says "netmap does not use features such as
- * checksum offloading, TCP segmentation offloading,
- * encryption, VLAN encapsulation/decapsulation, etc."
- */
- cpl->ctrl1 = htobe64(F_TXPKT_IPCSUM_DIS |
- F_TXPKT_L4CSUM_DIS);
+ cpl->ctrl1 = nm_txcsum ? 0 :
+ htobe64(F_TXPKT_IPCSUM_DIS | F_TXPKT_L4CSUM_DIS);
usgl = (void *)(cpl + 1);
usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) |