From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2575EA050B; Thu, 7 Apr 2022 08:27:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14F1040689; Thu, 7 Apr 2022 08:27:21 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 599D940689 for ; Thu, 7 Apr 2022 08:27:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649312839; x=1680848839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y5eVl5kG/mkIi5Q0PDgxSfrlGhn+p4tYObzjFOonZ08=; b=X9XPD7UZEEJsfTTtut1IYFFL5YD4oO7xpGYFc4MHsY7hA4UQQSqbLp/e INe3iGpaaQVUvoZ/IBvutDxkkcZzgkGKeEeAf/z4T/bjBOzsEor3TFDJJ E7xJPPu+ldauW9I9Gxuk5CwOMbiOJDeis+WOrWUEQDawVF96TivtpRd5F 2Grnh7ZrPHJV+MX853T6gr0zHE+zU25/5esTD80E8lePIwEV116VDcpV1 FyWCMrFhTMs3jjE28YIv2QdWTp9RwH2+R9NkpHoOCe0DOhSq6NkzwZmnf rpPOWQyIgslg+qbUpMJAIlZDwpUlzVwxuZgCEjhPptjUUkC8ekRj7RZ7+ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10309"; a="248764663" X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="248764663" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 23:27:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,241,1643702400"; d="scan'208";a="549885011" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by orsmga007.jf.intel.com with ESMTP; 06 Apr 2022 23:27:16 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com Subject: [PATCH 1/3] common/iavf: support raw packet in protocol header Date: Thu, 7 Apr 2022 14:27:19 +0800 Message-Id: <20220407062721.3886136-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220407062721.3886136-1-junfeng.guo@intel.com> References: <20220407062721.3886136-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The patch extends existing virtchnl_proto_hdrs structure to allow VF to pass a pair of buffers as packet data and mask that describe a match pattern of a filter rule. Then the kernel PF driver is requested to parse the pair of buffer and figure out low level hardware metadata (ptype, profile, field vector.. ) to program the expected FDIR or RSS rules. INTERNAL ONLY: This is requirement from DPDK to support Protocol Agnostic Flow Offloading(*1). Previously we have integrated the Parser Library(*2) into DPDK and enabled a raw packet based FDIR and RSS support in DPDK PF driver(*3,*4), to enable the same feature for AVF driver, we need Virtual Channel to support raw packet filter rule passing. [1] https://wiki.ith.intel.com/display/NPGCVL/Protocol+Agnostic+Flow+Offloading [2] http://patchwork.dpdk.org/project/dpdk/list/?series=19057&archive=both&state=* [3] http://patchwork.dpdk.org/project/dpdk/list/?series=20254&state=%2A&archive=both [4] http://patchwork.dpdk.org/project/dpdk/list/?series=20291&state=%2A&archive=both Signed-off-by: Qi Zhang Signed-off-by: Junfeng Guo --- drivers/common/iavf/virtchnl.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h index 3e44eca7d8..3975229545 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -1482,6 +1482,7 @@ enum virtchnl_vfr_states { }; #define VIRTCHNL_MAX_NUM_PROTO_HDRS 32 +#define VIRTCHNL_MAX_SIZE_RAW_PACKET 1024 #define PROTO_HDR_SHIFT 5 #define PROTO_HDR_FIELD_START(proto_hdr_type) \ (proto_hdr_type << PROTO_HDR_SHIFT) @@ -1676,14 +1677,25 @@ VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_proto_hdr); struct virtchnl_proto_hdrs { u8 tunnel_level; /** - * specify where protocol header start from. + * specify where protocol header start from. must be 0 when sending a raw packet request. * 0 - from the outer layer * 1 - from the first inner layer * 2 - from the second inner layer * .... - **/ - int count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */ - struct virtchnl_proto_hdr proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS]; + */ + int count; + /** + * number of proto layers, must < VIRTCHNL_MAX_NUM_PROTO_HDRS + * must be 0 for a raw packet request. + */ + union { + struct virtchnl_proto_hdr proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS]; + struct { + u16 pkt_len; + u8 spec[VIRTCHNL_MAX_SIZE_RAW_PACKET]; + u8 mask[VIRTCHNL_MAX_SIZE_RAW_PACKET]; + } raw; + }; }; VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs); -- 2.25.1