aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixl
Commit message (Collapse)AuthorAgeFilesLines
* ixl(4): Fix MAC/VLAN filters accountingKrzysztof Galazka2023-02-155-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Account for a filter required to enable reception of untagged frames while registering and unregistering VLANs to avoid trying to add more filters than HW supports - While adding MAC/VLAN filters, pre-set matching method field in the Admin Queue Command response buffer to expected error value to work around an issue with some FW versions, which do not update that field if operation fails, and be able correctly track which filters were configured in HW. - Remove unused IXL_MAX_FILTERS macro definition - Update number of available MAC/VLAN filters as in newer FW versions it was decreased by one. - Simplify i40e_dma_mem structure Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: erj@ Tested by: Gowtham Kumar Ks <gowtham.kumar.ks@intel.com> MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37457
* ixl: purge EOL release compatibilityElliott Mitchell2023-02-043-28/+0
| | | | | | | | Drop code that differentiated between FreeBSD 10 and 11. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
* Mechanically convert ixl(4) to IfAPIJustin Hibbits2023-01-242-7/+7
| | | | | | Reviewed by: erj Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37857
* ixl: Fix a mechanical mess-up in DrvAPI conversionJustin Hibbits2022-12-211-1/+1
| | | | | | | | ixl_iw.c is not compiled by default, and I missed this in code inspection. Reported by: erj@ Sponsored by: Juniper Networks, Inc.
* Convert iflib(4) and iflib-based drivers to the DrvAPIJustin Hibbits2022-12-215-15/+15
| | | | | | | | | | | | | | Summary: Convert iflib(4) and the following drivers: * axgbe * em * ice * ixl * vmxnet Sponsored by: Juniper Networks, Inc. Reviewed by: kbowling, #iflib Differential Revision: https://reviews.freebsd.org/D37768
* ixl: silence runtime warning when PCI_IOV is not enabledAndrew Gallatin2022-12-061-0/+3
| | | | | | | | | | | | | | When PCI_IOV is not enabled, do not attempt to call iflib_softirq_alloc_generic(...IFLIB_INTR_IOV), as it results in boot-time warnings similar to: taskqgroup_attach_cpu: qid not found for iov cpu=2 ixl2: taskqgroup_attach_cpu failed 22 Instead, make it conditional on PCI_IOV like the other SR-IOV related code. Reviewed by: erj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37609
* ixl(4): Fix SR-IOV panicsYan Ka Chiu2022-07-131-0/+8
| | | | | | | | | | | | | | | | | The hw and ifp of a vsi will be NULL if such ixl_vsi is allocated for a VF. When ixl_reconfigure_filters called, it is trying to access vsi->ifp and hw->mac.addr and therefore is casuing panic. This commit add checks to determine if vsi is a VF by checking if vsi->hw is NULL, before adding IXL_VLAN_ANY filter (which is already in a VF vsi's filter list) and VLAN filters. (erj's Note: The SR-IOV flows need revisiting; this will help prevent panics for now) Reviewed by: krzysztof.galazka@intel.com, erj@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35649
* ixl(4): Add support for I710 devices and remove non-inclusive languageKrzysztof Galazka2022-05-244-5/+11
| | | | | | | | | | | | | | Intel introduces a new line of 1G Ethernet adapters with Device ID 0x0DD2. While at that also remove non-inclusive language. Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: kbowling@ Tested by: gowtham.kumar.ks@intel.com MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D34924
* iavf/ice/ixl: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-2/+1
|
* i40e_validate_filter_settings: Remove unused variables.John Baldwin2022-04-121-5/+0
| | | | | Reviewed by: erj Differential Revision: https://reviews.freebsd.org/D34829
* ixl: Remove unused variables.John Baldwin2022-04-062-8/+0
|
* ixl(4): Remove unused function declarationEric Joyner2022-01-121-1/+0
| | | | | | Signed-off-by: Eric Joyner <erj@FreeBSD.org> Sponsored by: Intel Corporation
* net: iflib: fix vlan processing in the driversVincenzo Maffione2021-12-281-8/+5
| | | | | | | | | | | | | | The logic that sets iri_vtag and M_VLANTAG does not handle the case where the 802.11q VLAN tag is 0. Fix this issue across the iflib drivers. While there, also improve and align the VLAN tag check extraction, by moving it outside the RX descriptor loop, eliminating a local variable and additional checks. PR: 260068 Reviewed by: kbowling, gallatin Reported by: erj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33156
* net: iflib: let the drivers use isc_capenableVincenzo Maffione2021-12-281-1/+2
| | | | | | | | | | | | | Since isc_capenable (private copy of ifp->if_capenable) is now synchronized to if_capenable, use it in the drivers when checking the IFCAP_* bits. This results in better cache usage and avoids indirection through the ifp pointer. PR: 260068 Reviewed by: kbowling, gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33156
* ixl(4): Remove iavf(4) source filesEric Joyner2021-11-243-3683/+0
| | | | | | | | | | | Since iavf(4) no longer shares code with ixl(4) as of commit f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory, remove these now-unused iavf(4)-only files. Signed-off-by: Eric Joyner <erj@FreeBSD.org> Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28638
* ixl(4): Fix a typo in a sysctl descriptionGordon Bergling2021-11-191-1/+1
| | | | MFC after: 3 days
* ixl(4): Fix 2.5 and 5G speeds reporting and update shared codeKrzysztof Galazka2021-09-1310-108/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 2.5 and 5G speeds reporting and update shared code with recent changes: - Update expected FW API versions for X710 and X722 adapters - Define pointers related to Preservation Rules Module - Add definitions for Shadow RAM pointers to new modules: 5th and 6th FPA, and Preservation Rules Module. - Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know opcode for parser aborted packets. - Add the new filter types needed for custom cloud filters. - Add support for Minimum Rollback Revision - Fix RX_ONLY mode for unicast promiscuous on VLAN - Add EEE LPI status check for X722 adapters - Fix PHY type identifiers for 2.5G and 5G adapters - Fix update link data for X722 - Increase the timeout value for PF reset to give PF more time to finish reset if it is loaded with filters. - Added support for Min Rollback Revision for 4 more X722 modules - Fix reporting of Active Optical Cable media type - Add flags and fields for double VLAN processing - Fix potentially uninitialized variables in NVM code Reviewed by: kbowling@, mike.jakubik@gmail.com Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D31565
* ixl(4): Fix reporting of unqualified transceiversKrzysztof Galazka2021-08-202-10/+13
| | | | | | | | | | | | | | | | | | | When link_active_on_if_down flag is disabled and link is brought down with ifconfig, FW reports a false positive link event about an unqualified transceiver. The condition used in the driver to filter out those false positive events was incorrect and caused that unqualified module event to also not be reported when the event was valid. Change the condition to rely on IFF_UP flag instead of link_active_on_if_down and bump driver version to 2.3.1-k. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: stallamr@netapp.com, erj@ Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D30733
* intel ethernet: Use ether_gen_addr(9)Kevin Bowling2021-08-201-7/+3
| | | | | | | | Use ether_gen_addr(9) for VF MAC generation Reviewed by: Intel Networking (erj), kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31616
* ixl(4): Add tunable to override Flow Control settingsKrzysztof Galazka2021-04-053-18/+43
| | | | | | | | | | | | Add flow_control to hw.ixl tunables tree to let override initial flow control configuration for all interfaces. Keep using configuration set by NVM by default. Reviewed by: erj@, gallatin@ Tested by: gowtham.kumar.ks_intel.com MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D29338
* Fix some common typos in commentsGordon Bergling2021-03-131-20/+20
| | | | | | | | | | | - occured -> occurred - normaly -> normally - controling -> controlling - fileds -> fields - insterted -> inserted - outputing -> outputting MFC after: 1 week
* iflib: Make if_shared_ctx_t a pointer to constMark Johnston2021-03-082-6/+2
| | | | | | | | | | | | | | | This structure is shared among multiple instances of a driver, so we should ensure that it doesn't somehow get treated as if there's a separate instance per interface. This is especially important for software-only drivers like wg. DEVICE_REGISTER() still returns a void * and so the per-driver sctx structures are not yet defined with the const qualifier. Reviewed by: gallatin, erj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29102
* ixl(4): Add ability to control link state on ifconfig downKrzysztof Galazka2021-03-034-1/+154
| | | | | | | | | | | | Add sysctl link_active_on_if_down, which allows user to control if interface is kept in active state when it is brought down with ifconfig. Set it to enabled by default to preserve backwards compatibility. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D28028
* ixl(4): Report RX errors as sum of all RX error countersKrzysztof Galazka2021-03-033-9/+23
| | | | | | | | | | | | | | | | | | HW keeps track of RX errors using several counters, each for specific type of errors. Report RX errors to OS as sum of all those counters: CRC errors, illegal bytes, checksum, length, undersize, fragment, oversize and jabber errors. There is no HW counter for frames with invalid L3/L4 checksums so add a SW one. Also add a "rx_errors" sysctl with a copy of netstat IERRORS counter value to make it easier accessible from scripts. Reviewed By: erj Tested By: gowtham.kumar.ks@intel.com Sponsored By: Intel Corporation Differential Revision: https://reviews.freebsd.org/D27639
* ixl(4): Fix VLAN HW filteringKrzysztof Galazka2021-02-0411-313/+487
| | | | | | | | | | | | | | | | | | | X700 family of controllers has limited number of available VLAN HW filters. Driver did not handle properly a case when user assigned more VLANs to the interface which had all filters already in use. Fix that by disabling HW filtering when it is impossible to create filters for all requested VLANs. Keep track of registered VLANs using bitstring to be able to re-enable HW filtering when number of requested VLANs drops below the limit. Also switch all allocations to use M_IXL malloc type to ease detecting memory leaks in the driver. Reviewed by: erj Tested by: gowtham.kumar.ks@intel.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28137
* iflib: Free resources in a consistent order during detachSai Rajesh Tallamraju2021-02-011-1/+1
| | | | | | | | | | | | | Memory and PCI resources are freed with no particular order. This could cause use-after-frees when detaching following a failed attach. For instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but iflib_tqg_detach() attempts to access this array. Similarly, adapter queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to access adapter queues to free PCI resources. MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D27634
* ixl: Permit 802.1ad frames to pass though the chipLutz Donnerhacke2021-01-191-0/+40
| | | | | | | | | | | | This patch is a quick hack to change the internal Ethertype used within the chip. All frames with this type are dropped silently. This patch allows you to overwrite the factory default 0x88a8, which is used by IEEE 802.1ad VLAN stacking. Reviewed by: kp, philip, brueffer Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24179
* iflib: ensure that tx interrupts enabled and cleanupsMatt Macy2021-01-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing a 'dd' over iscsi will reliably cause stalls. Tx cleaning _should_ reliably happen as data is sent. However, currently if the transmit queue fills it will wait until the iflib timer (hz/2) runs. This change causes the the tx taskq thread to be run if there are completed descriptors. While here: - make timer interrupt delay a sysctl - simplify txd_db_check handling - comment on INTR types Background on the change: Initially doorbell updates were minimized by only writing to the register on every fourth packet. If txq_drain would return without writing to the doorbell it scheduled a callout on the next tick to do the doorbell write to ensure that the write otherwise happened "soon". At that time a sysctl was added for users to avoid the potential added latency by simply writing to the doorbell register on every packet. This worked perfectly well for e1000 and ixgbe ... and appeared to work well on ixl. However, as it turned out there was a race to this approach that would lockup the ixl MAC. It was possible for a lower producer index to be written after a higher one. On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial response was to add a lock around doorbell writes - fixing the problem but adding an unacceptable amount of lock contention. The next iteration was to use transmit interrupts to drive delayed doorbell writes. If there were no packets in the queue all doorbell writes would be immediate as the queue started to fill up we could delay doorbell writes further and further. At the start of drain if we've cleaned any packets we know we've moved the state machine along and we write the doorbell (an obvious missing optimization was to skip that doorbell write if db_pending is zero). This change required that tx interrupts be scheduled periodically as opposed to just when the hardware txq was full. However, that just leads to our next problem. Initially dedicated msix vectors were used for both tx and rx. However, it was often possible to use up all available vectors before we set up all the queues we wanted. By having rx and tx share a vector for a given queue we could halve the number of vectors used by a given configuration. The problem here is that with this change only e1000 passed the necessary value to have the fast interrupt drive tx when appropriate. Reported by: mav@ Tested by: mav@ Reviewed by: gallatin@ MFC after: 1 month Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D27683
* ixl(4): Add support for X710-T*L devicesEric Joyner2020-09-019-16/+537
| | | | | | | | | | | | | | | | | | Add support for new devices which are capable of 2.5 and 5G speeds, as well as Energy Efficient Ethernet (EEE): - introduce new device ids - add ability to select 2.5 and 5G speeds on devices which support it - add sysctls to enable EEE and read related statistics Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reviewed by: #IntelNetworking MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D25549 Notes: svn path=/head/; revision=365231
* Remove redeclaration found by gcc buildLi-Wen Hsu2020-08-151-2/+0
| | | | | | | | | | Reviewed by: Jacob Keller <jacob.e.keller@intel.com> Suggested editing from: Krzysztof Galazka <krzysztof.galazka@intel.com> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25954 Notes: svn path=/head/; revision=364241
* dev.ixl.<N>.debug: mark as MPSAFEPawel Biernacki2020-07-041-1/+1
| | | | | | | | | | | This node provides no handler, it's implicitly MPSAFE. Reviewed by: erj Sponsored by: Mysterious Code Ltd. Differential Revision: https://reviews.freebsd.org/D25408 Notes: svn path=/head/; revision=362932
* ixl(4): Add FW recovery mode support and other thingsEric Joyner2020-06-0921-2192/+3128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the iflib version of ixl driver based on the OOT version ixl-1.11.29. Major changes: - Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c to simplify code sharing between legacy and iflib version of driver - Add support for most recent FW API version (1.10), which extends FW LLDP Agent control by user to X722 devices - Improve handling of device global reset - Add support for the FW recovery mode - Use virtchnl function to validate virtual channel messages instead of using separate checks - Fix MAC/VLAN filters accounting Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reviewed by: erj@ Tested by: Jeffrey Pieper <jeffrey.e.pieper@intel.com> MFC after: 1 week Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D24564 Notes: svn path=/head/; revision=361992
* em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib methodEric Joyner2020-05-112-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Pursuant to r360398, implement driver-specific versions of the ifdi_needs_restart iflib device method. Some (if not most?) Intel network cards don't need reinitializing when a VLAN is added or removed from the device hardware, so these implement ifdi_needs_restart in a way that tell iflib not to bring the interface up or down when a VLAN is added or removed, regardless of whether the VLAN_HWFILTER interface capability flag is set or not. This could potentially solve several PRs relating to link flaps that occur when VLANs are added/removed to devices. Signed-off-by: Eric Joyner <erj@freebsd.org> PR: 240818, 241785 Reviewed by: gallatin@, olivier@ MFC after: 3 days MFC with: r360398 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D24659 Notes: svn path=/head/; revision=360902
* ixl: Add missing conversions from/to LE16Leandro Lupori2020-03-062-15/+20
| | | | | | | | | | | | | | | This fixes some errors on PPC64, during attach and when trying to assign an IP to an interface. With this change, basic operation of X710 NICs is now possible. This also fixes builds with IXL_DEBUG enabled Reviewed by: erj Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D23975 Notes: svn path=/head/; revision=358698
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (15 of many)Pawel Biernacki2020-02-244-61/+106
| | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Notes: svn path=/head/; revision=358286
* Miscellaneous typo fixesEd Maste2020-02-071-1/+1
| | | | | | | | Submitted by: Gordon Bergling <gbergling_gmail.com> Differential Revision: https://reviews.freebsd.org/D23453 Notes: svn path=/head/; revision=357664
* ixl: prevent non-privileged access to NVM update interfaceEric Joyner2020-01-022-5/+24
| | | | | | | | | | | | | | | | | | Add a privilege check to the ixl_handle_nvmupd_cmd function, ensuring that only privileged users are allowed to access the NVM update interface. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reported by: markj@ Reviewed by: markj@, erj@, jeffrey.e.pieper@intel.com MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22870 Notes: svn path=/head/; revision=356309
* Fix compile error introduced in r353658Eric Joyner2019-10-161-1/+1
| | | | | | | | | "adapter" doesn't exist in ixl. Reported by: O. Hartmann <ohartmann@walstatt.org> Notes: svn path=/head/; revision=353661
* ixl: report whether device received pause framesEric Joyner2019-10-161-0/+8
| | | | | | | | | | | | | | | | | From Jake: When updating the device statistics, report whether or not we have received any pause frames to the iflib stack. This allows the iflib stack to avoid generating a Tx hang message while the device is paused. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: gallatin@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21870 Notes: svn path=/head/; revision=353658
* Convert if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-143-71/+48
| | | | | | | Reviewed by: erj Notes: svn path=/head/; revision=353503
* Add the missing braces to fix the code not guarded by the if clause and hasLi-Wen Hsu2019-05-301-2/+3
| | | | | | | | | | | | misleading indentation. This is found by gcc -Wmisleading-indentation Approved by: erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20428 Notes: svn path=/head/; revision=348445
* iflib: expose the Rx mbuf buffer size to driversEric Joyner2019-03-192-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From Jake: iflib_fl_setup calculates a suitable buffer size for the Rx mbufs based on the isc_max_frame_size value that drivers setup. This calculation is repeated by drivers when programming their hardware with the size of each Rx buffer. This can lead to a mismatch where the iflib mbuf size is different from the expected size of the buffer as programmed by the hardware. This can lead to unexpected results. If iflib ever wants to support mbuf sizes larger than one page, every driver must be updated to account for the new possible buffer sizes. Fix this by calculating the mbuf size prior to calling IFDI_INIT, and adding the iflib_get_rx_mbuf_sz function which will expose this value to drivers, so that they do not repeat the same calculation. Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: shurd@, erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19489 Notes: svn path=/head/; revision=345305
* ixl: Fix panic caused by bug exposed by r344062Eric Joyner2019-02-142-2/+1
| | | | | | | | | | | | | | | Don't use a struct if_irq for IFLIB_INTR_IOV type interrupts since that results in get_core_offset() being called on them, and get_core_offset() doesn't handle IFLIB_INTR_IOV type interrupts, which results in an assert() being triggered in iflib_irq_set_affinity(). PR: 235730 Reported by: Jeffrey Pieper <jeffrey.e.pieper@intel.com> MFC after: 1 day Sponsored by: Intel Corporation Notes: svn path=/head/; revision=344132
* - Stop iflib(4) from leaking MSI messages on detachment by callingMarius Strobl2019-01-304-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bus_teardown_intr(9) before pci_release_msi(9). - Ensure that iflib(4) and associated drivers pass correct RIDs to bus_release_resource(9) by obtaining the RIDs via rman_get_rid(9) on the corresponding resources instead of using the RIDs initially passed to bus_alloc_resource_any(9) as the latter function may change those RIDs. Solely em(4) for the ioport resource (but not others) and bnxt(4) were using the correct RIDs by caching the ones returned by bus_alloc_resource_any(9). - Change the logic of iflib_msix_init() around to only map the MSI-X BAR if MSI-X is actually supported, i. e. pci_msix_count(9) returns > 0. Otherwise the "Unable to map MSIX table " message triggers for devices that simply don't support MSI-X and the user may think that something is wrong while in fact everything works as expected. - Put some (mostly redundant) debug messages emitted by iflib(4) and em(4) during attachment under bootverbose. The non-verbose output of em(4) seen during attachment now is close to the one prior to the conversion to iflib(4). - Replace various variants of spelling "MSI-X" (several in messages) with "MSI-X" as used in the PCI specifications. - Remove some trailing whitespace from messages emitted by iflib(4) and change them to consistently start with uppercase. - Remove some obsolete comments about releasing interrupts from drivers and correct a few others. Reviewed by: erj, Jacob Keller, shurd Differential Revision: https://reviews.freebsd.org/D18980 Notes: svn path=/head/; revision=343578
* ixl(4): Fix handling data passed with ioctl from NVM update toolEric Joyner2019-01-241-11/+58
| | | | | | | | | | | | | | | | | From Krzysztof: Ensure that the entire data buffer passed from the NVM update tool is copied in to kernel space and copied back out to user space using copyin() and copyout(). PR: 234104 Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reported by: Finn <ixbug@riseup.net> MFC after: 5 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18817 Notes: svn path=/head/; revision=343372
* intel iflib drivers: correct initialization of tx_cidx_processedEric Joyner2019-01-241-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Jake: In r341156 ("Fix first-packet completion", 2018-11-28) a hack to work around a delta calculation determining how many descriptors were used was added to ixl_isc_tx_credits_update_dwb. The same fix was also applied to the em and igb drivers in r340310, and to ix in r341156. The hack checked the case where prev and cur were equal, and then added one. This works, because by the time we do the delta check, we already know there is at least one packet available, so the delta should be at least one. However, it's not a complete fix, and as indicated by the comment is really a hack to work around the real bug. The real problem is that the first time that we transmit a packet, tx_cidx_processed will be set to point to the start of the ring. Ultimately, the credits_update function expects it to point to the *last* descriptor that was processed. Since we haven't yet processed any descriptors, pointing it to 0 results in this incorrect calculation. Fix the initialization code to have it point to the end of the ring instead. One way to think about this, is that we are setting the value to be one prior to the first available descriptor. Doing so, corrects the delta calculation in all cases. The original fix only works if the first packet has exactly one descriptor. Otherwise, we will report 1 less than the correct value. As part of this fix, also update the MPASS assertions to match the real expectations. First, ensure that prev is not equal to cur, since this should never happen. Second, remove the assertion about prev==0 || delta != 0. It looks like that originated from when the em driver was converted to iflib. It seems like it was supposed to ensure that delta was non-zero. However, because we originally returned 0 delta for the first calculation, the "prev == 0" was tacked on. Instead, replace this with a check that delta is greater than zero, after the correction necessary when the ring pointers wrap around. This new solution should fix the same bug as r341156 did, but in a more robust way. Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: shurd@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18545 Notes: svn path=/head/; revision=343369
* Fix first-packet completionStephen Hurd2018-11-281-0/+6
| | | | | | | | | | | | | | | | | | | The first packet after the ring is initialized was never completed as isc_txd_credits_update() would not include it in the count of completed packets. This caused netmap to never complete a batch. See PR 233022 for more details. This is the same fix as the r340310 for e1000 PR: 233607 Reported by: lev Reviewed by: lev MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D18368 Notes: svn path=/head/; revision=341156
* ixl/iavf(4): Fix TSO offloads when TXCSUM is disabledEric Joyner2018-11-084-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Jake: The iflib stack does not disable TSO automatically when TXCSUM is disabled, instead assuming that the driver will correctly handle TSOs even when CSUM_IP is not set. This results in iflib calling ixl_isc_txd_encap with packets which have CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of this, ixl_tx_setup_offload will not setup the IPv4 checksum offloading. This results in bad TSO packets being sent if a user disables TXCSUM without disabling TSO. Fix this by updating the ixl_tx_setup_offload function to check both CSUM_IP and CSUM_IP_TSO when deciding whether to enable IPv4 checksums. Once this is corrected, another issue for TSO packets is revealed. The driver sets IFLIB_NEED_ZERO_CSUM in order to enable a work around that causes the ip->sum field to be zero'd. This is necessary for ixl hardware to correctly perform TSOs. However, if TXCSUM is disabled, then the work around is not enabled, as CSUM_IP will not be set when the iflib stack checks to see if it should clear the sum field. Fix this by adding IFLIB_TSO_INIT_IP to the iflib flags for the iavf and ixl interface files. It is uncertain if the hardware needs IFLIB_NEED_ZERO_CSUM for any other case besides TSO, so leave that flag assigned. It may be worth investigating to see if this work around flag could be disabled in a future change. Once both of these changes are made, the ixl driver should correctly offload TSO packets when TSO4 offload is enabled, regardless of whether TXCSUM is enabled or disabled. Submitted by: Jacob Keller <jacob.e.keller@intel.com> Reviewed by: erj@, shurd@ MFC after: 0 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D17900 Notes: svn path=/head/; revision=340256
* ixl/iavf(4): Update remaining references of "num_queues" to "num_rx_queues"Eric Joyner2018-11-012-7/+3
| | | | | | | | | | This should fix a build issue when "options RSS" is set. Reported by: bz@ Sponsored by: Intel Corporation Notes: svn path=/head/; revision=340010
* ixl/iavf(4): Fix GCC 6.4.0 buildConrad Meyer2018-10-202-4/+0
| | | | | | | | | Don't define redundant prototypes. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=339459