opennetworkinglab / stratum-onos-demo

Stratum+ONOS demo @ ONF Connect 2019 & EuroP4 '19
Apache License 2.0
13 stars 7 forks source link

Add support for L2 unicast forwarding table in FPM backend #23

Closed ccascone closed 5 years ago

ccascone commented 5 years ago

That matches on eth dst (exact) and sets egress port

  action set_mcast_group_id(bit<16> group_id) {
    standard_metadata.mcast_grp = group_id;
  }

  action set_egress_port(PortNum port) {
    standard_metadata.egress_spec = port;
  }

  table l2_unicast_table {
    key = {
        hdr.ethernet.dst_addr : exact;
    }
    actions = {
        set_egress_port;
    }
  }

  @switchstack("pipeline_stage: INGRESS_ACL")
  table l2_broadcast_table {
    key = {
      // hdr.ethernet.src_addr : ternary;
      hdr.ethernet.dst_addr : exact;
      // hdr.ethernet.ether_type : exact;
    }
    actions = {
      set_mcast_group_id;
    }
  }

  apply {
    if (!l2_broadcast_table.apply().hit) {
        l2_unicast_table.apply();
    }
  }
ccascone commented 5 years ago

@Yi-Tseng can this be closed? I understand we now have stable support for static L2 entries since you fixed the initialization phase.

ccascone commented 5 years ago

Done