aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
Commit message (Collapse)AuthorAgeFilesLines
* be2net: fix a race in be_xmit()Eric Dumazet2012-07-161-2/+3
| | | | | | | | | | | | [ Upstream commit cd8f76c0a0c6fce0b2cf23c9bd0123f91453f46d ] As soon as hardware is notified of a transmit, we no longer can assume skb can be dereferenced, as TX completion might have freed the packet. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Add appropriate <linux/prefetch.h> include for prefetch usersPaul Gortmaker2011-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After discovering that wide use of prefetch on modern CPUs could be a net loss instead of a win, net drivers which were relying on the implicit inclusion of prefetch.h via the list headers showed up in the resulting cleanup fallout. Give them an explicit include via the following $0.02 script. ========================================= #!/bin/bash MANUAL="" for i in `git grep -l 'prefetch(.*)' .` ; do grep -q '<linux/prefetch.h>' $i if [ $? = 0 ] ; then continue fi ( echo '?^#include <linux/?a' echo '#include <linux/prefetch.h>' echo . echo w echo q ) | ed -s $i > /dev/null 2>&1 if [ $? != 0 ]; then echo $i needs manual fixup MANUAL="$i $MANUAL" fi done echo ------------------- 8\<---------------------- echo vi $MANUAL ========================================= Signed-off-by: Paul <paul.gortmaker@windriver.com> [ Fixed up some incorrect #include placements, and added some non-network drivers and the fib_trie.c case - Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* be2net: Kill set but unused variable 'req' in lancer_fw_download()David S. Miller2011-05-191-2/+0
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Enable SR-IOV for LancerMammatha Edhala2011-05-181-8/+9
| | | | | | | | Enable SR-IOV for Lancer Signed-off-by: Mammatha Edhala <mammatha.edhala@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: FW download for LancerShripad Nunjundarao2011-05-161-19/+110
| | | | | | | | | Added implementation of FW download feature for Lancer. Signed-off-by: Shripad Nunjundarao <shripad.nunjundarao@emulex.com> Signed-off-by: Sevin Xavier <selvin.xavier@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Stats for LancerSelvin Xavier2011-05-161-11/+80
| | | | | | | | Added Lancer stats implementation. Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Support for version 1 of stats for BE3Ajit Khaparde2011-05-161-29/+153
| | | | | | | | | | Added support to get version 1 of the stats for BE3. Use old stats command for BE2. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Fix to prevent flooding of TX queuePadmanabh Ratnakar2011-05-111-8/+12
| | | | | | | | | | | | Start/stop TX queue is controlled by TX queue "used" counter. It is incremented while WRBs are posted to TX queue and decremented when TX completions are received. This counter was getting decremented before HW is informed about processing of TX completions. As used counter is decremented, transmit function posts new WRBs and creates completion queue full scenario in HW. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Use NTWK_RX_FILTER command for promiscous modePadmanabh Ratnakar2011-05-111-2/+2
| | | | | | | | Use OPCODE_COMMON_NTWK_RX_FILTER command for promiscous mode as OPCODE_ETH_PROMISCUOUS command is getting deprecated. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Handle error completion in LancerPadmanabh Ratnakar2011-05-111-1/+4
| | | | | | | | | | In Lancer if a frame is DMAed partially due to lack of RX buffers, an error completion is sent with packet size as zero and num_recvd indicating number of used buffers. These buffers need to be freed and packet dropped. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2011-05-111-11/+14
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-3.6 Conflicts: drivers/net/benet/be_main.c
| * be2net: Fixed bugs related to PVID.Somnath Kotur2011-05-091-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug to make sure 'pvid' retrieval will work on big endian hosts. Fixed incorrect comparison between the Rx Completion's 16-bit VLAN TCI and the PVID. Now comparing only the relevant 12 bits corresponding to the VID. Renamed 'vid' field under Rx Completion to 'vlan_tag' to reflect accurate description. Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2011-04-261-0/+1
|\ \ | |/ | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Resolved logic conflicts causing a build failure due to drivers/net/r8169.c changes using a patch from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
| * be2net: increment work_counter in be_workerIvan Vecera2011-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The commit 609ff3b ("be2net: add code to display temperature of ASIC") adds support to display temperature of ASIC but there is missing increment of work_counter in be_worker. Because of this 1) the function be_cmd_get_die_temperature is called every 1 second instead of every 32 seconds 2) be_cmd_get_die_temperature is called, although it is not supported. This patch fixes this bug. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: add code to display default value of tx rate for VFsAjit Khaparde2011-04-191-0/+13
| | | | | | | | | | | | | | | | This change will allow the default value of tx rate to be displayed when ip link show is called on a PF interface. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: pass domain id to be_cmd_link_status_queryAjit Khaparde2011-04-191-1/+1
| | | | | | | | | | Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2011-04-111-1/+1
|\ \ | |/ | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/smsc911x.c
| * Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds2011-04-111-8/+11
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits) net: Add support for SMSC LAN9530, LAN9730 and LAN89530 mlx4_en: Restoring RX buffer pointer in case of failure mlx4: Sensing link type at device initialization ipv4: Fix "Set rt->rt_iif more sanely on output routes." MAINTAINERS: add entry for Xen network backend be2net: Fix suspend/resume operation be2net: Rename some struct members for clarity pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev dsa/mv88e6131: add support for mv88e6085 switch ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2) be2net: Fix a potential crash during shutdown. bna: Fix for handling firmware heartbeat failure can: mcp251x: Allow pass IRQ flags through platform data. smsc911x: fix mac_lock acquision before calling smsc911x_mac_read iwlwifi: accept EEPROM version 0x423 for iwl6000 rt2x00: fix cancelling uninitialized work rtlwifi: Fix some warnings/bugs p54usb: IDs for two new devices wl12xx: fix potential buffer overflow in testmode nvs push zd1211rw: reset rx idle timer from tasklet ...
| * | Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | | | | | | | | | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* | | net: benet: convert to hw_features - fixupMichał Mirosław2011-04-101-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix up after merge with NETIF_F_RXHASH implementation. This allows to toggle NETIF_F_RXHASH and NETIF_F_HW_VLAN_TX. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | net: benet: convert to hw_featuresMichał Mirosław2011-04-071-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple conversion. This also fixes a bug in TX checksum toggling --- driver was changing NETIF_F_HW_CSUM instead of NETIF_F_IP_CSUM+NETIF_F_IPV6_CSUM. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | be2net: call FLR after setup wol in be_shutdownAjit Khaparde2011-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Calling setup_wol after a reset is inconsequential. The WOL setting should be programmed before FLR. And yes, FLR does not erase wol information. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | be2net: dynamically allocate adapter->vf_cfgAjit Khaparde2011-04-071-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | Instead of a fixed sized array for vf_cfg, allocate the size dynamically depending on number of VFs the device supports. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | be2net: fix to get max VFs supported from adapterAjit Khaparde2011-04-071-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The user supplied num_vfs value need not be compared against a static BE_MAX_VF, but can be checked against the actual VFs that the device can support. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | be2net: add rxhash supportAjit Khaparde2011-04-071-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add rxhash support, Based on initial work by Eric Dumazet. Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | Merge branch 'master' of ↵David S. Miller2011-04-071-7/+10
|\ \ \ | | |/ | |/| | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/benet/be_main.c
| * | be2net: Fix suspend/resume operationPadmanabh Ratnakar2011-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | eq_next_idx is not getting reset to zero during suspend. This causes resume to fail. Added the fix. Signed-off-by: Sarveswara Rao Mygapula <sarveswararao.mygapula@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | be2net: Rename some struct members for clarityPadmanabh Ratnakar2011-04-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed msix_vec_idx to eq_idx in be_eq_obj struct. Renamed msix_vec_next_idx to eq_next_idx in be_adapter structure. These members are used in INTX mode also. Signed-off-by: Sarveswara Rao Mygapula <sarveswararao.mygapula@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | be2net: Fix a potential crash during shutdown.Ajit Khaparde2011-04-061-3/+5
| |/ | | | | | | | | | | | | | | | | adapter could remain uninitialized if probe fails for some reason. A null pointer access could cause a crash if be_shutdown is called after that. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: remove one useless lineSathya Perla2011-03-301-1/+0
| | | | | | | | | | Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: cancel be_worker in be_shutdown() even when i/f is downSathya Perla2011-03-301-2/+1
| | | | | | | | | | | | | | | | As the be_worker() workqueue is scheduled in be_probe() it must be canceled unconditionally in be_shutdown(). Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: remove redundant code in be_worker()Sathya Perla2011-03-301-5/+3
| | | | | | | | | | Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: parse vid and vtm fields of rx-compl only if vlanf bit is setSathya Perla2011-03-301-11/+23
| | | | | | | | | | Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | be2net: refactor code that decides adapter->num_rx_queuesSathya Perla2011-03-301-32/+34
|/ | | | | | | | | The code has been refactored to not set num_rx_qs inside be_enable_msix(). num_rx_qs is now set at the time of queue creation based on the number of available msix vectors. Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Copyright notice change. Update to Emulex instead of ServerEnginesAjit Khaparde2011-03-161-5/+5
| | | | | Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Fix UDP packet detected status in RX complPadmanabh Ratnakar2011-03-151-0/+2
| | | | | | | | | Status of UDP packet detection not getting populated in RX completion structure. This is required in csum_passed() routine. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: changes for BE3 native mode supportSathya Perla2011-03-141-146/+133
| | | | | | | | | So far be2net has been using BE3 in legacy mode. It now checks for native mode capability and if available it sets it. In native mode, the RX_COMPL structure is different from that in legacy mode. Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Add multicast filter capability for LancerPadmanabh Ratnakar2011-03-071-1/+3
| | | | | | | | | | Lancer requires multicast capability flag set during IFACE_CREATE for adding multicast filters. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Disarm CQ and EQ to disable interrupt in LancerPadmanabh Ratnakar2011-03-071-5/+12
| | | | | | | | | | For Lancer disable interrupts in close by disarming CQs and EQs. Change the order of calls in be_close to achieve the correct result. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Remove TX Queue stop in closePadmanabh Ratnakar2011-03-071-1/+0
| | | | | | | | | Remove TX Queue stop in close Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Add error recovery during load for LancerPadmanabh Ratnakar2011-03-071-0/+56
| | | | | | | | | Add error recovery during load for Lancer Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Checksum field valid only for TCP/UDPPadmanabh Ratnakar2011-03-071-3/+6
| | | | | | | | | L4 checksum field is valid only for TCP/UDP packets in Lancer Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Remove ERR compl workaround for LancerPadmanabh Ratnakar2011-03-071-23/+8
| | | | | | | | | | Workaround added for Lancer in handling RX ERR completion received when no RX buffers are posted is not needed. Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* benet: use GFP_KERNEL allocations when possibleEric Dumazet2011-03-031-9/+9
| | | | | | | | | Extend be_alloc_pages() with a gfp parameter, so that we use GFP_KERNEL allocations instead of GFP_ATOMIC when not running in softirq context. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: use hba_port_num instead of port_numAjit Khaparde2011-02-221-0/+4
| | | | | | | | Use hba_port_num for phy loopback and ethtool phy identification. From: Suresh R <suresh.reddy@emulex.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: fix to ignore transparent vlan ids wrongly indicated by NICAjit Khaparde2011-02-221-0/+6
| | | | | | | | | With transparent VLAN tagging, the ASIC wrongly indicates packets with VLAN ID. Strip them off in the driver. The VLAN Tag to be stripped will be given to the host as an async message. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: variable name changeAjit Khaparde2011-02-221-1/+1
| | | | | | | change occurances of stats_ioctl_sent to stats_cmd_sent Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: detect a UE even when a interface is down.Ajit Khaparde2011-02-111-0/+4
| | | | | Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: gracefully handle situations when UE is detectedAjit Khaparde2011-02-111-0/+1
| | | | | | | Avoid accessing the hardware when UE is detected. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: fix be_suspend/resume/shutdownAjit Khaparde2011-02-111-0/+8
| | | | | | | | | | | > call pci msix disable in be_suspend > call pci msix enable in be_resume > stop worker thread in be_suspend > start worker thread in be_resume > stop worker thread in be_shutdown Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>