Skip to content

Commit

Permalink
Merge remote-tracking branch 'public/master' into update-from-public
Browse files Browse the repository at this point in the history
Conflicts:
	modules/OVSDriver/module/src/groups.c
	modules/ivs/module/inc/ivs/ivs.h
  • Loading branch information
rlane committed Feb 10, 2014
2 parents 53688ba + 97aa969 commit 4874b58
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
6 changes: 0 additions & 6 deletions modules/OVSDriver/module/inc/OVSDriver/ovsdriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,4 @@ void ind_ovs_finish(void);

indigo_error_t ind_ovs_tunnel_init(void);

/*
* Exported from OVSDriver for use by the pipeline
*/
struct ind_ovs_flow_effects *ind_ovs_fwd_pipeline_lookup(int table_id, struct ind_ovs_cfr *cfr, struct xbuf *stats);


#endif
20 changes: 16 additions & 4 deletions modules/OVSDriver/module/src/groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ indigo_fwd_group_add(uint32_t id, uint8_t group_type, of_list_bucket_t *of_bucke
struct ind_ovs_group_bucket *buckets;
uint16_t num_buckets;

if (group_type != OF_GROUP_TYPE_SELECT) {
return INDIGO_ERROR_NOT_SUPPORTED;
}

/* TODO validate */

err = translate_buckets(of_buckets, &buckets, &num_buckets);
Expand Down Expand Up @@ -216,6 +212,22 @@ ind_ovs_group_select(uint32_t id, uint32_t hash, struct xbuf **actions)
return INDIGO_ERROR_NONE;
}

indigo_error_t
ind_ovs_group_indirect(uint32_t id, struct xbuf **actions)
{
struct ind_ovs_group *group = ind_ovs_group_lookup(id);
if (group == NULL) {
return INDIGO_ERROR_NOT_FOUND;
} else if (group->type != OF_GROUP_TYPE_INDIRECT) {
return INDIGO_ERROR_COMPAT;
} else if (group->num_buckets == 0) {
return INDIGO_ERROR_NOT_FOUND;
}

*actions = &group->buckets[0].actions;
return INDIGO_ERROR_NONE;
}

void
ind_ovs_group_module_init(void)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/OVSDriver/module/src/ovs_driver_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#define IND_OVS_MAX_PORTS 1024

#define IND_OVS_NUM_TABLES 16
#define IND_OVS_NUM_TABLES 32

/*
* Special pre-created ports.
Expand Down
2 changes: 2 additions & 0 deletions modules/ivs/module/inc/ivs/ivs.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,7 @@ AIM_STATIC_ASSERT(CFR_SIZE, sizeof(struct ind_ovs_cfr) == 13*8);
* Exported from OVSDriver for use by the pipeline
*/
struct ind_ovs_flow_effects *ind_ovs_fwd_pipeline_lookup(int table_id, struct ind_ovs_cfr *cfr, struct xbuf *stats);
indigo_error_t ind_ovs_group_select(uint32_t id, uint32_t hash, struct xbuf **actions);
indigo_error_t ind_ovs_group_indirect(uint32_t id, struct xbuf **actions);

#endif
2 changes: 1 addition & 1 deletion modules/pipeline_bvs/module/src/pipeline_bvs_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include <stdlib.h>
#include <arpa/inet.h>

#include <indigo/error.h>
#include <xbuf/xbuf.h>
#include <ivs/ivs.h>
#include <ivs/actions.h>
#include <loci/loci.h>
#include <indigo/error.h>
#include <pipeline/pipeline.h>

#define UNUSED __attribute__((unused))
Expand Down
6 changes: 3 additions & 3 deletions targets/ivs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ parse_options(int argc, char **argv)

case OPT_PIPELINE:
pipeline = optarg ? optarg : "experimental";
AIM_LOG_MSG("Setting forwarding pipeline to '%s'", pipeline);
break;

case 'h':
Expand Down Expand Up @@ -409,14 +408,15 @@ aim_main(int argc, char* argv[])

if (pipeline == NULL) {
if (openflow_version == NULL || !strcmp(openflow_version, "1.0")) {
AIM_TRUE_OR_DIE(pipeline_set("standard-1.0") == 0);
pipeline = "standard-1.0";
} else if (!strcmp(openflow_version, "1.3")) {
AIM_TRUE_OR_DIE(pipeline_set("standard-1.3") == 0);
pipeline = "standard-1.3";
} else {
AIM_DIE("unexpected OpenFlow version");
}
}

AIM_LOG_INFO("Initializing forwarding pipeline '%s'", pipeline);
indigo_error_t rv = pipeline_set(pipeline);
if (rv < 0) {
AIM_LOG_FATAL("Failed to set pipeline: %s", indigo_strerror(rv));
Expand Down

0 comments on commit 4874b58

Please sign in to comment.