summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r322250:hselasky2017-08-151-4/+4
| | | | | | | | | Count drop events due to lack of PCI bandwidth as queue drops and not as input errors in the mlx5en(4) driver. This improves the sysadmin view of physical port errors. Submitted by: gallatin@ Sponsored by: Mellanox Technologies
* MFC r312872:hselasky2017-08-031-0/+10
| | | | | | | | | | | | | | | | Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies
* MFC r312537:hselasky2017-08-031-1/+0
| | | | | | Remove superfluous return statement. Sponsored by: Mellanox Technologies
* MFC r312536:hselasky2017-08-031-30/+38
| | | | | | | | | | | | | | | | | | Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @
* MFC r312528:hselasky2017-08-031-2/+34
| | | | | | | | | | | | | | | | | | | Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies
* MFC r312527:hselasky2017-08-031-0/+41
| | | | | | | | Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies
* MFC r317568:hselasky2017-05-051-3/+32
| | | | | | | Improve sysadmin visibility of physical port error counters in the mlx5en driver. Sponsored by: Mellanox Technologies
* MFC r310387:hselasky2017-01-091-0/+22
| | | | | | Add more comments regarding collection of statistics counters. Sponsored by: Mellanox Technologies
* MFC r310388:hselasky2017-01-091-2/+2
| | | | | | Make a read only pointer constant. Sponsored by: Mellanox Technologies
* MFC r309406:hselasky2016-12-191-16/+0
| | | | | | | | | | Remove useless NULL checks. NULL is not returned when allocating memory passing the M_WAITOK flag. Submitted by: trasz @ Differential Revision: https://reviews.freebsd.org/D5772 Sponsored by: Mellanox Technologies
* MFC r308416:hselasky2016-11-151-0/+8
| | | | | | | | | | | Add timer to watch the RQ when we are out of mbufs. The firmware/hardware does not generate additional completion events unless we post new buffers. Use a timer to try to post more buffers in case we are temporarily out of mbufs. Else the receive schedule completely stops. Sponsored by: Mellanox Technologies
* MFC r306453:hselasky2016-10-101-0/+1
| | | | | | Set hardware stats flag to avoid double counting the number of incoming bytes. Found by: Ben RUBSON <ben.rubson@gmail.com>
* MFC r305876:hselasky2016-09-231-3/+0
| | | | | | mlx5en: Remove unused pdev pointer. Sponsored by: Mellanox Technologies
* MFC r305875:hselasky2016-09-231-0/+3
| | | | | | | | mlx5en: Verify port type is ethernet before creating network device Else the mlx5en driver might attach to infiniband ports. Sponsored by: Mellanox Technologies
* MFC r305874:hselasky2016-09-231-12/+12
| | | | | | | | | | | mlx5en: Allow setting the software MTU size below 1500 bytes The hardware MTU size can't be set to a value less than 1500 bytes due to side-band management support. Allow setting the software MTU size below 1500 bytes, thus creating a mismatch between hardware and software MTU sizes. Sponsored by: Mellanox Technologies
* MFC r305873:hselasky2016-09-231-10/+17
| | | | | | | | | | mlx5en: Factor out common sendqueue code for use with rate limiting SQs. Try to reuse code to setup sendqueues when possible by making some static functions global. Further split the mlx5e_close_sq_wait() function to separate out reusable parts. Sponsored by: Mellanox Technologies
* MFC r305872:hselasky2016-09-231-0/+1
| | | | | | mlx5en: Properly declare doorbell lock for 32-bit CPUs. Sponsored by: Mellanox Technologies
* MFC r305871:hselasky2016-09-231-2/+0
| | | | | | | | | | mlx5en: Optimise away duplicate UAR pointers. This change also reduces the size of the mlx5e_sq structure so that the last queue_state element will fit into the previous cacheline and then the mlx5e_sq structure becomes one cacheline less for amd64. Sponsored by: Mellanox Technologies
* MFC r305870:hselasky2016-09-231-17/+2
| | | | | | | | | mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global. Make some functions and structures global to allow for code reuse when creating rate limiting sendqueues. Sponsored by: Mellanox Technologies
* MFC r305869:hselasky2016-09-231-44/+39
| | | | | | | | | | | | | mlx5en: Minor completion queue control path code refactor. Move setting of CQ moderation mode together with the other CQ moderation parameters. Pass completion event vector as a separate argument to mlx5e_open_cq(), because its value is different for each call. Pass mlx5e_priv pointer instead of mlx5e_channel pointer so that code can be used by rate limiting sendqueues. Sponsored by: Mellanox Technologies
* MFC r305868:hselasky2016-09-231-31/+12
| | | | | | | | | | mlx5en: Separate the sendqueue from using the mlx5e_channel structure. This change allows for reusing the transmit path for so called rate limited senqueues. While at it optimise some pointer lookups in the fast path. Sponsored by: Mellanox Technologies
* MFC r305867:hselasky2016-09-231-4/+11
| | | | | | | | | Update the MLX5 core module: - Add new firmware commands and update existing ones. - Add more firmware related structures and update existing ones. - Some minor fixes, like adding missing \n to some prints. Sponsored by: Mellanox Technologies
* MFC r303870:hselasky2016-08-151-0/+7
| | | | | | | | | | | | Fix for use after free. Clear the device description to avoid use after free because the bsddev is not destroyed when the mlx5en module is unloaded. Only when the parent mlx5 module is unloaded the bsddev is destroyed. This fixes a panic on listing sysctls which refer strings in the bsddev after the mlx5en module has been unloaded. Sponsored by: Mellanox Technologies
* MFC r303837:hselasky2016-08-151-15/+9
| | | | | | | | | | | | | Switch to the new block based LRO input function for the mlx5en driver. This change significantly increases the overall RX aggregation ratio for heavily loaded networks handling 10-80 thousand simultaneous connections. Remove the turbo LRO code and all references to it which has now been superceeded by the tcp_lro_queue_mbuf() function. Tested by: Netflix Sponsored by: Mellanox Technologies
* Add SR-IOV guest support to the mlx5en driver.hselasky2016-06-071-0/+7
| | | | | | | | | This patch adds the missing pieces needed for device setup using the mlx5en driver inside a virtual machine which is providing hardware access through SR-IOV. Sponsored by: Mellanox Technologies MFC after: 1 week
* Optimise use of doorbell and remove redundant NOPshselasky2016-05-201-8/+8
| | | | | | | | | | Store the last doorbell write in the mlx5e_sq structure and write the doorbell to the hardware when the transmit routine finishes transmitting all queued mbufs. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week
* Implement TX completion event interleaving.hselasky2016-05-201-21/+76
| | | | | | | | | | | | | | | | | | This patch implements a sysctl which allows setting a factor, N, for how many work queue elements can be generated before requiring a completion event. When a completion event happens the code simulates N completion events instead of only one. When draining a transmit queue, N-1 NOPs are transmitted at most, to force generation of the final completion event. Further a timer is running every HZ ticks to flush any remaining data off the transmit queue when the tx_completion_fact > 1. The goal of this feature is to reduce the PCI bandwidth needed when transmitting data. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week
* Correct some error codes to native FreeBSD ones.hselasky2016-04-291-0/+3
| | | | | | Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week
* Add function to detect the presence of a port module and use thishselasky2016-04-291-1/+6
| | | | | | | | | | function to error out early when no port module is present and doing eeprom access. This also prevents error codes from filling up in dmesg. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week
* Allow RX and TX pause frames to be set through ifconfig.hselasky2016-01-191-19/+101
| | | | | | | Reviewed by: gnn Sponsored by: Mellanox Technologies MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D4817
* Add support for modifying coalescing parameters runtime.hselasky2015-12-301-0/+56
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Allow I2C to read address 0x51 as well as address 0x50.hselasky2015-12-301-4/+15
| | | | | | MFC after: 1 week Submitted by: Shahar Klein <shahark@mellanox.com> Sponsored by: Mellanox Technologies
* 10G ER/LR should present itself as LR.hselasky2015-12-301-2/+2
| | | | | | MFC after: 1 week Submitted by: Shahar Klein <shahark@mellanox.com> Sponsored by: Mellanox Technologies
* Add support for CQE zipping. CQE zipping reduces PCI overhead byhselasky2015-12-281-0/+12
| | | | | | | | | | | | | coalescing and zipping multiple CQEs into a single merged CQE. The feature is enabled by default and can be disabled by a sysctl. Implementing this feature mlx5_cqwq_pop() has been separated from mlx5e_get_cqe(). MFC after: 1 week Submitted by: Mark Bloch <markb@mellanox.com> Differential Revision: https://reviews.freebsd.org/D4598 Sponsored by: Mellanox Technologies
* Add full support for Receive Side Scaling, RSS, to the mlx5enhselasky2015-12-071-6/+64
| | | | | | | | | | | driver. This includes binding all interrupt and worker threads according to the RSS configuration, setting up correct Toeplitz hashing keys as given by RSS and setting the correct mbuf hashtype for all received traffic. MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4410
* Add support for setting the TX moderation mode via a sysctl entry. TXhselasky2015-12-071-1/+13
| | | | | | | | | completion events can be moderated in the same way like RX completion events. Expose this functionality by a sysctl variable. MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4409
* The firmware no longer supports setting a port MTU of zero bytes.hselasky2015-12-071-20/+3
| | | | | | | | | Set the port MTU and then query it and report if any problems instead. MFC after: 1 week Submitted by: Shahar Klein <shahark@mellanox.com> Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4408
* Style changes, mostly automated.hselasky2015-11-191-73/+65
| | | | | | | Differential Revision: https://reviews.freebsd.org/D4179 Submitted by: Daria Genzel <dariaz@mellanox.com> Sponsored by: Mellanox Technologies MFC after: 3 days
* Accumulate out of RX buffers into a 64-bit value and subtract out ofhselasky2015-11-191-8/+20
| | | | | | | | | RX buffers from number of received packets. Differential Revision: https://reviews.freebsd.org/D4178 Submitted by: Drew Gallatin <gallatin@freebsd.org> Sponsored by: Mellanox Technologies MFC after: 3 days
* Add mlx5 and mlx5en driver(s) for ConnectX-4 and ConnectX-4LX cardshselasky2015-11-101-0/+2902
from Mellanox Technologies. The current driver supports ethernet speeds up to and including 100 GBit/s. Infiniband support will be done later. The code added is not compiled by default, which will be done by a separate commit. Sponsored by: Mellanox Technologies MFC after: 2 weeks
OpenPOWER on IntegriCloud