Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 committed Jul 25, 2023
1 parent 4068a6d commit 25475c6
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 100 deletions.
6 changes: 3 additions & 3 deletions dataplane/standalone/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ extern "C" {
#include "inc/sai.h"
}

const std::string contextID = "lucius"
const std::string contextID = "lucius";

// SaiObject is an object and its attributes.
class SaiObject {
// SaiObject is an object and its attributes.
class SaiObject {
public:
sai_object_type_t type;
std::string switch_id;
Expand Down
3 changes: 3 additions & 0 deletions dataplane/standalone/port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sai_status_t Port::create(_In_ uint32_t attr_count,
std::vector<sai_attribute_t> attrs(attr_list, attr_list + attr_count);
std::vector<int> lanes;
std::string name = "eth" + std::to_string(Port::nextIdx);
// TODO(dgrau): Decide on approach for port naming and make static.
Port::nextIdx += 1;
sai_port_type_t type;
for (auto attr : attrs) {
Expand Down Expand Up @@ -175,3 +176,5 @@ std::unordered_map<std::string, std::vector<int>> Port::parseLaneMap() {

std::unordered_map<std::string, std::vector<int>> Port::laneMap =
Port::parseLaneMap();

int Port::nextIdx = 2;
2 changes: 1 addition & 1 deletion dataplane/standalone/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ class Port : public APIBase {
bool portExists;
};

int Port::nextIdx = 2;


#endif // DATAPLANE_STANDALONE_PORT_H_
4 changes: 2 additions & 2 deletions dataplane/standalone/router_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sai_status_t RouterInterface::create(_In_ uint32_t attr_count,
switch (attr.id) {
// TODO(dgrau): Handle vr and mtu.
case SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID:
req.set_vr_id(attr.value.oid);
req.set_vrf_id(attr.value.oid);
break;
case SAI_ROUTER_INTERFACE_ATTR_MTU:
req.set_mtu(attr.value.u32);
Expand All @@ -40,7 +40,7 @@ sai_status_t RouterInterface::create(_In_ uint32_t attr_count,
req.set_port_id(std::to_string(attr.value.oid));
break;
case SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS:
req.set_src_mac(attr.value.mac, sizeof(attr.value.mac));
req.set_mac(attr.value.mac, sizeof(attr.value.mac));
break;
case SAI_ROUTER_INTERFACE_ATTR_TYPE:
type = static_cast<sai_router_interface_type_t>(attr.value.s32);
Expand Down
Loading

0 comments on commit 25475c6

Please sign in to comment.