Date: Mon, 1 Sep 2014 07:54:31 +0000 (UTC) From: Jack F Vogel <jfv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270919 - in stable/10/sys: conf dev/ixl modules Message-ID: <201409010754.s817sVdO072460@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jfv Date: Mon Sep 1 07:54:30 2014 New Revision: 270919 URL: http://svnweb.freebsd.org/changeset/base/270919 Log: MFC of 270755, 270772, 270773, 270775, 270799, 270806, 270807, 270820 Enable the build of the Intel XL710 drivers, and fixes for that build. Modified: stable/10/sys/conf/NOTES stable/10/sys/dev/ixl/README stable/10/sys/dev/ixl/i40e_alloc.h stable/10/sys/dev/ixl/i40e_common.c stable/10/sys/dev/ixl/i40e_osdep.h stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixl.h stable/10/sys/dev/ixl/ixl_txrx.c stable/10/sys/modules/Makefile Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/conf/NOTES Mon Sep 1 07:54:30 2014 (r270919) @@ -2089,6 +2089,8 @@ device em # Intel Pro/1000 Gigabit Eth device igb # Intel Pro/1000 PCIE Gigabit Ethernet device ixgb # Intel Pro/10Gbe PCI-X Ethernet device ixgbe # Intel Pro/10Gbe PCIE Ethernet +device ixl # Intel XL710 40Gbe PCIE Ethernet +device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter Modified: stable/10/sys/dev/ixl/README ============================================================================== --- stable/10/sys/dev/ixl/README Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/README Mon Sep 1 07:54:30 2014 (r270919) @@ -1,9 +1,10 @@ -ixl FreeBSD* Base Driver for the Intel® XL710 Ethernet Controller Family + ixl FreeBSD* Base Driver and ixlv VF Driver for the + Intel XL710 Ethernet Controller Family /*$FreeBSD$*/ ================================================================ -July 21, 2014 +August 26, 2014 Contents @@ -11,6 +12,7 @@ Contents - Overview - Supported Adapters +- The VF Driver - Building and Installation - Additional Configurations - Known Limitations @@ -19,15 +21,21 @@ Contents Overview ======== -This file describes the IXL FreeBSD* Base driver for the XL710 Ethernet Family of Adapters. The Driver has been developed for use with FreeBSD 10.0 or later, but should be compatible with any supported release. - -For questions related to hardware requirements, refer to the documentation supplied with your Intel XL710 adapter. All hardware requirements listed apply for use with FreeBSD. +This file describes the IXL FreeBSD* Base driver and the IXLV VF Driver +for the XL710 Ethernet Family of Adapters. The Driver has been developed +for use with FreeBSD 10.0 or later, but should be compatible with any +supported release. + +For questions related to hardware requirements, refer to the documentation +supplied with your Intel XL710 adapter. All hardware requirements listed +apply for use with FreeBSD. Supported Adapters ================== -The driver in this release is compatible with XL710 and X710-based Intel Ethernet Network Connections. +The drivers in this release are compatible with XL710 and X710-based +Intel Ethernet Network Connections. SFP+ Devices with Pluggable Optics @@ -49,18 +57,45 @@ QSFP+ Modules Intel TRIPLE RATE 1G/10G/40G QSFP+ LR (bailed) E40GQSFPLR QSFP+ 1G speed is not supported on XL710 based devices. -X710/XL710 Based SFP+ adapters support all passive and active limiting direct attach cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. +X710/XL710 Based SFP+ adapters support all passive and active limiting direct +attach cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. +The VF Driver +================== +The VF driver is normally used in a virtualized environment where a host +driver manages SRIOV, and provides a VF device to the guest. With this +first release the only host environment tested was using Linux QEMU/KVM. +Support is planned for Xen and VMWare hosts at a later time. + +In the FreeBSD guest the IXLV driver would be loaded and will function +using the VF device assigned to it. + +The VF driver provides most of the same functionality as the CORE driver, +but is actually a slave to the Host, access to many controls are actually +accomplished by a request to the Host via what is called the "Admin queue". +These are startup and initialization events however, once in operation +the device is self-contained and should achieve near native performance. + +Some notable limitations of the VF environment: for security reasons +the driver is never permitted to be promiscuous, therefore a tcpdump +will not behave the same with the interface. Second, media info is not +available from the PF, so it will always appear as auto. -Building and Installation +Tarball Building and Installation ========================= -NOTE: You must have kernel sources installed to compile the driver module. +NOTE: You must have kernel sources installed to compile the driver tarball. + +These instructions assume a standalone driver tarball, building the driver +already in the kernel source is simply a matter of adding the device entry +to the kernel config file, or building in the ixl or ixlv module directory. In the instructions below, x.x.x is the driver version -as indicated in thename of the driver tar. +as indicated in the name of the driver tarball. The example is +for ixl, the same procedure applies for ixlv. -1. Move the base driver tar file to the directory of your choice. For example, use /home/username/ixl or /usr/local/src/ixl. +1. Move the base driver tar file to the directory of your choice. + For example, use /home/username/ixl or /usr/local/src/ixl. 2. Untar/unzip the archive: tar xfz ixl-x.x.x.tar.gz @@ -76,7 +111,9 @@ as indicated in thename of the driver ta 5. To assign an IP address to the interface, enter the following: ifconfig ixl<interface_num> <IP_address> -6. Verify that the interface works. Enter the following, where <IP_address> is the IP address for another machine on the same subnet as the interface that is being tested: +6. Verify that the interface works. Enter the following, where <IP_address> + is the IP address for another machine on the same subnet as the interface + that is being tested: ping <IP_address> @@ -105,7 +142,7 @@ as indicated in thename of the driver ta Configuration and Tuning ========================= -The driver supports Transmit/Receive Checksum Offload for IPv4 and IPv6, +Both drivers supports Transmit/Receive Checksum Offload for IPv4 and IPv6, TSO forIPv4 and IPv6, LRO, and Jumbo Frames on all 40 Gigabit adapters. Jumbo Frames @@ -240,7 +277,7 @@ TSO forIPv4 and IPv6, LRO, and Jumbo Fra ifconfig ixl<interface_num> lro -Flow Control +Flow Control (IXL only) ------------ Flow control is disabled by default. To change flow control settings use sysctl. @@ -263,19 +300,25 @@ To disable flow control: NOTE: You must have a flow control capable link partner. +NOTE: The VF driver does not have access to flow control, it must be + managed from the host side. Important system configuration changes: ======================================= - -Change the file /etc/sysctl.conf, and add the line: hw.intr_storm_threshold: 0 (the default is 1000) -Best throughput results are seen with a large MTU; use 9706 if possible. --The default number of descriptors per ring is 1024, increasing this may improve performance depending on the use case. +-The default number of descriptors per ring is 1024, increasing this may +improve performance depending on the use case. + +-The VF driver uses a relatively large buf ring, this was found to eliminate + UDP transmit errors, it is a tuneable, and if no UDP traffic is used it can + be reduced. It is memory used per queue. Known Limitations @@ -283,7 +326,11 @@ Known Limitations Network Memory Buffer allocation -------------------------------- - FreeBSD may have a low number of network memory buffers (mbufs) by default. Ifyour mbuf value is too low, it may cause the driver to fail to initialize and/orcause the system to become unresponsive. You can check to see if the system is mbuf-starved by running 'netstat -m'. Increase the number of mbufs by editing the lines below in /etc/sysctl.conf: + FreeBSD may have a low number of network memory buffers (mbufs) by default. +If your mbuf value is too low, it may cause the driver to fail to initialize +and/or cause the system to become unresponsive. You can check to see if the +system is mbuf-starved by running 'netstat -m'. Increase the number of mbufs +by editing the lines below in /etc/sysctl.conf: kern.ipc.nmbclusters kern.ipc.nmbjumbop @@ -291,9 +338,11 @@ Network Memory Buffer allocation kern.ipc.nmbjumbo16 kern.ipc.nmbufs -The amount of memory that you allocate is system specific, and may require some trial and error. +The amount of memory that you allocate is system specific, and may +require some trial and error. -Also, increasing the follwing in /etc/sysctl.conf could help increase network performance: +Also, increasing the follwing in /etc/sysctl.conf could help increase +network performance: kern.ipc.maxsockbuf net.inet.tcp.sendspace @@ -304,7 +353,10 @@ Also, increasing the follwing in /etc/sy UDP Stress Test Dropped Packet Issue ------------------------------------ - Under small packet UDP stress test with the ixl driver, the FreeBSD system will drop UDP packets due to the fullness of socket buffers. You may want to change the driver's Flow Control variables to the minimum value for controlling packet reception. +Under small packet UDP stress test with the ixl driver, the FreeBSD system +may drop UDP packets due to the fullness of socket buffers. You may want to +change the driver's Flow Control variables to the minimum value for +controlling packet reception. Disable LRO when routing/bridging @@ -314,11 +366,20 @@ LRO must be turned off when forwarding t Lower than expected performance ------------------------------- - Some PCIe x8 slots are actually configured as x4 slots. These slots have insufficient bandwidth for full line rate with dual port and quad port devices. In addition, if you put a PCIe Generation 3-capable adapter into a PCIe Generation 2 slot, you cannot get full bandwidth. The driver detects this situation and writes the following message in the system log: - - "PCI-Express bandwidth available for this card is not sufficient for optimal performance. For optimal performance a x8 PCI-Express slot is required." +Some PCIe x8 slots are actually configured as x4 slots. These slots have +insufficient bandwidth for full line rate with dual port and quad port +devices. + +In addition, if you put a PCIe Generation 3-capable adapter into a PCIe +Generation 2 slot, you cannot get full bandwidth. The driver detects this +situation and writes the following message in the system log: + + "PCI-Express bandwidth available for this card is not sufficient for + optimal performance. For optimal performance a x8 PCI-Express slot + is required." -If this error occurs, moving your adapter to a true PCIe Generation 3 x8 slot will resolve the issue. +If this error occurs, moving your adapter to a true PCIe Generation 3 x8 +slot will resolve the issue. Support @@ -328,14 +389,21 @@ For general information and support, go http://support.intel.com -If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue tofreebsdnic@mailbox.intel.com. +If an issue is identified with the released source code on the supported kernel +with a supported adapter, email the specific information related to the issue +to freebsdnic@mailbox.intel.com. License ======= -This software program is released under the terms of a license agreement betweenyou ('Licensee') and Intel. Do not use or load this software or any associated materials (collectively, the 'Software') until you have carefully read the full terms and conditions of the LICENSE located in this software package. By loadingor using the Software, you agree to the terms of this Agreement. If you do not -agree with the terms of this Agreement, do not install or use the Software. +This software program is released under the terms of a license agreement +between you ('Licensee') and Intel. Do not use or load this software or any +associated materials (collectively, the 'Software') until you have carefully +read the full terms and conditions of the LICENSE located in this software +package. By loadingor using the Software, you agree to the terms of this +Agreement. If you do not agree with the terms of this Agreement, do not +install or use the Software. * Other names and brands may be claimed as the property of others. Modified: stable/10/sys/dev/ixl/i40e_alloc.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_alloc.h Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/i40e_alloc.h Mon Sep 1 07:54:30 2014 (r270919) @@ -51,16 +51,15 @@ enum i40e_memory_type { }; /* prototype for functions used for dynamic memory allocation */ -enum i40e_status_code i40e_allocate_dma_mem(struct i40e_hw *hw, +enum i40e_status_code i40e_allocate_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem, - enum i40e_memory_type type, - u64 size, u32 alignment); -enum i40e_status_code i40e_free_dma_mem(struct i40e_hw *hw, + bus_size_t size, u32 alignment); +enum i40e_status_code i40e_free_dma(struct i40e_hw *hw, struct i40e_dma_mem *mem); -enum i40e_status_code i40e_allocate_virt_mem(struct i40e_hw *hw, +enum i40e_status_code i40e_allocate_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem, u32 size); -enum i40e_status_code i40e_free_virt_mem(struct i40e_hw *hw, +enum i40e_status_code i40e_free_virt(struct i40e_hw *hw, struct i40e_virt_mem *mem); #endif /* _I40E_ALLOC_H_ */ Modified: stable/10/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_common.c Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/i40e_common.c Mon Sep 1 07:54:30 2014 (r270919) @@ -4375,8 +4375,8 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)(uintptr_t)buffer)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)(uintptr_t)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); @@ -4458,8 +4458,8 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)(uintptr_t)buffer)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)(uintptr_t)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); Modified: stable/10/sys/dev/ixl/i40e_osdep.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_osdep.h Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/i40e_osdep.h Mon Sep 1 07:54:30 2014 (r270919) @@ -137,11 +137,15 @@ struct i40e_spinlock { #define le16_to_cpu +#if defined(__amd64__) || defined(i386) static __inline void prefetch(void *x) { __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); } +#else +#define prefetch(x) +#endif struct i40e_osdep { @@ -191,7 +195,7 @@ rd32_osdep(struct i40e_osdep *osdep, uin KASSERT(reg < osdep->mem_bus_space_size, ("ixl: register offset %#jx too large (max is %#jx", - (uintmax_t)a, (uintmax_t)osdep->mem_bus_space_size)); + (uintmax_t)reg, (uintmax_t)osdep->mem_bus_space_size)); return (bus_space_read_4(osdep->mem_bus_space_tag, osdep->mem_bus_space_handle, reg)); @@ -203,7 +207,7 @@ wr32_osdep(struct i40e_osdep *osdep, uin KASSERT(reg < osdep->mem_bus_space_size, ("ixl: register offset %#jx too large (max is %#jx", - (uintmax_t)a, (uintmax_t)osdep->mem_bus_space_size)); + (uintmax_t)reg, (uintmax_t)osdep->mem_bus_space_size)); bus_space_write_4(osdep->mem_bus_space_tag, osdep->mem_bus_space_handle, reg, value); Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/if_ixl.c Mon Sep 1 07:54:30 2014 (r270919) @@ -276,10 +276,6 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif -#ifdef DEV_NETMAP -#include <dev/netmap/if_ixl_netmap.h> -#endif /* DEV_NETMAP */ - static char *ixl_fc_string[6] = { "None", "Rx", @@ -652,10 +648,6 @@ ixl_attach(device_t dev) vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); -#ifdef DEV_NETMAP - ixl_netmap_attach(pf); -#endif /* DEV_NETMAP */ - INIT_DEBUGOUT("ixl_attach: end"); return (0); @@ -733,10 +725,6 @@ ixl_detach(device_t dev) ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); -#ifdef DEV_NETMAP - netmap_detach(vsi->ifp); -#endif /* DEV_NETMAP */ - ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2300,7 +2288,7 @@ ixl_setup_interface(device_t dev, struct /* * Tell the upper layer(s) we support long frames. */ - ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_HWCSUM; ifp->if_capabilities |= IFCAP_HWCSUM_IPV6; @@ -2552,12 +2540,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) rctx.tphdata_ena = 0; rctx.tphhead_ena = 0; rctx.lrxqthresh = 2; -#ifdef DEV_NETMAP - /* "CRC strip in netmap is conditional" */ - if (vsi->ifp->if_capenable & IFCAP_NETMAP && !ixl_crcstrip) - rctx.crcstrip = 0; - else -#endif /* DEV_NETMAP */ rctx.crcstrip = 1; rctx.l2tsel = 1; rctx.showiv = 1; @@ -2581,21 +2563,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) break; } wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); -#ifdef DEV_NETMAP - /* TODO appropriately comment - * Code based on netmap code in ixgbe_init_locked() - * Messes with what the software sets as queue - * descriptor tail in hardware. - */ - if (vsi->ifp->if_capenable & IFCAP_NETMAP) - { - struct netmap_adapter *na = NA(vsi->ifp); - struct netmap_kring *kring = &na->rx_rings[que->me]; - int t = na->num_rx_desc - 1 - kring->nr_hwavail; - - wr32(vsi->hw, I40E_QRX_TAIL(que->me), t); - } else -#endif /* DEV_NETMAP */ wr32(vsi->hw, I40E_QRX_TAIL(que->me), que->num_desc - 1); } return (err); @@ -4016,11 +3983,11 @@ ixl_print_debug_info(struct ixl_pf *pf) u32 reg; - printf("Queue irqs = %lx\n", que->irqs); - printf("AdminQ irqs = %lx\n", pf->admin_irq); + printf("Queue irqs = %jx\n", (uintmax_t)que->irqs); + printf("AdminQ irqs = %jx\n", (uintmax_t)pf->admin_irq); printf("RX next check = %x\n", rxr->next_check); - printf("RX not ready = %lx\n", rxr->not_done); - printf("RX packets = %lx\n", rxr->rx_packets); + printf("RX not ready = %jx\n", (uintmax_t)rxr->not_done); + printf("RX packets = %jx\n", (uintmax_t)rxr->rx_packets); printf("TX desc avail = %x\n", txr->avail); reg = rd32(hw, I40E_GLV_GORCL(0xc)); @@ -4161,7 +4128,7 @@ ixl_stat_update48(struct i40e_hw *hw, u3 { u64 new_data; -#if __FreeBSD__ >= 10 && __amd64__ +#if defined(__FreeBSD__) && (__FreeBSD_version >= 1000000) && defined(__amd64__) new_data = rd64(hw, loreg); #else /* Modified: stable/10/sys/dev/ixl/if_ixlv.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixlv.c Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/if_ixlv.c Mon Sep 1 07:54:30 2014 (r270919) @@ -1367,7 +1367,7 @@ ixlv_setup_interface(device_t dev, struc /* * Tell the upper layer(s) we support long frames. */ - ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_HWCSUM; ifp->if_capabilities |= IFCAP_HWCSUM_IPV6; @@ -2311,7 +2311,7 @@ ixlv_update_link_status(struct ixlv_sc * static void ixlv_stop(struct ixlv_sc *sc) { - mtx_assert(&sc->sc_mtx, MA_OWNED); + mtx_assert(&sc->mtx, MA_OWNED); INIT_DBG_IF(&sc->vsi->ifp, "begin"); Modified: stable/10/sys/dev/ixl/ixl.h ============================================================================== --- stable/10/sys/dev/ixl/ixl.h Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/ixl.h Mon Sep 1 07:54:30 2014 (r270919) @@ -47,8 +47,10 @@ #include <sys/kernel.h> #include <sys/module.h> #include <sys/sockio.h> +#include <sys/eventhandler.h> #include <net/if.h> +#include <net/if_var.h> #include <net/if_arp.h> #include <net/bpf.h> #include <net/ethernet.h> @@ -293,9 +295,6 @@ struct ixl_rx_buf { struct mbuf *fmp; bus_dmamap_t hmap; bus_dmamap_t pmap; -#ifdef DEV_NETMAP - u64 addr; -#endif }; /* Modified: stable/10/sys/dev/ixl/ixl_txrx.c ============================================================================== --- stable/10/sys/dev/ixl/ixl_txrx.c Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/dev/ixl/ixl_txrx.c Mon Sep 1 07:54:30 2014 (r270919) @@ -454,17 +454,9 @@ ixl_init_tx_ring(struct ixl_queue *que) { struct tx_ring *txr = &que->txr; struct ixl_tx_buf *buf; -#ifdef DEV_NETMAP - struct ixl_vsi *vsi = que->vsi; - struct netmap_adapter *na = NA(vsi->ifp); - struct netmap_slot *slot; -#endif /* DEV_NETMAP */ /* Clear the old ring contents */ IXL_TX_LOCK(txr); -#ifdef DEV_NETMAP - slot = netmap_reset(na, NR_TX, que->me, 0); -#endif bzero((void *)txr->base, (sizeof(struct i40e_tx_desc)) * que->num_desc); @@ -488,13 +480,6 @@ ixl_init_tx_ring(struct ixl_queue *que) m_freem(buf->m_head); buf->m_head = NULL; } -#ifdef DEV_NETMAP - if (slot) - { - int si = netmap_idx_n2k(&na->tx_rings[que->me], i); - netmap_load_map(txr->tag, buf->map, NMB(slot + si)); - } -#endif /* Clear the EOP index */ buf->eop_index = -1; } @@ -573,9 +558,13 @@ ixl_tx_setup_offload(struct ixl_queue *q struct mbuf *mp, u32 *cmd, u32 *off) { struct ether_vlan_header *eh; +#ifdef INET struct ip *ip = NULL; +#endif struct tcphdr *th = NULL; +#ifdef INET6 struct ip6_hdr *ip6; +#endif int elen, ip_hlen = 0, tcp_hlen; u16 etype; u8 ipproto = 0; @@ -606,6 +595,7 @@ ixl_tx_setup_offload(struct ixl_queue *q } switch (etype) { +#ifdef INET case ETHERTYPE_IP: ip = (struct ip *)(mp->m_data + elen); ip_hlen = ip->ip_hl << 2; @@ -617,13 +607,16 @@ ixl_tx_setup_offload(struct ixl_queue *q else *cmd |= I40E_TX_DESC_CMD_IIPT_IPV4; break; +#endif +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(mp->m_data + elen); ip_hlen = sizeof(struct ip6_hdr); ipproto = ip6->ip6_nxt; th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); *cmd |= I40E_TX_DESC_CMD_IIPT_IPV6; - /* Falls thru */ + break; +#endif default: break; } @@ -681,9 +674,15 @@ ixl_tso_setup(struct ixl_queue *que, str u16 etype; int idx, elen, ip_hlen, tcp_hlen; struct ether_vlan_header *eh; +#ifdef INET struct ip *ip; +#endif +#ifdef INET6 struct ip6_hdr *ip6; +#endif +#if defined(INET6) || defined(INET) struct tcphdr *th; +#endif u64 type_cmd_tso_mss; /* @@ -725,9 +724,9 @@ ixl_tso_setup(struct ixl_queue *que, str break; #endif default: - panic("%s: CSUM_TSO but no supported IP version (0x%04x)", + printf("%s: CSUM_TSO but no supported IP version (0x%04x)", __func__, ntohs(etype)); - break; + return FALSE; } /* Ensure we have at least the IP+TCP header in the first mbuf. */ @@ -794,36 +793,6 @@ ixl_txeof(struct ixl_queue *que) mtx_assert(&txr->mtx, MA_OWNED); -#ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - struct netmap_kring *kring = &na->tx_rings[que->me]; - tx_desc = txr->base; - bus_dmamap_sync(txr->dma.tag, txr->dma.map, - BUS_DMASYNC_POSTREAD); - if (!netmap_mitigate || - (kring->nr_kflags < kring->nkr_num_slots && - tx_desc[kring->nr_kflags].cmd_type_offset_bsz & - htole32(I40E_TX_DESC_DTYPE_DESC_DONE))) - { -#if NETMAP_API < 4 - struct ixl_pf *pf = vsi->pf; - kring->nr_kflags = kring->nkr_num_slots; - selwakeuppri(&na->tx_rings[que->me].si, PI_NET); - IXL_TX_UNLOCK(txr); - IXL_PF_LOCK(pf); - selwakeuppri(&na->tx_si, PI_NET); - IXL_PF_UNLOCK(pf); - IXL_TX_LOCK(txr); -#else /* NETMAP_API >= 4 */ - netmap_tx_irq(ifp, txr->que->me); -#endif /* NETMAP_API */ - } - // XXX guessing there is no more work to be done - return FALSE; - } -#endif /* DEV_NETMAP */ - /* These are not the descriptors you seek, move along :) */ if (txr->avail == que->num_desc) { que->busy = 0; @@ -1011,12 +980,8 @@ no_split: buf->m_pack = mp; bus_dmamap_sync(rxr->ptag, buf->pmap, BUS_DMASYNC_PREREAD); -#ifdef DEV_NETMAP - rxr->base[i].read.pkt_addr = buf->addr; -#else /* !DEV_NETMAP */ rxr->base[i].read.pkt_addr = htole64(pseg[0].ds_addr); -#endif /* DEV_NETMAP */ /* Used only when doing header split */ rxr->base[i].read.hdr_addr = 0; @@ -1127,15 +1092,8 @@ ixl_init_rx_ring(struct ixl_queue *que) struct ixl_rx_buf *buf; bus_dma_segment_t pseg[1], hseg[1]; int rsize, nsegs, error = 0; -#ifdef DEV_NETMAP - struct netmap_adapter *na = NA(ifp); - struct netmap_slot *slot; -#endif /* DEV_NETMAP */ IXL_RX_LOCK(rxr); -#ifdef DEV_NETMAP - slot = netmap_reset(na, NR_RX, que->me, 0); -#endif /* Clear the ring contents */ rsize = roundup2(que->num_desc * sizeof(union i40e_rx_desc), DBA_ALIGN); @@ -1169,21 +1127,6 @@ ixl_init_rx_ring(struct ixl_queue *que) struct mbuf *mh, *mp; buf = &rxr->buffers[j]; -#ifdef DEV_NETMAP - if (slot) - { - int sj = netmap_idx_n2k(&na->rx_rings[que->me], j); - u64 paddr; - void *addr; - - addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->ptag, buf->pmap, addr); - /* Update descriptor and cached value */ - rxr->base[j].read.pkt_addr = htole64(paddr); - buf->addr = htole64(paddr); - continue; - } -#endif /* DEV_NETMAP */ /* ** Don't allocate mbufs if not ** doing header split, its wasteful @@ -1416,29 +1359,6 @@ ixl_rxeof(struct ixl_queue *que, int cou IXL_RX_LOCK(rxr); -#ifdef DEV_NETMAP -#if NETMAP_API < 4 - if (ifp->if_capenable & IFCAP_NETMAP) - { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[que->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[que->me].si, PI_NET); - IXL_RX_UNLOCK(rxr); - IXL_PF_LOCK(vsi->pf); - selwakeuppri(&na->rx_si, PI_NET); - IXL_PF_UNLOCK(vsi->pf); - return (FALSE); - } -#else /* NETMAP_API >= 4 */ - if (netmap_rx_irq(ifp, que->me, &processed)) - { - IXL_RX_UNLOCK(rxr); - return (FALSE); - } -#endif /* NETMAP_API */ -#endif /* DEV_NETMAP */ - for (i = rxr->next_check; count != 0;) { struct mbuf *sendmp, *mh, *mp; u32 rsc, status, error; Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Mon Sep 1 07:34:36 2014 (r270918) +++ stable/10/sys/modules/Makefile Mon Sep 1 07:54:30 2014 (r270919) @@ -176,6 +176,8 @@ SUBDIR= \ ${_iwnfw} \ ${_ixgb} \ ${_ixgbe} \ + ${_ixl} \ + ${_ixlv} \ jme \ joy \ kbdmux \ @@ -721,6 +723,8 @@ _iwnfw= iwnfw .endif _ixgb= ixgb _ixgbe= ixgbe +_ixl= ixl +_ixlv= ixlv _lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409010754.s817sVdO072460>