From c8bffc8f294bf5ccba74475f94c63d2646ef4c2e Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Mon, 30 Nov 2015 10:29:30 +0530 Subject: [PATCH] Handle FatFlow configuration absence in requests If FatFlow configuration is present in vif, but no configuration is present in the interface request, all the existing configuration in the interface should be removed. Change-Id: Ieb74ed5a3955773fd39d70727cd5f095ad266c0a Partial-BUG: 1518234 --- dp-core/vr_interface.c | 5 ++++- include/vr_interface.h | 2 +- utils/vif.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dp-core/vr_interface.c b/dp-core/vr_interface.c index c4bb44526..218ae3b2b 100644 --- a/dp-core/vr_interface.c +++ b/dp-core/vr_interface.c @@ -2566,7 +2566,10 @@ vif_fat_flow_add(struct vr_interface *vif, vr_interface_req *req) bool add; if (!req->vifr_fat_flow_protocol_port_size) { - return 0; + if (!memcmp(vif->vif_fat_flow_config_size, old_fat_flow_config_sizes, + sizeof(old_fat_flow_config_sizes))) { + return 0; + } } else { if (!req->vifr_fat_flow_protocol_port) return -EINVAL; diff --git a/include/vr_interface.h b/include/vr_interface.h index 15211a146..dd7c95868 100644 --- a/include/vr_interface.h +++ b/include/vr_interface.h @@ -213,7 +213,7 @@ struct vr_interface { unsigned char *(*vif_set_rewrite)(struct vr_interface *, struct vr_packet *, struct vr_forwarding_md *, unsigned char *, unsigned short); uint8_t **vif_fat_flow_ports[VIF_FAT_FLOW_MAXPROTO_INDEX]; - /* + /* * one for tcp, another for udp, one for sctp and one for * everything else */ diff --git a/utils/vif.c b/utils/vif.c index 9a9a35a41..93320ee1e 100644 --- a/utils/vif.c +++ b/utils/vif.c @@ -490,8 +490,8 @@ list_get_print(vr_interface_req *req) printf("\n"); printed = 0; vr_interface_print_head_space(); - /* %12 corresponds to "ComboFlows: " */ - printed += printf("%12c", ' '); + /* %10 corresponds to "FatFlows: " */ + printed += printf("%10c", ' '); } else { printf(", "); }