|
Packit |
857059 |
/* BEGIN_ICS_COPYRIGHT2 ****************************************
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Copyright (c) 2015-2018, Intel Corporation
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
857059 |
modification, are permitted provided that the following conditions are met:
|
|
Packit |
857059 |
|
|
Packit |
857059 |
* Redistributions of source code must retain the above copyright notice,
|
|
Packit |
857059 |
this list of conditions and the following disclaimer.
|
|
Packit |
857059 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit |
857059 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
857059 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
857059 |
* Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
857059 |
may be used to endorse or promote products derived from this software
|
|
Packit |
857059 |
without specific prior written permission.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
857059 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
857059 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
857059 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
857059 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
857059 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
857059 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
857059 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
857059 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
857059 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
** END_ICS_COPYRIGHT2 ****************************************/
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* [ICS VERSION STRING: unknown] */
|
|
Packit |
857059 |
#ifndef _PA_L_H_
|
|
Packit |
857059 |
#define _PA_L_H_
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#include "ib_const.h"
|
|
Packit |
857059 |
#include "stl_types.h"
|
|
Packit |
857059 |
#include "cs_g.h"
|
|
Packit |
857059 |
#include "cs_hashtable.h"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define PA_SRV_MAX_RECORD_SZ 512
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef struct pa_cntxt {
|
|
Packit |
857059 |
uint64_t tstamp ;
|
|
Packit |
857059 |
uint64_t tid ; // Tid for hash table search
|
|
Packit |
857059 |
STL_LID lid ; // Lid for hash table search
|
|
Packit |
857059 |
uint16_t method; // initial method requested by initiator
|
|
Packit |
857059 |
IBhandle_t sendFd; // mai handle to use for sending packets (fd_sa for 1st seg and fd_pa_w threafter)
|
|
Packit |
857059 |
uint8_t hashed ; // Entry is inserted into the hash table
|
|
Packit |
857059 |
uint32_t ref ; // Reference count for the structure
|
|
Packit |
857059 |
uint32_t reqDataLen; // length of the getMulti request MAD
|
|
Packit |
857059 |
char* reqData ; // Data pointer for input getMulti MAD
|
|
Packit |
857059 |
char* data ; // Data pointer for MAD rmpp response
|
|
Packit |
857059 |
uint32_t len ; // Length of the MAD response
|
|
Packit |
857059 |
uint16_t attribLen; // num 8-byte words from start of one attrib to start of next
|
|
Packit |
857059 |
Mai_t mad ;
|
|
Packit |
857059 |
/* 1.1 related fields */
|
|
Packit |
857059 |
uint32_t WF; // Window First: segNum that is first packet in current window
|
|
Packit |
857059 |
uint32_t WL; // Window Last: segNum that is last packet in current window
|
|
Packit |
857059 |
uint32_t NS; // Next segNum to be tranmitted by Sender
|
|
Packit |
857059 |
uint32_t ES; // segNum expected next (Receiver side)
|
|
Packit |
857059 |
uint16_t isDS; // Double sided getMulti in effect
|
|
Packit |
857059 |
uint16_t reqInProg; // receipt of request in progress
|
|
Packit |
857059 |
uint64_t RespTimeout;// current response timeout value (13.6.3.1)
|
|
Packit |
857059 |
uint64_t tTime; // total transaction timeout value (13.6.3.2)
|
|
Packit |
857059 |
uint16_t retries; // retry count
|
|
Packit |
857059 |
uint16_t last_ack; // last segment number acked
|
|
Packit |
857059 |
uint16_t segTotal; // total segments in response
|
|
Packit |
857059 |
struct pa_cntxt *next ; // Link List next pointer
|
|
Packit |
857059 |
struct pa_cntxt *prev ; // Link List prev pointer
|
|
Packit |
857059 |
uint8_t chkSum; // checksum of rmpp response
|
|
Packit |
857059 |
//SACacheEntry_t *cache; // pointer to cache structure if applicable
|
|
Packit |
857059 |
Status_t (*freeDataFunc)(struct pa_cntxt *); // func to call to free data. may
|
|
Packit |
857059 |
// either free locally allocated data, or defer to
|
|
Packit |
857059 |
// the cache mechanism to decref the cache
|
|
Packit |
857059 |
//Status_t (*processFunc)(Mai_t *, struct pa_cntxt *); // function to call
|
|
Packit |
857059 |
// to process the incoming packet.
|
|
Packit |
857059 |
} pa_cntxt_t ;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef enum {
|
|
Packit |
857059 |
ContextAllocated = 1, // new context allocated
|
|
Packit |
857059 |
ContextNotAvailable = 2, // out of context
|
|
Packit |
857059 |
ContextExist = 3, // general duplicate request
|
|
Packit |
857059 |
ContextExistGetMulti = 4 // existing getMult request
|
|
Packit |
857059 |
} PAContextGet_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
extern uint32_t pa_max_cntxt;
|
|
Packit |
857059 |
extern uint32_t pa_data_length;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
extern void pa_delete_filters(void);
|
|
Packit |
857059 |
extern Status_t pa_process_mad(Mai_t *maip, pa_cntxt_t* sa_cntxt);
|
|
Packit |
857059 |
extern pa_cntxt_t * pa_mngr_get_cmd(Mai_t * mad, uint8_t * processMad);
|
|
Packit |
857059 |
extern Status_t pa_mngr_open_cnx(void);
|
|
Packit |
857059 |
extern void pa_mngr_close_cnx(void);
|
|
Packit |
857059 |
extern void pa_main_kill(void);
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#endif // _PA_L_H_
|
|
Packit |
857059 |
|