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

--- 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);
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to