[64/69] net/i40e/base: add inline ipsec data struct and commands
diff mbox series

Message ID 20191202074935.97629-65-xiaolong.ye@intel.com
State New
Delegated to: xiaolong ye
Headers show
Series
  • update for i40e base code
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ye Xiaolong Dec. 2, 2019, 7:49 a.m. UTC
AVF support inline ipsec. This patch add some change in
header file of virtchnl.h to support the basic command
on inline ipsec, including data struct defining and basic
command.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Kirsher Jeffrey T <jeffrey.t.kirsher@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/i40e/base/virtchnl.h | 35 ++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Patch
diff mbox series

diff --git a/drivers/net/i40e/base/virtchnl.h b/drivers/net/i40e/base/virtchnl.h
index c701edf03..a6787a065 100644
--- a/drivers/net/i40e/base/virtchnl.h
+++ b/drivers/net/i40e/base/virtchnl.h
@@ -37,6 +37,10 @@ 
  * value in current and future projects
  */
 
+#ifdef VIRTCHNL_IPSEC
+#include "virtchnl_inline_ipsec.h"
+#endif
+
 /* Error Codes */
 enum virtchnl_status_code {
 	VIRTCHNL_STATUS_SUCCESS				= 0,
@@ -138,6 +142,15 @@  enum virtchnl_ops {
 	VIRTCHNL_OP_DISABLE_CHANNELS = 31,
 	VIRTCHNL_OP_ADD_CLOUD_FILTER = 32,
 	VIRTCHNL_OP_DEL_CLOUD_FILTER = 33,
+#ifdef VIRTCHNL_IPSEC
+	VIRTCHNL_OP_GET_IPSEC_CAP = 34,
+	VIRTCHNL_OP_IPSEC_SA_CREATE = 35,
+	VIRTCHNL_OP_IPSEC_SA_UPDATE = 36,
+	VIRTCHNL_OP_IPSEC_SA_DESTROY = 37,
+	VIRTCHNL_OP_IPSEC_SA_READ = 38,
+#else
+	/* opcodes 34, 35, 36, 37 and 38 are reserved */
+#endif /* VIRTCHNL_IPSEC */
 #ifdef VIRTCHNL_EXT_FEATURES
 	/* New major set of opcodes introduced and so leaving room for
 	* old misc opcodes to be added in future. Also these opcodes may only
@@ -281,6 +294,12 @@  VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);
 #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM	0X00400000
 #define VIRTCHNL_VF_OFFLOAD_ADQ			0X00800000
 #define VIRTCHNL_VF_OFFLOAD_USO			0X02000000
+#ifdef VIRTCHNL_IPSEC
+#define VIRTCHNL_VF_OFFLOAD_INLINE_IPSEC	0X80000000
+#else
+	/* 0X80000000 is reserved */
+#endif
+
 /* Define below the capability flags that are not offloads */
 #ifdef VIRTCHNL_EXT_FEATURES
 #define VIRTCHNL_VF_CAP_EXT_FEATURES		0x01000000
@@ -1369,6 +1388,22 @@  virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
 	case VIRTCHNL_OP_GET_ADDNL_SOL_CONFIG:
 		break;
 #endif
+#ifdef VIRTCHNL_IPSEC
+	case VIRTCHNL_OP_GET_IPSEC_CAP:
+		break;
+	case VIRTCHNL_OP_IPSEC_SA_CREATE:
+		valid_len = sizeof(struct virtchnl_ipsec_sa_cfg);
+		break;
+	case VIRTCHNL_OP_IPSEC_SA_UPDATE:
+		valid_len = sizeof(struct virtchnl_ipsec_sa_update);
+		break;
+	case VIRTCHNL_OP_IPSEC_SA_DESTROY:
+		valid_len = sizeof(struct virtchnl_ipsec_sa_destroy);
+		break;
+	case VIRTCHNL_OP_IPSEC_SA_READ:
+		valid_len = sizeof(u32);
+		break;
+#endif /* VIRTCHNL_IPSEC */
 #ifdef VIRTCHNL_EXT_FEATURES
 	case VIRTCHNL_OP_GET_CAPS:
 		valid_len = sizeof(struct virtchnl_get_capabilities);