From patchwork Wed Sep 11 17:19:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1161174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46T7xS4vR9z9s00 for ; Thu, 12 Sep 2019 03:22:04 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id AFA63E80; Wed, 11 Sep 2019 17:20:04 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E206BE70 for ; Wed, 11 Sep 2019 17:20:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7E7F181A for ; Wed, 11 Sep 2019 17:20:02 +0000 (UTC) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA6F43D3C for ; Wed, 11 Sep 2019 17:20:01 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id j10so10761814wrb.16 for ; Wed, 11 Sep 2019 10:20:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w3D6Yrp4s25pw8dOIq3KIjRESSd3HoCbsReWyNtItlM=; b=UmZgYQNm4/l/n+/e30mx33qlFMpQ6jYgXAuzUr50203d0PvXego3pvlrXlWwuZi/rq vJgBAW9Aj9lcuMPdDeG9MdEyexwc9V1NGoB+XK6A0Jsrgoy5x/y1hvwOeGYfiMpLUJBn ZDNX12GWSqJvTxCE8ylDXOIxg/ZlQ7QPXXHKEr55tRYtnVcpM0r94ocAPZsz0C/HJrqh 8Sb39T7iCBXwNsdpD3qTUNpjVAbbS3fAlw9hpf290oLOoGyfN6yP0VKBAFhtflMs5hFl FTM9Ql7iStYhXeRBwGTaHYtZ39ZmgluCISpCXeS/0GQZ/T6vKt0R0hoUf1ZCUk4yKnsC Rqmw== X-Gm-Message-State: APjAAAXW1QsUHChgHzUMfF8xaM6/Tplta1XdOeupvoQ/kDqjOqEhkP7L 2tkeY6sovolANr0ZeLRVsB3T3HP3+P6J06b2q7HSrKupBcJeK46fpRquLSe1sn/1yFrHTW2PCwX 1+5FdHfKN7dmlM1slgw== X-Received: by 2002:a05:600c:230d:: with SMTP id 13mr212719wmo.114.1568222400281; Wed, 11 Sep 2019 10:20:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeM2X3Xi6bhxXaCIlzPshyqzrKooF380ooB9RI9fyMrK0Jeid8jou2IwPkgCP9ECTt02MMKQ== X-Received: by 2002:a05:600c:230d:: with SMTP id 13mr212705wmo.114.1568222400034; Wed, 11 Sep 2019 10:20:00 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id j30sm26903822wrb.66.2019.09.11.10.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 10:19:59 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Wed, 11 Sep 2019 19:19:48 +0200 Message-Id: <05231fbaf932a57e2d72ebe28f3b8ad87a05dcf7.1568220566.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [RFC ovn 3/3] northd: interoduce logical flow for localnet egress shaping X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Add set_queue() action for qos capable localnet port in S_SWITCH_OUT_PORT_SEC_L2 stage of logical switch pipeline Signed-off-by: Lorenzo Bianconi --- northd/ovn-northd.8.xml | 7 ++++++- northd/ovn-northd.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml index b34ef687a..d28f8965c 100644 --- a/northd/ovn-northd.8.xml +++ b/northd/ovn-northd.8.xml @@ -1150,10 +1150,15 @@ output; eth.dst are always accepted instead of being subject to the port security rules; this is implemented through a priority-100 flow that matches on eth.mcast with action output;. - Finally, to ensure that even broadcast and multicast packets are not + Moreover, to ensure that even broadcast and multicast packets are not delivered to disabled logical ports, a priority-150 flow for each disabled logical outport overrides the priority-100 flow with a drop; action. + Finally if egress qos has been enabled on a localnet port, the outgoing + queue id is set through set_queue action. Please remember to + mark the corresponding physical interface with + ovn-egress-iface set to true in

Logical Router Datapaths

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 889eeb795..5bae035b3 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -5681,10 +5681,20 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, ds_clear(&match); ds_put_format(&match, "outport == %s", op->json_key); if (lsp_is_enabled(op->nbsp)) { + ds_clear(&actions); + + if (!strcmp(op->nbsp->type, "localnet")) { + const char *queue_id = smap_get(&op->sb->options, + "qdisc_queue_id"); + if (queue_id) { + ds_put_format(&actions, "set_queue(%s); ", queue_id); + } + } + ds_put_cstr(&actions, "output;"); build_port_security_l2("eth.dst", op->ps_addrs, op->n_ps_addrs, &match); ovn_lflow_add(lflows, op->od, S_SWITCH_OUT_PORT_SEC_L2, 50, - ds_cstr(&match), "output;"); + ds_cstr(&match), ds_cstr(&actions)); } else { ovn_lflow_add(lflows, op->od, S_SWITCH_OUT_PORT_SEC_L2, 150, ds_cstr(&match), "drop;");