Skip to content

Avoid manual translation of table names for softnpu #187

@rcgoodfellow

Description

@rcgoodfellow

The softnpu table mapping mechanism uses manually collected table names here:

const SWITCH_ADDR4: &str = "pipe.Ingress.filter.switch_ipv4_addr";
const SWITCH_ADDR6: &str = "pipe.Ingress.filter.switch_ipv6_addr";
const ROUTER4_LOOKUP_RT: &str =
"pipe.Ingress.l3_router.Router4.lookup_idx.route";
const ROUTER4_LOOKUP_IDX: &str =
"pipe.Ingress.l3_router.Router4.lookup_idx.lookup";
const ROUTER6_LOOKUP_RT: &str =
"pipe.Ingress.l3_router.Router6.lookup_idx.route";
const ROUTER6_LOOKUP_IDX: &str =
"pipe.Ingress.l3_router.Router6.lookup_idx.lookup";
const NDP: &str = "pipe.Ingress.l3_router.Router6.Ndp.tbl";
const ARP: &str = "pipe.Ingress.l3_router.Router4.Arp.tbl";
const DPD_MAC_REWRITE: &str = "pipe.Ingress.mac_rewrite.mac_rewrite";
const NAT_INGRESS4: &str = "pipe.Ingress.nat_ingress.ingress_ipv4";
const NAT_INGRESS6: &str = "pipe.Ingress.nat_ingress.ingress_ipv6";
const ATTACHED_SUBNET_INGRESS4: &str =
"pipe.Ingress.attached_subnet_ingress.attached_subnets_v4";
const ATTACHED_SUBNET_INGRESS6: &str =
"pipe.Ingress.attached_subnet_ingress.attached_subnets_v6";

To create a mapping onto sidecar-lite table names. This is highly error prone and just cost me a good chunk of time. The ASIC table names should probably be conditionally compiled for the ASIC being used in places like this

pub const TABLE_NAME: &str = "pipe.Ingress.l3_router.Router4.Arp.tbl";

So we don't have to manually map things.

While the argument can and should be made that sidecar-lite should move toward full emulation of sidecar-proper. We've got new hardware ASICs in the pipeline that may have differing ASIC table names. And until we get to a place where data plane code is completely portable we'll need to deal with these differences in dpd.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions