From patchwork Wed Feb 17 11:40:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jamal X-Patchwork-Id: 45611 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 8EDE5B7067 for ; Wed, 17 Feb 2010 22:41:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755962Ab0BQLk6 (ORCPT ); Wed, 17 Feb 2010 06:40:58 -0500 Received: from mail-qy0-f178.google.com ([209.85.221.178]:65394 "EHLO mail-qy0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755889Ab0BQLk5 (ORCPT ); Wed, 17 Feb 2010 06:40:57 -0500 Received: by qyk8 with SMTP id 8so1696701qyk.24 for ; Wed, 17 Feb 2010 03:40:55 -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:content-type:date:message-id:mime-version:x-mailer; bh=OvMalyMOFvBkX+SyfKA1k6i2aX2Bi+gIQYQhcQsLYfQ=; b=T1+RzjbXlUhoqSlf/T+Ac7ARLL50BDQCn5NTLlOH1ZtUxPruNQhdbPzdZHicoSkjiK 8OxXefpe2cmgLA1IwMiILmneOKMvkbqGeyDWWJKtR1sKdDUTaXh6RittmysZnuAYkPAP QNFzfXOcoBhWgJCqk9MzxfMnLLxsos7RzcV88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:reply-to:to:cc:content-type:date:message-id :mime-version:x-mailer; b=qvTzhSJSIuEKQgjJoaaNq4qPYjSxys4TOz7GR4F96FSBytsbn6QstIDh7K7YOJlMmc u8Lzj6bZCrtd6PeCbhYGzXbUzNUEPHPwzzmtGGkU3Z2zxVuypVX82NbQGyaSmi5M7YbY jtqibv6QgrlRttsxS+MN3azM+b4uO41gtaDxQ= Received: by 10.224.44.229 with SMTP id b37mr1519781qaf.367.1266406854980; Wed, 17 Feb 2010 03:40:54 -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 5sm23960058qwg.38.2010.02.17.03.40.53 (version=SSLv3 cipher=RC4-MD5); Wed, 17 Feb 2010 03:40:54 -0800 (PST) Subject: [RFC PATCH net-next-2.6]: xfrm: Introduce LINUX_MIB_XFRMFWDHDRERROR From: jamal Reply-To: hadi@cyberus.ca To: David Miller Cc: Masahide NAKAMURA , Patrick McHardy , herbert@gondor.apana.org.au, netdev@vger.kernel.org Date: Wed, 17 Feb 2010 06:40:52 -0500 Message-Id: <1266406852.3799.7.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 I had a hard time debugging some setup while testing xfrm by mark in presence of traffic being forwarded as well as being locally terminated. This change helped narrow things down a little for me. The danger is that it changes the /proc output which may break some user space tool (thats why i have it as an RFC). cheers, jamal commit cba12a140f1c4cad34f55d1b01067c2d83ee0748 Author: Jamal Hadi Salim Date: Wed Feb 17 06:26:52 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..8522120 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h @@ -246,6 +246,7 @@ enum LINUX_MIB_XFRMINNOPOLS, /* XfrmInNoPols */ LINUX_MIB_XFRMINPOLBLOCK, /* XfrmInPolBlock */ LINUX_MIB_XFRMINPOLERROR, /* XfrmInPolError */ + LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ LINUX_MIB_XFRMOUTERROR, /* XfrmOutError */ LINUX_MIB_XFRMOUTBUNDLEGENERROR, /* XfrmOutBundleGenError */ LINUX_MIB_XFRMOUTBUNDLECHECKERROR, /* XfrmOutBundleCheckError */ diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index eb870fc..916784d 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2052,8 +2052,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 c083a4e..289992a 100644 --- a/net/xfrm/xfrm_proc.c +++ b/net/xfrm/xfrm_proc.c @@ -30,6 +30,7 @@ static const struct snmp_mib xfrm_mib_list[] = { SNMP_MIB_ITEM("XfrmInNoPols", LINUX_MIB_XFRMINNOPOLS), SNMP_MIB_ITEM("XfrmInPolBlock", LINUX_MIB_XFRMINPOLBLOCK), SNMP_MIB_ITEM("XfrmInPolError", LINUX_MIB_XFRMINPOLERROR), + SNMP_MIB_ITEM("XfrmFwdHdrError", LINUX_MIB_XFRMFWDHDRERROR), SNMP_MIB_ITEM("XfrmOutError", LINUX_MIB_XFRMOUTERROR), SNMP_MIB_ITEM("XfrmOutBundleGenError", LINUX_MIB_XFRMOUTBUNDLEGENERROR), SNMP_MIB_ITEM("XfrmOutBundleCheckError", LINUX_MIB_XFRMOUTBUNDLECHECKERROR),