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 6ED20A00C3; Thu, 21 Apr 2022 05:28:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A783F427EE; Thu, 21 Apr 2022 05:28:40 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E76F6410E1 for ; Thu, 21 Apr 2022 05:28: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=1650511718; x=1682047718; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nIPRyIIPz9k8CB5PBx8P049PKrOhFm9+Y6hZ7cvJ/5A=; b=Gqt2gUFaeRx3d9qD4yGTWwwP/16dM5KgY8C9Mb9MJxIqGBldruGgO1eT beA/UScEA/dpC0Esyb2x9K++kuYQPAC+gBhFeTt/mroS8uuHWIAyHq4cY hw6KkLUx+kD6Cph0lztK1Zc7+WVpwJzs/z7/VH35bk8UThhJ3Ly5pnA2P A4Fi515ej4SdqK1h564fOazGpcTR48O3QWmTeml7tvcY7X5jcO6XVUbSd EU2iuoMwGs4lhiDu0JtCdl9Hb9WKlxlwWwQ+o1zG62eNjJn0O4t+Xf2d8 Fpf2F1shIoY1HQiIr8a1gHa17Wdvvdn4Y/ftlk+s8GETsgowKPfRI5stE A==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="244157818" X-IronPort-AV: E=Sophos;i="5.90,277,1643702400"; d="scan'208";a="244157818" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 20:28:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,277,1643702400"; d="scan'208";a="576972819" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by orsmga008.jf.intel.com with ESMTP; 20 Apr 2022 20:28:35 -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 v4 1/4] common/iavf: support raw packet in protocol header Date: Thu, 21 Apr 2022 11:28:48 +0800 Message-Id: <20220421032851.1355350-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421032851.1355350-1-junfeng.guo@intel.com> References: <20220408091218.240922-4-junfeng.guo@intel.com> <20220421032851.1355350-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 249ae6ed23..c9f6cab55b 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -1484,6 +1484,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) @@ -1678,14 +1679,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