From patchwork Fri Sep 18 17:19:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 1367107 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.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: 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=Q+WikiNL; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BtLDk0Qz8z9sRf for ; Sat, 19 Sep 2020 03:19:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0524F87895; Fri, 18 Sep 2020 17:19:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TjWb8AYscXU6; Fri, 18 Sep 2020 17:19:47 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 6C67387893; Fri, 18 Sep 2020 17:19:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 50CFCC0859; Fri, 18 Sep 2020 17:19:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A3901C0051 for ; Fri, 18 Sep 2020 17:19:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 91EA087895 for ; Fri, 18 Sep 2020 17:19:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cpR+mXXhdhrj for ; Fri, 18 Sep 2020 17:19:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id E89E287893 for ; Fri, 18 Sep 2020 17:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600449583; 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; bh=52k69Gsne/AH/YFpo6rXV+wi9D0gAdDTvJdc3EO4UlE=; b=Q+WikiNLYQdYnW+Qr+SyDkB07G48s/tYInRP3Zq2kGEOlzj2HM2A4ynnrC38ZinyL0BRno 6uoTXlxs3SVGKJszbyTKmiFi2mGJAzg2JqRGhaoS1MCqYAIBxU7xBrIJqIZ4joCj4AG9iI lx7qnsfo3RzAP5nAr9eTRAja4weHJbc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-b9pSVDBVO-qd8HlxXbY90A-1; Fri, 18 Sep 2020 13:19:41 -0400 X-MC-Unique: b9pSVDBVO-qd8HlxXbY90A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D763CACE20; Fri, 18 Sep 2020 17:19:40 +0000 (UTC) Received: from localhost.localdomain (dhcp-158-210.lab.eng.brq.redhat.com [10.37.158.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15D3019646; Fri, 18 Sep 2020 17:19:39 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Fri, 18 Sep 2020 19:19:35 +0200 Message-Id: <5415d8b1a899016cf25e951d16f2ef2ee7f9ed3e.1600449575.git.tredaelli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=tredaelli@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] ofp-actions: Fix userspace support for mpls_ttl 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" Currently mpls_ttl is ignored when a flow is added because MFF_MPLS_TTL is not handled in nx_put_raw(). This commit adds the correct handling of MFF_MPLS_TTL in nx_put_raw(). Fixes: bef3f465bcd5 ("openflow: Support matching and modifying MPLS TTL field.") Cc: blp@ovn.org Signed-off-by: Timothy Redaelli --- lib/nx-match.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nx-match.c b/lib/nx-match.c index 3ffd7d9d7..325a20ec6 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -1133,6 +1133,11 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match, mpls_lse_to_bos(flow->mpls_lse[0])); } + if (match->wc.masks.mpls_lse[0] & htonl(MPLS_TTL_MASK)) { + nxm_put_8(&ctx, MFF_MPLS_TTL, oxm, + mpls_lse_to_ttl(flow->mpls_lse[0])); + } + if (match->wc.masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) { nxm_put_32(&ctx, MFF_MPLS_LABEL, oxm, htonl(mpls_lse_to_label(flow->mpls_lse[0])));