aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sfxge/common/efx.h
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* sfxge: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-22/+0
| | | | Notes: svn path=/head/; revision=365086
* sfxge(4): unify power of 2 alignment check macroAndrew Rybchenko2019-07-271-0/+4
| | | | | | | | | | | | | | | | Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED() defined in libefx. Add type argument and cast value and alignment to one specified type. Reported by: Andrea Valsania <andrea.valsania at answervad.it> Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21076 Notes: svn path=/head/; revision=350371
* sfxge(4): fix align to power of 2 when align has smaller typeAndrew Rybchenko2019-07-271-0/+4
| | | | | | | | | | | | | | | | | Substitute driver-defined P2ALIGN() with EFX_P2ALIGN() defined in libefx. Cast value and alignment to one specified type to guarantee result correctness. Reported by: Andrea Valsania <andrea.valsania at answervad.it> Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21075 Notes: svn path=/head/; revision=350370
* sfxge(4): fix power of 2 round up when align has smaller typeAndrew Rybchenko2019-07-271-4/+9
| | | | | | | | | | | | | | | | | Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP() defined in libefx. Cast value and alignment to one specified type to guarantee result correctness. Reported by: Andrea Valsania <andrea.valsania at answervad.it> Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D21074 Notes: svn path=/head/; revision=350369
* sfxge(4): report support for Tx checksum op descriptorsAndrew Rybchenko2018-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD driver needs a patch to provide a means for packets which do not need checksum offload but have flow ID set to avoid hitting only the first Tx queue (which has been used for packets not needing checksum offload). This should be possible on Huntington, Medford or Medford2 chips since these support toggling checksum offload on any given queue dynamically by means of pushing option descriptors. The patch for FreeBSD driver will then need a means to figure out whether the feature can be used, and testing adapter family might not be a good solution. This patch adds a feature bit specifically to indicate support for checksum option descriptors. The new feature bits may have more users in future, apart from the mentioned FreeBSD patch. Submitted by: Ivan Malov <Ivan.Malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18388 Notes: svn path=/head/; revision=341783
* sfxge(4): correct annotations where NULL input is OKAndrew Rybchenko2018-11-301-1/+1
| | | | | | | | | | | Correct annotations where NULL input can be permitted Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18284 Notes: svn path=/head/; revision=341323
* sfxge(4): add accessor to whole link statusAndrew Rybchenko2018-11-301-0/+15
| | | | | | | | | | | | | | | | Add a function which makes an MCDI GET_LINK request and packages up the results. Currently, the get-link function is triggered from several entry points which then pass on or store selected parts of the data. When the driver needs to obtain the current link state, it is more efficient to do this in a single call. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18281 Notes: svn path=/head/; revision=341320
* sfxge(4): guard Rx scale code with corresponding optionAndrew Rybchenko2018-11-301-0/+2
| | | | | | | | | | | | Previously only some of the code was guarded by this which caused a build error when EFSYS_OPT_RX_SCALE is 0 (e.g. in manftest). Submitted by: Tom Millington <tmillington at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18280 Notes: svn path=/head/; revision=341319
* sfxge(4): adjust PHY module info interfaceAndrew Rybchenko2018-11-301-2/+8
| | | | | | | | | | | | | Adjust data types in interface to permit the complete module information buffer to be obtained in a single call. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18275 Notes: svn path=/head/; revision=341313
* sfxge(4): expose PHY module device address constantsAndrew Rybchenko2018-11-301-0/+21
| | | | | | | | | | | Rearrange so the valid addresses are visible to the caller. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18274 Notes: svn path=/head/; revision=341312
* sfxge(4): add helper API to make Geneve filter specAndrew Rybchenko2018-11-301-2/+16
| | | | | | | | | Submitted by: Vijay Srivastava <vijays at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18272 Notes: svn path=/head/; revision=341310
* sfxge(4): simplify the code to parse RSS hash typeAndrew Rybchenko2018-11-301-1/+1
| | | | | | | | | | | | | RSS mode bits can be accessed a lot easier in the hash type value provided that the variable type is uint32_t. The macro helper can be removed to enhance readability. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18268 Notes: svn path=/head/; revision=341306
* sfxge(4): check buffer size for hash flagsAndrew Rybchenko2018-11-301-1/+2
| | | | | | | | | | | | | | | The efx_rx_scale_hash_flags_get interface is unsafe, as it does not have an argument for the size of the output buffer used to return the flags. While the only caller currently supplies a sufficiently large buffer, this should be checked at runtime to avoid writing past the end of the buffer. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18267 Notes: svn path=/head/; revision=341305
* sfxge(4): add support to get active FEC typeAndrew Rybchenko2018-11-301-0/+11
| | | | | | | | | Submitted by: Vijay Srivastava <vijays at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18265 Notes: svn path=/head/; revision=341303
* sfxge(4): add API to inform libefx of hardware removalAndrew Rybchenko2018-11-301-0/+4
| | | | | | | | | | | | | | | | The efx_nic_hw_unavailable() checks ensure that if the NIC hardware has failed or has been physically removed then libefx will stop further attempts to access the hardware. Add an interface for libefx clients to force unavailability, so the hardware is treated as dead or removed even if still physically present. Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18261 Notes: svn path=/head/; revision=341299
* sfxge(4): add routine to check for hardware presenceAndrew Rybchenko2018-11-301-0/+4
| | | | | | | | | | | | Add efx_nic_hw_unavailable() routine to check for hardware presence before continuing with NIC operations. Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18260 Notes: svn path=/head/; revision=341298
* sfxge(4): add information if TSO workaround is requiredAndrew Rybchenko2018-11-301-0/+1
| | | | | | | | | | | | | | | | | | | In SF bug 61297 it's been confirmed that the hardware does not always calculate the TCP checksum correctly with TSO sends. The value of the Total Length field (IPv4) or Payload Length field (IPv6) is the critical factor. We're sufficiently confident that if these fields are zero then the checksum will be calculated correctly. The information may be used by the drivers to check if the workaround is required when FATSOv2 is implemented. Submitted by: Mark Spender <mspender at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18258 Notes: svn path=/head/; revision=341296
* sfxge(4): add buffer editing functions to boot configAndrew Rybchenko2018-11-301-0/+81
| | | | | | | | | | | | | | | | | Functions to process the DHCP option list format used by the expansion ROM config buffers, to support extracting and updating of individual options. The initial use case is the driver presenting the global and per-PF options as separate items, with the driver implementing the synchronization of global options across the configuration buffers for all PFs. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18254 Notes: svn path=/head/; revision=341292
* sfxge(4): add API to retrieve sensor limitsAndrew Rybchenko2018-11-301-0/+12
| | | | | | | | | Submitted by: Martin Harvey <mharvey at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18253 Notes: svn path=/head/; revision=341291
* sfxge(4): add generated description of sensorsAndrew Rybchenko2018-11-301-0/+5
| | | | | | | | | | | Description of sensors is generated from firmware sources. Submitted by: Martin Harvey <mharvey at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18251 Notes: svn path=/head/; revision=341286
* sfxge(4): refactor monitors supportAndrew Rybchenko2018-11-301-62/+96
| | | | | | | | | | | | | | | Remove obsolete monitor types since Falcon SFN4000 series adapters no longer supported by libefx. Rename MCDI monitors to be consistent with YML. The code may be simplified and generalized since only MCDI monitors remain. Submitted by: Martin Harvey <mharvey at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18249 Notes: svn path=/head/; revision=341284
* sfxge(4): move empty efsys definitions to EFX headersAndrew Rybchenko2018-11-301-0/+1
| | | | | | | | | | | | | Move empty definitions for platform-specific annotations from efsys.h to EFX headers. Submitted by: Martin Harvey <mharvey at solarflare.com> Submitted by: Andrew Lee <alee at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18248 Notes: svn path=/head/; revision=341283
* sfxge(4): add more definitions of partitionsAndrew Rybchenko2018-11-291-0/+2
| | | | | | | | | | | | Add definitions of dynamic config and expansion ROM backup partitions. Submitted by: Paul Fox <pfox at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18247 Notes: svn path=/head/; revision=341216
* sfxge(4): add Medford2 head-of-line blocking statsAndrew Rybchenko2018-11-291-0/+1
| | | | | | | | | | | | These stats are availble on Medford2 DPDK firmware variant which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE capability bit is set when the stats are available. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18243 Notes: svn path=/head/; revision=341212
* sfxge(4): generate Medford2 RxDP statsAndrew Rybchenko2018-11-291-1/+4
| | | | | | | | Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18241 Notes: svn path=/head/; revision=341210
* sfxge(4): get max supported value for action MARKAndrew Rybchenko2018-11-291-0/+1
| | | | | | | | | | | | | | The mark value for MATCH_ACTION_MARK has a maximum value. Requesting a value larger than the maximum will cause the filter insertion to fail with EINVAL. This patch allows the driver to check the value at the filter validation. Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18240 Notes: svn path=/head/; revision=341209
* sfxge(4): support MARK and FLAG actions in filtersAndrew Rybchenko2018-11-291-0/+6
| | | | | | | | | | | | This patch adds support for DPDK rte_flow "MARK" and "FLAG" filter actions to filters on EF10 family NICs. Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18239 Notes: svn path=/head/; revision=341208
* sfxge(4): get actions MARK and FLAG supportAndrew Rybchenko2018-11-291-0/+3
| | | | | | | | | | | | Filter actions MARK and FLAG are supported on Medford2 by DPDK firmware variant. Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18238 Notes: svn path=/head/; revision=341207
* sfxge(4): support equal stride super-buffer Rx modeAndrew Rybchenko2018-11-291-2/+32
| | | | | | | | | | | | | | | Equal stride super-buffer Rx mode is supported by DPDK firmware variant. One Rx descriptor provides many Rx buffers to firmware. Rx buffers follow each other with specified stride. Also it supports head of line blocking with timeout to address drops when no Rx descriptors are available. So it gives extra time to the driver to provide Rx descriptors before drop. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18236 Notes: svn path=/head/; revision=341205
* sfxge(4): detect equal stride super-buffer supportAndrew Rybchenko2018-11-291-0/+1
| | | | | | | | | | | Equal stride super-buffer Rx mode is supported on Medford2 by DPDK firmware variant. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18235 Notes: svn path=/head/; revision=341204
* sfxge(4): honour packed stream RSS restrictionAndrew Rybchenko2018-11-291-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packed stream firmware variant on EF10 adapters has a number of properties which must be taken into account: - Only one exclusive RSS context is available per port. - Only IP addresses can contribute to the hash value. Huntington and Medford have one more limitation which is important for the drivers capable of packed stream: - Hash algorithm is non-standard (i.e. non-Toeplitz). This implies XORing together source + destination IP addresses (or last four bytes in the case of IPv6) and using the result as the input to a Toeplitz hash. This patch provides a number of improvements in order to treat the mentioned limitations in the common code. If the firmware variant is packed stream, the list of supported hash tuples will include less variants, and the maximum number of RSS contexts will be set to one. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18232 Notes: svn path=/head/; revision=341201
* sfxge(4): support more RSS hash configurationsAndrew Rybchenko2018-11-291-2/+18
| | | | | | | | | | | | | | | | | Modern firmwares on EF10 adapters have support for more traffic classes eligible for hash computation. Also, it has become possible to adjust hashing per individual class and select distinct packet fields which will be able to contribute to the hash value. This patch adds support for the mentioned features. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18231 Notes: svn path=/head/; revision=341200
* sfxge(4): add a new means to control RSS hashAndrew Rybchenko2018-11-291-0/+90
| | | | | | | | | | | | | | | | | | Currently, libefx has no support for additional RSS modes available with later controllers. In order to support this, libefx should be able to list available hash configurations. This patch provides basic infrastructure for the new interface. The client drivers will be able to query the list of supported hash configurations for a particular hash algorithm. Also, it will be possible to configure hashing by means of new definitions. Submitted by: Ivan Malov <ivan.malov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18230 Notes: svn path=/head/; revision=341199
* sfxge(4): support FW subvariant choiceAndrew Rybchenko2018-11-291-0/+32
| | | | | | | | | | | | | | If DPDK application or OS does not need checksumming on transmit, it may be disabled in firmware to achieve higher packet rates. Choice must be done before VIS allocation and is allowed if no other non-preboot and firmware subvariant-unaware drivers are attached. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18227 Notes: svn path=/head/; revision=341196
* sfxge(4): report no Tx checksum FW subvariant supportAndrew Rybchenko2018-11-291-0/+1
| | | | | | | | Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18226 Notes: svn path=/head/; revision=341195
* sfxge(4): add values for RxDPCPU firmware id recognitionAndrew Rybchenko2018-11-291-0/+7
| | | | | | | | | Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18223 Notes: svn path=/head/; revision=341192
* sfxge(4): support choosing firmware variantAndrew Rybchenko2018-11-291-1/+14
| | | | | | | | | Submitted by: Gautam Dawar <gdawar at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18222 Notes: svn path=/head/; revision=341191
* sfxge(4): distinguish filters for encapsulated packetsAndrew Rybchenko2018-11-291-0/+5
| | | | | | | | | | | | | | | | | | | | | Add filter match flag to distinguish filters applied only to encapsulated packets. Match flags set should allow to determine whether a filter is supported or not. The problem is that if specification has supported set outer match flags and specified encapsulation without any inner flags, check says that it is supported, and filter insertion is performed. However, there is no filtering of the encapsulated traffic. A new flag is added to solve this problem and separate the filters for the encapsulated packets. Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18220 Notes: svn path=/head/; revision=341189
* sfxge(4): support VXLAN filter creationAndrew Rybchenko2018-11-291-0/+7
| | | | | | | | | Submitted by: Vijay Srivastava <vijays at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18219 Notes: svn path=/head/; revision=341188
* sfxge(4): support VNI/VSID and inner frame local MACAndrew Rybchenko2018-11-291-0/+8
| | | | | | | | | | | | This supports VNI/VSID and inner frame local MAC fields to match in VXLAN, GENEVE, or NVGRE packets. Submitted by: Roman Zhukov <roman.zhukov at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18218 Notes: svn path=/head/; revision=341187
* sfxge(4): add signed image layout supportAndrew Rybchenko2018-11-291-0/+87
| | | | | | | | | Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18215 Notes: svn path=/head/; revision=341184
* sfxge(4): add outer IP ID parameter to TSOv2 descriptorAndrew Rybchenko2018-11-281-0/+1
| | | | | | | | | | | Set outer_ip_id in the TX option descriptor for encapsulated packets. Submitted by: Vijay Srivastava <vijays at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18213 Notes: svn path=/head/; revision=341138
* sfxge(4): add encapsulated TSOv2 capabilityAndrew Rybchenko2018-11-281-0/+1
| | | | | | | | | Submitted by: Vijay Srivastava <vijays at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18212 Notes: svn path=/head/; revision=341137
* sfxge(4): regenerate headers to pick up CTPIO statsAndrew Rybchenko2018-11-281-1/+17
| | | | | | | | | Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18210 Notes: svn path=/head/; revision=341135
* sfxge(4): add 1.3V voltage and current sensorsAndrew Rybchenko2018-11-281-1/+3
| | | | | | | | | Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18205 Notes: svn path=/head/; revision=341130
* sfxge(4): support FEC mode settingsAndrew Rybchenko2018-11-281-0/+6
| | | | | | | | | | | | | Medford2 controllers support control and reporting of FEC modes for 25G and higher links. See SF-109306-TC for suggested usage in client code. Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18197 Notes: svn path=/head/; revision=341122
* sfxge(4): remove MAC stats size defineAndrew Rybchenko2018-11-271-3/+2
| | | | | | | | | Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18180 Notes: svn path=/head/; revision=341066
* sfxge(4): decode Medford2 FEC stats if availableAndrew Rybchenko2018-11-271-0/+1
| | | | | | | | | | | Decode Medford2 FEC stats if available in MAC stats DMA buffer. Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18178 Notes: svn path=/head/; revision=341064