From patchwork Mon Sep 28 13:49:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaixi Fan X-Patchwork-Id: 1372655 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=bytedance.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=JNSk3+i3; 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 4C0P6G33Sxz9sSC for ; Mon, 28 Sep 2020 23:50:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5B6D986FE7; Mon, 28 Sep 2020 13:50:08 +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 Uq0uN8gmtLDP; Mon, 28 Sep 2020 13:50:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A5BE86FB3; Mon, 28 Sep 2020 13:50:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0F009C0891; Mon, 28 Sep 2020 13:50:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0EAFFC016F for ; Mon, 28 Sep 2020 13:50:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E787385B6F for ; Mon, 28 Sep 2020 13:50:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kF0ND7AspiaX for ; Mon, 28 Sep 2020 13:49:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id DF5EA85B68 for ; Mon, 28 Sep 2020 13:49:58 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id mm21so721688pjb.4 for ; Mon, 28 Sep 2020 06:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UGTLeDJUO86bE9mKw6u3TRV6fnWPfwgKghQ34KxCfnw=; b=JNSk3+i3ZA/bJP37o/wh0ESdTlTzYN6pby+0QANLVCkMffSRu10t6g/1zFsWJ1L4Hb 1sopWls312eYIWdCBtYJ4hENOOItd3QQU6kc0+ZgxeIkTYuQy3rHkiDIWEeoqJ/UZLtO 1Cr32n3UFW1bGMzg2ltr4iH1ncNBQ5ZSeFOkoErR5vdxkj/yl9rAvcROP8XMzZsU6H7p jKLw6eC5QZcsQPAuYEel6V53WK3o7uAEnvpt/u4plPWvPP5bFuL3N73kDByWXA6/T3Jo JNstGD99BJBhjKBwZAu3bjMwGJJ3XrR+O/LE4D3Wd1P5/poVHzU7meWRYxItVNO1qkZY EMYg== 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=UGTLeDJUO86bE9mKw6u3TRV6fnWPfwgKghQ34KxCfnw=; b=NI6xShR72eiEF7UYNZdHGK0QgKnUpPeYY6SbvqKtScIUIIJ/XbZxT1IrVLQNW0kh9w 4liwFO4d2LwfbC7SscdMjxunhfg5XQEfwKztn0RRZP8yeLM+FFrxprsy2Gh5+lsJTJfv Cup5+Mts1yEmnvVoS7Pli5T2A2TRJKAYQsVw9beZDeDZ0Oi8f2J+zdPJHsMZdcRiKr+f FHlxLX7O5wqc58dMFdztvjNYswXp+XZ7yxqIwO17gUXFzADJgtB7dVS8yUy0m1nHAryc R8XpODd9O0mBGXkk9mnDZf+1B88hEBwZ2uD0ZKxiFaMS6jOhRlBVutjEEK+tDYf1GfDo k8Ug== X-Gm-Message-State: AOAM533baLtOS+1ZbJUovpVW4CcmT9C2R+kaznc6q8jRqP4T8zQoR6UI h0hs9g9M/5Bv48cnJCKDq2qBNIYeJvxp2tf2 X-Google-Smtp-Source: ABdhPJz4g5GqAdTEu1eEjBJ+ooCU/0D5nk26kyvaG4S4mjzCw3+KPojbmOHG6XSHO+1NRDPZR7vsPw== X-Received: by 2002:a17:90b:4b0b:: with SMTP id lx11mr1423076pjb.104.1601300998155; Mon, 28 Sep 2020 06:49:58 -0700 (PDT) Received: from MacBook-Pro-3.local.net ([103.136.220.72]) by smtp.gmail.com with ESMTPSA id s28sm1920775pfd.111.2020.09.28.06.49.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 06:49:57 -0700 (PDT) From: fankaixi.li@bytedance.com To: dev@openvswitch.org, fbl@redhat.com Date: Mon, 28 Sep 2020 21:49:47 +0800 Message-Id: <20200928134947.48269-1-fankaixi.li@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] ofproto-dpif: remove checking setting nd_ext field 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" From: "fankaixi.li" In order to support openflow rule which setting nd_ext fields in openflow tables, we should remove setting nd_ext fields when constructing rule. The ofproto would translate it into userspace actions when handling upcalls. When trying to add the following flows to ovs with kernel: # flow 1 ovs-ofctl -Oopenflow13 add-flow br0 "cookie=0x4000000, table=0, priority=50,icmp6,icmpv6_type=135,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,nd_sll=fa:16:3e:55:ad:df,actions=set_field:136->icmpv6_type,set_field:0->icmpv6_code,set_field:2->nd_options_type,goto_table:1" # flow 2 ovs-ofctl -Oopenflow13 add-flow br0 "cookie=0x12220d57,table=1,priority=80,icmp6,icmpv6_type=136,icmpv6_code=0,nd_target=2001:db8:0:2:0:0:0:1,actions= move:eth_src[]->eth_dst[],set_field:00:23:15:d3:22:01->eth_src,move:ipv6_src[]->ipv6_dst[],set_field:2001:db8:0:2:0:0:0:1->ipv6_src,set_field:00:23:15:d3:22:01->nd_tll,set_field:0xe00->nd_reserved,set_field:2->nd_options_type,output:3" Ovs would emit a error message: OFPT_ERROR (OF1.3) (xid=0x6): OFPBAC_BAD_SET_ARGUMENT The output of log file shows a error message: 2020-09-28T12:22:09.453Z|00036|ofproto_dpif|WARN|Rejecting set field action because datapath does not support setting IPv6 ND Extensions fields (your kernel module may be out of date) 2020-09-28T12:22:09.453Z|00037|connmgr|INFO|br0<->unix#14: sending OFPBAC_BAD_SET_ARGUMENT error reply to OFPT_FLOW_MOD message This patch would fix this error. Also following Flavio Leitner's advise, I have prepared a testcase for this patch. But after running auto-testcases, I found that the test framework ovs support flows with actions to set nd_reserved field. The testsuites.log shows table 0 supporting setting nd_reserved and nd_options_type fields, and it shows that ovs was configured at dummy mode. I think there are some differences bewteen these two ovs modes. So I decide not commit the testcase about this fix. Signed-off-by: fankaixi.li CC: Flavio Leitner Fixes: d0d571493cf8 ("ofproto-dpif: Allow IPv6 ND Extensions only if supported") --- ofproto/ofproto-dpif.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 4f0638f23..f4c37f43d 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4637,14 +4637,6 @@ check_actions(const struct ofproto_dpif *ofproto, "ct original direction tuple"); return OFPERR_NXBAC_CT_DATAPATH_SUPPORT; } - } else if (!support->nd_ext && ofpact->type == OFPACT_SET_FIELD) { - const struct mf_field *dst = ofpact_get_mf_dst(ofpact); - - if (dst->id == MFF_ND_RESERVED || dst->id == MFF_ND_OPTIONS_TYPE) { - report_unsupported_act("set field", - "setting IPv6 ND Extensions fields"); - return OFPERR_OFPBAC_BAD_SET_ARGUMENT; - } } }