X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fclassify%2Fvnet_classify.c;h=bf030241f68bc3951cc887ebcc7febf33c8faf2d;hb=07063b8ea;hp=b461463d02e3ca8c28493eb21df401945c3a37a8;hpb=cd681adab40f49d1305144b6bbbd5118e63a2805;p=vpp.git diff --git a/src/vnet/classify/vnet_classify.c b/src/vnet/classify/vnet_classify.c index b461463d02e..bf030241f68 100755 --- a/src/vnet/classify/vnet_classify.c +++ b/src/vnet/classify/vnet_classify.c @@ -147,13 +147,9 @@ vnet_classify_new_table (vnet_classify_main_t * cm, t->skip_n_vectors = skip_n_vectors; t->entries_per_page = 2; -#if USE_DLMALLOC == 0 - t->mheap = mheap_alloc (0 /* use VM */ , memory_size); -#else t->mheap = create_mspace (memory_size, 1 /* locked */ ); /* classifier requires the memory to be contiguous, so can not expand. */ mspace_disable_expand (t->mheap); -#endif vec_validate_aligned (t->buckets, nbuckets - 1, CLIB_CACHE_LINE_BYTES); oldheap = clib_mem_set_heap (t->mheap); @@ -180,12 +176,7 @@ vnet_classify_delete_table_index (vnet_classify_main_t * cm, vec_free (t->mask); vec_free (t->buckets); -#if USE_DLMALLOC == 0 - mheap_free (t->mheap); -#else destroy_mspace (t->mheap); -#endif - pool_put (cm->tables, t); } @@ -1744,6 +1735,10 @@ classify_filter_command_fn (vlib_main_t * vm, if (sw_if_index == ~0 && pkt_trace == 0 && pcap == 0) return clib_error_return (0, "Must specify trace, pcap or interface..."); + if (pkt_trace && pcap) + return clib_error_return + (0, "Packet trace and pcap are mutually exclusive..."); + if (pkt_trace && sw_if_index != ~0) return clib_error_return (0, "Packet trace filter is per-system"); @@ -2070,7 +2065,6 @@ show_classify_filter_command_fn (vlib_main_t * vm, if (verbose) { - u8 *s = 0; u32 table_index; for (j = 0; j < vec_len (set->table_indices); j++) @@ -2087,8 +2081,7 @@ show_classify_filter_command_fn (vlib_main_t * vm, } else { - u8 *s = 0; - table_index = set->table_indices[0]; + table_index = set->table_indices ? set->table_indices[0] : ~0; if (table_index != ~0) s = format (s, " %u", table_index);