From patchwork Wed May 10 14:21:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1779530 X-Patchwork-Delegate: nusiddiq@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzkDhDKE; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QGcfq1n5rz214j for ; Thu, 11 May 2023 00:22:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 46ED84299B; Wed, 10 May 2023 14:22:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 46ED84299B Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzkDhDKE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tLlrYI2-ciB9; Wed, 10 May 2023 14:22:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id D1335429DF; Wed, 10 May 2023 14:22:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D1335429DF Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C583BC008E; Wed, 10 May 2023 14:22:03 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6FD4EC0036 for ; Wed, 10 May 2023 14:22:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4A75F6FE7B for ; Wed, 10 May 2023 14:22:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4A75F6FE7B Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OzkDhDKE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UXr23nGknzWo for ; Wed, 10 May 2023 14:22:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 23638616C9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 23638616C9 for ; Wed, 10 May 2023 14:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683728519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n+zAxeiLuzz5Hx1s94et9CTXEXY1fzbxwYshZ6mdRYU=; b=OzkDhDKEWI3kQ/8TOvrw++7fsMwBlcoVOsUXo56INw1k4dI7b+dcGnwcD6y0eYCbnHvmEh UJqP406zac44KA05IMC5Ymq9UaVHIZCCl7W5cFeDA03eZV7QbCdUnBlAm2pJNxvgX2IrpG sYhvPx3Xjrzg/GWdeIN6dENcBHj8WVM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-i_1XEN3sObePaVCrQB9adA-1; Wed, 10 May 2023 10:21:57 -0400 X-MC-Unique: i_1XEN3sObePaVCrQB9adA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f426ffdbc6so21575525e9.3 for ; Wed, 10 May 2023 07:21:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683728516; x=1686320516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n+zAxeiLuzz5Hx1s94et9CTXEXY1fzbxwYshZ6mdRYU=; b=T3gdYmwM91M+Wl4tMq5NIai1/4VU2wWWHD+VSCvOCF4i6LyDi2WYAWQ45co4RuzlkD XMxbneZnuLtLJfPPrDpW+OEgKusprmcIJSrzOU8+UFGLcnqSBprlxuBVE4SbshbdDc25 kSzpOxhvRqgHYq0+Fyg0b2U+b+lNvU/zlZn4gMuzwsIbtqyu7N7c7tM7ZqNfeGGoTx/+ p8fSuv9wNIOy+hADGAfrHIkaJb5Mja+jzUtJv0Tnitv4uQ/bDJ5Lactb1tHh58iR0Vo4 huiWxbZ6+oKQPnLscCewP/t9/Rbq/1KdBE/keTp1Wr4oBGiTWewIbgqif5DVtrpiKhhW LnQw== X-Gm-Message-State: AC+VfDwFZZPb6rjCpZT8CAEt5S5aFpHcdJ2fOCbITv8/PyMu4UYOowcw ogIx7wAu16/waGOybEXT9ItyG0Q/MMMGCn+v2ypqydvEnGq83CwweIv+8xTK7QYT1i1qKuodncg 8TJ5R9XragEpaCtGP+B9S/8VANTz9TruIICsFyyFWj+7tlj4geP4kft3K6/AaNK8ZStZVP3F7mV TEnoxBjqNUpr1P X-Received: by 2002:adf:ee46:0:b0:2d2:f3e3:115d with SMTP id w6-20020adfee46000000b002d2f3e3115dmr13328204wro.59.1683728516157; Wed, 10 May 2023 07:21:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rv5mRb0nMwdPV1M50ZMmXtcXF34XtnywaUM0mHNaGpB537l3FJxSA39Dml66gW4eaN2IxXQ== X-Received: by 2002:adf:ee46:0:b0:2d2:f3e3:115d with SMTP id w6-20020adfee46000000b002d2f3e3115dmr13328182wro.59.1683728515888; Wed, 10 May 2023 07:21:55 -0700 (PDT) Received: from localhost (net-130-25-106-149.cust.vodafonedsl.it. [130.25.106.149]) by smtp.gmail.com with ESMTPSA id r12-20020a5d494c000000b003077f3dfcc8sm16818991wrs.32.2023.05.10.07.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 07:21:55 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Wed, 10 May 2023 16:21:25 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: dceara@redhat.com, simon.horman@corigine.com, i.maximets@ovn.org, ralonsoh@redhat.com Subject: [ovs-dev] [PATCH v6 ovn 3/9] northd: introduce qos_physical_network in port_binding other_config column 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This is a preliminary patch to rework OVN QoS implementation in order to configure it through OVS QoS table instead of running tc command directly bypassing OVS. Signed-off-by: Lorenzo Bianconi --- controller/binding.c | 7 ++++++- northd/northd.c | 8 ++++++++ ovn-sb.xml | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/controller/binding.c b/controller/binding.c index b9bcb5389..6854a162d 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -142,6 +142,7 @@ static void update_lport_tracking(const struct sbrec_port_binding *pb, struct qos_queue { struct hmap_node node; + char *network; char *port; bool stale; @@ -210,6 +211,7 @@ qos_queue_gc(const struct sbrec_port_binding *pb, struct hmap *queue_map) HMAP_FOR_EACH_SAFE (q, node, queue_map) { if (q->stale) { hmap_remove(queue_map, &q->node); + free(q->network); free(q->port); free(q); } @@ -221,6 +223,7 @@ destroy_qos_map(struct hmap *qos_map) { struct qos_queue *q; HMAP_FOR_EACH_POP (q, node, qos_map) { + free(q->network); free(q->port); free(q); } @@ -234,8 +237,9 @@ get_qos_queue(const struct sbrec_port_binding *pb, struct hmap *queue_map) uint32_t max_rate = smap_get_int(&pb->options, "qos_max_rate", 0); uint32_t burst = smap_get_int(&pb->options, "qos_burst", 0); uint32_t queue_id = smap_get_int(&pb->options, "qdisc_queue_id", 0); + const char *network = smap_get(&pb->options, "qos_physical_network"); - if ((!min_rate && !max_rate && !burst) || !queue_id) { + if ((!min_rate && !max_rate && !burst) || !queue_id || !network) { /* Qos is not configured for this port. */ return; } @@ -246,6 +250,7 @@ get_qos_queue(const struct sbrec_port_binding *pb, struct hmap *queue_map) if (!q) { q = xzalloc(sizeof *q); hmap_insert(queue_map, &q->node, hash); + q->network = xstrdup(network); q->port = xstrdup(pb->logical_port); q->min_rate = min_rate; q->max_rate = max_rate; diff --git a/northd/northd.c b/northd/northd.c index 25df0957e..53217347d 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -3505,7 +3505,15 @@ ovn_port_update_sbrec(struct ovsdb_idl_txn *ovnsb_txn, } smap_clone(&options, &op->nbsp->options); + if (queue_id) { + if (op->od->n_localnet_ports) { + struct ovn_port *port = op->od->localnet_ports[0]; + const char *physical_network = smap_get( + &port->nbsp->options, "network_name"); + smap_add(&options, "qos_physical_network", + physical_network); + } smap_add_format(&options, "qdisc_queue_id", "%d", queue_id); } diff --git a/ovn-sb.xml b/ovn-sb.xml index 8ca206109..d8c726dfa 100644 --- a/ovn-sb.xml +++ b/ovn-sb.xml @@ -3654,6 +3654,11 @@ tcp.flags = RST; interface, in bits. + + If set, indicates the name of the egress network name where traffic + shaping will be applied. + + Indicates the queue number on the physical device. This is same as the