Skip to content

Commit

Permalink
Reserve the first slot to redirect L2 flows to queue 0
Browse files Browse the repository at this point in the history
  • Loading branch information
xguerin committed Nov 28, 2023
1 parent 709a56b commit f1852a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/transport/ena/Port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,14 @@ Port::setupReceiveSideScaling(struct rte_eth_dev_info const& dev_info,
*/
hlen = ENA_LEGACY_HASH_KEY_LEN;
hkey = new uint8_t[hlen];
memcpy(hkey, ENA_LEGACY_HASH_KEY, hlen);
/*
* Copy the legacy key by flipping it:
*
* https://github.com/amzn/amzn-drivers/issues/267#issuecomment-1566119986
*/
for (size_t i = 0; i < ENA_LEGACY_HASH_KEY_LEN; i += 1) {
hkey[i] = ENA_LEGACY_HASH_KEY[ENA_LEGACY_HASH_KEY_LEN - i];
}
}
/*
* Allocate the redirection table.
Expand Down
1 change: 1 addition & 0 deletions src/transport/ena/RawProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <tulips/stack/Ethernet.h>
#include <tulips/system/SpinLock.h>
#include <tulips/transport/ena/RawProcessor.h>
#include <iostream>
#include <mutex>
#include <netinet/in.h>

Expand Down
7 changes: 4 additions & 3 deletions src/transport/ena/RedirectionTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ RedirectionTable::RedirectionTable(const uint16_t portid, const size_t nqus,
}
/*
* Partition the RETA.
*
* NOTE(xrg): we don't allocate any slot for queue 0 as its sole purpose it to
* handle L2 messages.
*/
for (size_t i = 0; i < nqus - 1; i += 1) {
for (size_t j = 0; j < partlen; j += 1) {
Expand All @@ -45,6 +42,10 @@ RedirectionTable::RedirectionTable(const uint16_t portid, const size_t nqus,
auto eidx = i & 0x3F;
m_table[slot].reta[eidx] = nqus - 1;
}
/*
* Reserve the first slot to redirect L2 flows to queue 0.
*/
m_table[0].reta[0] = 0;
/*
* Update the RETA.
*/
Expand Down

0 comments on commit f1852a4

Please sign in to comment.