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 A5983A00BE; Fri, 8 Apr 2022 10:02:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89712427E9; Fri, 8 Apr 2022 10:02:38 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 35C124003F for ; Fri, 8 Apr 2022 10:02:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649404957; x=1680940957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y5eVl5kG/mkIi5Q0PDgxSfrlGhn+p4tYObzjFOonZ08=; b=BbiaCqlPY3jfFxy2ndWV0iH7IdENGJmSJLlYQXo56CvUyKAqF17NHdVh Wojn4erWAMYskdVvMMJnjDygRKtjyOWrQeyUGr+ohHIEk08+CsNl8lceN ydoSR25qshkNGrMZ9s8lEoJloLsyLBMMlw5qsQtJAGLl2wudrM+4Jjpbr grJpwP7nW7llAhVqnlfCuEaPQRDtJE7Evfs02YZWh0kjc5ieSZLuX6WL0 9KF3xS9/mL7qBngPrXfJGS+itaJkvwTUm2quINY9iBYPXNpS96ruELis9 JaWs1H36MQHWYoLxDXa65+gPldaMcBSH27Ez5j/9pxMDjfVkeqG0CHi// Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="242135614" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="242135614" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 01:02:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="506477471" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by orsmga003.jf.intel.com with ESMTP; 08 Apr 2022 01:02:35 -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 v2 1/3] common/iavf: support raw packet in protocol header Date: Fri, 8 Apr 2022 16:02:43 +0800 Message-Id: <20220408080245.173253-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408080245.173253-1-junfeng.guo@intel.com> References: <20220407062721.3886136-4-junfeng.guo@intel.com> <20220408080245.173253-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