Skip to content

Commit

Permalink
New action format
Browse files Browse the repository at this point in the history
  • Loading branch information
carlverge committed Mar 1, 2013
1 parent deb63b9 commit 0eb4d10
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions gao_mmio_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#else
#include <stdint.h>
#include <sys/socket.h>
#include <net/if.h>
#endif
#include "gao_log.h"
Expand Down Expand Up @@ -159,28 +160,42 @@ struct gao_descriptor_ring_header {
#define GAO_QUEUE(BASE, INDEX) ((struct gao_user_queue*)(((uint64_t)BASE) + (INDEX * GAO_MAX_QUEUE_SIZE_BYTES)))
#endif

#define GAO_INVALID_ACTION_MASK (~(0x00077F01))


typedef enum gao_action_id_t {
GAO_ACTION_DROP = 0,
GAO_ACTION_FORWARD,
struct gao_descriptor_context {
uint64_t resv;
};

typedef enum gao_action_id {
GAO_NEW_ACTION_DROP = 0,
GAO_NEW_ACTION_FWD = 1,
GAO_NEW_ACTION_MCAST = 2,
GAO_NEW_ACTION_SLOWPATH = 3,
} gao_action_id_t;

#define GAO_INVALID_ACTION_MASK (~(0x00077F01))
struct gao_action {
uint8_t action_id;
uint8_t new_offset;
uint16_t new_len;

struct gao_action {
union {
struct {
uint8_t action_id;
uint8_t port_id;
uint8_t queue_id;
uint8_t padding;
};
uint32_t action;
uint8_t dport;
uint8_t dqueue;
uint16_t resv;
}fwd;
struct {
uint32_t group_id;
}mcast;
struct {
uint32_t resv;
}slow;
};

struct gao_descriptor_context desc_ctx;
};


typedef enum gao_port_type_t {
GAO_PORT_PHYSICAL = 0,
GAO_PORT_CONTROLLER,
Expand Down Expand Up @@ -450,7 +465,9 @@ struct gao_resources {

struct gao_context {
void* mmap_addr; //The base address of the mmap area
size_t mmap_size; //The base address of the mmap area
unsigned long offset; //Used for calculating descriptor addresses
unsigned long raw_offset; //Used for calculating descriptor addresses
int fd; //Used for control
};

Expand Down

0 comments on commit 0eb4d10

Please sign in to comment.