wireshark/epan/dissectors/packet-infiniband.h

141 lines
5.8 KiB
C
Raw Normal View History

/* packet-infiniband.h
* Routines for Infiniband/ERF Dissection
* Copyright 2008 Endace Technology Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Modified 2010 by Mellanox Technologies Ltd.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __PACKET_INFINIBAND_H_
#define __PACKET_INFINIBAND_H_
#define MAD_DATA_SIZE 232 /* size of data field a MAD payload carries */
#define GID_SIZE 16 /* size of GID = 128bit (same as IPv6) */
/* infiniband-specific information for conversations */
typedef struct {
guint64 service_id; /* service id specified when the (RC) channel was set-up */
packet-infiniband: Fixed IP based connections & other minor fixes 1. Fixed setting right address type instead of AT_IB for RoCE and RRoCE depending on address type given by pinfo where address type would be IPv4 or IPV6. Fail to do so was resulting into infiniband dissector adding conversation info based on AT_IB type vs payload dissectors dissecting based on pinfo. Fixing this allows to add/search based on right address type. (Tested for Infiniband and RRoCE) 2. Added support to pass already parsed CM attribute id from infiniand to other mad private data dissectors so that right dissection of private data can be done based on CM attribute id (message type). Moved CM attribute id definitions to header file so that private data dissectors based on CM attribute id can reuse these values without duplicate defines. (Tested for Infiniband and RRoCE) 3. Added direction client to server/server to client, (active/passive) to conversation_data for payload dissectors which cannot dissect only based on payload content without knowing the direction. (Tested for RRoCE) 4. Fixed IP CM to claim all 92 bytes of private data (including consumer private data), instead of just 36 bytes of header because its part of IP CM private data. (Tested for Infiniband and RRoCE) 5. Fixed MAD header to claim all 232 (256-24) bytes of data as it belongs to it in the tree. (Tested for Infiniband and RRoCE) 6. Fixed getting ip version by performing AND operation first to extract IP version field. (Tested for RRoCE-IPV4 and Infiniband) Change-Id: I37daca6a089784b61c25e10cdc8f3cf028ca8c58 Tested-by: paravpandit@yahoo.com Reviewed-on: https://code.wireshark.org/review/18573 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-30 08:20:48 +00:00
gboolean client_to_server; /* message direction */
2016-11-29 03:40:55 +00:00
guint32 src_qp; /* originator src qp as this is not present in RC packets */
/* store mad data so that it can be parsed for private data by ULP */
guint8 mad_private_data[MAD_DATA_SIZE];
} conversation_infiniband_data;
/* OpCodeValues
* Code Bits [7-5] Connection Type
* [4-0] Message Type
* Reliable Connection (RC)
* [7-5] = 000 */
#define RC_SEND_FIRST 0 /*0x00000000 */
#define RC_SEND_MIDDLE 1 /*0x00000001 */
#define RC_SEND_LAST 2 /*0x00000010 */
#define RC_SEND_LAST_IMM 3 /*0x00000011 */
#define RC_SEND_ONLY 4 /*0x00000100 */
#define RC_SEND_ONLY_IMM 5 /*0x00000101 */
#define RC_RDMA_WRITE_FIRST 6 /*0x00000110 */
#define RC_RDMA_WRITE_MIDDLE 7 /*0x00000111 */
#define RC_RDMA_WRITE_LAST 8 /*0x00001000 */
#define RC_RDMA_WRITE_LAST_IMM 9 /*0x00001001 */
#define RC_RDMA_WRITE_ONLY 10 /*0x00001010 */
#define RC_RDMA_WRITE_ONLY_IMM 11 /*0x00001011 */
#define RC_RDMA_READ_REQUEST 12 /*0x00001100 */
#define RC_RDMA_READ_RESPONSE_FIRST 13 /*0x00001101 */
#define RC_RDMA_READ_RESPONSE_MIDDLE 14 /*0x00001110 */
#define RC_RDMA_READ_RESPONSE_LAST 15 /*0x00001111 */
#define RC_RDMA_READ_RESPONSE_ONLY 16 /*0x00010000 */
#define RC_ACKNOWLEDGE 17 /*0x00010001 */
#define RC_ATOMIC_ACKNOWLEDGE 18 /*0x00010010 */
#define RC_CMP_SWAP 19 /*0x00010011 */
#define RC_FETCH_ADD 20 /*0x00010100 */
#define RC_SEND_LAST_INVAL 22 /*0x00010110 */
#define RC_SEND_ONLY_INVAL 23 /*0x00010111 */
/* Reliable Datagram (RD)
* [7-5] = 010 */
#define RD_SEND_FIRST 64 /*0x01000000 */
#define RD_SEND_MIDDLE 65 /*0x01000001 */
#define RD_SEND_LAST 66 /*0x01000010 */
#define RD_SEND_LAST_IMM 67 /*0x01000011 */
#define RD_SEND_ONLY 68 /*0x01000100 */
#define RD_SEND_ONLY_IMM 69 /*0x01000101 */
#define RD_RDMA_WRITE_FIRST 70 /*0x01000110 */
#define RD_RDMA_WRITE_MIDDLE 71 /*0x01000111 */
#define RD_RDMA_WRITE_LAST 72 /*0x01001000 */
#define RD_RDMA_WRITE_LAST_IMM 73 /*0x01001001 */
#define RD_RDMA_WRITE_ONLY 74 /*0x01001010 */
#define RD_RDMA_WRITE_ONLY_IMM 75 /*0x01001011 */
#define RD_RDMA_READ_REQUEST 76 /*0x01001100 */
#define RD_RDMA_READ_RESPONSE_FIRST 77 /*0x01001101 */
#define RD_RDMA_READ_RESPONSE_MIDDLE 78 /*0x01001110 */
#define RD_RDMA_READ_RESPONSE_LAST 79 /*0x01001111 */
#define RD_RDMA_READ_RESPONSE_ONLY 80 /*0x01010000 */
#define RD_ACKNOWLEDGE 81 /*0x01010001 */
#define RD_ATOMIC_ACKNOWLEDGE 82 /*0x01010010 */
#define RD_CMP_SWAP 83 /*0x01010011 */
#define RD_FETCH_ADD 84 /*0x01010100 */
#define RD_RESYNC 85 /*0x01010101 */
/* Unreliable Datagram (UD)
* [7-5] = 011 */
#define UD_SEND_ONLY 100 /*0x01100100 */
#define UD_SEND_ONLY_IMM 101 /*0x01100101 */
/* Unreliable Connection (UC)
* [7-5] = 001 */
#define UC_SEND_FIRST 32 /*0x00100000 */
#define UC_SEND_MIDDLE 33 /*0x00100001 */
#define UC_SEND_LAST 34 /*0x00100010 */
#define UC_SEND_LAST_IMM 35 /*0x00100011 */
#define UC_SEND_ONLY 36 /*0x00100100 */
#define UC_SEND_ONLY_IMM 37 /*0x00100101 */
#define UC_RDMA_WRITE_FIRST 38 /*0x00100110 */
#define UC_RDMA_WRITE_MIDDLE 39 /*0x00100111 */
#define UC_RDMA_WRITE_LAST 40 /*0x00101000 */
#define UC_RDMA_WRITE_LAST_IMM 41 /*0x00101001 */
#define UC_RDMA_WRITE_ONLY 42 /*0x00101010 */
#define UC_RDMA_WRITE_ONLY_IMM 43 /*0x00101011 */
packet-infiniband: Fixed IP based connections & other minor fixes 1. Fixed setting right address type instead of AT_IB for RoCE and RRoCE depending on address type given by pinfo where address type would be IPv4 or IPV6. Fail to do so was resulting into infiniband dissector adding conversation info based on AT_IB type vs payload dissectors dissecting based on pinfo. Fixing this allows to add/search based on right address type. (Tested for Infiniband and RRoCE) 2. Added support to pass already parsed CM attribute id from infiniand to other mad private data dissectors so that right dissection of private data can be done based on CM attribute id (message type). Moved CM attribute id definitions to header file so that private data dissectors based on CM attribute id can reuse these values without duplicate defines. (Tested for Infiniband and RRoCE) 3. Added direction client to server/server to client, (active/passive) to conversation_data for payload dissectors which cannot dissect only based on payload content without knowing the direction. (Tested for RRoCE) 4. Fixed IP CM to claim all 92 bytes of private data (including consumer private data), instead of just 36 bytes of header because its part of IP CM private data. (Tested for Infiniband and RRoCE) 5. Fixed MAD header to claim all 232 (256-24) bytes of data as it belongs to it in the tree. (Tested for Infiniband and RRoCE) 6. Fixed getting ip version by performing AND operation first to extract IP version field. (Tested for RRoCE-IPV4 and Infiniband) Change-Id: I37daca6a089784b61c25e10cdc8f3cf028ca8c58 Tested-by: paravpandit@yahoo.com Reviewed-on: https://code.wireshark.org/review/18573 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-30 08:20:48 +00:00
/* ComMgt class Attributes */
#define ATTR_CM_REQ 0x0010
#define ATTR_CM_REJ 0x0012
#define ATTR_CM_REP 0x0013
#define ATTR_CM_RTU 0x0014
#define ATTR_CM_DREQ 0x0015
#define ATTR_CM_DRSP 0x0016
/*
* Private data passed from the infiniband dissector to payload subdissectors.
*/
struct infinibandinfo {
proto_tree* payload_tree;
guint8 opCode; /* OpCode from BTH header. */
guint8 pad_count; /* PadCount from BTH header. */
packet-infiniband: Fixed IP based connections & other minor fixes 1. Fixed setting right address type instead of AT_IB for RoCE and RRoCE depending on address type given by pinfo where address type would be IPv4 or IPV6. Fail to do so was resulting into infiniband dissector adding conversation info based on AT_IB type vs payload dissectors dissecting based on pinfo. Fixing this allows to add/search based on right address type. (Tested for Infiniband and RRoCE) 2. Added support to pass already parsed CM attribute id from infiniand to other mad private data dissectors so that right dissection of private data can be done based on CM attribute id (message type). Moved CM attribute id definitions to header file so that private data dissectors based on CM attribute id can reuse these values without duplicate defines. (Tested for Infiniband and RRoCE) 3. Added direction client to server/server to client, (active/passive) to conversation_data for payload dissectors which cannot dissect only based on payload content without knowing the direction. (Tested for RRoCE) 4. Fixed IP CM to claim all 92 bytes of private data (including consumer private data), instead of just 36 bytes of header because its part of IP CM private data. (Tested for Infiniband and RRoCE) 5. Fixed MAD header to claim all 232 (256-24) bytes of data as it belongs to it in the tree. (Tested for Infiniband and RRoCE) 6. Fixed getting ip version by performing AND operation first to extract IP version field. (Tested for RRoCE-IPV4 and Infiniband) Change-Id: I37daca6a089784b61c25e10cdc8f3cf028ca8c58 Tested-by: paravpandit@yahoo.com Reviewed-on: https://code.wireshark.org/review/18573 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-30 08:20:48 +00:00
guint16 cm_attribute_id; /* attribute id for CM messages */
guint32 reth_remote_key; /* Remote Key from RETH header */
guint64 reth_remote_address;/* Remote address from RETH header */
guint32 reth_dma_length; /* DMA Length from RETH header */
guint32 packet_seq_num; /* Packet sequence number */
gboolean dctConnect; /* indicator for DCT connect/disconnect */
};
#endif
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/