Cosmetic changes
This commit is contained in:
1 parent
83fa636860
commit
7b0c7e50c7
5 files changed
+40
-48
No files matched your search
@@ -68,7 +68,7 @@ static int tmpl_modify_flow(struct sw_table *, const struct sw_flow_key *,
|
||||
uint16_t, int, const struct ofp_action_header *,
|
||||
size_t);
|
||||
static int do_uninstall(struct datapath *, struct sw_table *, struct sw_flow *,
|
||||
enum nx_flow_end_reason);
|
||||
enum nx_flow_end_reason);
|
||||
static int tmpl_uninstall_flow(struct datapath *, struct sw_table *,
|
||||
const struct sw_flow_key *,
|
||||
uint16_t, uint16_t, int);
|
||||
@@ -139,7 +139,7 @@ tmpl_modify_flow(struct sw_table *flowtab, const struct sw_flow_key *key,
|
||||
|
||||
static int
|
||||
do_uninstall(struct datapath *dpinst, struct sw_table *flowtab,
|
||||
struct sw_flow *flow, enum nx_flow_end_reason reason)
|
||||
struct sw_flow *flow, enum nx_flow_end_reason reason)
|
||||
{
|
||||
/* XXX: Remove the entry from hardware. If you need to do any other
|
||||
* clean-up associated with the entry, do it here.
|
||||
@@ -164,7 +164,7 @@ tmpl_uninstall_flow(struct datapath *dpinst, struct sw_table *flowtab,
|
||||
if (flow_matches_desc(&flow->key, key, strict)
|
||||
&& (!strict || (flow->priority == priority)))
|
||||
count += do_uninstall(dpinst, flowtab,
|
||||
flow, NXFER_DELETE);
|
||||
flow, NXFER_DELETE);
|
||||
}
|
||||
|
||||
if (count != 0)
|
||||
@@ -200,7 +200,7 @@ tmpl_flow_timeout(struct datapath *dpinst, struct sw_table *flowtab)
|
||||
reason = flow_timeout(flow);
|
||||
if (reason >= 0) {
|
||||
num_uninst_flows += do_uninstall(dpinst, flowtab,
|
||||
flow, reason);
|
||||
flow, reason);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&dp_mutex);
|
||||
|
||||
@@ -68,9 +68,9 @@ static int nf2_modify_flow(struct sw_table *, const struct sw_flow_key *,
|
||||
static void deferred_uninstall_callback(struct rcu_head *);
|
||||
static void do_deferred_uninstall(struct sw_flow *);
|
||||
static int do_uninstall(struct datapath *, struct sw_table *, struct sw_flow *,
|
||||
enum nx_flow_end_reason);
|
||||
enum nx_flow_end_reason);
|
||||
static int nf2_has_conflict(struct sw_table *, const struct sw_flow_key *,
|
||||
uint16_t, int);
|
||||
uint16_t, int);
|
||||
static int nf2_uninstall_flow(struct datapath *, struct sw_table *,
|
||||
const struct sw_flow_key *, uint16_t,
|
||||
uint16_t, int);
|
||||
@@ -152,7 +152,7 @@ nf2_modify_flow(struct sw_table *flowtab, const struct sw_flow_key *key,
|
||||
|
||||
static int
|
||||
nf2_has_conflict(struct sw_table *flowtab, const struct sw_flow_key *key,
|
||||
uint16_t priority, int strict)
|
||||
uint16_t priority, int strict)
|
||||
{
|
||||
struct nf2_flowtable *nf2flowtab = (struct nf2_flowtable *)flowtab;
|
||||
struct sw_flow *flow;
|
||||
@@ -182,7 +182,7 @@ do_deferred_uninstall(struct sw_flow *flow)
|
||||
|
||||
static int
|
||||
do_uninstall(struct datapath *dpinst, struct sw_table *flowtab,
|
||||
struct sw_flow *flow, enum nx_flow_end_reason reason)
|
||||
struct sw_flow *flow, enum nx_flow_end_reason reason)
|
||||
{
|
||||
if (flow != NULL && flow->private != NULL) {
|
||||
if (dpinst != NULL)
|
||||
@@ -219,12 +219,13 @@ nf2_uninstall_flow(struct datapath *dpinst, struct sw_table *flowtab,
|
||||
nf2flow = flow->private;
|
||||
if (nf2flow != NULL) {
|
||||
flow->packet_count
|
||||
+= nf2_get_packet_count(netdev, nf2flow);
|
||||
flow->byte_count
|
||||
+= nf2_get_byte_count(netdev, nf2flow);
|
||||
+= nf2_get_packet_count(netdev,
|
||||
nf2flow);
|
||||
flow->byte_count += nf2_get_byte_count(netdev,
|
||||
nf2flow);
|
||||
}
|
||||
count += do_uninstall(dpinst, flowtab,
|
||||
flow, NXFER_DELETE);
|
||||
flow, NXFER_DELETE);
|
||||
}
|
||||
}
|
||||
if (count != 0)
|
||||
@@ -266,7 +267,7 @@ nf2_flow_timeout(struct datapath *dpinst, struct sw_table *flowtab)
|
||||
reason = flow_timeout(flow);
|
||||
if (reason >= 0) {
|
||||
num_uninst_flows += do_uninstall(dpinst, flowtab,
|
||||
flow, reason);
|
||||
flow, reason);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&dp_mutex);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "hwtable_nf2/nf2_lib.h"
|
||||
|
||||
#define MAX_INT_32 0xFFFFFFFF
|
||||
#define PORT_BASE 1
|
||||
#define PORT_BASE 1
|
||||
|
||||
#define VID_BITMASK 0x0FFF
|
||||
#define PCP_BITSHIFT 13
|
||||
@@ -115,7 +115,8 @@ nf2_are_actions_supported(struct sw_flow *flow)
|
||||
// Only support ports 1-4(incl. IN_PORT), ALL, FLOOD.
|
||||
// Let CONTROLLER/LOCAL fall through
|
||||
if ((ntohs(ah->type) == OFPAT_OUTPUT)
|
||||
&& (!((ntohs(oa->port) >= PORT_BASE) && (ntohs(oa->port) <= MAX_IFACE))
|
||||
&& (!((ntohs(oa->port) >= PORT_BASE)
|
||||
&& (ntohs(oa->port) <= MAX_IFACE))
|
||||
&& !(ntohs(oa->port) == OFPP_ALL)
|
||||
&& !(ntohs(oa->port) == OFPP_FLOOD)
|
||||
&& !(ntohs(oa->port) == OFPP_IN_PORT))) {
|
||||
@@ -314,11 +315,10 @@ nf2_populate_of_entry(nf2_of_entry_wrap *key, struct sw_flow *flow)
|
||||
|
||||
if (ntohs(flow->key.dl_vlan) == 0xffff) {
|
||||
key->entry.vlan_id = 0xffff;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
vlan_vid = VID_BITMASK & ntohs(flow->key.dl_vlan);
|
||||
vlan_pcp = PCP_BITMASK &
|
||||
((uint16_t)(flow->key.dl_vlan_pcp) << PCP_BITSHIFT);
|
||||
vlan_pcp = PCP_BITMASK
|
||||
& ((uint16_t)(flow->key.dl_vlan_pcp) << PCP_BITSHIFT);
|
||||
key->entry.vlan_id = vlan_pcp | vlan_vid;
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,8 @@ populate_action_output(nf2_of_action_wrap *action, nf2_of_entry_wrap *entry,
|
||||
|
||||
if ((port >= PORT_BASE) && (port <= MAX_IFACE)) {
|
||||
// Bitmask for output port(s), evens are phys odds cpu
|
||||
action->action.forward_bitmask |= (1 << ((port - PORT_BASE) * 2));
|
||||
action->action.forward_bitmask
|
||||
|= (1 << ((port - PORT_BASE) * 2));
|
||||
NF2DEBUGMSG("Output Port: %i Forward Bitmask: %x\n",
|
||||
port, action->action.forward_bitmask);
|
||||
} else if (port == OFPP_IN_PORT) {
|
||||
|
||||
@@ -330,9 +330,14 @@ nf2_write_of_wildcard(struct net_device *dev, int row,
|
||||
|
||||
// Reset the stats for the row
|
||||
val = 0;
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_BYTES_HIT_0_REG + (4 * row), &val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_PKTS_HIT_0_REG + (4 * row), &val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row), &val);
|
||||
nf2k_reg_write(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_BYTES_HIT_0_REG + (4 * row),
|
||||
&val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_PKTS_HIT_0_REG + (4 * row),
|
||||
&val);
|
||||
nf2k_reg_write(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row),
|
||||
&val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_WRITE_ADDR_REG, &row);
|
||||
|
||||
do_gettimeofday(&t);
|
||||
@@ -413,7 +418,8 @@ nf2_modify_write_of_wildcard(struct net_device *dev, int row,
|
||||
nf2k_reg_read(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_PKTS_HIT_0_REG + (4 * row),
|
||||
&pkts_reg_val);
|
||||
nf2k_reg_read(dev, OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row),
|
||||
nf2k_reg_read(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row),
|
||||
&last_reg_val);
|
||||
|
||||
for (i = 0; i < NF2_OF_ENTRY_WORD_LEN; ++i) {
|
||||
@@ -431,11 +437,13 @@ nf2_modify_write_of_wildcard(struct net_device *dev, int row,
|
||||
+ (4 * i), &(action->raw[i]));
|
||||
}
|
||||
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_BYTES_HIT_0_REG + (4 * row),
|
||||
nf2k_reg_write(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_BYTES_HIT_0_REG + (4 * row),
|
||||
&bytes_reg_val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_PKTS_HIT_0_REG + (4 * row),
|
||||
&pkts_reg_val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row),
|
||||
nf2k_reg_write(dev,
|
||||
OPENFLOW_WILDCARD_LOOKUP_LAST_SEEN_TS_0_REG + (4 * row),
|
||||
&last_reg_val);
|
||||
nf2k_reg_write(dev, OPENFLOW_WILDCARD_LOOKUP_WRITE_ADDR_REG, &row);
|
||||
|
||||
@@ -811,11 +819,11 @@ nf2_get_all_ports_info(struct net_device *dev)
|
||||
nf2k_reg_read(dev, nf2addr->rx_q_num_pkts_stored_reg[i],
|
||||
&(nf2portinfo->port[i].rx_q_num_pkts_stored));
|
||||
nf2k_reg_read(dev, nf2addr->rx_q_num_pkts_dropped_full_reg[i],
|
||||
&(nf2portinfo->port[i].
|
||||
rx_q_num_pkts_dropped_full));
|
||||
&(nf2portinfo
|
||||
->port[i].rx_q_num_pkts_dropped_full));
|
||||
nf2k_reg_read(dev, nf2addr->rx_q_num_pkts_dropped_bad_reg[i],
|
||||
&(nf2portinfo->port[i].
|
||||
rx_q_num_pkts_dropped_bad));
|
||||
&(nf2portinfo
|
||||
->port[i].rx_q_num_pkts_dropped_bad));
|
||||
nf2k_reg_read(dev, nf2addr->rx_q_num_words_pushed_reg[i],
|
||||
&(nf2portinfo->port[i].rx_q_num_words_pushed));
|
||||
nf2k_reg_read(dev, nf2addr->rx_q_num_bytes_pushed_reg[i],
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
// DRAM address width
|
||||
#define DRAM_ADDR_WIDTH 24
|
||||
|
||||
|
||||
// ===== File: lib/verilog/core/common/xml/nf_defines.xml =====
|
||||
|
||||
// Clock period of 125 MHz clock in ns
|
||||
@@ -71,24 +70,20 @@
|
||||
// Data path control width
|
||||
#define CTRL_WIDTH 8
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/output_port_lookup.xml =====
|
||||
|
||||
#define FAST_CLOCK_PERIOD 8
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/vlan_remover.xml =====
|
||||
|
||||
#define VLAN_CTRL_WORD 0x42
|
||||
|
||||
#define VLAN_ETHERTYPE 0x8100
|
||||
|
||||
|
||||
// ===== File: lib/verilog/core/output_queues/bram_output_queues/xml/bram_output_queues.xml =====
|
||||
|
||||
#define NUM_OUTPUT_QUEUES 8
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/opl_processor.xml =====
|
||||
|
||||
#define NF2_OFPAT_OUTPUT 0x0001
|
||||
@@ -111,7 +106,6 @@
|
||||
|
||||
#define NF2_OFPAT_SET_TP_DST 0x0200
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/wildcard_match.xml =====
|
||||
|
||||
#define OPENFLOW_WILDCARD_TABLE_SIZE 32
|
||||
@@ -120,7 +114,6 @@
|
||||
|
||||
#define OPENFLOW_WILDCARD_NUM_CMP_WORDS_USED 8
|
||||
|
||||
|
||||
// ===== File: lib/verilog/core/utils/xml/device_id_reg.xml =====
|
||||
|
||||
// Total number of registers
|
||||
@@ -148,7 +141,6 @@
|
||||
#define DEV_ID_MD5_VALUE_2 0x4d55f629
|
||||
#define DEV_ID_MD5_VALUE_3 0x89a73c95
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/header_parser.xml =====
|
||||
|
||||
#define ETH_TYPE_IP 0x0800
|
||||
@@ -159,12 +151,10 @@
|
||||
|
||||
#define IP_PROTO_ICMP 0x01
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/watchdog.xml =====
|
||||
|
||||
#define WDT_CPCI_REG_CTRL 0x00000008
|
||||
|
||||
|
||||
// ===== File: lib/verilog/core/io_queues/ethernet_mac/xml/ethernet_mac.xml =====
|
||||
|
||||
// TX queue disable bit
|
||||
@@ -194,7 +184,6 @@
|
||||
// MAC disable crc generate bit
|
||||
#define MAC_GRP_MAC_DIS_CRC_GEN_BIT_NUM 8
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/match_arbiter.xml =====
|
||||
|
||||
#define OPENFLOW_ENTRY_TRANSP_DST_WIDTH 16
|
||||
@@ -291,7 +280,6 @@
|
||||
|
||||
#define OPENFLOW_SET_TP_DST_POS 232
|
||||
|
||||
|
||||
// ===== File: projects/openflow_switch/include/exact_match.xml =====
|
||||
|
||||
#define OPENFLOW_EXACT_ENTRY_PKT_COUNTER_WIDTH 25
|
||||
@@ -312,7 +300,6 @@
|
||||
|
||||
#define OPENFLOW_EXACT_ENTRY_ACTION_BASE_POS 0x0000000a
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Modules
|
||||
// -------------------------------------
|
||||
@@ -347,7 +334,6 @@
|
||||
#define CPU_QUEUE_OFFSET 0x0040000
|
||||
#define MAC_GRP_OFFSET 0x0040000
|
||||
|
||||
|
||||
/* ========== Registers ========== */
|
||||
|
||||
// Name: device_id (DEV_ID)
|
||||
@@ -778,8 +764,4 @@
|
||||
// Name: DRAM (DRAM)
|
||||
// Description: DRAM
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user