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 2E2BEA0501; Fri, 8 Apr 2022 11:12:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 848E440E64; Fri, 8 Apr 2022 11:12:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id C484A4003F for ; Fri, 8 Apr 2022 11:12:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649409128; x=1680945128; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y5eVl5kG/mkIi5Q0PDgxSfrlGhn+p4tYObzjFOonZ08=; b=Ehi/bsqyjdiquBbjt//Bd0YcysTeAgH9et15/Hx3HH1LjV4QsBMxAwa0 Tk1EdJgsM2/mKtKHw+TvUStjpW2zgp9ia7Sm6X5hz6xWMtQ2A5RuKTTA4 viyQ6gE/RNXuc45DAezUUQdMFov6CssnSw5Kuy/fHshHpi5Z8MFPYErli EHC6o4Vu/lc5bkMndAOIRgdCTgmLCjQs6GrTfq9D71E0GGSwl9jWVe1bm wUw64MFZu99RZgXfjdjIA2R3wXp9Zb3bOYIOVZAImt2zktFvMy1SXBH/2 +IKQC6dpOf5RcSePGPjEyK93keva4pkoiZmCFKoPTPGL1GAOTNys+UkzE g==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="286539899" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="286539899" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 02:12:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="723322863" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by orsmga005.jf.intel.com with ESMTP; 08 Apr 2022 02:12:06 -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 v3 1/3] common/iavf: support raw packet in protocol header Date: Fri, 8 Apr 2022 17:12:16 +0800 Message-Id: <20220408091218.240922-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408091218.240922-1-junfeng.guo@intel.com> References: <20220408080245.173253-4-junfeng.guo@intel.com> <20220408091218.240922-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