Skip to content

Commit fb43dc8

Browse files
committed
[Fix] Correct cid field type to uint16_t to match protocol spec
## Purpose Fix cid field type mismatch with protocol specification ## Modifications * Change cid from uint32_t to uint16_t in all Request classes (7 classes) * Update test cases to use uint16_t for kCid constants * Protocol spec defines CID as 16 bits [31:16] in Dword 0 ## Test All 11 unit tests passed (7 SQE + 4 link protocol)
1 parent 877946d commit fb43dc8

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

ucm/transport/kv/asu/test/case/sqe_pack_test.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SqePackTest : public ::testing::Test {
3838
TEST_F(SqePackTest, StoreSqePackMatchesProtocol)
3939
{
4040
// Test values
41-
constexpr std::uint32_t kCid = 0x1234;
41+
constexpr std::uint16_t kCid = 0x1234;
4242
constexpr std::uint32_t kKvNsId = 0x0001;
4343
constexpr std::uint8_t kDtype = 0x1; // 3 bits [15:13]
4444
constexpr std::uint8_t kDspec = 0x05; // 5 bits [12:8]
@@ -117,7 +117,7 @@ TEST_F(SqePackTest, StoreSqePackMatchesProtocol)
117117

118118
TEST_F(SqePackTest, RetrieveSqePackMatchesProtocol)
119119
{
120-
constexpr std::uint32_t kCid = 0x5678;
120+
constexpr std::uint16_t kCid = 0x5678;
121121
constexpr std::uint32_t kKvNsId = 0x0002;
122122
constexpr std::uint64_t kBufferAddr = 0x0000FEDCBA987654ULL;
123123
constexpr std::uint32_t kBufferLength = 0x00020000; // 128KB
@@ -162,7 +162,7 @@ TEST_F(SqePackTest, RetrieveSqePackMatchesProtocol)
162162

163163
TEST_F(SqePackTest, BatchStoreSqePackMatchesProtocol)
164164
{
165-
constexpr std::uint32_t kCid = 0xABCD;
165+
constexpr std::uint16_t kCid = 0xABCD;
166166
constexpr std::uint32_t kKvNsId = 0x0003;
167167
constexpr std::uint8_t kDtype = 0x2;
168168
constexpr std::uint8_t kDspec = 0x0A;
@@ -241,7 +241,7 @@ TEST_F(SqePackTest, BatchStoreSqePackMatchesProtocol)
241241

242242
TEST_F(SqePackTest, BatchRetrieveSqePackMatchesProtocol)
243243
{
244-
constexpr std::uint32_t kCid = 0x1111;
244+
constexpr std::uint16_t kCid = 0x1111;
245245
constexpr std::uint32_t kKvNsId = 0x0004;
246246
constexpr std::uint64_t kRespBufferAddr = 0x0000444455556666ULL;
247247
constexpr std::uint32_t kRespMrKey = 0x88888888;
@@ -295,7 +295,7 @@ TEST_F(SqePackTest, BatchRetrieveSqePackMatchesProtocol)
295295

296296
TEST_F(SqePackTest, DeleteSqePackMatchesProtocol)
297297
{
298-
constexpr std::uint32_t kCid = 0x2222;
298+
constexpr std::uint16_t kCid = 0x2222;
299299
constexpr std::uint32_t kKvNsId = 0x0005;
300300
constexpr std::uint64_t kRespBufferAddr = 0x0000AAAA0000BBBBULL;
301301
constexpr std::uint32_t kRespMrKey = 0x77777777;
@@ -337,7 +337,7 @@ TEST_F(SqePackTest, DeleteSqePackMatchesProtocol)
337337

338338
TEST_F(SqePackTest, ExistSqePackMatchesProtocol)
339339
{
340-
constexpr std::uint32_t kCid = 0x3333;
340+
constexpr std::uint16_t kCid = 0x3333;
341341
constexpr std::uint32_t kKvNsId = 0x0006;
342342
constexpr std::uint64_t kRespBufferAddr = 0x0000CCCC0000DDDDULL;
343343
constexpr std::uint32_t kRespMrKey = 0x66666666;
@@ -379,7 +379,7 @@ TEST_F(SqePackTest, ExistSqePackMatchesProtocol)
379379

380380
TEST_F(SqePackTest, KeepAliveSqePackMatchesProtocol)
381381
{
382-
constexpr std::uint32_t kCid = 0x4444;
382+
constexpr std::uint16_t kCid = 0x4444;
383383
constexpr std::uint64_t kRespBufferAddr = 0x0000EEEE0000FFFFULL;
384384
constexpr std::uint32_t kRespMrKey = 0x55555555;
385385
constexpr bool kRflag = true;

ucm/transport/kv/asu/trans/src/sqe.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SqeRequest {
6161

6262
class KvStoreRequest : public SqeRequest {
6363
public:
64-
std::uint32_t cid{0};
64+
std::uint16_t cid{0};
6565
std::uint32_t kv_ns_id{0};
6666
std::uint8_t dtype{0};
6767
std::uint8_t dspec{0};
@@ -76,7 +76,7 @@ class KvStoreRequest : public SqeRequest {
7676

7777
class KvRetrieveRequest : public SqeRequest {
7878
public:
79-
std::uint32_t cid{0};
79+
std::uint16_t cid{0};
8080
std::uint32_t kv_ns_id{0};
8181
std::uint64_t buffer_addr{0};
8282
std::uint32_t buffer_length{0};
@@ -98,7 +98,7 @@ class KvBatchStoreEntry {
9898

9999
class KvBatchStoreRequest : public SqeRequest {
100100
public:
101-
std::uint32_t cid{0};
101+
std::uint16_t cid{0};
102102
std::uint32_t kv_ns_id{0};
103103
std::uint8_t dtype{0};
104104
std::uint8_t dspec{0};
@@ -121,7 +121,7 @@ class KvBatchRetrieveEntry {
121121

122122
class KvBatchRetrieveRequest : public SqeRequest {
123123
public:
124-
std::uint32_t cid{0};
124+
std::uint16_t cid{0};
125125
std::uint32_t kv_ns_id{0};
126126
std::uint64_t response_buffer_addr{0};
127127
std::uint32_t response_mr_key{0};
@@ -133,7 +133,7 @@ class KvBatchRetrieveRequest : public SqeRequest {
133133

134134
class KvDeleteRequest : public SqeRequest {
135135
public:
136-
std::uint32_t cid{0};
136+
std::uint16_t cid{0};
137137
std::uint32_t kv_ns_id{0};
138138
std::uint64_t response_buffer_addr{0};
139139
std::uint32_t response_mr_key{0};
@@ -144,7 +144,7 @@ class KvDeleteRequest : public SqeRequest {
144144

145145
class KvExistRequest : public SqeRequest {
146146
public:
147-
std::uint32_t cid{0};
147+
std::uint16_t cid{0};
148148
std::uint32_t kv_ns_id{0};
149149
std::uint64_t response_buffer_addr{0};
150150
std::uint32_t response_mr_key{0};
@@ -156,7 +156,7 @@ class KvExistRequest : public SqeRequest {
156156

157157
class KvKeepAliveRequest : public SqeRequest {
158158
public:
159-
std::uint32_t cid{0};
159+
std::uint16_t cid{0};
160160
std::uint64_t response_buffer_addr{0};
161161
std::uint32_t response_mr_key{0};
162162
bool rflag{false};

0 commit comments

Comments
 (0)