Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2018 15:54:04 -0400
From:      Joe Buehler <aspam@cox.net>
To:        Vincenzo Maffione <v.maffione@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: netmap ixgbevf mtu
Message-ID:  <5AB166DC.8060708@cox.net>
In-Reply-To: <Q8MS1x00g3ftU9t018MSnu>
References:  <5AAC49BE.3030508@cox.net> <5AAC4A96.1040107@cox.net> <5AB01439.3090003@cox.net> <Q8MS1x00g3ftU9t018MSnu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070501060205030509030002
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Attached is a patch that allows fragmented TX with the ixgbevf driver.

For the first TX buffer set the slot length to the full length of the frame and make sure that the slot buffer is fully filled.  For succeeding slots just set the length to the amount of the buffer filled.

Not intended as the perfect solution but it works fine for my situation.

Joe Buehler


--------------070501060205030509030002
Content-Type: text/x-patch;
 name="fragmented-tx.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="fragmented-tx.patch"

--- LINUX/ixgbe_netmap_linux.h.~1~	2018-03-19 12:36:09.000000001 -0400
+++ LINUX/ixgbe_netmap_linux.h	2018-03-20 14:54:47.000000001 -0400
@@ -329,7 +329,8 @@
 		nic_i = netmap_idx_k2n(kring, nm_i);
 		for (n = 0; nm_i != head; n++) {
 			struct netmap_slot *slot = &ring->slot[nm_i];
-			u_int len = slot->len;
+			u_int full_len = slot->len;
+			u_int len = full_len > ring->nr_buf_size ? ring->nr_buf_size : full_len;
 			uint64_t paddr;
 			void *addr = PNMB(na, slot, &paddr);
 
@@ -347,8 +348,8 @@
 
 			/* Fill the slot in the NIC ring. */
 			curr->read.buffer_addr = htole64(paddr);
-			curr->read.olinfo_status = htole32(len << IXGBE_ADVTXD_PAYLEN_SHIFT);
-			curr->read.cmd_type_len = htole32(len | hw_flags |
+			curr->read.olinfo_status = htole32(full_len << IXGBE_ADVTXD_PAYLEN_SHIFT);
+			curr->read.cmd_type_len = htole32(len | hw_flags |
 				IXGBE_ADVTXD_DTYP_DATA | IXGBE_ADVTXD_DCMD_DEXT |
 				IXGBE_ADVTXD_DCMD_IFCS);
 			netmap_sync_map(na, (bus_dma_tag_t) na->pdev, &paddr, len, NR_TX);

--------------070501060205030509030002--



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