From patchwork Mon Oct 31 21:33:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 689654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3t770X5CZYz9srZ for ; Tue, 1 Nov 2016 08:34:04 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 82358105FB; Mon, 31 Oct 2016 14:34:02 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 3FDE4105F9 for ; Mon, 31 Oct 2016 14:34:01 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id BA6114204C9 for ; Mon, 31 Oct 2016 15:34:00 -0600 (MDT) X-ASG-Debug-ID: 1477949640-09eadd0f9540ae20001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id st8oFv0i9SJl5zEB (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 31 Oct 2016 15:34:00 -0600 (MDT) X-Barracuda-Envelope-From: blp@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay3-d.mail.gandi.net) (217.70.183.195) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 31 Oct 2016 21:33:59 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.195 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.195 X-Barracuda-RBL-IP: 217.70.183.195 Received: from mfilter45-d.gandi.net (mfilter45-d.gandi.net [217.70.178.176]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 71C9FA80C4; Mon, 31 Oct 2016 22:33:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter45-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter45-d.gandi.net (mfilter45-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id uFuYmLXF9TMv; Mon, 31 Oct 2016 22:33:55 +0100 (CET) X-Originating-IP: 208.91.2.3 Received: from ovn.org (unknown [208.91.2.3]) (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id D0F62A80C7; Mon, 31 Oct 2016 22:33:53 +0100 (CET) Date: Mon, 31 Oct 2016 14:33:50 -0700 X-CudaMail-Envelope-Sender: blp@ovn.org From: Ben Pfaff To: Joe Stringer X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1030071866 X-CudaMail-DTE: 103116 X-CudaMail-Originating-IP: 217.70.183.195 Message-ID: <20161031213350.GD16705@ovn.org> X-ASG-Orig-Subj: [##CM-E1-1030071866##]Re: [ovs-dev] [PATCH] ofproto-dpif: Log warning when ct action or its variants are not supported. References: <1477945416-22602-1-git-send-email-blp@ovn.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1477949640 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: ovs dev , Kevin Lin Subject: Re: [ovs-dev] [PATCH] ofproto-dpif: Log warning when ct action or its variants are not supported. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" On Mon, Oct 31, 2016 at 02:16:05PM -0700, Joe Stringer wrote: > On 31 October 2016 at 13:23, Ben Pfaff wrote: > > Some datapaths do not support the ct action, and others support only a > > subset of its features. Until now, it has been difficult to tell why a > > particular action is being rejected. This commit should make it clearer. > > > > Reported-by: Kevin Lin > > Reported-at: http://openvswitch.org/pipermail/discuss/2016-October/023060.html > > Signed-off-by: Ben Pfaff > > Thanks, no doubt this will save a bunch of people a bunch of > confusion. It still doesn't directly state that "Your kernel module > may be out of date", but it's more clear than just OpenFlow hexdumps > telling you "OFPBAC". Maybe it should either say this, or this should > be mentioned in the FAQ. > > Acked-by: Joe Stringer You're right, this can be better. How about like this? --8<--------------------------cut here-------------------------->8-- From: Ben Pfaff Date: Mon, 31 Oct 2016 14:33:13 -0700 Subject: [PATCH] ofproto-dpif: Log warning when ct action or its variants are not supported. Some datapaths do not support the ct action, and others support only a subset of its features. Until now, it has been difficult to tell why a particular action is being rejected. This commit should make it clearer. Reported-by: Kevin Lin Reported-at: http://openvswitch.org/pipermail/discuss/2016-October/023060.html Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 7374ccc..330bd48 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4134,6 +4134,16 @@ check_mask(struct ofproto_dpif *ofproto, const struct miniflow *flow) return 0; } +static void +report_unsupported_ct(const char *detail) +{ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + VLOG_WARN_RL(&rl, "Rejecting ct action because datapath does not support " + "ct action%s%s (your kernel module may be out of date)", + detail ? " " : "", + detail ? detail : ""); +} + static enum ofperr check_actions(const struct ofproto_dpif *ofproto, const struct rule_actions *const actions) @@ -4153,9 +4163,11 @@ check_actions(const struct ofproto_dpif *ofproto, support = &ofproto_dpif_get_support(ofproto)->odp; if (!support->ct_state) { + report_unsupported_ct(NULL); return OFPERR_OFPBAC_BAD_TYPE; } if ((ct->zone_imm || ct->zone_src.field) && !support->ct_zone) { + report_unsupported_ct("zone"); return OFPERR_OFPBAC_BAD_ARGUMENT; } @@ -4166,10 +4178,12 @@ check_actions(const struct ofproto_dpif *ofproto, /* The backer doesn't seem to support the NAT bits in * 'ct_state': assume that it doesn't support the NAT * action. */ + report_unsupported_ct("nat"); return OFPERR_OFPBAC_BAD_TYPE; } if (dst && ((dst->id == MFF_CT_MARK && !support->ct_mark) || (dst->id == MFF_CT_LABEL && !support->ct_label))) { + report_unsupported_ct("setting mark and/or label"); return OFPERR_OFPBAC_BAD_SET_ARGUMENT; } }