From patchwork Thu May 14 14:11:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1290341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=gcOSXrNX; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49ND4t28QYz9sTb for ; Fri, 15 May 2020 00:12:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 441B788A12; Thu, 14 May 2020 14:12:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z8i5oK+2WfUn; Thu, 14 May 2020 14:12:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 78A6A88AA6; Thu, 14 May 2020 14:12:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5FF10C0863; Thu, 14 May 2020 14:12:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BAB96C016F for ; Thu, 14 May 2020 14:12:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B736388A12 for ; Thu, 14 May 2020 14:12:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h-+5fQKFgaX4 for ; Thu, 14 May 2020 14:12:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 47EF8889F4 for ; Thu, 14 May 2020 14:12:06 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id 23so1356437pfy.8 for ; Thu, 14 May 2020 07:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ePHaVFfRN+OU7oU1rwnwq7ggjLrnK4EIA3gadd+i/UE=; b=gcOSXrNXX5hBzCg44O90GT0e9/UvKJB19o2IqyT8A3hhtscEaWcuQFDctp0M49ZWvP MaUzYAGzL4iNUfVdrHioWI1tAsAB3KhLtCHA+o5FUhBUT9gmgabWNW1RuDHld4rulycp dFH2sM/+sV4TKR7f/0gYU87CrnaEby970ArV2egoAicCs6KPV8JyL1nbRmsaxNd+ZfSD eajB/1SsR6sUDACL/lqownaDpWJhfRnchqU1nJuyCUjR2zuNtUgwtDGwf8b7yX84n+qw mSyTVyKd/0bpkZkmrEtYYLCZSMrhVIlWt6k0tC3u0APq8nOJwGI8DRmvxqKpq+ZpMBrl btHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ePHaVFfRN+OU7oU1rwnwq7ggjLrnK4EIA3gadd+i/UE=; b=UC/AkgzSknPIxPS0bElvd8IpuSUPY0RqM7FoEtwWdtmpull0iPfgmfTCGepY2vr+sX UCzmybF1D28ZF0cz5ryfxvUpsg6u1QSXjjSQRLbAxGDCS7bAsNkTvC2AEpIEgAmxiibs shYZifEzp5/97Bkzzz/2ynbtySYiEFCBiOXpLow3VrvJ71oxpqC/5LBzF4WstDXCNzdS pQDX6UgrJXUc4OBV1r1w0ZNuExc/YHzVFlk/Gc8UAbgbXkgRM7Sgrxz04Zyj1ngff7wZ IH5VEltauz6wigdio3b7wEQOsL7Zljp+8GfAfLuH0fZtw3Lz+zqLiNXjQw9KNVlw2AgB 992A== X-Gm-Message-State: AOAM5315mKCyfcWI9+piKA5WkhXaUk1op6XJsBJa143sJKwPJOodWkBl hWAo4xi1gkgj8dM0TPfqfEbwzMj1jr0= X-Google-Smtp-Source: ABdhPJws5iQsR/j6NPtGrq68VhvQHXHYTQFgTqWv8e355+f3uZYn0SuGDT/3X/zPjUf4mtsTFWCgog== X-Received: by 2002:a63:f004:: with SMTP id k4mr4039672pgh.17.1589465525290; Thu, 14 May 2020 07:12:05 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id 3sm2551663pfo.27.2020.05.14.07.12.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2020 07:12:04 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Thu, 14 May 2020 07:11:38 -0700 Message-Id: <1589465498-68144-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH] dpif-netdev: Add miniflow bits to dump-flows. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The 'dpctl/dump-flows -m' only shows the number of 1-bit in the miniflow map, the patch outputs additional miniflow bits after it. The format will be dp-extra-info:miniflow_bits(count_1bit(unit0):unit0, count_1bit(unit1):unit1) Example: dp-extra-info:miniflow_bits(4:0x30c0000000000000,1:0x400) By searching the unique miniflow bits, we know the number of subtables, and for earch subtables, the fields it matches on. Cc: Emma Finn Cc: Ian Stokes Signed-off-by: William Tu Acked-by: Greg Rose Tested-by: Emma Finn --- lib/dpif-netdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 51c888501bdf..b618b07be0c8 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3352,8 +3352,9 @@ dp_netdev_flow_add(struct dp_netdev_pmd_thread *pmd, if (unit) { ds_put_char(&extra_info, ','); } - ds_put_format(&extra_info, "%d", - count_1bits(flow->cr.mask->mf.map.bits[unit])); + ds_put_format(&extra_info, "%d:0x%llx", + count_1bits(flow->cr.mask->mf.map.bits[unit]), + flow->cr.mask->mf.map.bits[unit]); } ds_put_char(&extra_info, ')'); flow->dp_extra_info = ds_steal_cstr(&extra_info);