Skip to content

Commit

Permalink
northd: Add support for Logical Datapath Groups.
Browse files Browse the repository at this point in the history
northd will create only one logical flow with a single logical
datapath group instead of several lflows that differs only by a
datapath column.  We're avoiding creation of datapath groups with
only one datapath to save space.  Old 'logical_datapath' column
used instead.

Feature is disabled.  Configuration option to enable it will be
added in the next commit.

Note: ovn-controller highly depnds on fact that logical flow that
uses multicast group is always received after or in the same update
with the corresponding multicast group.  That will not be the case
with datapath groups.  For that reason northd will not use datapath
groups for such logical flows.

Co-authored-by: Dumitru Ceara <[email protected]>
Signed-off-by: Dumitru Ceara <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Mark Michelson <[email protected]>
Acked-by: Mark Michelson <[email protected]>
  • Loading branch information
2 people authored and putnopvut committed Dec 5, 2020
1 parent 8eb7280 commit bfed224
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 64 deletions.
14 changes: 3 additions & 11 deletions lib/ovn-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,24 +505,16 @@ ovn_is_known_nb_lsp_type(const char *type)
uint32_t
sbrec_logical_flow_hash(const struct sbrec_logical_flow *lf)
{
const struct sbrec_datapath_binding *ld = lf->logical_datapath;
if (!ld) {
return 0;
}

return ovn_logical_flow_hash(&ld->header_.uuid,
lf->table_id, lf->pipeline,
return ovn_logical_flow_hash(lf->table_id, lf->pipeline,
lf->priority, lf->match, lf->actions);
}

uint32_t
ovn_logical_flow_hash(const struct uuid *logical_datapath,
uint8_t table_id, const char *pipeline,
ovn_logical_flow_hash(uint8_t table_id, const char *pipeline,
uint16_t priority,
const char *match, const char *actions)
{
size_t hash = uuid_hash(logical_datapath);
hash = hash_2words((table_id << 16) | priority, hash);
size_t hash = hash_2words((table_id << 16) | priority, 0);
hash = hash_string(pipeline, hash);
hash = hash_string(match, hash);
return hash_string(actions, hash);
Expand Down
3 changes: 1 addition & 2 deletions lib/ovn-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const char *db_table_usage(struct ds *tables,
bool ovn_is_known_nb_lsp_type(const char *type);

uint32_t sbrec_logical_flow_hash(const struct sbrec_logical_flow *);
uint32_t ovn_logical_flow_hash(const struct uuid *logical_datapath,
uint8_t table_id, const char *pipeline,
uint32_t ovn_logical_flow_hash(uint8_t table_id, const char *pipeline,
uint16_t priority,
const char *match, const char *actions);
bool datapath_is_switch(const struct sbrec_datapath_binding *);
Expand Down
Loading

0 comments on commit bfed224

Please sign in to comment.