aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-02-13 19:48:07 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-02-15 19:25:13 -0500
commitcd2d5b529cdb9bd274f3e4bc68d37d4d63b7f383 (patch)
treef21a5f98185b8e227b843a28b54d4260a0e57033 /drivers/net/ethernet/sfc/net_driver.h
parent28e47c498a931200125e299e9d60d22e27b4ab0d (diff)
sfc: Add SR-IOV back-end support for SFC9000 family
On the SFC9000 family, each port has 1024 Virtual Interfaces (VIs), each with an RX queue, a TX queue, an event queue and a mailbox register. These may be assigned to up to 127 SR-IOV virtual functions per port, with up to 64 VIs per VF. We allocate an extra channel (IRQ and event queue only) to receive requests from VF drivers. There is a per-port limit of 4 concurrent RX queue flushes, and queue flushes may be initiated by the MC in response to a Function Level Reset (FLR) of a VF. Therefore, when SR-IOV is in use, we submit all flush requests via the MC. The RSS indirection table is shared with VFs, so the number of RX queues used in the PF is limited to the number of VIs per VF. This is almost entirely the work of Steve Hodgson, formerly shodgson@solarflare.com. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 7870cefcb203..3fbec458c323 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -24,6 +24,7 @@
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/highmem.h> 25#include <linux/highmem.h>
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27#include <linux/mutex.h>
27#include <linux/vmalloc.h> 28#include <linux/vmalloc.h>
28#include <linux/i2c.h> 29#include <linux/i2c.h>
29 30
@@ -54,7 +55,8 @@
54 55
55#define EFX_MAX_CHANNELS 32U 56#define EFX_MAX_CHANNELS 32U
56#define EFX_MAX_RX_QUEUES EFX_MAX_CHANNELS 57#define EFX_MAX_RX_QUEUES EFX_MAX_CHANNELS
57#define EFX_MAX_EXTRA_CHANNELS 0U 58#define EFX_EXTRA_CHANNEL_IOV 0
59#define EFX_MAX_EXTRA_CHANNELS 1U
58 60
59/* Checksum generation is a per-queue option in hardware, so each 61/* Checksum generation is a per-queue option in hardware, so each
60 * queue visible to the networking core is backed by two hardware TX 62 * queue visible to the networking core is backed by two hardware TX
@@ -629,6 +631,8 @@ union efx_multicast_hash {
629}; 631};
630 632
631struct efx_filter_state; 633struct efx_filter_state;
634struct efx_vf;
635struct vfdi_status;
632 636
633/** 637/**
634 * struct efx_nic - an Efx NIC 638 * struct efx_nic - an Efx NIC
@@ -712,6 +716,17 @@ struct efx_filter_state;
712 * completed (either success or failure). Not used when MCDI is used to 716 * completed (either success or failure). Not used when MCDI is used to
713 * flush receive queues. 717 * flush receive queues.
714 * @flush_wq: wait queue used by efx_nic_flush_queues() to wait for flush completions. 718 * @flush_wq: wait queue used by efx_nic_flush_queues() to wait for flush completions.
719 * @vf: Array of &struct efx_vf objects.
720 * @vf_count: Number of VFs intended to be enabled.
721 * @vf_init_count: Number of VFs that have been fully initialised.
722 * @vi_scale: log2 number of vnics per VF.
723 * @vf_buftbl_base: The zeroth buffer table index used to back VF queues.
724 * @vfdi_status: Common VFDI status page to be dmad to VF address space.
725 * @local_addr_list: List of local addresses. Protected by %local_lock.
726 * @local_page_list: List of DMA addressable pages used to broadcast
727 * %local_addr_list. Protected by %local_lock.
728 * @local_lock: Mutex protecting %local_addr_list and %local_page_list.
729 * @peer_work: Work item to broadcast peer addresses to VMs.
715 * @monitor_work: Hardware monitor workitem 730 * @monitor_work: Hardware monitor workitem
716 * @biu_lock: BIU (bus interface unit) lock 731 * @biu_lock: BIU (bus interface unit) lock
717 * @last_irq_cpu: Last CPU to handle a possible test interrupt. This 732 * @last_irq_cpu: Last CPU to handle a possible test interrupt. This
@@ -762,6 +777,7 @@ struct efx_nic {
762 unsigned next_buffer_table; 777 unsigned next_buffer_table;
763 unsigned n_channels; 778 unsigned n_channels;
764 unsigned n_rx_channels; 779 unsigned n_rx_channels;
780 unsigned rss_spread;
765 unsigned tx_channel_offset; 781 unsigned tx_channel_offset;
766 unsigned n_tx_channels; 782 unsigned n_tx_channels;
767 unsigned int rx_buffer_len; 783 unsigned int rx_buffer_len;
@@ -820,6 +836,20 @@ struct efx_nic {
820 atomic_t rxq_flush_outstanding; 836 atomic_t rxq_flush_outstanding;
821 wait_queue_head_t flush_wq; 837 wait_queue_head_t flush_wq;
822 838
839#ifdef CONFIG_SFC_SRIOV
840 struct efx_channel *vfdi_channel;
841 struct efx_vf *vf;
842 unsigned vf_count;
843 unsigned vf_init_count;
844 unsigned vi_scale;
845 unsigned vf_buftbl_base;
846 struct efx_buffer vfdi_status;
847 struct list_head local_addr_list;
848 struct list_head local_page_list;
849 struct mutex local_lock;
850 struct work_struct peer_work;
851#endif
852
823 /* The following fields may be written more often */ 853 /* The following fields may be written more often */
824 854
825 struct delayed_work monitor_work ____cacheline_aligned_in_smp; 855 struct delayed_work monitor_work ____cacheline_aligned_in_smp;