From owner-svn-src-all@FreeBSD.ORG Thu Mar 19 00:23:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAAB5328; Thu, 19 Mar 2015 00:23:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABF2F3C8; Thu, 19 Mar 2015 00:23:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2J0NHYE085353; Thu, 19 Mar 2015 00:23:17 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2J0NHXe085350; Thu, 19 Mar 2015 00:23:17 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201503190023.t2J0NHXe085350@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Thu, 19 Mar 2015 00:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280237 - in head: share/man/man4 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 00:23:18 -0000 Author: hiren Date: Thu Mar 19 00:23:16 2015 New Revision: 280237 URL: https://svnweb.freebsd.org/changeset/base/280237 Log: Add connection flow type to siftr(4). Suggested by: adrian Sponsored by: Limelight Networks Modified: head/share/man/man4/siftr.4 head/sys/netinet/siftr.c Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Thu Mar 19 00:04:25 2015 (r280236) +++ head/share/man/man4/siftr.4 Thu Mar 19 00:23:16 2015 (r280237) @@ -342,6 +342,15 @@ A caveat: Zero '0' either represents a v not being set. There is no easy way to differentiate without looking at actual network interface card and drivers being used. .El +.Bl -tag -offset indent -width Va +.It Va 28 +Flow type for the connection. +Flowtype defines which protocol fields are hashed to produce the flowid. +A complete listing is available in +.Pa sys/mbuf.h +under +.Dv M_HASHTYPE_* . +.El .Pp The third type of log message is written to the file when the module is disabled and ceases collecting data from the running kernel. Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Thu Mar 19 00:04:25 2015 (r280236) +++ head/sys/netinet/siftr.c Thu Mar 19 00:23:16 2015 (r280237) @@ -229,6 +229,8 @@ struct pkt_node { int t_segqlen; /* Flowid for the connection. */ u_int flowid; + /* Flow type for the connection. */ + u_int flowtype; /* Link to next pkt_node in the list. */ STAILQ_ENTRY(pkt_node) nodes; }; @@ -488,7 +490,8 @@ siftr_process_pkt(struct pkt_node * pkt_ pkt_node->rcv_buf_cc, pkt_node->sent_inflight_bytes, pkt_node->t_segqlen, - pkt_node->flowid); + pkt_node->flowid, + pkt_node->flowtype); } else { /* IPv4 packet */ pkt_node->ip_laddr[0] = FIRST_OCTET(pkt_node->ip_laddr[3]); pkt_node->ip_laddr[1] = SECOND_OCTET(pkt_node->ip_laddr[3]); @@ -504,7 +507,7 @@ siftr_process_pkt(struct pkt_node * pkt_ log_buf->ae_bytesused = snprintf(log_buf->ae_data, MAX_LOG_MSG_LEN, "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld," - "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u\n", + "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", direction[pkt_node->direction], pkt_node->hash, (intmax_t)pkt_node->tval.tv_sec, @@ -538,7 +541,8 @@ siftr_process_pkt(struct pkt_node * pkt_ pkt_node->rcv_buf_cc, pkt_node->sent_inflight_bytes, pkt_node->t_segqlen, - pkt_node->flowid); + pkt_node->flowid, + pkt_node->flowtype); #ifdef SIFTR_IPV6 } #endif @@ -792,6 +796,7 @@ siftr_siftdata(struct pkt_node *pn, stru pn->sent_inflight_bytes = tp->snd_max - tp->snd_una; pn->t_segqlen = tp->t_segqlen; pn->flowid = inp->inp_flowid; + pn->flowtype = inp->inp_flowtype; /* We've finished accessing the tcb so release the lock. */ if (inp_locally_locked)