Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DEA715B546 for ; Wed, 22 Jan 2025 06:21:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737526919; cv=none; b=rQp9FF/RcipT5JXz7/fKD/yKu7bWFpVD+v62YrdZiG591HfSBgrEWmoCHj40NDtwtFQBOnyLedX7SKWUTF20WkZczvF+BIltDYyFbI/NM2h3Np1UBIlSszuriyQaBf+qebN5uEaeYw7NXO6ihwGBgVkEXiXXvftaPWcDNUUAIFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737526919; c=relaxed/simple; bh=1EWeZ7rr1X0cF91Vmf8/K42Gr096T1iRpnaeladQYf8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=scC5yHq7O2eZQyxYqkIlU9dDvUY+tVjkmjRTSwZvFDTlp4y1gbwFGD3Ss0lsBdkvH9yAp3+gOab2KgqFYXjevj0Gk0y6nMrEDRmUsdZEGglWQRAy5vvOmTGp+OgaIJ3D/pdjtURQHlhVK8yHVQWkiyLLT5pbHYqu769an5hGxlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=S3iFWaV6; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="S3iFWaV6" Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50M6LdhV021065; Tue, 21 Jan 2025 22:21:57 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=j XWrXBnc7YZ48gQGqfw3oKJlvz3wGRVxSIEEksKy12U=; b=S3iFWaV6OC7BN/q7Y aOjbrCzHbi4FFJEfwU3kYGZePNmrNIZmtoh2dyw0xGRMT2gl+SrT+ynX61EFLaJx L4FDgJLBArmI8I1mypkHpfpu8/ZAYQHZ0oR8OewU/1SrN597p3UmL10LGVesabuQ On4iuJBRcADp/bdU3TjToP80OB82wq26dPXCBWQTQiys1t9B3Nv02lZBU5OpcAum lbanJr+a6jnhFm7DWkCJzCdik8jrqNX3XNYMQdKEwgaEjwDuvDMmgN3V7HGpIZ2t z+t8cs/BxHWvfzInm+IteVExZZ2wa7Eq9GqZlmaFZzfawvDmzn6D2xBp02GclJ1X HUi+A== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 44aub9001b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jan 2025 22:21:56 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 21 Jan 2025 22:21:55 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 21 Jan 2025 22:21:55 -0800 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id 5229B3F70B6; Tue, 21 Jan 2025 22:21:52 -0800 (PST) From: Srujana Challa To: CC: , , , , , , , Subject: [PATCH RFC v2 2/4] virtio-net: Add new flow filter selector and action for IPsec Date: Wed, 22 Jan 2025 11:51:42 +0530 Message-ID: <20250122062144.266725-3-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250122062144.266725-1-schalla@marvell.com> References: <20250122062144.266725-1-schalla@marvell.com> Precedence: bulk X-Mailing-List: virtio-comment@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: ZI9QUrJTzKCGgwpCVTuad9kwYhYs934v X-Proofpoint-ORIG-GUID: ZI9QUrJTzKCGgwpCVTuad9kwYhYs934v X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-22_02,2025-01-22_01,2024-11-22_01 This update introduces a new flow filter selector to match the ESP header and adds a new flow filter action for IPsec processing. Signed-off-by: Srujana Challa --- device-types/net/description.tex | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/device-types/net/description.tex b/device-types/net/description.tex index 020d090..cef109d 100644 --- a/device-types/net/description.tex +++ b/device-types/net/description.tex @@ -2634,7 +2634,9 @@ \subsubsection{Flow filter}\label{sec:Device Types / Network Device / Device Ope \hline 0x5 & VIRTIO_NET_FF_MASK_TYPE_UDP & 8 bytes of UDP header described in \hyperref[intro:UDP]{UDP} \\ \hline -0x6 - 0xFF & & Reserved for future \\ +0x6 & VIRTIO_NET_FF_MASK_TYPE_ESP & 8 bytes of ESP header \\ +\hline +0x7 - 0xFF & & Reserved for future \\ \hline \end{tabularx} \end{table} @@ -2694,7 +2696,11 @@ \subsubsection{Flow filter}\label{sec:Device Types / Network Device / Device Ope \hline 0x2 & VIRTIO_NET_FF_ACTION_DIRECT_RX_VQ & Matching packet will be directed to a receive queue \\ \hline -0x3 - 0xFF & & Reserved for future \\ +0x3 & VIRTIO_NET_FF_ACTION_IPSEC & Matching packet will undergo IPsec processing \\ +\hline +0x4 & VIRTIO_NET_FF_ACTION_IPSEC_RECIRCULATE & Matching packet will first undergo IPsec processing, followed by the flow filter rules again \\ +\hline +0x5 - 0xFF & & Reserved for future \\ \hline \end{tabularx} \end{table} @@ -2748,7 +2754,8 @@ \subsubsection{Flow filter}\label{sec:Device Types / Network Device / Device Ope The first selector is always VIRTIO_NET_FF_MASK_TYPE_ETH. When there are multiple selectors, a second selector can be either VIRTIO_NET_FF_MASK_TYPE_IPV4 or VIRTIO_NET_FF_MASK_TYPE_IPV6. If the third selector exists, the third -selector can be either VIRTIO_NET_FF_MASK_TYPE_UDP or VIRTIO_NET_FF_MASK_TYPE_TCP. +selector can be one of VIRTIO_NET_FF_MASK_TYPE_UDP, VIRTIO_NET_FF_MASK_TYPE_TCP +and VIRTIO_NET_FF_MASK_TYPE_ESP. For example, to match a Ethernet IPv6 UDP packet, \field{selectors[0].type} is set to VIRTIO_NET_FF_MASK_TYPE_ETH, \field{selectors[1].type} is set to VIRTIO_NET_FF_MASK_TYPE_IPV6 and \field{selectors[2].type} is @@ -3046,6 +3053,16 @@ \subsubsection{IPsec Operation}\label{sec:Device Types / Network Device / Device attach ICV, update/add IP header and add ESP/AH header/trailer to the packet and transmit. +\paragraph{Packet processing order} +\label{par:Device Types / Network Device / Device Operation / IPsec Operation / Packet processing order} + +If an IPsec action rule, either VIRTIO_NET_FF_ACTION_IPSEC or VIRTIO_NET_FF_ACTION_IPSEC_RECIRCULATE, +is matched during flow filter processing, then IPsec processing is applied on the packet. +In the case of VIRTIO_NET_FF_ACTION_IPSEC_RECIRCULATE, the packet is also recirculated. + +See \ref{sec:Device Types / Network Device / Device Operation / Flow filter} +for details about flow filter. + \paragraph{Device and driver capabilities} \label{par:Device Types / Network Device / Device Operation / IPsec Operation / Device and driver capabilities} -- 2.25.1