Commit 18021360 authored by David S. Miller's avatar David S. Miller

Merge branch 'ovs-meter-tables'

Tonghao Zhang says:

====================
openvswitch: expand meter tables and fix bug

The patch set expand or shrink the meter table when necessary.
and other patches fix bug or improve codes.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents efcd549d e5735887
......@@ -82,7 +82,7 @@ struct datapath {
u32 max_headroom;
/* Switch meters. */
struct hlist_head *meters;
struct dp_meter_table meter_tbl;
};
/**
......
This diff is collapsed.
......@@ -13,26 +13,26 @@
#include <linux/openvswitch.h>
#include <linux/genetlink.h>
#include <linux/skbuff.h>
#include <linux/bits.h>
#include "flow.h"
struct datapath;
#define DP_MAX_BANDS 1
#define DP_METER_ARRAY_SIZE_MIN BIT_ULL(10)
#define DP_METER_NUM_MAX (200000UL)
struct dp_meter_band {
u32 type;
u32 rate;
u32 burst_size;
u32 bucket; /* 1/1000 packets, or in bits */
u64 bucket; /* 1/1000 packets, or in bits */
struct ovs_flow_stats stats;
};
struct dp_meter {
spinlock_t lock; /* Per meter lock */
struct rcu_head rcu;
struct hlist_node dp_hash_node; /*Element in datapath->meters
* hash table.
*/
u32 id;
u16 kbps:1, keep_stats:1;
u16 n_bands;
......@@ -42,6 +42,18 @@ struct dp_meter {
struct dp_meter_band bands[];
};
struct dp_meter_instance {
struct rcu_head rcu;
u32 n_meters;
struct dp_meter __rcu *dp_meters[];
};
struct dp_meter_table {
struct dp_meter_instance __rcu *ti;
u32 count;
u32 max_meters_allowed;
};
extern struct genl_family dp_meter_genl_family;
int ovs_meters_init(struct datapath *dp);
void ovs_meters_exit(struct datapath *dp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment