From patchwork Wed Apr 24 09:56:05 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Naveen Yerramneni
X-Patchwork-Id: 1927080
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256
header.s=proofpoint20171006 header.b=k7w1+jl4;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256
header.s=selector1 header.b=L5R8tfpC;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org
(client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;
envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)
Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4VPZBn3Lcjz1yZr
for ; Wed, 24 Apr 2024 19:56:33 +1000 (AEST)
Received: from localhost (localhost [127.0.0.1])
by smtp4.osuosl.org (Postfix) with ESMTP id 74B1A407D8;
Wed, 24 Apr 2024 09:56:31 +0000 (UTC)
X-Virus-Scanned: amavis at osuosl.org
Received: from smtp4.osuosl.org ([127.0.0.1])
by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id y4_mbdY7Eq4Y; Wed, 24 Apr 2024 09:56:30 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56;
helo=lists.linuxfoundation.org;
envelope-from=ovs-dev-bounces@openvswitch.org; receiver=
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6429340801
Authentication-Results: smtp4.osuosl.org;
dkim=fail reason="signature verification failed" (2048-bit key)
header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256
header.s=proofpoint20171006 header.b=k7w1+jl4;
dkim=fail reason="signature verification failed" (2048-bit key,
unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256
header.s=selector1 header.b=L5R8tfpC
Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])
by smtp4.osuosl.org (Postfix) with ESMTPS id 6429340801;
Wed, 24 Apr 2024 09:56:28 +0000 (UTC)
Received: from lf-lists.osuosl.org (localhost [127.0.0.1])
by lists.linuxfoundation.org (Postfix) with ESMTP id 505CAC008E;
Wed, 24 Apr 2024 09:56:28 +0000 (UTC)
X-Original-To: dev@openvswitch.org
Delivered-To: ovs-dev@lists.linuxfoundation.org
Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])
by lists.linuxfoundation.org (Postfix) with ESMTP id 10252C0037
for ; Wed, 24 Apr 2024 09:56:27 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by smtp4.osuosl.org (Postfix) with ESMTP id E2FA3407EE
for ; Wed, 24 Apr 2024 09:56:26 +0000 (UTC)
X-Virus-Scanned: amavis at osuosl.org
Received: from smtp4.osuosl.org ([127.0.0.1])
by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP
id P7eYp9jy6qcc for ;
Wed, 24 Apr 2024 09:56:25 +0000 (UTC)
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=148.163.155.12;
helo=mx0b-002c1b01.pphosted.com; envelope-from=naveen.yerramneni@nutanix.com;
receiver=
DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 8FC7B40791
Authentication-Results: smtp4.osuosl.org;
dmarc=pass (p=none dis=none) header.from=nutanix.com
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8FC7B40791
Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com
[148.163.155.12])
by smtp4.osuosl.org (Postfix) with ESMTPS id 8FC7B40791
for ; Wed, 24 Apr 2024 09:56:24 +0000 (UTC)
Received: from pps.filterd (m0127844.ppops.net [127.0.0.1])
by mx0b-002c1b01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
43O0S6s4031089;
Wed, 24 Apr 2024 02:56:23 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=
from:to:cc:subject:date:message-id:in-reply-to:references
:content-transfer-encoding:content-type:mime-version; s=
proofpoint20171006; bh=sBViVx2bM24leWhFqMjDsU4T9+ym7g0f3Fb3vZqC3
EE=; b=k7w1+jl4+Q/vdYx+Ff/JwmVPcIAKW5N3zTQScDP6vk8rzC9oW+LRRuXrV
QgElmJZb6JeE/927hKxSB9F908CJ2P4H6HatKkaMGHcGvEWyRR6dkhlp1pv/4vri
HIqDsZ/62GMK22KvWVZ59lzqHWNahUTicCn+R3kiEimMWjs8uKFGIdWMXtUIPg0N
RvH4OEqZZTUQzsqyix6rlQjUACM7K8Nre2/I84pk/aXYOKudJUnnIRpFMiU6KIgU
p60ZdoeKvK0CjVYjihx2t5RJuOXpQOVU5ls7ywxUr6wMJVAV2EHTQ4EZ2LwwiGMY
DxAPS3SiyzvyRA9Khk5ylU6RsaSnA==
Received: from nam02-dm3-obe.outbound.protection.outlook.com
(mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41])
by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3xmd7yfstw-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 24 Apr 2024 02:56:23 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=HrEtQ6y7NUuiLewRu+Cm6PiNYp/5zPhYJdJpGqi9HiWgeWG53V9nppfB1JIkn/vCPfW/7TFc1bGar0JpImXSMMUeTONE78HE7wmGFDrb1PIkpvaD2CM45nbtCh9gmF5+7ldAVGTBiUOiV+gBS5tIkV7dEaqR+c5H5UJaL82EZnBqw9Yp6oFYtjSzaUxRzjysAJZ8w/6NoqwegOFlLRO3LMfHYj2jJnTAsRInFid1WAIaD188Bnju0iM/7gsOeJDnUYCl0kTeDkJG2cNciT4Gg2ZAXCkt/ChOzSfPPe5CZz5fGec3CoUmpQqn6DDn6x/Tn1QX0CycFDn/tJPkASu7Rg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=sBViVx2bM24leWhFqMjDsU4T9+ym7g0f3Fb3vZqC3EE=;
b=IFo9vFkE9n9p0Ut17c88UCHCC6XHF8qSQrlQltzvp4YU57jmP/klERqtQW1++lFS4ordGuDHbbClmmvZbLCd10cTLG/Yp9JEFtWUq4lOqYBhF1nCBjq+OAezfvcMhFb8ttkU2nY62axUvXjpi4D5QPFvo2wFIZ5dO27UJDU900l+hNX6ap0l2sn6OtbMdRmLu3zH5pDgGw3SDgsBATizPhnutAGBx8f151pOln87aK960fxVdhK0fE9U4pZfqUNuct6GuyQNG39s53L054r5chyPYAr5dgH/QO5WtMexuW8/MeHZ5Qfnv5pVakf+cHlUb74FmbGSyCf1M4FHoIT8cg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com;
dkim=pass header.d=nutanix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com;
s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=sBViVx2bM24leWhFqMjDsU4T9+ym7g0f3Fb3vZqC3EE=;
b=L5R8tfpCDk9rrsg5b65I3nAw9JA8BlJZzPaPOSSa2zWdQjxz5PkdQNziJ5cXAxDfz1HvzNhXaDegvLIfDdu39vC5sl0xjP6a2031sJIas2lTV7i3RbV6T5w1oxu9QjjXC/Go/jLjnZulwBAkIUtdpozRuFkH05Xau9ifFwdKBhYZv02FX50P59fGLwpgqDeFjIYlhEBvxgfy+aIFazfrYNYPtOgEREaKUZ6R8yGfsp++oBk9bIth6sc3MAx7zKIoB24yDvYbCLcvfTNBg2N3eOPrNxoBKBePGduoGRUlHzlEz0lmKCQ4cqu2uoZKZiFmkxOL/MuRvm+sK3UsUq2BZA==
Received: from SJ0PR02MB7808.namprd02.prod.outlook.com (2603:10b6:a03:326::16)
by SJ0PR02MB7453.namprd02.prod.outlook.com (2603:10b6:a03:29b::18)
with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.23; Wed, 24 Apr
2024 09:56:21 +0000
Received: from SJ0PR02MB7808.namprd02.prod.outlook.com
([fe80::d95e:4ad8:aa24:7c4]) by SJ0PR02MB7808.namprd02.prod.outlook.com
([fe80::d95e:4ad8:aa24:7c4%3]) with mapi id 15.20.7519.021; Wed, 24 Apr 2024
09:56:21 +0000
From: Naveen Yerramneni
To: dev@openvswitch.org
Date: Wed, 24 Apr 2024 09:56:05 +0000
Message-Id: <20240424095607.129155-2-naveen.yerramneni@nutanix.com>
X-Mailer: git-send-email 2.36.6
In-Reply-To: <20240424095607.129155-1-naveen.yerramneni@nutanix.com>
References: <20240424095607.129155-1-naveen.yerramneni@nutanix.com>
X-ClientProxiedBy: PH8PR21CA0001.namprd21.prod.outlook.com
(2603:10b6:510:2ce::25) To SJ0PR02MB7808.namprd02.prod.outlook.com
(2603:10b6:a03:326::16)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ0PR02MB7808:EE_|SJ0PR02MB7453:EE_
X-MS-Office365-Filtering-Correlation-Id: 6a4f14d4-d7f8-4d70-17a7-08dc6444cb62
x-proofpoint-crosstenant: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
ARA:13230031|366007|52116005|376005|1800799015|38350700005;
X-Microsoft-Antispam-Message-Info:
cg9Js0taV4YCoBP7hNK0rrXQ3OGY2krSxUyVspVEMLCzBWSi0K+pwFOa0X6ept3mZO8W3aEKJhKuxiJtmDcyMq65Ox0URVrvm9N9egjDNL8GdGYWyRVrFITSOjrVes9WZJQWXx+3o9qyEAGYyNV1dYKr180ljirxK4zRrcLhiRX6YhI7NogrnE6LM2GbvCkER4TUl/t+CAAhmq3IBpi5EwWLK7HxAczXZafY5r/HKgj4bZmWk6FnQZZIOPRFc2Y+dCBGRpuXLUjGP36+F1sp/8oLt72arP/hQKqPTrKBAcwEJaKmsPdfPcJtystjHOYV+20bvqWq1Q0pnDL03qpI7UwkV0rF8bsK3sb/gmPRoBHNsr/npYFplGrt60GVRslzza/GZeyHMS5ZzPfzC5MFPTRXRcCTxk8R54EpwE5ERhPh/0dPGH9deRMZ/eV9MJzd0uxJ1fbdXVSFJdDlUETHabIGWU7bM1HPnP4+/j5EacKh640jiV1Ia/A76rO5i272g4aaJoERYoqQGaq82apziGtOHc9x0QOWVcos1PC9IX/OVU4EHLuFBDjkTntFAN0vScRQNFg6qAWJLSuR2lCmCgbcV+oswkxOKFXJur/RtY3EcHrvIL7Snu2d9S1BjJjYDaX4Hj2eG321/2yDTg7VQfl/FHbE8eK2h2+7FTiWzuMYGeitte9StFL7wWTa71xzrjCOBis8PC/26/3Q8Z8OYTWHCpPjrCCZRWofy4t/sx4dgE4jmGLPXmXvDoD+ftrDJt7vTKQ7uGTYgqGT1MjCujvV0cO4oQThknLj2QJZrlq3lqxmPYofgHr9J+tD4t3weBNprUKtp4eXsvV33fDBV4QpWk+ZO8b5hGws+tTraahTsulMqMM9zxvb/v6d98m7dTIFddPOj9iedBSMBWCZWw9/nvXMUiYkiO+T1HithegtfRQShTO+pvp5mXsiC37TMtNaT14hyirE/4GmMm/3jNI+4QG/rULc6xPv93f2BFTOQB4J7LKm2p5xr0LpANXWvkVe4KKP+/OtF4YBuci24GCttgiyFJFzsrrzOZmhqQIgrhlelBzy0E5j+BRRONKlCQwgDcHe92Uot5IvgADGPq5dMKplnji8kvOndiXvvfez5lh4mKLD+l0MI4rWk3ZGCdUON21fCUemBMXqNsWDV564TNZhq/PDi8zSjo/Pk9nHVF3QOeRtxAFRHftfoFMe+/eVvHU9xISV8N2xDkStgRzJc0sfqztU5Hwbk/ez7uozi7S0QnZSoKbA8+njL2MTiyLS7nweGgG352Gm732+EKCKV4uiowAYfonXqj9roBNjnr4iYqZwAC8R3beymoE5a6bVo6A9Gf7jff8zhrNrLQ==
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:SJ0PR02MB7808.namprd02.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230031)(366007)(52116005)(376005)(1800799015)(38350700005); DIR:OUT;
SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
7Ufud4ZGLRxE0yXeIMjDyK3I8ll/07ei+ToSrT+oAVkEGudqh5tMJzYlO3gfuAHSqXSSEinsF1HkAB3lCqj58/Exe7eZ4+eaOjekvjCuyY+Ern+3Dpjdm1dWXXgoX+pzKvNU+H14mfKeiftPjWTgNjIgUyS5PtN6fsb4UxqmdtD6uF2cssKHU6lXXAQVFA53Ti2+qvP4KnzQZgGdc0Jpqftyhtd8vAXaJWKAtYPxpYn2w/SV+KPK2RfAH0ZYDHKMn1VMItZKTTx0UFDBqnSt4VOIlmzrMuXuGInJAyxbQ8oiVyMXSLy66nPKPIHoesQcG3RLi1BUomdgbrYo769aaz36e527rQGV3nvZ+poQDkpzO6uCKwiVsqVxF4RWOZ9dUvxLQhG9Qzs8MV5Oj6V88bsIldyzNKymi9opzeXSPfi14vqS1aVINmqt7X1yEiANQhPJCIDCgnSPUScvKuW5I2cDSbfoTHEpJbsq4+WNeQASv7wJW0Cnu/9Ic2ffcsnePkWH6htdqY9AP2dTSSOaDffh4o3HeZ069s/UYEPbjZIv63qrGioNNKNgX6oqa831u55F2Z5bvIKHUTrZHIsZYgdyrcR2V7S1Xk1FdH8m+orzFVqhsIrC2j+FKdhanyAiXglOBr//CuiBYWhooPXLOmOqr7RzKlmo9aDTntEiXRL/Ph+wC3FvGiKq/2ENUV3oQQY4vdv2aw1WqgittqR60zInQtjkQHiJ2U9XsbP+wexuteAIVdwqPa8I4hv3RHuvn2MWJioB2z8bYdA2hTarbQu2Hm8zNHH22/5p22jN9cCRKVeWuo6S/2IU3KzRIr/mcHiZo8J8GuvQ7eGivqTcNrAxuYbN5w3w/hy9herMVBgxLthruGNPvM1OHZQfd4Wp2RuYT2BZUT2by/LJFx5YL0h+xM0YnbqxoF/SU2pjC/6nj+XQO4pi3rrTCDgUyJI0fMQ1lUZ4auU02+I2OpLfqnQpRKCicXOYW/tEuzo/3HgVd7pezzAdhtz0na5l9VtQngZcTeHWXqRvJUsZTJp1CDFLOGXI8Ocu4yrANAlhMgEeeb98O8paFXB5dq8x6R1S8uDZHb0ZkX4DiK5hL+ueNlnbYVwsm4rPgmu7eAUPY5erpk85yJZANJrDa1mv2Iodyg+9n9o0riYKkV4yoNeGnNsJ2TUymh1tJ03L2xMDtkEApwJqjdEoOGBMX9x3fCjdzbGQIav0Ng4UI6gXGvI05lPpqZ5sYniEQSfp3Ayw3RmubH7oJds0+j8FdE5BcHXVYEgeV+TcBhnovyb8cjaPXeQ2+rv2gDPKZ8uOAXSrNuCg0vnUgdUYfxWvwars2BXrYgfSW2DTmDMKp0jyb1VQN33c0jJVyikQs4jkWKxjYDin3f04ZjmDa6a9TsYEo1bv3/bQG0e8ql8wnvRhtGoJtPC/2Mt9w09tiTJCv1qqxGW6m53rJ0KmE0ePE6Nt/GykJvRK++KbnrTQHqKoRLpjOIOs9myypPlk356RHc1vTFIdmzc/ziRPL+ScRwht8+X33n7CYUhtWpeMR4ezxA6YqsjvVYVL3JtO/FLuFaVxl3Pfr6EtYHF6ZNBVux9aUCK74yUaTPGkjV/wyZJkrUgclpfgSM1UMmK9IIeFz8/QH44=
X-OriginatorOrg: nutanix.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
6a4f14d4-d7f8-4d70-17a7-08dc6444cb62
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR02MB7808.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 09:56:21.3666 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName:
1JlPAVWNVSIWUskqhdl/aaMISBqfDWUD+De/n1t9YyxfmtEDdARG9RKXuw+bFeJXgdzNKGDBtiSOr0EPXO+DsE9pe4BOu5hwBOQY4HUbsX8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7453
X-Proofpoint-GUID: jG6g0z9M8Ruv6x9iJrM6gajp4fr6sqwS
X-Proofpoint-ORIG-GUID: jG6g0z9M8Ruv6x9iJrM6gajp4fr6sqwS
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26
definitions=2024-04-24_07,2024-04-23_02,2023-05-22_02
X-Proofpoint-Spam-Reason: safe
Cc: huzaifa.c@nutanix.com
Subject: [ovs-dev] [PATCH OVN v6 1/3] actions: DHCP Relay Agent support for
overlay IPv4 subnets.
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"
NEW OVN ACTIONS
---------------
1. dhcp_relay_req_chk(, )
- This action executes on the source node on which the DHCP request originated.
- This action relays the DHCP request coming from client to the server.
Relay-ip is used to update GIADDR in the DHCP header.
2. dhcp_relay_resp_chk(, )
- This action executes on the first node (RC node) which processes
the DHCP response from the server.
- This action updates the destination MAC and destination IP so that the response
can be forwarded to the appropriate node from which request was originated.
- Relay-ip, server-ip are used to validate GIADDR and SERVER ID in the DHCP payload.
Signed-off-by: Naveen Yerramneni
---
include/ovn/actions.h | 27 ++++++++++
lib/actions.c | 116 ++++++++++++++++++++++++++++++++++++++++++
ovn-sb.xml | 62 ++++++++++++++++++++++
tests/ovn.at | 34 +++++++++++++
utilities/ovn-trace.c | 67 ++++++++++++++++++++++++
5 files changed, 306 insertions(+)
diff --git a/include/ovn/actions.h b/include/ovn/actions.h
index f697dff39..ab2f3856c 100644
--- a/include/ovn/actions.h
+++ b/include/ovn/actions.h
@@ -96,6 +96,8 @@ struct collector_set_ids;
OVNACT(LOOKUP_ND_IP, ovnact_lookup_mac_bind_ip) \
OVNACT(PUT_DHCPV4_OPTS, ovnact_put_opts) \
OVNACT(PUT_DHCPV6_OPTS, ovnact_put_opts) \
+ OVNACT(DHCPV4_RELAY_REQ_CHK, ovnact_dhcp_relay) \
+ OVNACT(DHCPV4_RELAY_RESP_CHK, ovnact_dhcp_relay) \
OVNACT(SET_QUEUE, ovnact_set_queue) \
OVNACT(DNS_LOOKUP, ovnact_result) \
OVNACT(LOG, ovnact_log) \
@@ -389,6 +391,15 @@ struct ovnact_put_opts {
size_t n_options;
};
+/* OVNACT_DHCP_RELAY. */
+struct ovnact_dhcp_relay {
+ struct ovnact ovnact;
+ int family;
+ struct expr_field dst; /* 1-bit destination field. */
+ ovs_be32 relay_ipv4;
+ ovs_be32 server_ipv4;
+};
+
/* Valid arguments to SET_QUEUE action.
*
* QDISC_MIN_QUEUE_ID is the default queue, so user-defined queues should
@@ -765,6 +776,22 @@ enum action_opcode {
/* multicast group split buffer action. */
ACTION_OPCODE_MG_SPLIT_BUF,
+
+ /* "dhcp_relay_req_chk(relay_ip, server_ip)".
+ *
+ * Arguments follow the action_header, in this format:
+ * - The 32-bit DHCP relay IP.
+ * - The 32-bit DHCP server IP.
+ */
+ ACTION_OPCODE_DHCP_RELAY_REQ_CHK,
+
+ /* "dhcp_relay_resp_chk(relay_ip, server_ip)".
+ *
+ * Arguments follow the action_header, in this format:
+ * - The 32-bit DHCP relay IP.
+ * - The 32-bit DHCP server IP.
+ */
+ ACTION_OPCODE_DHCP_RELAY_RESP_CHK,
};
/* Header. */
diff --git a/lib/actions.c b/lib/actions.c
index 361d55009..6cd60366a 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1869,6 +1869,8 @@ is_paused_nested_action(enum action_opcode opcode)
case ACTION_OPCODE_BFD_MSG:
case ACTION_OPCODE_ACTIVATION_STRATEGY_RARP:
case ACTION_OPCODE_MG_SPLIT_BUF:
+ case ACTION_OPCODE_DHCP_RELAY_REQ_CHK:
+ case ACTION_OPCODE_DHCP_RELAY_RESP_CHK:
default:
return false;
}
@@ -2610,6 +2612,114 @@ ovnact_controller_event_free(struct ovnact_controller_event *event)
free_gen_options(event->options, event->n_options);
}
+static void
+format_dhcpv4_relay_chk(const char *name,
+ const struct ovnact_dhcp_relay *dhcp_relay,
+ struct ds *s)
+{
+ expr_field_format(&dhcp_relay->dst, s);
+ ds_put_format(s, " = %s("IP_FMT", "IP_FMT");",
+ name,
+ IP_ARGS(dhcp_relay->relay_ipv4),
+ IP_ARGS(dhcp_relay->server_ipv4));
+}
+
+static void
+parse_dhcp_relay_chk(struct action_context *ctx,
+ const struct expr_field *dst,
+ struct ovnact_dhcp_relay *dhcp_relay)
+{
+ /* Skip dhcp_relay_req_chk/dhcp_relay_resp_chk( */
+ lexer_force_match(ctx->lexer, LEX_T_LPAREN);
+
+ /* Validate that the destination is a 1-bit, modifiable field. */
+ char *error = expr_type_check(dst, 1, true, ctx->scope);
+ if (error) {
+ lexer_error(ctx->lexer, "%s", error);
+ free(error);
+ return;
+ }
+ dhcp_relay->dst = *dst;
+
+ /* Parse relay ip and server ip. */
+ if (ctx->lexer->token.format == LEX_F_IPV4) {
+ dhcp_relay->family = AF_INET;
+ dhcp_relay->relay_ipv4 = ctx->lexer->token.value.ipv4;
+ lexer_get(ctx->lexer);
+ lexer_match(ctx->lexer, LEX_T_COMMA);
+ if (ctx->lexer->token.format == LEX_F_IPV4) {
+ dhcp_relay->family = AF_INET;
+ dhcp_relay->server_ipv4 = ctx->lexer->token.value.ipv4;
+ lexer_get(ctx->lexer);
+ } else {
+ lexer_syntax_error(ctx->lexer, "expecting IPv4 dhcp server ip");
+ return;
+ }
+ } else {
+ lexer_syntax_error(ctx->lexer, "expecting IPv4 dhcp relay "
+ "and server ips");
+ return;
+ }
+ lexer_force_match(ctx->lexer, LEX_T_RPAREN);
+}
+
+static void
+encode_dhcpv4_relay_chk(const struct ovnact_dhcp_relay *dhcp_relay,
+ const struct ovnact_encode_params *ep,
+ struct ofpbuf *ofpacts,
+ enum action_opcode dhcp_relay_opcode)
+{
+ struct mf_subfield dst = expr_resolve_field(&dhcp_relay->dst);
+ size_t oc_offset = encode_start_controller_op(dhcp_relay_opcode, true,
+ ep->ctrl_meter_id,
+ ofpacts);
+ nx_put_header(ofpacts, dst.field->id, OFP15_VERSION, false);
+ ovs_be32 ofs = htonl(dst.ofs);
+ ofpbuf_put(ofpacts, &ofs, sizeof ofs);
+ ofpbuf_put(ofpacts, &dhcp_relay->relay_ipv4,
+ sizeof(dhcp_relay->relay_ipv4));
+ ofpbuf_put(ofpacts, &dhcp_relay->server_ipv4,
+ sizeof(dhcp_relay->server_ipv4));
+ encode_finish_controller_op(oc_offset, ofpacts);
+}
+
+static void
+format_DHCPV4_RELAY_REQ_CHK(const struct ovnact_dhcp_relay *dhcp_relay,
+ struct ds *s)
+{
+ format_dhcpv4_relay_chk("dhcp_relay_req_chk",dhcp_relay, s);
+}
+
+static void
+encode_DHCPV4_RELAY_REQ_CHK(const struct ovnact_dhcp_relay *dhcp_relay,
+ const struct ovnact_encode_params *ep,
+ struct ofpbuf *ofpacts)
+{
+ encode_dhcpv4_relay_chk(dhcp_relay, ep, ofpacts,
+ ACTION_OPCODE_DHCP_RELAY_REQ_CHK);
+}
+
+static void
+format_DHCPV4_RELAY_RESP_CHK(const struct ovnact_dhcp_relay *dhcp_relay,
+ struct ds *s)
+{
+ format_dhcpv4_relay_chk("dhcp_relay_resp_chk",dhcp_relay, s);
+}
+
+static void
+encode_DHCPV4_RELAY_RESP_CHK(const struct ovnact_dhcp_relay *dhcp_relay,
+ const struct ovnact_encode_params *ep,
+ struct ofpbuf *ofpacts)
+{
+ encode_dhcpv4_relay_chk(dhcp_relay, ep, ofpacts,
+ ACTION_OPCODE_DHCP_RELAY_RESP_CHK);
+}
+
+static void ovnact_dhcp_relay_free(
+ struct ovnact_dhcp_relay *dhcp_relay OVS_UNUSED)
+{
+}
+
static void
parse_put_opts(struct action_context *ctx, const struct expr_field *dst,
struct ovnact_put_opts *po, const struct hmap *gen_opts,
@@ -5312,6 +5422,12 @@ parse_set_action(struct action_context *ctx)
lexer_lookahead(ctx->lexer) == LEX_T_LPAREN) {
parse_chk_lb_aff(ctx, &lhs,
ovnact_put_CHK_LB_AFF(ctx->ovnacts));
+ } else if (lexer_match_id(ctx->lexer, "dhcp_relay_req_chk")) {
+ parse_dhcp_relay_chk(ctx, &lhs,
+ ovnact_put_DHCPV4_RELAY_REQ_CHK(ctx->ovnacts));
+ } else if (lexer_match_id(ctx->lexer, "dhcp_relay_resp_chk")) {
+ parse_dhcp_relay_chk(ctx, &lhs,
+ ovnact_put_DHCPV4_RELAY_RESP_CHK(ctx->ovnacts));
} else {
parse_assignment_action(ctx, false, &lhs);
}
diff --git a/ovn-sb.xml b/ovn-sb.xml
index 4c26c6714..81ed824d0 100644
--- a/ovn-sb.xml
+++ b/ovn-sb.xml
@@ -2801,6 +2801,68 @@ tcp.flags = RST;
use statistics of MAC cache.
+
+ R = dhcp_relay_req_chk(relay-ip,
+ server-ip);
+
+
+ Parameters: Logical Router Port IP relay-ip, DHCP
+ Server IP server-ip.
+
+
+
+ Result: stored to a 1-bit subfield R.
+
+
+
+ This action executes on the source node on which the DHCP request
+ (DHCPDISCOVER or DHCPREQUEST) originated.
+
+
+
+ When this action applied successfully on the DHCP request packet,
+ it updates GIADDR in the DHCP packet with relay-ip and
+ stores 1 in R.
+
+
+
+ When this action failed to apply on the packet, it leaves the
+ packet unchanged and stores 0 in R.
+
+
+
+ R = dhcp_relay_resp_chk(relay-ip,
+ server-ip);
+
+
+ Parameters: Logical Router Port IP relay-ip, DHCP
+ Server IP server-ip.
+
+
+
+ Result: stored to a 1-bit subfield R.
+
+
+
+ This action executes on the first node (Redirect Chassis node)
+ which processes the DHCP response(DHCPOFFER, DHCPACK) from the DHCP
+ server.
+
+
+
+ When this action applied successfully on the DHCP response packet,
+ it updates the destination MAC and destination IP in the packet and
+ stores 1 in R.
+ relay-ip and server-ip are used to validate
+ GIADDR and SERVER-ID in the DHCP response packet.
+
+
+
+ When this action failed to apply on the packet, it leaves the
+ packet unchanged and stores 0 in R.
+
+
+
diff --git a/tests/ovn.at b/tests/ovn.at
index dc6aafd53..1ad4159cf 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1653,6 +1653,40 @@ reg1[[0]] = put_dhcp_opts(offerip=1.2.3.4, domain_name=1.2.3.4);
reg1[[0]] = put_dhcp_opts(offerip=1.2.3.4, domain_search_list=1.2.3.4);
DHCPv4 option domain_search_list requires string value.
+#dhcp_relay_req_chk
+reg9[[7]] = dhcp_relay_req_chk(192.168.1.1, 172.16.1.1);
+ encodes as controller(userdata=00.00.00.1c.00.00.00.00.80.01.08.08.00.00.00.07.c0.a8.01.01.ac.10.01.01,pause)
+
+reg9[[7]] = dhcp_relay_req_chk(192.168.1.1,172.16.1.1);
+ formats as reg9[[7]] = dhcp_relay_req_chk(192.168.1.1, 172.16.1.1);
+ encodes as controller(userdata=00.00.00.1c.00.00.00.00.80.01.08.08.00.00.00.07.c0.a8.01.01.ac.10.01.01,pause)
+
+reg9[[7..8]] = dhcp_relay_req_chk(192.168.1.1, 172.16.1.1);
+ Cannot use 2-bit field reg9[[7..8]] where 1-bit field is required.
+
+reg9[[7]] = dhcp_relay_req_chk("192.168.1.1", "172.16.1.1");
+ Syntax error at `"192.168.1.1"' expecting IPv4 dhcp relay and server ips.
+
+reg9[[7]] = dhcp_relay_req_chk(192.168.1, 172.16.1.1);
+ Invalid numeric constant.
+
+#dhcp_relay_resp_chk
+reg9[[8]] = dhcp_relay_resp_chk(192.168.1.1, 172.16.1.1);
+ encodes as controller(userdata=00.00.00.1d.00.00.00.00.80.01.08.08.00.00.00.08.c0.a8.01.01.ac.10.01.01,pause)
+
+reg9[[8]] = dhcp_relay_resp_chk(192.168.1.1,172.16.1.1);
+ formats as reg9[[8]] = dhcp_relay_resp_chk(192.168.1.1, 172.16.1.1);
+ encodes as controller(userdata=00.00.00.1d.00.00.00.00.80.01.08.08.00.00.00.08.c0.a8.01.01.ac.10.01.01,pause)
+
+reg9[[7..8]] = dhcp_relay_resp_chk(192.168.1.1, 172.16.1.1);
+ Cannot use 2-bit field reg9[[7..8]] where 1-bit field is required.
+
+reg9[[8]] = dhcp_relay_resp_chk("192.168.1.1", "172.16.1.1");
+ Syntax error at `"192.168.1.1"' expecting IPv4 dhcp relay and server ips.
+
+reg9[[8]] = dhcp_relay_resp_chk(192.168.1, 172.16.1.1);
+ Invalid numeric constant.
+
# nd_ns
nd_ns { nd.target = xxreg0; output; };
encodes as controller(userdata=00.00.00.09.00.00.00.00.00.1c.00.18.00.80.00.00.00.00.00.00.00.01.de.10.80.00.3e.10.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.OFTABLE_SAVE_INPORT_HEX.00.00.00,pause)
diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c
index ee086a7ae..0103253e1 100644
--- a/utilities/ovn-trace.c
+++ b/utilities/ovn-trace.c
@@ -2329,6 +2329,63 @@ execute_put_dhcp_opts(const struct ovnact_put_opts *pdo,
execute_put_opts(pdo, name, uflow, super);
}
+static void
+execute_dhcpv4_relay_req_chk(const struct ovnact_dhcp_relay *dr,
+ struct flow *uflow, struct ovs_list *super)
+{
+ ovntrace_node_append(
+ super, OVNTRACE_NODE_ERROR,
+ "/* We assume that this packet is DHCPDISCOVER or DHCPREQUEST. */");
+
+ struct ds s = DS_EMPTY_INITIALIZER;
+ struct mf_subfield dst = expr_resolve_field(&dr->dst);
+ if (!mf_is_register(dst.field->id)) {
+ /* Format assignment. */
+ ds_clear(&s);
+ expr_field_format(&dr->dst, &s);
+ ovntrace_node_append(super, OVNTRACE_NODE_MODIFY,
+ "%s = 1", ds_cstr(&s));
+ }
+ ds_destroy(&s);
+
+ struct mf_subfield sf = expr_resolve_field(&dr->dst);
+ union mf_subvalue sv = { .u8_val = 1 };
+ mf_write_subfield_flow(&sf, &sv, uflow);
+}
+
+static void
+execute_dhcpv4_relay_resp_chk(const struct ovnact_dhcp_relay *dr,
+ struct flow *uflow, struct ovs_list *super)
+{
+ ovntrace_node_append(
+ super, OVNTRACE_NODE_ERROR,
+ "/* We assume that this packet is DHCPOFFER or DHCPACK and "
+ "DHCP broadcast flag is set. Dest IP is set to broadcast. "
+ "Dest MAC is set to broadcast but in real network this is unicast "
+ "which is extracted from DHCP header. */");
+
+ /* Assume DHCP broadcast flag is set */
+ uflow->nw_dst = htonl(0xFFFFFFFF);
+ /* Dest MAC is set to broadcast but in real network this is unicast */
+ struct eth_addr bcast_mac = { .ea = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
+ uflow->dl_dst = bcast_mac;
+
+ struct ds s = DS_EMPTY_INITIALIZER;
+ struct mf_subfield dst = expr_resolve_field(&dr->dst);
+ if (!mf_is_register(dst.field->id)) {
+ /* Format assignment. */
+ ds_clear(&s);
+ expr_field_format(&dr->dst, &s);
+ ovntrace_node_append(super, OVNTRACE_NODE_MODIFY,
+ "%s = 1", ds_cstr(&s));
+ }
+ ds_destroy(&s);
+
+ struct mf_subfield sf = expr_resolve_field(&dr->dst);
+ union mf_subvalue sv = { .u8_val = 1 };
+ mf_write_subfield_flow(&sf, &sv, uflow);
+}
+
static void
execute_put_nd_ra_opts(const struct ovnact_put_opts *pdo,
const char *name, struct flow *uflow,
@@ -3215,6 +3272,16 @@ trace_actions(const struct ovnact *ovnacts, size_t ovnacts_len,
"put_dhcpv6_opts", uflow, super);
break;
+ case OVNACT_DHCPV4_RELAY_REQ_CHK:
+ execute_dhcpv4_relay_req_chk(ovnact_get_DHCPV4_RELAY_REQ_CHK(a),
+ uflow, super);
+ break;
+
+ case OVNACT_DHCPV4_RELAY_RESP_CHK:
+ execute_dhcpv4_relay_resp_chk(ovnact_get_DHCPV4_RELAY_RESP_CHK(a),
+ uflow, super);
+ break;
+
case OVNACT_PUT_ND_RA_OPTS:
execute_put_nd_ra_opts(ovnact_get_PUT_DHCPV6_OPTS(a),
"put_nd_ra_opts", uflow, super);