From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by dpdk.org (Postfix) with ESMTP id 62453CE7 for ; Mon, 8 Dec 2014 18:51:39 +0100 (CET) Received: by mail-pd0-f171.google.com with SMTP id y13so5591981pdi.2 for ; Mon, 08 Dec 2014 09:51:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject :references:mime-version:content-type:content-disposition; bh=7I3ObgHGlN8+8o6zsibKqpUxfLDjhcVi3Eb7wlb1JMc=; b=m2uZxiMshh2PUuXaYpzjswRccMw8hAUw7aeK/z03tUsYyP9KvBNxnMjKcEpaABpssY 8HfdVlCy6a3Lx4zkJ2Zu35L0ZWPGxWRYtbTQIgMj73DY8453KtRpWD/Fo+CYXn4v6B7J U9n9MpujwRZe32hf0PEichG6U9RUuYtoaJhtVoNKO+SQiGvsbFHAIm83Ft6Wxt1fPboW RieHhBtFBAU5q8BXimExyfSRN7V9NeMQFkEJ9WjsFpZp82/N3e2vt6vuj2rU7cqFTrxX y6/vwn3oHVGETkWl1w/pF6xquUSmGassUSHpwlRxP4RiLxqRDTltWQRf7tPNd1De7YQ0 wqpQ== X-Gm-Message-State: ALoCoQmWv+MthFuGtjG3Jk1p/f3whkfFxB9hDp6ZlprJjsfi3G6TYmDYyV/EPGz5e95yjGfvyz9X X-Received: by 10.68.224.6 with SMTP id qy6mr63610302pbc.35.1418061098782; Mon, 08 Dec 2014 09:51:38 -0800 (PST) Received: from localhost (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id of9sm36879682pbc.6.2014.12.08.09.51.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2014 09:51:38 -0800 (PST) X-Mailman-Approved-At: Mon, 08 Dec 2014 20:36:25 +0100 Subject: [dpdk-dev] (no subject) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Mon, 08 Dec 2014 17:51:39 -0000 X-List-Received-Date: Mon, 08 Dec 2014 17:51:39 -0000 Content-Type: text/plain; charset="UTF-8" Message-ID: <20141208175139.YBXIBBO5La7mbgn2dwwWRkbnRjqTO2kAnEk598lUBw8@z> >>From stephen@networkplumber.org Mon Dec 8 09:46:51 2014 Message-Id: <20141208174651.232055974@networkplumber.org> User-Agent: quilt/0.63-1 Date: Mon, 08 Dec 2014 09:45:58 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, Stephen Hemminger Subject: [PATCH 4/6] rte_sched: keep track of RED drops References: <20141208174554.889069531@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=red-stats.patch Add new statistic to keep track of drops due to RED. Signed-off-by: Stephen Hemminger --- a/lib/librte_sched/rte_sched.c 2014-12-08 09:28:37.810590895 -0800 +++ b/lib/librte_sched/rte_sched.c 2014-12-08 09:28:37.810590895 -0800 @@ -1028,7 +1028,9 @@ rte_sched_port_update_subport_stats(stru } static inline void -rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port, uint32_t qindex, struct rte_mbuf *pkt) +rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port, + uint32_t qindex, + struct rte_mbuf *pkt, uint32_t red) { struct rte_sched_subport *s = port->subport + (qindex / rte_sched_port_queues_per_subport(port)); uint32_t tc_index = (qindex >> 2) & 0x3; @@ -1036,6 +1038,9 @@ rte_sched_port_update_subport_stats_on_d s->stats.n_pkts_tc_dropped[tc_index] += 1; s->stats.n_bytes_tc_dropped[tc_index] += pkt_len; +#ifdef RTE_SCHED_RED + s->stats.n_pkts_red_dropped[tc_index] += red; +#endif } static inline void @@ -1206,12 +1211,20 @@ rte_sched_port_enqueue_qwa(struct rte_sc qlen = q->qw - q->qr; /* Drop the packet (and update drop stats) when queue is full */ - if (unlikely(rte_sched_port_red_drop(port, pkt, qindex, qlen) || (qlen >= qsize))) { + if (unlikely(rte_sched_port_red_drop(port, pkt, qindex, qlen))) { +#ifdef RTE_SCHED_COLLECT_STATS + rte_sched_port_update_subport_stats_on_drop(port, qindex, pkt, 1); + rte_sched_port_update_queue_stats_on_drop(port, qindex, pkt, 1); +#endif rte_pktmbuf_free(pkt); + } + + if (qlen >= qsize) { #ifdef RTE_SCHED_COLLECT_STATS - rte_sched_port_update_subport_stats_on_drop(port, qindex, pkt); - rte_sched_port_update_queue_stats_on_drop(port, qindex, pkt); + rte_sched_port_update_subport_stats_on_drop(port, qindex, pkt, 0); + rte_sched_port_update_queue_stats_on_drop(port, qindex, pkt, 0); #endif + rte_pktmbuf_free(pkt); return 0; } --- a/lib/librte_sched/rte_sched.h 2014-12-08 09:28:37.810590895 -0800 +++ b/lib/librte_sched/rte_sched.h 2014-12-08 09:29:11.402692026 -0800 @@ -140,6 +140,9 @@ struct rte_sched_subport_stats { subport for each traffic class*/ uint32_t n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Number of bytes dropped by the current subport for each traffic class due to subport queues being full or congested */ +#ifdef RTE_SCHED_RED + uint32_t n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; /**< Number of packets dropped by red */ +#endif }; /** Pipe configuration parameters. The period and credits_per_period parameters are measured @@ -168,7 +171,9 @@ struct rte_sched_queue_stats { /* Packets */ uint32_t n_pkts; /**< Number of packets successfully written to current queue */ uint32_t n_pkts_dropped; /**< Number of packets dropped due to current queue being full or congested */ - +#ifdef RTE_SCHED_RED + uint32_t n_pkts_red_dropped; +#endif /* Bytes */ uint32_t n_bytes; /**< Number of bytes successfully written to current queue */ uint32_t n_bytes_dropped; /**< Number of bytes dropped due to current queue being full or congested */