From patchwork Thu Feb 18 13:35:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jamal X-Patchwork-Id: 45767 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 63F5BB7F15 for ; Fri, 19 Feb 2010 00:35:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339Ab0BRNfO (ORCPT ); Thu, 18 Feb 2010 08:35:14 -0500 Received: from mail-qy0-f192.google.com ([209.85.221.192]:39233 "EHLO mail-qy0-f192.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754209Ab0BRNfM (ORCPT ); Thu, 18 Feb 2010 08:35:12 -0500 Received: by qyk30 with SMTP id 30so7066434qyk.23 for ; Thu, 18 Feb 2010 05:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:reply-to :to:cc:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer; bh=kK6KWImx0noRD1hYGmcQyQjIFpWJlaTMIJKAtQP1BBM=; b=FTh/y/lF3PqPowoRiwN8UBOpGKDiXDzOcFl2/Mk20jpsy8N3RaUrG7nPv0v1tY4wyb p+te77bxx3ywzqL6Y7lL6SZfSmhvW1YSOzd/PbQlUAmcoVKSY7u4TRspf7xBmtiWfLtg fe6Bfo6kn9xm/gk7KVU+FgDqTM/cLNzg9clWk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:reply-to:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer; b=KB2xJIuR/0nuVEuWEdep6cgzlPpS36cAWpQGLBr+eUBrrg86gF5s8oS6WvMa7eaukQ hL3I1d02fJ4B4Qakqg9dJfAKvXvPam8E2s3MAH3Fj1ECzZfn/TsrN27KlWhued2k20JJ ktXK1RhTSdlo5gdMpXdQG5/gxVKWSXVlorNj4= Received: by 10.224.108.135 with SMTP id f7mr2477818qap.248.1266500110078; Thu, 18 Feb 2010 05:35:10 -0800 (PST) Received: from ?10.0.0.26? (CPE0030ab124d2f-CM001bd7a7f1a0.cpe.net.cable.rogers.com [99.240.66.42]) by mx.google.com with ESMTPS id 7sm28728179qwb.27.2010.02.18.05.35.08 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Feb 2010 05:35:09 -0800 (PST) Subject: Re: [RFC PATCH net-next-2.6]: xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR From: jamal Reply-To: hadi@cyberus.ca To: David Miller Cc: nakam@linux-ipv6.org, kaber@trash.net, herbert@gondor.apana.org.au, netdev@vger.kernel.org In-Reply-To: <20100217.134946.106752388.davem@davemloft.net> References: <1266406852.3799.7.camel@bigi> <20100217.134946.106752388.davem@davemloft.net> Date: Thu, 18 Feb 2010 08:35:07 -0500 Message-Id: <1266500107.17794.167.camel@bigi> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 2010-02-17 at 13:49 -0800, David Miller wrote: > This should be fine, the tools just parse the lines individually > as "string integer" pairs. > > If you want to be super anal, add the new counter to the end of > the array. Ok, thanks - here is the updated patch. cheers, jamal commit 9bc885a86cf4be134ddf09cec8113cde24bb5048 Author: Jamal Hadi Salim Date: Thu Feb 18 08:25:57 2010 -0500 xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR XFRMINHDRERROR counter is ambigous when validating forwarding path. It makes it tricky to debug when you have both in and fwd validation. Signed-off-by: Jamal Hadi Salim diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 0f953fe..e28f5a0 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h @@ -257,6 +257,7 @@ enum LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ + LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ __LINUX_MIB_XFRMMAX }; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 2c5d931..4368e7b 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2045,8 +2045,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) int res; if (xfrm_decode_session(skb, &fl, family) < 0) { - /* XXX: we should have something like FWDHDRERROR here. */ - XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR); + XFRM_INC_STATS(net, LINUX_MIB_XFRMFWDHDRERROR); return 0; } diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c index 003f2c4..58d9ae0 100644 --- a/net/xfrm/xfrm_proc.c +++ b/net/xfrm/xfrm_proc.c @@ -41,6 +41,7 @@ static const struct snmp_mib xfrm_mib_list[] = { SNMP_MIB_ITEM("XfrmOutPolBlock", LINUX_MIB_XFRMOUTPOLBLOCK), SNMP_MIB_ITEM("XfrmOutPolDead", LINUX_MIB_XFRMOUTPOLDEAD), SNMP_MIB_ITEM("XfrmOutPolError", LINUX_MIB_XFRMOUTPOLERROR), + SNMP_MIB_ITEM("XfrmFwdHdrError", LINUX_MIB_XFRMFWDHDRERROR), SNMP_MIB_SENTINEL };