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 1DF52A0503; Fri, 20 May 2022 11:16:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09A9542BAB; Fri, 20 May 2022 11:16:30 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0163D42B9E for ; Fri, 20 May 2022 11:16:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653038187; x=1684574187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uw7lz5HO/7qw3cNwqy2a5W6O1GgqV5Jy9ecEVazgwXo=; b=HygC8FEpmZGM21sxS6bFfq0KaWHhETO8AXW0XF8YXHbAVXUizTnHCmqS LFj8NZJ4fCZzdv6lNEzIwHOUzw35h2UZoOBsvXYyeinZPMhwWVhh4sd8r +KzMa1W2WDSY/1w4MYAsNCjvO5iqeQuShSrwHZ+6niuczSt7hVXRQG9Km SdUOIs+UtnlWWe0uEB8/NORtneW34kYUPSEpVPOlktci3OW1mRuwNTWCn FjS/V9yehTTyc0liZXrRpzfEEaaJOz64b+vw8e3F4LC6TYrKPcVS2HZQt VXEz+c5t0LVjfDRGrOlpCuodJOBTMJQC2jztFq4RVKQxmiOOScRB3wrgW g==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="297857434" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="297857434" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 02:16:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="715432659" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by fmsmga001.fm.intel.com with ESMTP; 20 May 2022 02:16:25 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, ting.xu@intel.com, junfeng.guo@intel.com Subject: [PATCH v5 1/4] common/iavf: support raw packet in protocol header Date: Fri, 20 May 2022 17:16:45 +0800 Message-Id: <20220520091648.3524540-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520091648.3524540-1-junfeng.guo@intel.com> References: <20220421032851.1355350-5-junfeng.guo@intel.com> <20220520091648.3524540-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. 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 2d49f95f84..f123daec8e 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -1503,6 +1503,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) @@ -1697,14 +1698,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