aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bxe
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-037-31/+31
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* 1. Removed -Wno-shift-negative-value from MakefileDavid C Somayajulu2016-04-251-2/+2
| | | | | | | | | 2. Fixed warning its absence caused in bxe_elink.c MFC after:5 days Notes: svn path=/head/; revision=298591
* Remove Unused/Dead CodeDavid C Somayajulu2016-04-231-141/+0
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=298496
* 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocatedDavid C Somayajulu2016-04-193-67/+169
| | | | | | | | | | | | | and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump. Submitted by:vaishali.kulkarni@qlogic.com Notes: svn path=/head/; revision=298294
* reversed commits r297916 r297909 r297898 due to i386 build failures.David C Somayajulu2016-04-133-169/+67
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=297922
* Fix compilation error on i386David C Somayajulu2016-04-131-4/+4
| | | | Notes: svn path=/head/; revision=297916
* Fix build failure on i386. Need to typecast a bunch of variables to (uintmax_t)David C Somayajulu2016-04-131-11/+14
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=297909
* 1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as neededDavid C Somayajulu2016-04-133-67/+166
| | | | | | | | | | | | | | | basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump. Submitted by:vaishali.kulkarni@qlogic.com Approved by:davidcs@freebsd.org MFC after:5 days Notes: svn path=/head/; revision=297898
* Add support for Flash UpdateDavid C Somayajulu2016-04-123-5/+400
| | | | | | | | | Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Approved by:davidcs@freebsd.org MFC after:5 days Notes: svn path=/head/; revision=297884
* 1. Process tx completions in bxe_periodic_callout_func() and restartDavid C Somayajulu2016-04-122-23/+63
| | | | | | | | | | | | | transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Approved by:davidcs@freebsd.org MFC after:5 days Notes: svn path=/head/; revision=297873
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Modifications to achieve a common source base from FreeBSD7.x thru 10.xDavid C Somayajulu2016-03-212-24/+79
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=297155
* Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.Justin Hibbits2016-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544 Notes: svn path=/head/; revision=297000
* Fix code so that buf_ring allocation for Tx Queues and their mutexesDavid C Somayajulu2016-03-091-28/+119
| | | | | | | | | is done during during bxe_attach() and freed during bxe_detach() MFC after: 5 days Notes: svn path=/head/; revision=296579
* Remove taskqueue_enqueue_fast().John Baldwin2016-03-011-4/+4
| | | | | | | | | | | | | taskqueue_enqueue() was changed to support both fast and non-fast taskqueues 10 years ago in r154167. It has been a compat shim ever since. It's time for the compat shim to go. Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: sephe Differential Revision: https://reviews.freebsd.org/D5131 Notes: svn path=/head/; revision=296272
* Upgrade the firmware carried in driver and loaded during hardwareDavid C Somayajulu2016-02-2519-90252/+103855
| | | | | | | initialization (a.k.a STORM firmware) to version 7.13.1 (latest version) Notes: svn path=/head/; revision=296071
* Remove dead code. Code Cleanup. Improve clarity in debug messagesDavid C Somayajulu2016-02-194-1064/+110
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=295830
* Modified the use of bxe_grc_dump() function so that it can be invoked ↵David C Somayajulu2016-02-192-42/+56
| | | | | | | | | | | directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved. The sysctl trigger_grcdump can be used to manually trigger a fwdump. MFC after:5 days Notes: svn path=/head/; revision=295823
* Add support for firmware dump (a.k.a grcdump)David C Somayajulu2015-12-235-2/+2782
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=292639
* Check for packet_length is greater than 60 bytes as well as packet_length isDavid C Somayajulu2015-12-233-4/+23
| | | | | | | | | | | | | | greater than len_on_bd, before invoking the routine to handle jumbo over SGL (bxe_service_rxsgl()). Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts) Fix formatting in bxe_sysctl_state() MFC after:5 days Notes: svn path=/head/; revision=292638
* Add support for reading device temperatureDavid C Somayajulu2015-10-121-1/+4
| | | | | | | MFC after:5 days Notes: svn path=/head/; revision=289199
* Avoid left-shifting negative signed values in bxe(4).Dimitry Andric2015-08-131-3/+3
| | | | | | | | Reviewed by: davidcs MFC after: 3 days Notes: svn path=/head/; revision=286733
* - Avoid lock contention in the if_transmit callback by using trylock andDavid C Somayajulu2015-07-282-22/+15
| | | | | | | | | | | | | | | | | enqueueing the frames when it fails. This way there is some latency removed from the transmitting path. - If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just enqueue the desired frames and return successful transmit. This way we avoid to return errors on transmit side and resulting in possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set everytime we get the threshold ring hit, so this can be happening quite often. Submitted by: Attilio.Rao@isilon.com MFC after:5 days Notes: svn path=/head/; revision=285973
* tx_mtx should be grabbed before calling buf_ring_dequeue_sc()David C Somayajulu2015-06-231-3/+7
| | | | | | | | Submitted by:Attilio.Rao@isilon.com MFC after:5 days Notes: svn path=/head/; revision=284739
* Simplified implementation of bxe_set_mc_list()David C Somayajulu2015-06-201-54/+25
| | | | | | | | | | removed bxe_free_mcast_macs_list() and bxe_init_mcast_macs_list() fixed bug where copy of multicast list mta was deleted prior to passing the list to firmware MFC after:5 days Notes: svn path=/head/; revision=284651
* In bxe_init_mcast_macs_list(): mc_mac->mac needs to point to the multicast ↵David C Somayajulu2015-06-162-2/+5
| | | | | | | | | | | | mac address In bxe_set_mc_list(): added missing BXE_MCAST_UNLOCK() In __ecore_vlan_mac_h_exec_pending(): need to check for ECORE_PENDING Submitted by:gary.zambrano@qlogic.com Notes: svn path=/head/; revision=284470
* PHY LOCK acquires the hardware lock via bxe_acquire_phy_lock() and releases ↵David C Somayajulu2015-06-133-78/+47
| | | | | | | | | | | | | | it via bxe_release_phy_lock(). It was simply acquiring a mutex earlier which can cause the PHY to use bogus values. Fixes intermittent link failures. bxe_ioctl() completes all functions within its context as opposed to a taskqueue earlier. bxe_handle_rx_mode_tq() no longer required. bxe_set_rx_mode() handles the functionality within its context Submitted by:gary.zambrano@qlogic.com MFC after:5 days Notes: svn path=/head/; revision=284335
* Add stat counters for Jumbo Frames using SGE ring.David C Somayajulu2015-05-223-44/+49
| | | | | | | | | | | Also remove the checks for IFCAP_LRO in bxe_alloc_fp_buffers() and bxe_pf_rx_q_prep() since both TPA and Jumbo can use SGE ring. Submitted by:gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org MFC after:5 days Notes: svn path=/head/; revision=283274
* Limit the size of the posted receive buffers in Rx Rings to MJUMPAGESIZE. ↵David C Somayajulu2015-05-211-27/+79
| | | | | | | | | | | | | Previously for jumbo MTUs, the rx ring buffers were MTU + any required pad. Now when this size greater than MJUMPAGESIZE, the packet is spanned across multiple buffers and the mbufs are stiched together. Submitted by:gary.zambrano@qlogic.com Approved by:davidcs@freebsd.org Notes: svn path=/head/; revision=283269
* Move zlib.c from net to libkern.Craig Rodrigues2015-04-221-1/+1
| | | | | | | | | | | | | | | It is not network-specific code and would be better as part of libkern instead. Move zlib.h and zutil.h from net/ to sys/ Update includes to use sys/zlib.h and sys/zutil.h instead of net/ Submitted by: Steve Kiernan stevek@juniper.net Obtained from: Juniper Networks, Inc. GitHub Pull Request: https://github.com/freebsd/freebsd/pull/28 Relnotes: yes Notes: svn path=/head/; revision=281855
* When an mbuf allocation fails in the receive path, the mbuf containing the ↵David C Somayajulu2015-04-021-1/+8
| | | | | | | | | | | | received packet is not sent to the host net work stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread. MFC after: 5 days Notes: svn path=/head/; revision=281006
* Start process of removing the use of the deprecated "M_FLOWID" flagHans Petter Selasky2014-12-011-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=275358
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
* - Use if_inc_counter() to increment various counters.Gleb Smirnoff2014-09-183-56/+50
| | | | | | | | | | | | - Do not ever set a counter to a value. For those counters that we don't increment, but return directly from hardware create cases in if_get_counter() method. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271782
* For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag beforeDavid C Somayajulu2014-09-171-3/+12
| | | | | | | | | printing error message. MFC after:5 days Notes: svn path=/head/; revision=271728
* It is actually possible to have if_t a typedef to non-void type,Gleb Smirnoff2014-08-311-16/+16
| | | | | | | | | | | | | | and keep both converted to drvapi and non-converted drivers compilable. o Make if_t typedef to struct ifnet *. o Remove shim functions. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=270876
* Fix build by using the driver API (driver converted in r266979 which shouldXin LI2014-07-181-1/+1
| | | | | | | | | | be upstreamed). X-MFC with: r268854 MFC after: 5 days Notes: svn path=/head/; revision=268856
* Initiate error recovery stats fail to update after 3 retries.David C Somayajulu2014-07-185-1/+35
| | | | | | | | | | Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. MFC after:5 days Notes: svn path=/head/; revision=268854
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-12/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+12
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Convert bxe(4) to use the driver API.Marcel Moolenaar2014-06-024-197/+202
| | | | | | | | Submitted by: Sreekanth Rupavatharam <rupavath@juniper.net> Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=266979
* Modify Copyright information and other strings to reflect Qlogic ↵David C Somayajulu2014-05-081-19/+19
| | | | | | | | | | | | Corporation's purchase of Broadcom's NetXtreme business. Added clean option to Makefile Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation MFC after:5 days Notes: svn path=/head/; revision=265703
* Modify Copyright information to reflect Qlogic Corporation's purchaseDavid C Somayajulu2014-05-0622-176/+22
| | | | | | | | | | of Broadcom's NetXtreme business Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation MFC after:5 days Notes: svn path=/head/; revision=265411
* Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 GbitGleb Smirnoff2014-03-131-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=263102
* Fixed MSI interrupt allocation and handling.Eric Davis2014-03-111-78/+36
| | | | | | | | | | Fixed a DMA mapping leak that occurs when defragmenting packet chains. Approved by: davidch (mentor) MFC after: 1 week Notes: svn path=/head/; revision=262999
* Another round of removing historical mbuf(9) allocator flags.Gleb Smirnoff2014-01-161-6/+6
| | | | | | | | | They are breeding! New ones arouse since last round. Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=260718
* defragment mbuf chains longer than hw segment limit before droppingEric Davis2014-01-072-4/+32
| | | | | | | Approved by: davidch Notes: svn path=/head/; revision=260415
* For TSO, when the first mbuf contains both the packet header and data, theEric Davis2013-12-302-18/+17
| | | | | | | | | | | header is split out into its own BD for processing by the firmware. When this split occurred the data length in the BD was not being set correctly resulting in packet corruption. Approved by: davidcd (mentor) Notes: svn path=/head/; revision=260113
* In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(),Dimitry Andric2013-12-261-7/+0
| | | | | | | | | | which has never been used. Reviewed by: edavis MFC after: 3 days Notes: svn path=/head/; revision=259928