From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 14:43:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3853620; Thu, 18 Sep 2014 14:43:23 +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 DEA32EBF; Thu, 18 Sep 2014 14:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8IEhNJd075894; Thu, 18 Sep 2014 14:43:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8IEhNqw075893; Thu, 18 Sep 2014 14:43:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409181443.s8IEhNqw075893@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 18 Sep 2014 14:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271772 - head/sys/netgraph 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, 18 Sep 2014 14:43:24 -0000 Author: glebius Date: Thu Sep 18 14:43:23 2014 New Revision: 271772 URL: http://svnweb.freebsd.org/changeset/base/271772 Log: Accidentially, ng_ppp changes leaked out with r271770. The proper commit message should have been: In case if ng_ppp(4) runs only IPv4, with one link, w/o any encryption and compression, set faster rcvhook method. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_ppp.c Modified: head/sys/netgraph/ng_ppp.c ============================================================================== --- head/sys/netgraph/ng_ppp.c Thu Sep 18 14:41:57 2014 (r271771) +++ head/sys/netgraph/ng_ppp.c Thu Sep 18 14:43:23 2014 (r271772) @@ -660,7 +660,7 @@ ng_ppp_rcvmsg(node_p node, item_p item, &priv->bundleStats : &priv->links[linkNum].stats; /* Make 64bit reply. */ - if (msg->header.cmd == NGM_PPP_GET_LINK_STATS64 || + if (msg->header.cmd == NGM_PPP_GET_LINK_STATS64 || msg->header.cmd == NGM_PPP_GETCLR_LINK_STATS64) { NG_MKRESPONSE(resp, msg, sizeof(struct ng_ppp_link_stat64), M_NOWAIT); @@ -669,7 +669,7 @@ ng_ppp_rcvmsg(node_p node, item_p item, bcopy(stats, resp->data, sizeof(*stats)); } else /* Make 32bit reply. */ - if (msg->header.cmd == NGM_PPP_GET_LINK_STATS || + if (msg->header.cmd == NGM_PPP_GET_LINK_STATS || msg->header.cmd == NGM_PPP_GETCLR_LINK_STATS) { struct ng_ppp_link_stat *rs; NG_MKRESPONSE(resp, msg, @@ -1091,10 +1091,10 @@ ng_ppp_comp_xmit(node_p node, item_p ite proto != PROT_COMPD && proto != PROT_CRYPTD && priv->hooks[HOOK_INDEX_COMPRESS] != NULL) { - struct mbuf *m; + struct mbuf *m; int error; - NGI_GET_M(item, m); + NGI_GET_M(item, m); if ((m = ng_ppp_addproto(m, proto, 0)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); @@ -1197,8 +1197,8 @@ ng_ppp_rcvdata_decompress(hook_p hook, i } NGI_GET_M(item, m); if ((m = ng_ppp_cutproto(m, &proto)) == NULL) { - NG_FREE_ITEM(item); - return (EIO); + NG_FREE_ITEM(item); + return (EIO); } NGI_M(item) = m; if (!PROT_VALID(proto)) { @@ -1225,7 +1225,7 @@ ng_ppp_crypt_xmit(node_p node, item_p it struct mbuf *m; int error; - NGI_GET_M(item, m); + NGI_GET_M(item, m); if ((m = ng_ppp_addproto(m, proto, 0)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); @@ -1297,8 +1297,8 @@ ng_ppp_rcvdata_decrypt(hook_p hook, item } NGI_GET_M(item, m); if ((m = ng_ppp_cutproto(m, &proto)) == NULL) { - NG_FREE_ITEM(item); - return (EIO); + NG_FREE_ITEM(item); + return (EIO); } NGI_M(item) = m; if (!PROT_VALID(proto)) { @@ -1613,7 +1613,7 @@ ng_ppp_mp_recv(node_p node, item_p item, TAILQ_INSERT_AFTER(&priv->frags, qent, frag, f_qent); inserted = 1; break; - } else if (diff == 0) { /* should never happen! */ + } else if (diff == 0) { /* should never happen! */ link->stats.dupFragments++; NG_FREE_M(frag->data); TAILQ_INSERT_HEAD(&priv->fragsfree, frag, f_qent); @@ -1847,7 +1847,7 @@ ng_ppp_frag_process(node_p node, item_p if (item != NULL) { /* Stats */ priv->bundleStats.recvFrames++; - priv->bundleStats.recvOctets += + priv->bundleStats.recvOctets += NGI_M(item)->m_pkthdr.len; /* Drop mutex for the sending time. @@ -2383,10 +2383,9 @@ ng_ppp_mp_strategy(node_p node, int len, struct ng_ppp_link *const link = &priv->links[priv->activeLinks[sortByLatency[i]]]; - if (distrib[sortByLatency[slow]] == 0 - || (distrib[sortByLatency[i]] > 0 - && link->conf.bandwidth < - slowLink->conf.bandwidth)) { + if (distrib[sortByLatency[slow]] == 0 || + (distrib[sortByLatency[i]] > 0 && + link->conf.bandwidth < slowLink->conf.bandwidth)) { slow = i; slowLink = link; } @@ -2488,7 +2487,7 @@ ng_ppp_update(node_p node, int newConf) if (priv->links[i].conf.bandwidth == 0) continue; - + hdrBytes = MP_AVERAGE_LINK_OVERHEAD + (priv->links[i].conf.enableACFComp ? 0 : 2) + (priv->links[i].conf.enableProtoComp ? 1 : 2)