From patchwork Thu Feb 13 16:49:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1237595 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.137; helo=fraxinus.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=eVeFYfs0; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48JMw91xBGz9s29 for ; Fri, 14 Feb 2020 03:51:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F138985F94; Thu, 13 Feb 2020 16:51:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IYLOzexKaGbW; Thu, 13 Feb 2020 16:51:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0D83D86135; Thu, 13 Feb 2020 16:50:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E3B95C07FE; Thu, 13 Feb 2020 16:50:14 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5CBC6C0177 for ; Thu, 13 Feb 2020 16:50:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 49587203F5 for ; Thu, 13 Feb 2020 16:50:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5QMljmI8njmM for ; Thu, 13 Feb 2020 16:50:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by silver.osuosl.org (Postfix) with ESMTPS id 05A71214D2 for ; Thu, 13 Feb 2020 16:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581612609; 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=loqhPsVgW0gmXMc2cc+gcrv3KKf8nXgMkdZIU0YIG4g=; b=eVeFYfs0/ANWcYc+1Biy+p3IukdVC0m7fEdaD9U4qbVeYaNYCO5BHPzvd9qVprb/mgPy1O IYIZilp+Rmiqpbsx9AC7eGvo6aY45JbXGT2C5aNDjMwIZNdjE4uZ4orZuVg2RQLwcSQXyJ JCLiKB7x/MKmjYZkoM3yBxs+MAcl5wA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-S3vHhN_mOLuIYPBs1bTWbQ-1; Thu, 13 Feb 2020 11:50:03 -0500 Received: by mail-wm1-f69.google.com with SMTP id m4so2578989wmi.5 for ; Thu, 13 Feb 2020 08:50:03 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=rRFyF7+3rblEl4MaCooJchTc1LxOvA5a058FqQXOpMo=; b=d/TnzloLNQRL8rAtVLDikHApBKSa8Fof8+EHNgw+hp+rToTtU7h0n7GCDShyXtp9aL XrNuSjykmDlIXn+GRNTRh6cnj82ZeEGPwVABHNHhsujrB0+pkqe8xclB17aIoZHQ/hCo gC9TmFl8RdXC7A1TsGercsONgB1wfIgzje+ZLKf2I4HAuKDtQ0hDIFvhDcXs5YAGYZMk BBomLhhDoZ9nleJKbQboqJ0E0CGz/fnVuEkYWNYM14dtQ11tCzWMsZLMk4AqUsFms9he /9QjQn6+ffcZksYmWZHk0bbO5gp6CNg4o8bBNfzyFjpNkcwtwwDp48W8yX8v6n69qTu7 m67Q== X-Gm-Message-State: APjAAAVYREn6Xc2f4APQd96IrU3m7RMWJgSPnfet24o33VlaGa4k/WQW Muz4aJHA3P1BxbRIiA1UB38ZIUEq/121TtVuZ2/+UtE1fK7w2nEaQ31wcZMExova1YCaQtd8Ezp gZk1Dw+LeCv0S X-Received: by 2002:a1c:7fd7:: with SMTP id a206mr6650878wmd.171.1581612602570; Thu, 13 Feb 2020 08:50:02 -0800 (PST) X-Google-Smtp-Source: APXvYqx4qeiS57DglvY/hsQxdE/+t6fyDDP/QMnaYnlJScRCkiZNWf2YZMtAoXJnl/hU12Cmk8czwQ== X-Received: by 2002:a1c:7fd7:: with SMTP id a206mr6650854wmd.171.1581612602219; Thu, 13 Feb 2020 08:50:02 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id o4sm3487425wrx.25.2020.02.13.08.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 08:50:01 -0800 (PST) From: Lorenzo Bianconi To: dev@openvswitch.org Date: Thu, 13 Feb 2020 17:49:37 +0100 Message-Id: <0f0989dedc00b85af688df35ab0d444c09093a5c.1581611906.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-MC-Unique: S3vHhN_mOLuIYPBs1bTWbQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] pinctrl: fix IP buffering with connection-tracking 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" Whenever we need to reinject an IP packet buffered during L2 address resolution we need to preserve ovs ofport in order to let ovs connection tracking to properly SNAT/DNAT the packet. Do not overwrite the MFF_IN_PORT in consider_port_binding routine Signed-off-by: Numan Siddique Signed-off-by: Lorenzo Bianconi Acked-by: Dumitru Ceara --- controller/physical.c | 1 - controller/pinctrl.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controller/physical.c b/controller/physical.c index a7edaddac..144aeb7bd 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -905,7 +905,6 @@ consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name, for (int i = 0; i < MFF_N_LOG_REGS; i++) { put_load(0, MFF_LOG_REG0 + i, 0, 32, ofpacts_p); } - put_load(0, MFF_IN_PORT, 0, 16, ofpacts_p); put_resubmit(OFTABLE_LOG_INGRESS_PIPELINE, ofpacts_p); clone = ofpbuf_at_assert(ofpacts_p, clone_ofs, sizeof *clone); ofpacts_p->header = clone; diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 09b0f7bf7..d06915a65 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -559,6 +559,7 @@ set_actions_and_enqueue_msg(struct rconn *swconn, struct buffer_info { struct ofpbuf ofpacts; + ofp_port_t ofp_port; struct dp_packet *p; }; @@ -629,6 +630,8 @@ buffered_push_packet(struct buffered_packets *bp, ofpbuf_init(&bi->ofpacts, 4096); reload_metadata(&bi->ofpacts, md); + bi->ofp_port = md->flow.in_port.ofp_port; + struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&bi->ofpacts); resubmit->in_port = OFPP_CONTROLLER; resubmit->table_id = OFTABLE_REMOTE_OUTPUT; @@ -663,7 +666,7 @@ buffered_send_packets(struct rconn *swconn, struct buffered_packets *bp, .ofpacts = bi->ofpacts.data, .ofpacts_len = bi->ofpacts.size, }; - match_set_in_port(&po.flow_metadata, OFPP_CONTROLLER); + match_set_in_port(&po.flow_metadata, bi->ofp_port); queue_msg(swconn, ofputil_encode_packet_out(&po, proto)); ofpbuf_uninit(&bi->ofpacts);