Userspace used to use the n_flows information here to decide how much
memory needed to be allocated to list flows, but that isn't necessary any
longer now that listing flows uses an iterator abstraction. The
cur_capacity and max_capacity members are just curiosities and don't
provide much information; if the implementation ever changes away from
the current hash table implementation then they could become meaningless
anyhow.
But more than anything, these aren't really the kind of statistics that
networking people usually care about.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
static int get_dp_stats(struct datapath *dp, struct odp_stats __user *statsp)
{
static int get_dp_stats(struct datapath *dp, struct odp_stats __user *statsp)
{
- struct tbl *table = get_table_protected(dp);
struct odp_stats stats;
int i;
struct odp_stats stats;
int i;
- stats.n_flows = tbl_count(table);
- stats.cur_capacity = tbl_n_buckets(table);
- stats.max_capacity = TBL_MAX_BUCKETS;
stats.n_ports = dp->n_ports;
stats.max_ports = DP_MAX_PORTS;
stats.n_frags = stats.n_hit = stats.n_missed = stats.n_lost = 0;
stats.n_ports = dp->n_ports;
stats.max_ports = DP_MAX_PORTS;
stats.n_frags = stats.n_hit = stats.n_missed = stats.n_lost = 0;
#define ODP_SET_SFLOW_PROBABILITY _IOR('O', 19, int)
#define ODP_GET_SFLOW_PROBABILITY _IOW('O', 20, int)
#define ODP_SET_SFLOW_PROBABILITY _IOR('O', 19, int)
#define ODP_GET_SFLOW_PROBABILITY _IOW('O', 20, int)
- /* Flows. */
- uint32_t n_flows; /* Number of flows in flow table. */
- uint32_t cur_capacity; /* Current flow table capacity. */
- uint32_t max_capacity; /* Maximum expansion of flow table capacity. */
-
/* Ports. */
uint32_t n_ports; /* Current number of ports. */
uint32_t max_ports; /* Maximum supported number of ports. */
/* Ports. */
uint32_t n_ports; /* Current number of ports. */
uint32_t max_ports; /* Maximum supported number of ports. */
{
struct dp_netdev *dp = get_dp_netdev(dpif);
memset(stats, 0, sizeof *stats);
{
struct dp_netdev *dp = get_dp_netdev(dpif);
memset(stats, 0, sizeof *stats);
- stats->n_flows = hmap_count(&dp->flow_table);
- stats->cur_capacity = hmap_capacity(&dp->flow_table);
- stats->max_capacity = MAX_FLOWS;
stats->n_ports = dp->n_ports;
stats->max_ports = MAX_PORTS;
stats->n_frags = dp->n_frags;
stats->n_ports = dp->n_ports;
stats->max_ports = MAX_PORTS;
stats->n_frags = dp->n_frags;
printf("%s:\n", dpif_name(dpif));
if (!dpif_get_dp_stats(dpif, &stats)) {
printf("%s:\n", dpif_name(dpif));
if (!dpif_get_dp_stats(dpif, &stats)) {
- printf("\tflows: cur:%"PRIu32", soft-max:%"PRIu32", "
- "hard-max:%"PRIu32"\n",
- stats.n_flows, stats.cur_capacity, stats.max_capacity);
printf("\tports: cur:%"PRIu32", max:%"PRIu32"\n",
stats.n_ports, stats.max_ports);
printf("\tlookups: frags:%llu, hit:%llu, missed:%llu, lost:%llu\n",
printf("\tports: cur:%"PRIu32", max:%"PRIu32"\n",
stats.n_ports, stats.max_ports);
printf("\tlookups: frags:%llu, hit:%llu, missed:%llu, lost:%llu\n",