From patchwork Thu Sep 1 00:20:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramu Ramamurthy X-Patchwork-Id: 664721 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 3sPjZs4Q4Jz9s9Y for ; Thu, 1 Sep 2016 10:20:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ypZaOHjO; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id D79CE1090A; Wed, 31 Aug 2016 17:20:36 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id A756E102F7 for ; Wed, 31 Aug 2016 17:20:35 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 36C1C1621F4 for ; Wed, 31 Aug 2016 18:20:35 -0600 (MDT) X-ASG-Debug-ID: 1472689234-0b32370b351025e0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id n8Z9yL1dAeVFFssf (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 31 Aug 2016 18:20:34 -0600 (MDT) X-Barracuda-Envelope-From: ramu.ramamurthy@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-it0-f68.google.com) (209.85.214.68) by mx1-pf1.cudamail.com with ESMTPS (AES128-SHA encrypted); 1 Sep 2016 00:20:34 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.214.68 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.214.68 X-Barracuda-RBL-IP: 209.85.214.68 Received: by mail-it0-f68.google.com with SMTP id i184so4165463itf.3 for ; Wed, 31 Aug 2016 17:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=SS7CB6lsv9nyGLPmRcUKNn1Dg3vpDJvUbcQJLa2b6T0=; b=ypZaOHjO4laWjlAMA8quPeRgeU6uI14Sok62cYeew2st1N6DVBjJkuTg7ZVLNUa9x7 GqwAMcE1XlVf1kUID5mmHNgHIX+kNhLqq7ceW/rYWcbHStsFP7NV9uX2UENAiiw6jiFv XqCo52IFNyScZDRSuRw3Cd8DBmI17CV2aiQl3CeJb+vUgcbMl3XK2IX4w4OBGHXIEf1H i9ZgffV269uDwLAJZOnJqVmPtP4Z+CtePA8LHXqvNKiSc/xAN3OYQA3wxbaAb9qn8IYl WTV9seqKXhA+RWNfn65S31epDbQuHrqAe35ByTTLSQyk8OeneZuyyMQjudaNKmIscte+ ZUsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SS7CB6lsv9nyGLPmRcUKNn1Dg3vpDJvUbcQJLa2b6T0=; b=Fc8cCWZnCHkhxx2v4pGR+ghh0IUnkmu/ZalZuPUbPnOawtCiJwR8hBrVlAdZoAOmNI yHNF/PCxFx7R/xb9MFJvYQgbSF1xaBOgW93x/6K8ZJec9PpV/PPdyEtNRaGGt56X3syj NQE+jZdbneZjOhKIG3MAosglPgTslpvX5eD7MzakOVgoLiscv/GsML/ABMSliGIpEIiu fKzIqbYmsbMFqTMNPfawKE2eJ3pwmqQNlrNe5mC3sdAjcjGyEo/IOM1RcGgC7ZhadTbs L/0EDbpFP2hvl2f27H2/EpXNQ2vV3EobAf/aflc/k4qP8Nj47qT/Sg512UJo02PUeM9n z07w== X-Gm-Message-State: AE9vXwPyQF/vVPkZHhqApP2EfGUomf+cST5iJGkP/ZdYNl6Ib25Bt6MDaPxSqrl/AvxdUA== X-Received: by 10.36.227.7 with SMTP id d7mr1811557ith.97.1472689233058; Wed, 31 Aug 2016 17:20:33 -0700 (PDT) Received: from controller-01.node.os ([32.97.110.52]) by smtp.gmail.com with ESMTPSA id v124sm13991467ita.22.2016.08.31.17.20.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Aug 2016 17:20:32 -0700 (PDT) X-CudaMail-Envelope-Sender: ramu.ramamurthy@gmail.com From: Ramu Ramamurthy X-Google-Original-From: Ramu Ramamurthy To: dev@openvswitch.org X-CudaMail-MID: CM-E1-830085650 X-CudaMail-DTE: 083116 X-CudaMail-Originating-IP: 209.85.214.68 Date: Thu, 1 Sep 2016 00:20:46 +0000 X-ASG-Orig-Subj: [##CM-E1-830085650##][PATCH] ovn: log dhcp responses at INFO for debugging Message-Id: <1472689246-13644-1-git-send-email-ramu.ramamurthy@us.ibm.com> X-Mailer: git-send-email 1.8.3.1 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1472689234 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32516 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Ramu Ramamurthy Subject: [ovs-dev] [PATCH] ovn: log dhcp responses at INFO for debugging 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: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Since dhcp responses are important for debugging the vif lifecycle, we want to log them at info level which is the default log level. A logsearch (on macaddr) can quickly tell the dhcp status using such messages. There is no need to rate limit such logs because, we expect dhcp messages to be at low rate normally. Logs appear like this: 2016-09-01T00:08:16Z|00014|pinctrl|INFO|DHCPOFFER fa:16:3e:25:b0:78 10.0.0.5 2016-09-01T00:08:16Z|00015|pinctrl|INFO|DHCPACK fa:16:3e:25:b0:78 10.0.0.5 Signed-off-by: Ramu Ramamurthy --- ovn/controller/pinctrl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index d65e213..ad42fe9 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -354,6 +354,12 @@ pinctrl_handle_put_dhcp_opts( pin->packet = dp_packet_data(&pkt_out); pin->packet_len = dp_packet_size(&pkt_out); + /* Log the response. */ + const struct eth_header *l2 = dp_packet_l2(&pkt_out); + VLOG_INFO("DHCP%s "ETH_ADDR_FMT" "IP_FMT"", + msg_type == DHCP_MSG_OFFER ? "OFFER" : "ACK", + ETH_ADDR_ARGS(l2->eth_src), IP_ARGS(*offer_ip)); + success = 1; exit: if (!ofperr) {