From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2EEBC43215 for ; Thu, 14 Nov 2019 12:45:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 780CB2071B for ; Thu, 14 Nov 2019 12:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbfKNMo7 (ORCPT ); Thu, 14 Nov 2019 07:44:59 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:33962 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726139AbfKNMo5 (ORCPT ); Thu, 14 Nov 2019 07:44:57 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from roid@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Nov 2019 14:44:54 +0200 Received: from dev-r-vrt-139.mtr.labs.mlnx (dev-r-vrt-139.mtr.labs.mlnx [10.212.139.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xAECirEH024546; Thu, 14 Nov 2019 14:44:54 +0200 From: Roi Dayan To: netdev@vger.kernel.org Cc: David Ahern , Stephen Hemminger , Jiri Pirko , Eli Britstein , Roi Dayan Subject: [PATCH iproute2 v2 3/5] tc: flower: fix newline prints for ct-mark and ct-zone Date: Thu, 14 Nov 2019 14:44:39 +0200 Message-Id: <20191114124441.2261-4-roid@mellanox.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20191114124441.2261-1-roid@mellanox.com> References: <20191114124441.2261-1-roid@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eli Britstein Matches of ct-mark and ct-zone were printed all in the same line. Fix that so each ct match is printed in a separate line. Example: $ tc qdisc add dev eth0 ingress $ tc filter add dev eth0 protocol ip parent ffff: prio 1 flower skip_hw \ ct_zone 5 ct_mark 6/0xf action ct commit zone 7 mark 8/0xf drop Before: $ tc -s filter show dev eth0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 31 sec used 31 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 After: $ tc -s filter show dev eth0 parent ffff: filter protocol ip pref 1 flower chain 0 filter protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 ct_zone 5 ct_mark 6/0xf skip_hw not_in_hw action order 1: ct commit mark 8/0xf zone 7 drop index 1 ref 1 bind 1 installed 108 sec used 108 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Jiri Pirko --- tc/f_flower.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index 41b81217e47e..724577563c27 100644 --- a/tc/f_flower.c +++ b/tc/f_flower.c @@ -1847,13 +1847,13 @@ static void flower_print_ct_label(struct rtattr *attr, static void flower_print_ct_zone(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u16("ct_zone", attr, mask_attr, false); + print_masked_u16("ct_zone", attr, mask_attr, true); } static void flower_print_ct_mark(struct rtattr *attr, struct rtattr *mask_attr) { - print_masked_u32("ct_mark", attr, mask_attr, false); + print_masked_u32("ct_mark", attr, mask_attr, true); } static void flower_print_key_id(const char *name, struct rtattr *attr) -- 2.8.4