Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow termination mac entries without VID match #115

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/rofl_ofdpa_fm_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ cofflowmod rofl_ofdpa_fm_driver::enable_tmac_ipv4_unicast_mac(
if (in_port)
fm.set_match().set_in_port(in_port);
fm.set_match().set_eth_type(ETH_P_IP);
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
if (vid)
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
fm.set_match().set_eth_dst(mac);

fm.set_instructions().set_inst_goto_table().set_table_id(
Expand Down Expand Up @@ -442,7 +443,8 @@ cofflowmod rofl_ofdpa_fm_driver::enable_tmac_ipv6_unicast_mac(
if (in_port)
fm.set_match().set_in_port(in_port);
fm.set_match().set_eth_type(ETH_P_IPV6);
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
if (vid)
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
fm.set_match().set_eth_dst(mac);

fm.set_instructions().set_inst_goto_table().set_table_id(
Expand All @@ -460,7 +462,7 @@ cofflowmod rofl_ofdpa_fm_driver::disable_tmac_ipv4_unicast_mac(

cofflowmod fm(ofp_version);

fm.set_command(OFPFC_DELETE);
fm.set_command(OFPFC_DELETE_STRICT);
fm.set_table_id(OFDPA_FLOW_TABLE_ID_TERMINATION_MAC);

fm.set_priority(2);
Expand All @@ -470,7 +472,8 @@ cofflowmod rofl_ofdpa_fm_driver::disable_tmac_ipv4_unicast_mac(
if (in_port)
fm.set_match().set_in_port(in_port);
fm.set_match().set_eth_type(ETH_P_IP);
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
if (vid)
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
fm.set_match().set_eth_dst(mac);

DEBUG_LOG(": return flow-mod:" << std::endl << fm);
Expand All @@ -485,7 +488,7 @@ cofflowmod rofl_ofdpa_fm_driver::disable_tmac_ipv6_unicast_mac(

cofflowmod fm(ofp_version);

fm.set_command(OFPFC_DELETE);
fm.set_command(OFPFC_DELETE_STRICT);
fm.set_table_id(OFDPA_FLOW_TABLE_ID_TERMINATION_MAC);

fm.set_priority(2);
Expand All @@ -495,7 +498,8 @@ cofflowmod rofl_ofdpa_fm_driver::disable_tmac_ipv6_unicast_mac(
if (in_port)
fm.set_match().set_in_port(in_port);
fm.set_match().set_eth_type(ETH_P_IPV6);
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
if (vid)
fm.set_match().set_vlan_vid(vid | OFPVID_PRESENT);
fm.set_match().set_eth_dst(mac);

DEBUG_LOG(": return flow-mod:" << std::endl << fm);
Expand Down