summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 292Thomas Gleixner2019-06-051-9/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license gpl version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 66 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.606369721@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* bna: fix list corruptionIvan Vecera2016-03-011-1/+1
| | | | | | | | | | | Use list_move_tail() to move MAC address entry from list of pending to list of active entries. Simple list_add_tail() leaves the entry also in the first list, this leads to list corruption. Cc: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Acked-by: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: check for dma mapping errorsIvan Vecera2015-09-211-0/+2
| | | | | | | | | | Check for DMA mapping errors, recover from them and register them in ethtool stats like other errors. Cc: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Acked-by: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove superfluous parenthesesIvan Vecera2015-06-211-2/+2
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: make pointers to read-only inputs constIvan Vecera2015-06-211-7/+7
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: use list_for_each_entry where appropriateIvan Vecera2015-06-121-98/+19Star
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: get rid of private macros for manipulation with listsIvan Vecera2015-06-121-208/+102Star
| | | | | | | | Remove macros for manipulation with struct list_head and replace them with standard ones. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove TX_E_PRIO_CHANGE event and BNA_TX_F_PRIO_CHANGED flagIvan Vecera2015-06-121-18/+4Star
| | | | | | | | | TX_E_PRIO_CHANGE event is never sent for bna_tx so it doesn't need to be handled. After this change bna_tx->flags cannot contain BNA_TX_F_PRIO_CHANGED flag and it can be also eliminated. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove paused from bna_rx_config and flags from bna_rxfIvan Vecera2015-06-121-35/+1Star
| | | | | | | | | | | The bna_rx_config struct member paused can be removed as it is never written and as it cannot have non-zero value the bna_rxf struct member flags also cannot have BNA_RXF_F_PAUSED value and is always zero. So the flags member can be removed as well as bna_rxf_flags enum and the code-paths that needs to have non-zero bna_rxf->flags. This clean-up makes bna_rxf_sm_paused state unsed and can be also removed. Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove RXF_E_PAUSE and RXF_E_RESUME eventsIvan Vecera2015-06-121-75/+0Star
| | | | | | | | | RXF_E_PAUSE & RXF_E_RESUME events are never sent for bna_rxf object so they needn't to be handled. The bna_rxf's state bna_rxf_sm_fltr_clr_wait and function bna_rxf_fltr_clear are unused after this so remove them also. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove prio_change_cbfn oper_state_cbfn from struct bna_txIvan Vecera2015-06-121-13/+0Star
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove oper_state_cbfn from struct bna_rxfIvan Vecera2015-06-121-6/+0Star
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: remove unused cbfn parameterIvan Vecera2015-06-121-26/+9Star
| | | | | | | | | | | | | | | | | removed: bna_rx_ucast_add bna_rx_ucast_del simplified: bna_enet_pause_config bna_rx_mcast_delall bna_rx_mcast_listset bna_rx_mode_set bna_rx_ucast_listset bna_rx_ucast_set Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: use BIT(x) instead of (1 << x)Ivan Vecera2015-06-121-11/+11
| | | | | Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: get rid of duplicate and unused macrosIvan Vecera2015-06-121-7/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replaced macros: BNA_MAC_IS_EQUAL -> ether_addr_equal BNA_POWER_OF_2 -> is_power_of_2 BNA_TO_POWER_OF_2_HIGH -> roundup_pow_of_two removed unused macros: bfa_fsm_get_state bfa_ioc_clr_stats bfa_ioc_fetch_stats bfa_ioc_get_alt_ioc_fwstate bfa_ioc_isr_mode_set bfa_ioc_maxfrsize bfa_ioc_mbox_cmd_pending bfa_ioc_ownership_reset bfa_ioc_rx_bbcredit bfa_ioc_state_disabled bfa_sm_cmp_state bfa_sm_get_state bfa_sm_send_event bfa_sm_set_state bfa_sm_state_decl BFA_STRING_32 BFI_ADAPTER_IS_{PROTO,TTV,UNSUPP) BFI_IOC_ENDIAN_SIG BNA_{C,RX,TX}Q_PAGE_INDEX_MAX BNA_{C,RX,TX}Q_PAGE_INDEX_MAX_SHIFT BNA_{C,RX,TX}Q_QPGE_PTR_GET BNA_IOC_TIMER_FREQ BNA_MESSAGE_SIZE BNA_QE_INDX_2_PTR BNA_QE_INDX_RANGE BNA_Q_GET_{C,P}I BNA_Q_{C,P}I_ADD BNA_Q_FREE_COUNT BNA_Q_IN_USE_COUNT BNA_TO_POWER_OF_2 containing_rec Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: get rid of mac_tIvan Vecera2015-06-121-2/+2
| | | | | | | The patch converts mac_t type to widely used 'u8 [ETH_ALEN]'. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: use ether_addr_copy instead of memcpyIvan Vecera2015-06-121-6/+6
| | | | | | | | | | | | | | | Parameters of all ether_addr_copy instances were checked for proper alignment. Alignment of bnad_bcast_addr is forced to 2 as the implicit alignment is 1. I have also renamed address parameter of bnad_set_mac_address() to addr. The name mac_addr was a little bit confusing as the real parameter is struct sockaddr *. v2: added __aligned directive to bnad_bcast_addr, renamed parameter of bnad_set_mac_address() (thx joe@perches.com) Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: QLogic BR-series Adapters Driver RebrandingRasesh Mody2015-02-221-3/+4
| | | | | | | Re-brand the BNA driver to QLogic. Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2014-10-081-1/+1
|\
| * bna: allow transmit tagged framesIvan Vecera2014-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Tx VLAN offloading is disabled frames with size ~ MTU are not transmitted as the driver does not account 4 bytes of VLAN header added by stack. It should use VLAN_ETH_HLEN instead of ETH_HLEN. The second problem is with newer BNA chips (BNA 1860). These chips filter out any VLAN tagged frames in Tx path. This is a problem when Tx VLAN offloading is disabled and frames are tagged by stack. Older chips like 1010/1020 are not affected as they probably don't do such filtering. Cc: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bna: use container_of to resolve bufdesc_ex from bufdescFabian Frederick2014-09-151-2/+2
|/ | | | | | | | | Use container_of instead of casting first structure member. Compiled but untested. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Enable Multi Buffer RXRasesh Mody2013-12-181-20/+46
| | | | | | | | | | | | | | | | | | | | | | The CT2 HW supports multi-buffer Rx. This patch provides the necessary changes for bnad to use multi-buffer Rx feature. For BNAD, multi-buffer Rx is by default enabled when MTU is > 4096. For >4096 MTU, q0 data/large buffers are of 2048 size. As the resource requirements of multi-buffer Rx are different new Rx needs to be created to use this feature. ASIC posts multiple completions if frame exceeds buffer size. The last completion is marked with EOP flag. - Separate HQ and DQ enums for resource allocations and configurations. - rx_config and rxq structure changes to pass the correct info from bnad. - DQ depth need not be same as HQ depth. So CQ depth is adjusted accordingly. - Rx CFG frame size is taken from configured MTU. - Rx q0 buffer size is configured from bnad s rx_config when multi-buffer is enabled. - Poll for entire frame completion. - Once EOP completion is received gather the number of vectors used by the frame to submit it to the stack. - Changed MTU to frame size wherever necessary. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: RX Filter EnhancementsRasesh Mody2013-12-181-1/+137
| | | | | | | | | | | | | | | Change Details: - Added bna_rx_ucast_listset() for synchronous ucast listadd operation. - Clear mac->handle before adding it to free_q. - bnad_set_rx_mode() rewritten. bnad_set_rx_mode() adds the MACs in uc_list to UCAM. If it exceeds the max supported, DEFAULT mode is turned on. If MCAM limit is exceeded, ALLMULTI mode is turned on. - Clear CF flags, check for the new mode and reprogram the Rx approach. - Added bnad_set_rx_ucast_fltr() and bnad_set_rx_mcast_fltr(). - Check for IFF_PROMISC to set the correct mode. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Fix Filter Add DelRasesh Mody2013-12-181-29/+38
| | | | | | | | | | | | | | | | Change Details: - bna_rx_mcast_listset() API first looks at free_q only and not at other pending Qs rendering it non-deterministic of giving an upper limit. Modify bna_rx_mcast_listset() implementation to not use only half of the limit. - Allocate and initialize queue for deleting - Segregate the adding and deleting process by using separate queues. - The filter framework in bna does not let adding addresses to its max capacity due to asynchronous operations involved. Provide a synchronous option to set a given list. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Staticize local functionsJingoo Han2013-08-051-5/+5
| | | | | | | | | | | | | | | | | | | | bna_rx_sm_stop_wait_entry(), bna_rx_sm_rxf_stop_wait_entry(), bna_rx_sm_started_entry(), bna_rx_sm_cleanup_wait_entry(), and bna_rx_sm_cleanup_wait() are used only in this file. Fix the following sparse warnings: drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1423:1: warning: symbol 'bna_rx_sm_stop_wait_entry' was not declared. Should it be static? drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1476:1: warning: symbol 'bna_rx_sm_rxf_stop_wait_entry' was not declared. Should it be static? drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1532:1: warning: symbol 'bna_rx_sm_started_entry' was not declared. Should it be static? drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1597:1: warning: symbol 'bna_rx_sm_cleanup_wait_entry' was not declared. Should it be static? drivers/net/ethernet/brocade/bna/bna_tx_rx.c:1602:1: warning: symbol 'bna_rx_sm_cleanup_wait' was not declared. Should it be static? Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Fix Ucast Failure HandlingRasesh Mody2013-05-201-0/+15
| | | | | | | | | | | | | Failure of the UCAST set for base mac address fails when user configures a duplicate mac address that matches that of another vNIC on the same port. The bna does not handle the ucast failure and keeps this address in cache. On disable of the vNIC, bna tries to delete the failed base mac address and the fw asserts. On failure of ucast address, mark ucast address set to false. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Add RX StateRasesh Mody2012-12-121-1/+26
| | | | | | | | | | | | | | | | | | Change Details: - BNA state machine for Rx in start_wait state moves it to stop_wait on receipt of RX_E_STOP. In Rx stop_wait state, on receipt of RX_E_STARTED event does enet stop RX_E_STOPPED event does rx_cleanup_cbfn rx_cleanup_cbfn in this case is called without post_cbfn. post_cbfn happens only after RX_E_STARTED event is received in start_wait. Without doing post_cbfn, NAPI remains disabled and in cleanup we try to disable again causing endless wait. ifconfig process and other workers can thus get stuck. - Introducing start_stop_wait state for Rx. This state handles the case of if post_cbfn is not done simply do stop without the cleanup. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: TX Intr Coalescing FixRasesh Mody2012-12-121-1/+1
| | | | | | | | | | Change Details: For Tx IB, IPM was enabled with inter_pkt_timeo of 0. This caused the Tx IB not to generate interrupt till inter_pkt_count of packets have been received. Correct definition for BFI_TX_INTERPKT_TIMEO & BFI_TX_INTERPKT_COUNT Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Tx and Rx OptimizationsRasesh Mody2012-12-121-47/+62
| | | | | | | | | | | | | | | | Change details: - Have contiguous queue pages for TxQ, RxQ and CQ. Data structure and QPT changes related to contiguous queue pages - Optimized Tx and Rx unmap structures. Tx and Rx fast path changes due to unmap data structure changes - Re-factored Tx and Rx fastpath routines as per the new queue data structures - Implemented bnad_txq_wi_prepare() to program the opcode, flags, frame_len and num_vectors in the work item - Reduced Max TxQ and RxQ depth to 2048 while default value for Tx/Rx queue depth is unaltered (512) Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markersBen Hutchings2012-07-111-12/+5Star
| | | | | | | | | Convert doxygen (or similar) formatted comments to kernel-doc or unformatted comment. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Add Callback to Fix RXQ StopRasesh Mody2011-09-301-0/+11
| | | | | | | | | | | | | | | | | Change details: - Add a callback in the BNA, which is called before sending FW command to stop RxQs. After this callback is called, driver should not post anymore Rx buffers to the RxQ. This addresses a small window where driver posts Rx buffers while FW is stopping/has stopped the RxQ. - Registering callback function, rx_stall_cbfn, during bna_rx_create. Invoking callback function, rx_stall_cbfn, before sending rx_cfg_clr command to FW - Bnad_cb_rx_stall implementation - set a flag in the Rxq to mark buffer posting disabled state. While posting buffers check for the above flag. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: make function tables contstephen hemminger2011-09-171-2/+2
| | | | | | | | | | To prevent malicious usage, all tables of pointers must be const. Compile tested only. Gleaned for PAX. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bna: Tx and Rx RedesignRasesh Mody2011-08-111-0/+3787
Change details: - This patch contains the changes as a result of redesigning of Tx, Rx data path setup. In the old design, setting up Txqs, Rxqs were done in the driver. With the new design, most of the hardware setup steps for the Txq, Rxqs are moved to FW. Host driver issues commands to FW through the message queue to setup/teardown tx, rx data path. FW performs necessary steps and responds back to the driver with a status. - As a result of this redesign, the state machine implementation for Tx, Rx objects have changed significantly. Instead of doing the raw register access, these state machines mostly send a command to FW and wait for response and take the next action. In addition to tx, rx datapath setup, this patch also deals with rx filter configuration - such as unicast address, multicast address, vlan filter, promiscuous mode etc. Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>