Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infiniband soft_RoCE implement #1603

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
64cbd61
add infinibandlayer rxe for pcapp
FlashBarryAllen Sep 10, 2024
9f6016f
add bth definiction
FlashBarryAllen Sep 10, 2024
bb61530
Merge branch 'dev' into master
FlashBarryAllen Oct 4, 2024
3a7dfaf
fix C-cast and add override to code
FlashBarryAllen Oct 4, 2024
05333c8
fix pre-commit errors
FlashBarryAllen Oct 4, 2024
008eab7
fix macro and coding style
FlashBarryAllen Oct 5, 2024
86d3a58
IB toString use more efficient style
FlashBarryAllen Oct 5, 2024
5cbc3f9
IB coding style fix
FlashBarryAllen Oct 5, 2024
b6f3c04
add documentation of IB
FlashBarryAllen Oct 13, 2024
b7a2a74
add IB creation test case
FlashBarryAllen Oct 13, 2024
5d2402e
Merge branch 'dev' into master
FlashBarryAllen Oct 13, 2024
9579f68
fix IB code format
FlashBarryAllen Oct 14, 2024
33308c1
Merge branch 'dev' into master
FlashBarryAllen Oct 14, 2024
342367e
doxygen fix
FlashBarryAllen Oct 15, 2024
d9aaee5
Merge branch 'master' of github.com:FlashBarryAllen/PcapPlusPlus
FlashBarryAllen Oct 15, 2024
254231f
Merge branch 'dev' into master
FlashBarryAllen Oct 19, 2024
09a9e92
IB code style fix
FlashBarryAllen Oct 19, 2024
451aa5c
Merge branch 'master' of github.com:FlashBarryAllen/PcapPlusPlus
FlashBarryAllen Oct 19, 2024
1f0935e
Merge branch 'dev' into master
FlashBarryAllen Oct 22, 2024
0623403
Merge branch 'dev' into master
FlashBarryAllen Oct 26, 2024
8a05842
IB add pcap
FlashBarryAllen Oct 26, 2024
4a02168
Merge branch 'dev' into master
FlashBarryAllen Nov 3, 2024
e2d8f04
fix IB argument type
FlashBarryAllen Nov 3, 2024
dd63809
Merge branch 'master' of github.com:FlashBarryAllen/PcapPlusPlus
FlashBarryAllen Nov 3, 2024
6db4619
Merge branch 'dev' into master
FlashBarryAllen Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix IB code format
FlashBarryAllen committed Oct 14, 2024
commit 9579f68f639315c33203c54d7fc25ff0a6d5b783
41 changes: 21 additions & 20 deletions Packet++/header/InfiniBandLayer.h
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ namespace pcpp
* @param[in] se The solicited event
* @param[in] mig The migration state
* @param[in] pad The pad count
* @param[in] pkey The parition key
* @param[in] pkey The partition key
* @param[in] qpn The destination queue pair (QP) number
* @param[in] ack_req The acknowledgment request
* @param[in] psn The packet sequence number
@@ -101,9 +101,9 @@ namespace pcpp
return reinterpret_cast<rxe_bth*>(m_Data);
}

/**
* @return The operation code which defines the interpretation of the remaining header and payload bytes
*/
/**
* @return The operation code which defines the interpretation of the remaining header and payload bytes
*/
uint8_t getOpcode() const;

/**
@@ -118,8 +118,8 @@ namespace pcpp
uint8_t getSe() const;

/**
* Set solicited evnet
* @param[in] se The solicited evnet to set
* Set solicited event
* @param[in] se The solicited event to set
*/
void setSe(int se) const;

@@ -130,21 +130,22 @@ namespace pcpp

/**
* Set migreq
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto: What is migreq?

* @param[in] mig The migration state to set. If set to one, indicates the connection or EE context has been migrated;
* if set to zero, it means there is no change in the current migration state.
* @param[in] mig The migration state to set. If set to one, indicates the connection or EE context has been
* migrated; if set to zero, it means there is no change in the current migration state.
*/
void setMig(uint8_t mig) const;

/**
* @return PadCount which Packet payloads are sent as a multiple of 4-byte quantities.
* @return PadCount which Packet payloads are sent as a multiple of 4-byte quantities.
* Pad count indicates the number of pad bytes - 0 to 3 - that are appended to the packetpayload.
* Pads are used to “stretch” the payload (payloads may be zero or more bytes in length) to be a multiple of 4 bytes
* Pads are used to “stretch” the payload (payloads may be zero or more bytes in length) to be a multiple of 4
* bytes
*/
uint8_t getPad() const;

/**
* Set PadCount
* @param[in] pad The PadCount to set
* @param[in] pad The PadCount to set
*/
void setPad(uint8_t pad) const;

@@ -160,14 +161,14 @@ namespace pcpp
void setTver(uint8_t tver) const;

/**
* @return parition key identifing the partition
* @return partition key identifying the partition
* that the destination QP (RC, UC, UD, XRC) or EE Context (RD) is a member.
*/
uint16_t getPkey() const;

/**
* Set parition key
* @param[in] pkey The parition key to set
* Set partition key
* @param[in] pkey The partition key to set
*/
void setPkey(uint16_t pkey) const;

@@ -184,7 +185,7 @@ namespace pcpp

/**
* @return FECN
* F (FECN): 0 indicates that a FECN indication was not received.
* F (FECN): 0 indicates that a FECN indication was not received.
* 1 indicates that the packet went through a point of congestion
*/
int getFecn() const;
@@ -211,7 +212,7 @@ namespace pcpp
void setbecn(int becn) const;

/**
* @return Reserved (variant) - 6 bits. Transmitted as 0, ignored on receive.
* @return Reserved (variant) - 6 bits. Transmitted as 0, ignored on receive.
*/
uint8_t getResv6a() const;

@@ -232,13 +233,13 @@ namespace pcpp
void setAck(int ack) const;

/**
* Transmitted as 0, ignored on receive.
* Transmitted as 0, ignored on receive.
*/
void setResv7() const;

/**
* @return packet sequence number that is used to identify the position of a packet
* within a sequence of packets.
* @return packet sequence number that is used to identify the position of a packet
* within a sequence of packets.
*/
uint32_t getPsn() const;

@@ -275,7 +276,7 @@ namespace pcpp

/**
* A static method that check whether is inifiniband RoCE port
* @param[in] port The port from UDP destionation port
* @param[in] port The port from UDP destination port
* @return True if the port is inifiniband RoCE and can represent an rxe packet
*/
static inline bool isInfiniBandPort(uint16_t port)
4 changes: 2 additions & 2 deletions Packet++/src/InfiniBandLayer.cpp
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ namespace pcpp
ss << "InfiniBand Layer, Opcode: " << getOpcode();
return ss.str();
}

uint8_t InfiniBandLayer::getOpcode() const
{
return getBthHeader()->opcode;
@@ -197,4 +197,4 @@ namespace pcpp

getBthHeader()->apsn = htobe32((BTH_PSN_MASK & psn) | (~BTH_PSN_MASK & apsn));
}
} // namespace pcpp
} // namespace pcpp
2 changes: 1 addition & 1 deletion Tests/Packet++Test/Tests/InfiniBandTests.cpp
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add InfiniBandEditTest to test all of the setter methods

Original file line number Diff line number Diff line change
@@ -142,4 +142,4 @@ PTF_TEST_CASE(InfiniBandCreationTest)
PTF_ASSERT_EQUAL(infinibandLayer1.getAck(), 1);
PTF_ASSERT_EQUAL(infinibandLayer1.getPsn(), 5557091);

} // InfiniBandCreationTest
} // InfiniBandCreationTest