diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-09-28 11:59:59 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 14:16:25 -0400 |
commit | 9929b0fb0f35f54371e9364bab809bcd753f9d3a (patch) | |
tree | 1722f36becc47589bb7b0d98ad00c10dece2a95e /drivers/infiniband/hw/ipath/ipath_common.h | |
parent | 221e31985b490309eb9ae33ac815deae3b5aa021 (diff) |
IB/ipath: Driver support for userspace sharing of HW contexts
This allows multiple userspace processes to share a single hardware
context in a master/slave arrangement. It is backwards binary compatible
with existing userspace.
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_common.h')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_common.h | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_common.h b/drivers/infiniband/hw/ipath/ipath_common.h index f577905e3aca..46b7b20d8a91 100644 --- a/drivers/infiniband/hw/ipath/ipath_common.h +++ b/drivers/infiniband/hw/ipath/ipath_common.h | |||
@@ -185,6 +185,7 @@ typedef enum _ipath_ureg { | |||
185 | #define IPATH_RUNTIME_PCIE 0x2 | 185 | #define IPATH_RUNTIME_PCIE 0x2 |
186 | #define IPATH_RUNTIME_FORCE_WC_ORDER 0x4 | 186 | #define IPATH_RUNTIME_FORCE_WC_ORDER 0x4 |
187 | #define IPATH_RUNTIME_RCVHDR_COPY 0x8 | 187 | #define IPATH_RUNTIME_RCVHDR_COPY 0x8 |
188 | #define IPATH_RUNTIME_MASTER 0x10 | ||
188 | 189 | ||
189 | /* | 190 | /* |
190 | * This structure is returned by ipath_userinit() immediately after | 191 | * This structure is returned by ipath_userinit() immediately after |
@@ -202,7 +203,8 @@ struct ipath_base_info { | |||
202 | /* version of software, for feature checking. */ | 203 | /* version of software, for feature checking. */ |
203 | __u32 spi_sw_version; | 204 | __u32 spi_sw_version; |
204 | /* InfiniPath port assigned, goes into sent packets */ | 205 | /* InfiniPath port assigned, goes into sent packets */ |
205 | __u32 spi_port; | 206 | __u16 spi_port; |
207 | __u16 spi_subport; | ||
206 | /* | 208 | /* |
207 | * IB MTU, packets IB data must be less than this. | 209 | * IB MTU, packets IB data must be less than this. |
208 | * The MTU is in bytes, and will be a multiple of 4 bytes. | 210 | * The MTU is in bytes, and will be a multiple of 4 bytes. |
@@ -218,7 +220,7 @@ struct ipath_base_info { | |||
218 | __u32 spi_tidcnt; | 220 | __u32 spi_tidcnt; |
219 | /* size of the TID Eager list in infinipath, in entries */ | 221 | /* size of the TID Eager list in infinipath, in entries */ |
220 | __u32 spi_tidegrcnt; | 222 | __u32 spi_tidegrcnt; |
221 | /* size of a single receive header queue entry. */ | 223 | /* size of a single receive header queue entry in words. */ |
222 | __u32 spi_rcvhdrent_size; | 224 | __u32 spi_rcvhdrent_size; |
223 | /* | 225 | /* |
224 | * Count of receive header queue entries allocated. | 226 | * Count of receive header queue entries allocated. |
@@ -310,6 +312,12 @@ struct ipath_base_info { | |||
310 | __u32 spi_filler_for_align; | 312 | __u32 spi_filler_for_align; |
311 | /* address of readonly memory copy of the rcvhdrq tail register. */ | 313 | /* address of readonly memory copy of the rcvhdrq tail register. */ |
312 | __u64 spi_rcvhdr_tailaddr; | 314 | __u64 spi_rcvhdr_tailaddr; |
315 | |||
316 | /* shared memory pages for subports if IPATH_RUNTIME_MASTER is set */ | ||
317 | __u64 spi_subport_uregbase; | ||
318 | __u64 spi_subport_rcvegrbuf; | ||
319 | __u64 spi_subport_rcvhdr_base; | ||
320 | |||
313 | } __attribute__ ((aligned(8))); | 321 | } __attribute__ ((aligned(8))); |
314 | 322 | ||
315 | 323 | ||
@@ -328,12 +336,12 @@ struct ipath_base_info { | |||
328 | 336 | ||
329 | /* | 337 | /* |
330 | * Minor version differences are always compatible | 338 | * Minor version differences are always compatible |
331 | * a within a major version, however if if user software is larger | 339 | * a within a major version, however if user software is larger |
332 | * than driver software, some new features and/or structure fields | 340 | * than driver software, some new features and/or structure fields |
333 | * may not be implemented; the user code must deal with this if it | 341 | * may not be implemented; the user code must deal with this if it |
334 | * cares, or it must abort after initialization reports the difference | 342 | * cares, or it must abort after initialization reports the difference. |
335 | */ | 343 | */ |
336 | #define IPATH_USER_SWMINOR 2 | 344 | #define IPATH_USER_SWMINOR 3 |
337 | 345 | ||
338 | #define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR<<16) | IPATH_USER_SWMINOR) | 346 | #define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR<<16) | IPATH_USER_SWMINOR) |
339 | 347 | ||
@@ -379,7 +387,16 @@ struct ipath_user_info { | |||
379 | */ | 387 | */ |
380 | __u32 spu_rcvhdrsize; | 388 | __u32 spu_rcvhdrsize; |
381 | 389 | ||
382 | __u64 spu_unused; /* kept for compatible layout */ | 390 | /* |
391 | * If two or more processes wish to share a port, each process | ||
392 | * must set the spu_subport_cnt and spu_subport_id to the same | ||
393 | * values. The only restriction on the spu_subport_id is that | ||
394 | * it be unique for a given node. | ||
395 | */ | ||
396 | __u16 spu_subport_cnt; | ||
397 | __u16 spu_subport_id; | ||
398 | |||
399 | __u32 spu_unused; /* kept for compatible layout */ | ||
383 | 400 | ||
384 | /* | 401 | /* |
385 | * address of struct base_info to write to | 402 | * address of struct base_info to write to |
@@ -398,13 +415,17 @@ struct ipath_user_info { | |||
398 | #define IPATH_CMD_TID_UPDATE 19 /* update expected TID entries */ | 415 | #define IPATH_CMD_TID_UPDATE 19 /* update expected TID entries */ |
399 | #define IPATH_CMD_TID_FREE 20 /* free expected TID entries */ | 416 | #define IPATH_CMD_TID_FREE 20 /* free expected TID entries */ |
400 | #define IPATH_CMD_SET_PART_KEY 21 /* add partition key */ | 417 | #define IPATH_CMD_SET_PART_KEY 21 /* add partition key */ |
418 | #define IPATH_CMD_SLAVE_INFO 22 /* return info on slave processes */ | ||
401 | 419 | ||
402 | #define IPATH_CMD_MAX 21 | 420 | #define IPATH_CMD_MAX 22 |
403 | 421 | ||
404 | struct ipath_port_info { | 422 | struct ipath_port_info { |
405 | __u32 num_active; /* number of active units */ | 423 | __u32 num_active; /* number of active units */ |
406 | __u32 unit; /* unit (chip) assigned to caller */ | 424 | __u32 unit; /* unit (chip) assigned to caller */ |
407 | __u32 port; /* port on unit assigned to caller */ | 425 | __u16 port; /* port on unit assigned to caller */ |
426 | __u16 subport; /* subport on unit assigned to caller */ | ||
427 | __u16 num_ports; /* number of ports available on unit */ | ||
428 | __u16 num_subports; /* number of subport slaves opened on port */ | ||
408 | }; | 429 | }; |
409 | 430 | ||
410 | struct ipath_tid_info { | 431 | struct ipath_tid_info { |
@@ -435,6 +456,8 @@ struct ipath_cmd { | |||
435 | __u32 recv_ctrl; | 456 | __u32 recv_ctrl; |
436 | /* partition key to set */ | 457 | /* partition key to set */ |
437 | __u16 part_key; | 458 | __u16 part_key; |
459 | /* user address of __u32 bitmask of active slaves */ | ||
460 | __u64 slave_mask_addr; | ||
438 | } cmd; | 461 | } cmd; |
439 | }; | 462 | }; |
440 | 463 | ||
@@ -596,6 +619,10 @@ struct infinipath_counters { | |||
596 | 619 | ||
597 | /* K_PktFlags bits */ | 620 | /* K_PktFlags bits */ |
598 | #define INFINIPATH_KPF_INTR 0x1 | 621 | #define INFINIPATH_KPF_INTR 0x1 |
622 | #define INFINIPATH_KPF_SUBPORT_MASK 0x3 | ||
623 | #define INFINIPATH_KPF_SUBPORT_SHIFT 1 | ||
624 | |||
625 | #define INFINIPATH_MAX_SUBPORT 4 | ||
599 | 626 | ||
600 | /* SendPIO per-buffer control */ | 627 | /* SendPIO per-buffer control */ |
601 | #define INFINIPATH_SP_TEST 0x40 | 628 | #define INFINIPATH_SP_TEST 0x40 |
@@ -610,7 +637,7 @@ struct ipath_header { | |||
610 | /* | 637 | /* |
611 | * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset - | 638 | * Version - 4 bits, Port - 4 bits, TID - 10 bits and Offset - |
612 | * 14 bits before ECO change ~28 Dec 03. After that, Vers 4, | 639 | * 14 bits before ECO change ~28 Dec 03. After that, Vers 4, |
613 | * Port 3, TID 11, offset 14. | 640 | * Port 4, TID 11, offset 13. |
614 | */ | 641 | */ |
615 | __le32 ver_port_tid_offset; | 642 | __le32 ver_port_tid_offset; |
616 | __le16 chksum; | 643 | __le16 chksum; |