aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h
diff options
context:
space:
mode:
authorAriel Elior <ariele@broadcom.com>2013-01-01 00:22:27 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-02 04:45:05 -0500
commit8d9ac297d18dbe05b6e7cb4378da51e67143b452 (patch)
treeca3c8f89c5ce4d131bf7b89a03be70eac8885040 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h
parentad5afc89365e981cffafc241a4c46f56ca943370 (diff)
bnx2x: Add init, setup_q, set_mac to VF <-> PF channel
'init' - init an acquired VF. Supply allocation GPAs to PF. 'setup_q' - PF to allocate a queue in device on behalf of the VF. 'set_mac' - PF to configure a mac in device on behalf of the VF. VF driver uses these requests in the VF <-> PF channel in nic_load flow. Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h
index 561c6568b43f..12889f052299 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h
@@ -38,6 +38,22 @@ struct hw_sb_info {
38 */ 38 */
39#define TLV_BUFFER_SIZE 1024 39#define TLV_BUFFER_SIZE 1024
40 40
41#define VFPF_QUEUE_FLG_TPA 0x0001
42#define VFPF_QUEUE_FLG_TPA_IPV6 0x0002
43#define VFPF_QUEUE_FLG_TPA_GRO 0x0004
44#define VFPF_QUEUE_FLG_CACHE_ALIGN 0x0008
45#define VFPF_QUEUE_FLG_STATS 0x0010
46#define VFPF_QUEUE_FLG_OV 0x0020
47#define VFPF_QUEUE_FLG_VLAN 0x0040
48#define VFPF_QUEUE_FLG_COS 0x0080
49#define VFPF_QUEUE_FLG_HC 0x0100
50#define VFPF_QUEUE_FLG_DHC 0x0200
51
52#define VFPF_QUEUE_DROP_IP_CS_ERR (1 << 0)
53#define VFPF_QUEUE_DROP_TCP_CS_ERR (1 << 1)
54#define VFPF_QUEUE_DROP_TTL0 (1 << 2)
55#define VFPF_QUEUE_DROP_UDP_CS_ERR (1 << 3)
56
41enum { 57enum {
42 PFVF_STATUS_WAITING = 0, 58 PFVF_STATUS_WAITING = 0,
43 PFVF_STATUS_SUCCESS, 59 PFVF_STATUS_SUCCESS,
@@ -130,6 +146,107 @@ struct pfvf_acquire_resp_tlv {
130 } resc; 146 } resc;
131}; 147};
132 148
149/* Init VF */
150struct vfpf_init_tlv {
151 struct vfpf_first_tlv first_tlv;
152 aligned_u64 sb_addr[PFVF_MAX_SBS_PER_VF]; /* vf_sb based */
153 aligned_u64 spq_addr;
154 aligned_u64 stats_addr;
155};
156
157/* Setup Queue */
158struct vfpf_setup_q_tlv {
159 struct vfpf_first_tlv first_tlv;
160
161 struct vf_pf_rxq_params {
162 /* physical addresses */
163 aligned_u64 rcq_addr;
164 aligned_u64 rcq_np_addr;
165 aligned_u64 rxq_addr;
166 aligned_u64 sge_addr;
167
168 /* sb + hc info */
169 u8 vf_sb; /* index in hw_sbs[] */
170 u8 sb_index; /* Index in the SB */
171 u16 hc_rate; /* desired interrupts per sec. */
172 /* valid iff VFPF_QUEUE_FLG_HC */
173 /* rx buffer info */
174 u16 mtu;
175 u16 buf_sz;
176 u16 flags; /* VFPF_QUEUE_FLG_X flags */
177 u16 stat_id; /* valid iff VFPF_QUEUE_FLG_STATS */
178
179 /* valid iff VFPF_QUEUE_FLG_TPA */
180 u16 sge_buf_sz;
181 u16 tpa_agg_sz;
182 u8 max_sge_pkt;
183
184 u8 drop_flags; /* VFPF_QUEUE_DROP_X, for Linux VMs
185 * all the flags are turned off
186 */
187
188 u8 cache_line_log; /* VFPF_QUEUE_FLG_CACHE_ALIGN */
189 u8 padding;
190 } rxq;
191
192 struct vf_pf_txq_params {
193 /* physical addresses */
194 aligned_u64 txq_addr;
195
196 /* sb + hc info */
197 u8 vf_sb; /* index in hw_sbs[] */
198 u8 sb_index; /* Index in the SB */
199 u16 hc_rate; /* desired interrupts per sec. */
200 /* valid iff VFPF_QUEUE_FLG_HC */
201 u32 flags; /* VFPF_QUEUE_FLG_X flags */
202 u16 stat_id; /* valid iff VFPF_QUEUE_FLG_STATS */
203 u8 traffic_type; /* see in setup_context() */
204 u8 padding;
205 } txq;
206
207 u8 vf_qid; /* index in hw_qid[] */
208 u8 param_valid;
209#define VFPF_RXQ_VALID 0x01
210#define VFPF_TXQ_VALID 0x02
211 u8 padding[2];
212};
213
214/* Set Queue Filters */
215struct vfpf_q_mac_vlan_filter {
216 u32 flags;
217#define VFPF_Q_FILTER_DEST_MAC_VALID 0x01
218#define VFPF_Q_FILTER_VLAN_TAG_VALID 0x02
219#define VFPF_Q_FILTER_SET_MAC 0x100 /* set/clear */
220 u8 mac[ETH_ALEN];
221 u16 vlan_tag;
222};
223
224/* configure queue filters */
225struct vfpf_set_q_filters_tlv {
226 struct vfpf_first_tlv first_tlv;
227
228 u32 flags;
229#define VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED 0x01
230#define VFPF_SET_Q_FILTERS_MULTICAST_CHANGED 0x02
231#define VFPF_SET_Q_FILTERS_RX_MASK_CHANGED 0x04
232
233 u8 vf_qid; /* index in hw_qid[] */
234 u8 n_mac_vlan_filters;
235 u8 n_multicast;
236 u8 padding;
237
238#define PFVF_MAX_MAC_FILTERS 16
239#define PFVF_MAX_VLAN_FILTERS 16
240#define PFVF_MAX_FILTERS (PFVF_MAX_MAC_FILTERS +\
241 PFVF_MAX_VLAN_FILTERS)
242 struct vfpf_q_mac_vlan_filter filters[PFVF_MAX_FILTERS];
243
244#define PFVF_MAX_MULTICAST_PER_VF 32
245 u8 multicast[PFVF_MAX_MULTICAST_PER_VF][ETH_ALEN];
246
247 u32 rx_mask; /* see mask constants at the top of the file */
248};
249
133/* release the VF's acquired resources */ 250/* release the VF's acquired resources */
134struct vfpf_release_tlv { 251struct vfpf_release_tlv {
135 struct vfpf_first_tlv first_tlv; 252 struct vfpf_first_tlv first_tlv;
@@ -144,6 +261,9 @@ struct tlv_buffer_size {
144union vfpf_tlvs { 261union vfpf_tlvs {
145 struct vfpf_first_tlv first_tlv; 262 struct vfpf_first_tlv first_tlv;
146 struct vfpf_acquire_tlv acquire; 263 struct vfpf_acquire_tlv acquire;
264 struct vfpf_init_tlv init;
265 struct vfpf_setup_q_tlv setup_q;
266 struct vfpf_set_q_filters_tlv set_q_filters;
147 struct vfpf_release_tlv release; 267 struct vfpf_release_tlv release;
148 struct channel_list_end_tlv list_end; 268 struct channel_list_end_tlv list_end;
149 struct tlv_buffer_size tlv_buf_size; 269 struct tlv_buffer_size tlv_buf_size;
@@ -161,6 +281,9 @@ union pfvf_tlvs {
161enum channel_tlvs { 281enum channel_tlvs {
162 CHANNEL_TLV_NONE, 282 CHANNEL_TLV_NONE,
163 CHANNEL_TLV_ACQUIRE, 283 CHANNEL_TLV_ACQUIRE,
284 CHANNEL_TLV_INIT,
285 CHANNEL_TLV_SETUP_Q,
286 CHANNEL_TLV_SET_Q_FILTERS,
164 CHANNEL_TLV_RELEASE, 287 CHANNEL_TLV_RELEASE,
165 CHANNEL_TLV_LIST_END, 288 CHANNEL_TLV_LIST_END,
166 CHANNEL_TLV_MAX 289 CHANNEL_TLV_MAX