Skip to content

Commit

Permalink
Added Recirculation for PNA_NIC
Browse files Browse the repository at this point in the history
Signed-off-by: Rupesh Chiluka <[email protected]>
  • Loading branch information
rupesh-chiluka-marvell committed Nov 1, 2024
1 parent 28b736c commit 3da4f69
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions targets/pna_nic/pna_nic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ PnaNic::main_thread() {

Deparser *deparser = this->get_deparser("main_deparser");
deparser->deparse(packet.get());

// recirculation
if ((port_t) packet->get_egress_port() == PNA_PORT_RECIRCULATE) {
BMLOG_DEBUG_PKT(*packet, "Recirculating packet");

phv->reset();
phv->reset_header_stacks();
phv->reset_metadata();

phv->get_field("pna_main_parser_input_metadata.input_port")
.set(input_port);
phv->get_field("pna_main_parser_input_metadata.recirculated")
.set(1);

input_buffer.push_front(std::move(packet));
continue;
}

output_buffer.push_front(std::move(packet));
}
}
Expand Down
1 change: 1 addition & 0 deletions targets/pna_nic/pna_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class PnaNic : public Switch {

private:
static packet_id_t packet_id;
static constexpr port_t PNA_PORT_RECIRCULATE = 0xfffffffa;

enum PktInstanceType {
FROM_NET_PORT,
Expand Down

0 comments on commit 3da4f69

Please sign in to comment.