aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-08-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-6/+6
Merge net into net-next to setup some infrastructure Eric Dumazet needs for usbnet changes. Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-01net: rename CONFIG_NET_LL_RX_POLL to CONFIG_NET_RX_BUSY_POLLCong Wang1-6/+6
Eliezer renames several *ll_poll to *busy_poll, but forgets CONFIG_NET_LL_RX_POLL, so in case of confusion, rename it too. Cc: Eliezer Tamir <eliezer.tamir@linux.intel.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-31ixgbe: fix lockdep annotation issue for ptp's work itemJacob Keller1-3/+3
This patch fixes a lockdep issue created due to ixgbe_ptp_stop always running cancel_work_sync even if the work item had not been created properly with INIT_WORK. This is caused because ixgbe_ptp_stop did not check to actually ensure PTP was running first. The new implementation introduces a state in the &adapter->state field which is used to indicate that PTP is running. (This replaces the IXGBE_FLAG2_PTP_ENABLED field). This state will use the atomic set_bit, test_bit, and test_and_clear_bit functions. ixgbe_ptp_stop will check to ensure that PTP was enabled, (and if not, it will not attempt to do any cleanup work from ixgbe_ptp_init). This resolves the lockdep annotation warning found by Stephen Hemminger Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-30ixgbe: fix SFF data dumps of SFP+ modulesEmil Tantilov1-1/+0
This patch fixes several issues with the previous implementation of the SFF data dump of SFP+ modules: - removed the __IXGBE_READ_I2C flag - I2C access locking is handled in the HW specific routines - fixed the read loop to read data from ee->offset to ee->len - the reads fail if __IXGBE_IN_SFP_INIT is set in the process - this is needed because on some HW I2C operations can take long time and disrupt the SFP and link detection process Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Reported-by: Ben Hutchings <bhutchings@solarflare.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-10net: rename include/net/ll_poll.h to include/net/busy_poll.hEliezer Tamir1-1/+1
Rename the file and correct all the places where it is included. Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-06-10ixgbe: add extra stats for ndo_ll_pollEliezer Tamir1-0/+14
Add additional statistics to the ixgbe driver for ndo_ll_poll Defined under LL_EXTENDED_STATS Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-06-10ixgbe: add support for ndo_ll_pollEliezer Tamir1-0/+120
Add the ixgbe driver code implementing ndo_ll_poll. Adds ndo_ll_poll method and locking between it and the napi poll. When receiving a packet we use skb_mark_ll to record the napi it came from. Add each napi to the napi_hash right after netif_napi_add(). Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-18ixgbe: Remove unnecessary #ifdef CONFIG_DEBUG_FS testsJoe Perches1-0/+5
Add some empty static inlines instead to make the code more readable. Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-15ixgbe: Update DESC_NEEDED define to adjust for changes to MAX_SKB_FRAGSAlexander Duyck1-1/+1
Recent changes have made it so that MAX_SKB_FRAGS is now never less than 16. As a result we were seeing issues on systems with 64K pages as it would cause DESC_NEEDED to increase to 68, and we would need over 136 descriptors free before clean_tx_irq would wake the queue. This patch makes it so that DESC_NEEDED is always MAX_SKB_FRAGS + 4. This should prevent any possible deadlocks on the systems with 64K pages as we will now only require 42 descriptors to wake. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-15ixgbe: implement SFF diagnostic monitoring via ethtoolAurélien Guillaume1-0/+1
This patch adds support for reading data from SFP+ modules over i2c. Signed-off-by: Aurélien Guillaume <footplus@gmail.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-15ixgbe: Make ixgbe_setup_tc usable even when DCB is not enabledAlexander Duyck1-1/+1
The ixgbe_setup_tc code is essentially the same code we need any time we have to update the number of queues. As such I am making it available always and just stripping the DCB specific bits out when DCB is disabled instead of stripping the entire function. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Reviewed-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-15ixgbe: Add function for setting XPS queue mappingAlexander Duyck1-0/+1
This change adds support for ixgbe to configure the XPS queue mapping on load. The result of this change is that on open we will now be resetting the number of Tx queues, and then setting the default configuration for XPS based on if ATR is enabled or disabled. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Reviewed-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-15ixgbe: Define FCoE and Flow director limits much sooner to allow for changesAlexander Duyck1-8/+3
Instead of adjusting the FCoE and Flow director limits based on the number of CPUs we can define them much sooner. This allows the user to come through later and adjust them once we have updated the code to support the set_channels ethtool operation. I am still allowing for FCoE and RSS queues to be separated if the number queues is less than the number of CPUs. This essentially treats the two groupings like they are two separate traffic classes. In addition I am changing the initialization to use the MAX_TX/RX_QUEUES defines instead of trying to compute the value as it will be possible in upcoming patches for the user to request the maximum number of queues. I have also updated things so that the upper limit on queues is exactly 63 instead of allowing it to go up to 64. The reason for this change is to address the fact thqt the driver only supports up to 63 queue vectors since the hardware supports 64 MSI-X vectors, but one must be reserved for "other" causes. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-05ixgbe: Fix SR-IOV MTU warningAlexander Duyck1-2/+0
This change corrects the fact that we were using 1522 to test for the max frame size in ixgbe_change_mtu and 1518 in ixgbe_set_vf_lpe. The difference was the addition of VLAN_HLEN which we only need to add in the case of computing a buffer size, but not a filter size. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Sibai Li <Sibai.li@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-02-05ixgbe: update date to 2013Don Skidmore1-1/+1
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23ixgbe: Implement PCI SR-IOV sysfs callback operationGreg Rose1-0/+3
Implement callbacks in the driver for the new PCI bus driver interface that allows the user to enable/disable SR-IOV VFs in a device via the sysfs interface. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> CC: Don Dutile <ddutile@redhat.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23ixgbe: Inline Rx PTP descriptor handlingAlexander Duyck1-3/+18
This change is meant to inline the Rx PTP descriptor handling. The main motivation is to avoid unnecessary jumps into function calls that we then immediately exit because we are not performing timestamps. The net result of this change is that ixgbe_ptp_rx_tstamp drops from .5% CPU utilization in my performance runs to 0%, and the only value tested is the Rx descriptor which should already be warm in the cache if not stored in a register. Cc: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Jacob Keller <Jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23ixgbe: Add ptp work item to poll for the Tx timestampJacob Keller1-2/+3
This patch copies the igb implementation of Tx timestamps, which uses a work item to poll for the Tx timestamp. In addition it adds a timeout value of 15 seconds, after which it will stop polling. This is necessary due to an issue with the descriptor being marked done before the Tx timestamp event has occurred. These two events don't correlate, so using the done bit on the descriptor as indication that the timestamp must already have been taken leads to potentially dropped Tx timestamps (especially under heavy packet load) Reported-by: Matthew Vick <matthew.vick@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23ixgbe: Use watchdog check in favor of BPF for detecting latched timestampJacob Keller1-2/+5
This patch removes ixgbe_ptp_match, and the corresponding packet filtering from ixgbe driver. This code was previously causing some issues within the hotpath of the driver. However the code also provided a check against possible frozen Rx timestamp due to dropped packets when the Rx ring is full. This patch provides a replacement solution based on the watchdog. To this end, whenever a packet consumes the Rx timestamp it stores the jiffy value in the rx_ring structure. Watchdog updates its own jiffy timer whenever there is no valid timestamp in the registers. If watchdog detects a valid timestamp in the registers, (meaning that no Rx packet has consumed it yet) it will check which time is most recent, the last time in the watchdog, or any time in the rx_rings. If the most recent "event" was more than 5seconds ago, it will flush the Rx timestamp and print a warning message to the syslog. Reported-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-19ixgbe: Update ixgbe Tx flags to improve code efficiencyAlexander Duyck1-10/+17
This change is meant to improve the efficiency of the Tx flags in ixgbe by aligning them with the values that will later be written into either the cmd_type or olinfo. By doing this we are able to reduce most of these functions to either just a simple shift followed by an or in the case of cmd_type, or an and followed by an or in the case of olinfo. To do this I also needed to change the logic and/or drop some flags. I dropped the IXGBE_TX_FLAGS_FSO and it was replaced by IXGBE_TX_FLAGS_TSO since the only place it was ever checked was in conjunction with IXGBE_TX_FLAGS_TSO. I replaced IXGBE_TX_FLAGS_TXSW with IXGBE_TX_FLAGS_CC, this way we have a clear point for what the flag is meant to do. Finally the IXGBE_TX_FLAGS_NO_IFCS was dropped since were are already carrying the data for that flag in the skb. Instead we can just check the bitflag in the skb. In order to avoid type conversion errors I also adjusted the locations where we were switching between CPU and little endian. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-11-28ixgbe: Make the bridge mode setting stickyGreg Rose1-0/+1
The internal bridge mode setting needs to be sticky so that it can be configured correctly after a device reset. This change is required now that the driver supports setting the bridge mode to VEB or VEPA. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Acked-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <Sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-11-01ptp: Enable clock drivers along with associated net/PHY driversBen Hutchings1-6/+0
Where a PTP clock driver is associated with a net or PHY driver, it should be enabled automatically whenever that driver is enabled. Therefore: - Make PTP clock drivers select rather than depending on PTP_1588_CLOCK - Remove separate boolean options for PTP clock drivers that are built as part of net driver modules. (This also fixes cases where the PTP subsystem is wrongly forced to be built-in.) - Set 'default y' for PTP clock drivers that depend on specific net drivers but are built separately Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-29ixgbe: Add support for pipeline resetDon Skidmore1-0/+1
Calling the ixgbe_reset_pipeline_82599 function will ensure a full pipeline reset on all 82599 devices. This is necessary to avoid possible link issues. Since this patch accomplishes this by modifying AUTOC.LMS we need to wrap all AUTOC writes when LESM is enabled. v2- fix LMS behaviour based on feedback by Martin Josefsson CC: Martin Josefsson <gandalf@mjufs.se> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-10-22ixgbe: (PTP) refactor init, cyclecounter and resetJacob Keller1-2/+2
This patch modifies when and where PTP registers and data are set. Previously a work-around was used inside cyclecounter_start in order to reset some of the time registers. This patch creates a new ixgbe_ptp_reset specifically for this purpose. The cyclecounter configuration has trimmed down to only modify what is necessary. Due to hardware conditions after probe and before open, PTP init has now moved into the ixgbe_open call. This allows the ptp device name in the sysfs to be the ethernet device name instead of the MAC address. The cyclecounter check flag is renamed to PTP_ENABLED and is used to prevent PTP init from happening when PTP has not been enabled. CC: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-10-22ixgbe: Add support for tracking the default user priority to SR-IOVAlexander Duyck1-0/+2
It is necessary to track the default user priority in the PF so that we can force it upon the VFs. The motivation behind this is to keep the VFs from getting access to user priorities meant for things like storage. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-10-19ixgbe: Add mailbox API version negotiation support to ixgbe PFAlexander Duyck1-0/+1
This change allows us to add a mailbox versioning API. This will allow us to determine the features supported by the VFs from the PF. For example we will be implementing a version 1.1 API for the VF that will indicate that it can support us enabling Jumbo frames as the VF will support buffer chaining. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Robert Garrett <RobertX.Garrett@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-10-09ixgbe/ixgbevf: Limit maximum jumbo frame size to 9.5K to avoid Tx hangsAlexander Duyck1-1/+1
This change limits the PF/VF driver to 9.5K max jumbo frame size in order prevent a possible Tx hang in the adapter when sending frames between pools. All of the parts in ixgbe support a maximum frame of 15.5K for standard traffic, however with SR-IOV or DCB enabled they should be limiting the MTU size to 9.5K. Instead of adding extra checks which would have to change the MTU when we go into or out of these modes it is preferred to just use a standard 9.5K MTU limit for all modes so that this extra overhead can be avoided. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-09-15ixgbe: add debugfs supportCatherine Sullivan1-1/+9
This patch adds debugfs support to the ixgbe driver to give users the ability to access kernel information and to simulate kernel events. The filesystem is set up in the following driver/PCI-instance hierarchy: <debugfs> |-- ixgbe |-- PCI instance | |-- attribute files Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-08-16ixgbe: Rewrite code related to configuring IFCS bit in Tx descriptorAlexander Duyck1-0/+1
This change updates the code related to configuring the transmit frame checksum. Specifically I have updated the code so that we can only skip inserting the checksum in the case that we are not performing some other offload that will modify the frame data. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2012-08-16ixgbe: Only use double buffering if page size is less than 8KAlexander Duyck1-6/+18
This change makes it so that we do not use double buffering if the page size is larger than 4K. Instead we will simply walk through the page using up to 3K per receive, and if we receive less than we only move the offset by that amount. We will free the page when there is no longer any space left that we can use instead of checking the page count to see if we can cycle back to the start. The main motivation behind this is to avoid the unnecessary truesize cost for using a half page when most packets are 2K or smaller. With this new approach the largest possible truesize for a page fragment will be 3K when PAGE_SIZE is larger than 4K. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2012-07-21ixgbe: Reduce Rx header size to what is actually usedAlexander Duyck1-7/+8
The recent changes to netdev_alloc_skb actually make it so that the size of the buffer now actually has a more direct input on the truesize. So in order to make best use of the piece of a page we are allocated I am reducing the IXGBE_RX_HDR_SIZE to 256 so that our truesize will be reduced by 256 bytes as well. This should result in performance improvements since the number of uses per page should increase from 4 to 6 in the case of a 4K page. In addition we should see socket performance improvements due to the truesize dropping to less than 1K for buffers less than 256 bytes. Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-21ixgbe: Change how we check for pre-existing and assigned VFsAlexander Duyck1-1/+0
This patch does two things. First it drops the unnecessary work of searching for enabled VFs when we first bring up the adapter and instead just uses pci_num_vf to determine how many VFs are enabled on the adapter. The second thing it does is drop the use of vfdev from the vf_data_storage structure. Instead we just search the entire system for a VF that has us as it's PF, and then if that VF is assigned we indicate that the VFs are assigned. This allows us to still check for assigned VFs even if the vfinfo allocation has failed, or vfinfo has been freed. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-19ixgbe: Make FCoE allocation and configuration closer to how rings workAlexander Duyck1-1/+2
This patch changes the behavior of the FCoE configuration so that it is much closer to how the main body of the ixgbe driver works for ring allocation. The first piece is the ixgbe_fcoe_ddp_enable/disable calls. These allocate the percpu values and if successful set the fcoe_ddp_xid value indicating that we can support DDP. The next piece is the ixgbe_setup/free_ddp_resources calls. These are called on open/close and will allocate and free the DMA pools. Finally ixgbe_configure_fcoe is now just register configuration. It can go through and enable the registers for the FCoE redirection offload, and FIP configuration without any interference from the DDP pool allocation. The net result of all this is two fold. First it adds a certain amount of exception handling. So for example if ixgbe_setup_fcoe_resources fails we will actually generate an error in open and refuse to bring up the interface. Secondly it provides a much more graceful failure case than the previous model which would skip setting up the registers for FCoE on failure to allocate DDP resources leaving no Rx functionality enabled instead of just disabling DDP. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-19ixgbe: Use VMDq offset to indicate the default poolAlexander Duyck1-1/+1
This change makes it so that we can use the VMDq ring feature offset value to determine the default pool instead of using num_vfs. The reason for this change is to avoid issues should we fail to allocate vfinfo but have pre-existing VFs. What should happen in this case is that num_vfs will go to 0, but the VMDq offset will contain the location of the first PF pool. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Sibai Li <Sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-18ixgbe: Cleanup holes in flags after removing several of themAlexander Duyck1-25/+25
This change is just meant to defragment the flags as there are several hole that have been introduced since several features, or the flags for them, have been removed. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-18ixgbe: Retire RSS enabled and capable flagsAlexander Duyck1-2/+0
All of our hardware supports RSS even if it is only for a single queue. So instead of toting around the RSS enable flag I am updating the code so that all devices are enabled and if we want to disable RSS it is indicated via the RSS mask. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-18ixgbe: Add support for SR-IOV w/ DCB or RSSAlexander Duyck1-0/+4
This change essentially makes it so that we can enable almost all of the features all at once. This patch allows for the combination of SR-IOV, DCB, and FCoE in the case of the x540. It also beefs up the SR-IOV by adding support for RSS to the PF. The testing matrix gets to be very complex for this patch as there are a number of different features and subsets for queueing options. I tried to narrow these down a bit by restricting the PF to only supporting 4TC DCB when it is enabled in addition to SR-IOV. Cc: Greg Rose <gregory.v.rose@intel.com> Cc: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-14ixgbe: Add function for obtaining FCoE TC based on FCoE user priorityAlexander Duyck1-0/+1
In upcoming patches it will become increasingly common to need to determine the FCoE traffic class in order to determine the correct queues for FCoE. In order to make this easier I am adding a function for obtaining the FCoE traffic class based on the user priority. Cc: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-11ixgbe: Add feature offset value to ring featuresAlexander Duyck1-1/+2
The mask value for ring features was overloaded for FCoE which can lead to some confusion. In order to avoid any confusion I am splitting the mask value and adding an offset value. This can be used for the start of the FCoE rings, and in the future I hope to use it to store the start of the registers for SR-IOV. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-11ixgbe: Add upper limit to ring featuresAlexander Duyck1-1/+2
We are currently using indices to indicate the upper limit on a ring feature. However since we can switch back and forth on features such as DCB and that has effects on other features such as RSS it is preferable to instead store the upper limit separate from the current value for the number of rings related to the feature. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-07-11ixgbe: count q_vectors instead of MSI-X vectorsAlexander Duyck1-7/+7
It makes much more sense for us to count q_vectors instead of MSI-X vectors. We were using num_msix_vectors to find the number of q_vectors in multiple places. This was wasteful since we only had one place that actually needs the number of MSI-X vectors and that is in slow path. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-06-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-2/+2
Conflicts: drivers/net/caif/caif_hsi.c drivers/net/usb/qmi_wwan.c The qmi_wwan merge was trivial. The caif_hsi.c, on the other hand, was not. It's a conflict between 1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform device with ops structure.") in the net-next tree and commit 39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of HIS until open()") in the net tree. I did my best with that one and will ask Sjur to check it out. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-26ixgbe: Do not pad FCoE frames as this can cause issues with FCoE DDPAlexander Duyck1-2/+2
FCoE target mode was experiencing issues due to the fact that we were sending up data frames that were padded to 60 bytes after the DDP logic had already stripped the frame down to 52 or 56 depending on the use of VLANs. This was resulting in the FCoE DDP logic having issues since it thought the frame still had data in it due to the padding. To resolve this, adding code so that we do not pad FCoE frames prior to handling them to the stack. CC: <stable@vger.kernel.org> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-14ixgbe: Check PTP Rx timestamps via BPF filterJacob Keller1-0/+2
This patch fixes a potential Rx timestamp deadlock that causes the Rx timestamping to stall indefinitely. The issue could occur when a PTP packet is timestamped by hardware but never reaches the Rx queue. In order to prevent a permanent loss of timestamping, the RXSTMP(L/H) registers have to be read to unlock them. (This used to only occur when a packet that was timestamped reached the software.) However the registers can't be read early otherwise there is no way to correlate them to the packet. This patch introduces a filter function which can be used to determine if a packet should have been timestamped. Supplied with the filter setup by the hwtstamp ioctl, check to make sure the PTP protocol and message type match the expected values. If so, then read the timestamp registers (to free them.) At this point check the descriptor bit, if the bit is set then we know this packet correlates to the timestamp stored in the RXTSTAMP registers. Otherwise, assume that packet was dropped by the hardware, and ignore this timestamp value. However, we have at least unlocked the rxtstamp registers for future timestamping. Due to the way the driver handles skb data, it cannot be directly accessed. In order to work around this, a copy of the skb data into a linear buffer is made. From this buffer it becomes possible to read the data correctly Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Richard Cochran <richardcochran@gmail.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-09ixgbe: cleanup the hwmon function callsDon Skidmore1-0/+2
When the hwmon code was initially added it was with the assumption that a sysfs patch would be also coming soon. Since that isn't the case some clean up needs to be done. This patch does that. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-09ixgbe: Enable timesync clock-out feature for PPS support on X540Jacob E Keller1-0/+2
This patch enables the PPS system in the PHC framework, by enabling the clock-out feature on the X540 device. Causes the SDP0 to be set as a 1Hz clock. Also configures the timesync interrupt cause in order to report each pulse to the PPS via the PHC framework, which can be used for general system clock synchronization. (This allows a stable method for tuning the general system time via the on-board SYSTIM register based clock.) Signed-off-by: Jacob E Keller <jacob.e.keller@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-09ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)Jacob Keller1-0/+32
This patch enables hardware timestamping for use with PTP software by extracting a ns counter from an arbitrary fixed point cycles counter. The hardware generates SYSTIME registers using the DMA tick which changes based on the current link speed. These SYSTIME registers are converted to ns using the cyclecounter and timecounter structures provided by the kernel. Using the SO_TIMESTAMPING api, software can enable and access timestamps for PTP packets. The SO_TIMESTAMPING API has space for 3 different kinds of timestamps, SYS, RAW, and SOF. SYS hardware timestamps are hardware ns values that are then scaled to the software clock. RAW hardware timestamps are the direct raw value of the ns counter. SOF software timestamps are the software timestamp calculated as close as possible to the software transmit, but are not offloaded to the hardware. This patch only supports the RAW hardware timestamps due to inefficiency of the SYS design. This patch also enables the PHC subsystem features for atomically adjusting the cycle register, and adjusting the clock frequency in parts per billion. This frequency adjustment works by slightly adjusting the value added to the cycle registers each DMA tick. This causes the hardware registers to overflow rapidly (approximately once every 34 seconds, when at 10gig link). To solve this, the timecounter structure is used, along with a timer set for every 25 seconds. This allows for detecting register overflow and converting the cycle counter registers into ns values needed for providing useful timestamps to the network stack. Only the basic required clock functions are supported at this time, although the hardware supports some ancillary features and these could easily be enabled in the future. Note that use of this hardware timestamping requires modifying daemon software to use the SO_TIMESTAMPING API for timestamps, and the ptp_clock PHC framework for accessing the clock. The timestamps have no relation to the system time at all, so software must use the posix clock generated by the PHC framework instead. Signed-off-by: Jacob E Keller <jacob.e.keller@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-09ixgbe: Set Drop_EN bit when multiple Rx queues are present w/o flow controlAlexander Duyck1-0/+1
The drop enable bit can be used to improve the performance of the adapter in the case of multiple queues being present. This performance gain is due to the fact that some slower CPUs can cause the FIFO to backfill preventing faster CPUs from receiving additional work. By setting the drop enable bit we prevent this and instead just drop the packets that would have been bound for the slower CPU. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-3/+0
Conflicts: drivers/net/ethernet/intel/e1000e/param.c drivers/net/wireless/iwlwifi/iwl-agn-rx.c drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c drivers/net/wireless/iwlwifi/iwl-trans.h Resolved the iwlwifi conflict with mainline using 3-way diff posted by John Linville and Stephen Rothwell. In 'net' we added a bug fix to make iwlwifi report a more accurate skb->truesize but this conflicted with RX path changes that happened meanwhile in net-next. In e1000e a conflict arose in the validation code for settings of adapter->itr. 'net-next' had more sophisticated logic so that logic was used. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-03ixgbe: dcb: BIT_APP_UPCHG not set by ixgbe_copy_dcb_cfg()John Fastabend1-3/+0
After this commit: commit aacc1bea190d731755a65cb8ec31dd756f4e263e Author: Multanen, Eric W <eric.w.multanen@intel.com> Date: Wed Mar 28 07:49:09 2012 +0000 ixgbe: driver fix for link flap The BIT_APP_UPCHG bit is no longer set when ixgbe_dcbnl_set_all() is called. This results in the FCoE app user priority never getting set and the driver will not configure the tx_rings correctly for FCoE packets which use the SAN MTU and FCoE offloads. We resolve this regression by fixing ixgbe_copy_dcb_cfg() to also check for FCoE application changes. Additionally, we can drop the IEEE variants of get_dcb_app() because this path is never called with the IEEE mode enabled. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>