From owner-freebsd-net@freebsd.org Tue Mar 20 19:54:14 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E48CF69390 for ; Tue, 20 Mar 2018 19:54:14 +0000 (UTC) (envelope-from aspam@cox.net) Received: from eastrmfepo102.cox.net (eastrmfepo102.cox.net [68.230.241.214]) by mx1.freebsd.org (Postfix) with ESMTP id 96E5B841BC for ; Tue, 20 Mar 2018 19:54:13 +0000 (UTC) (envelope-from aspam@cox.net) Received: from eastrmimpo209.cox.net ([68.230.241.224]) by eastrmfepo102.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20180320195407.YLVZ24661.eastrmfepo102.cox.net@eastrmimpo209.cox.net> for ; Tue, 20 Mar 2018 15:54:07 -0400 Received: from thunder.sweets ([68.100.138.62]) by eastrmimpo209.cox.net with cox id QKu61x00W1LxgH801Ku7PR; Tue, 20 Mar 2018 15:54:07 -0400 X-Authority-Analysis: v=2.2 cv=JbLMlQCV c=1 sm=1 tr=0 a=3mkzfl4ircflX6G+lDqBYw==:117 a=3mkzfl4ircflX6G+lDqBYw==:17 a=x7bEGLp0ZPQA:10 a=v2DPQv5-lfwA:10 a=e9ASbk4n0QUA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=a2fyScrFYJEhPD73AkgA:9 a=74FAferboko-xCEp:21 a=8UeKvEBbmdWUWlPf:21 a=QEXdDO2ut3YA:10 a=zE9a5rZaH-iPzQhwlkkA:9 a=CdiWusdWvyIA:10 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (LOGIN) smtp.auth=jbuehler@cox.net Received: from [10.10.10.15] (thunder.sweets [10.10.10.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thunder.sweets (Postfix) with ESMTP id 78F701152A; Tue, 20 Mar 2018 15:54:06 -0400 (EDT) Message-ID: <5AB166DC.8060708@cox.net> Date: Tue, 20 Mar 2018 15:54:04 -0400 From: Joe Buehler User-Agent: Thunderbird 1.5.0.12 (X11/20120201) MIME-Version: 1.0 To: Vincenzo Maffione CC: "freebsd-net@freebsd.org" Subject: Re: netmap ixgbevf mtu References: <5AAC49BE.3030508@cox.net> <5AAC4A96.1040107@cox.net> <5AB01439.3090003@cox.net> In-Reply-To: Content-Type: multipart/mixed; boundary="------------070501060205030509030002" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 19:54:14 -0000 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--