Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B72C1C25B78 for ; Wed, 22 May 2024 19:36:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 89B938216D; Wed, 22 May 2024 19:36:54 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id RWSpU-3mZ1qb; Wed, 22 May 2024 19:36:54 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org DCB718219A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1716406613; bh=PlLzJRecjqqHxOuJYbe997NJBZgkIkl0G5q4lhJ2yeY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=6DxYn6hGqHqKov2pom8aQ51Q6DrBmzYfntOwwtTYKlu66WmzaKSAcGm9YD5Lyaka7 dRkoMxkc21JBrEF0A5aeXZe6Kb2KKgGqlQGIs4DLU7kNwUVfpKuwjd9hJN6UranddR EnDrMEWEUvx7Ok6g8mjTCV2+m0eiOCI0lXLLPtfXroDfkpA13RufujEyfk/MW8Hv7r 50SBli4SsmbSSlDHsxU3Ps5KigysOqRo1y+0frUwXiPekFvkgA6ryeWf18kK8z+JQ5 lyv4ojy6/2XnhmMt7/pggIatQHSJkxV8Iu3KaeyXPqDNgnVT95tBfkeJNq4RS/lG7w ZMVOtpVmHtvwg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id DCB718219A; Wed, 22 May 2024 19:36:53 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id AE1F11C5EF7 for ; Wed, 22 May 2024 19:36:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9AF7A406C2 for ; Wed, 22 May 2024 19:36:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IAbAusHfS7cN for ; Wed, 22 May 2024 19:36:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.11; helo=mgamail.intel.com; envelope-from=ahmed.zaki@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org B6C1C406C1 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B6C1C406C1 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by smtp4.osuosl.org (Postfix) with ESMTPS id B6C1C406C1 for ; Wed, 22 May 2024 19:36:45 +0000 (UTC) X-CSE-ConnectionGUID: /+vXj7TLS7akmZ+yS+yx6Q== X-CSE-MsgGUID: epEVrtvZQlibr8KUL6eu6A== X-IronPort-AV: E=McAfee;i="6600,9927,11080"; a="23256360" X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="23256360" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 12:36:45 -0700 X-CSE-ConnectionGUID: J1dfDumrR4qxMzrzFj1JMQ== X-CSE-MsgGUID: kmdYZkSeRq+hGiqPAU7KWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="33254181" Received: from spandruv-desk1.amr.corp.intel.com (HELO azaki-desk1.intel.com) ([10.125.109.214]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 12:36:43 -0700 From: Ahmed Zaki To: intel-wired-lan@lists.osuosl.org Date: Wed, 22 May 2024 13:35:58 -0600 Message-ID: <20240522193602.164331-10-ahmed.zaki@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240522193602.164331-1-ahmed.zaki@intel.com> References: <20240522193602.164331-1-ahmed.zaki@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716406605; x=1747942605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2yFiu1Og9cxMJXWXQ+vO2j1w/wU3jvz/fw4Fj8ypKf0=; b=l/EI5MsB9gbLDdV4urM4vvkug24jDHYQv168mVHFP3mBEkrQdVeUNcEl 4z4s18M0//zRqEnwqwZdjj8imSXb63pNkwF/7k9FZ7qWZRT6TB+3ptFOG 6sNyELJVsiaDjI1lFriGfGDi4pI48dp9gtL/muKscaucNeNVhn3kZVZhH qa14fMjiC8O3eA93wLD4rwGbTXoe5kcE2kemJ647s7d9WYpjIPtUF6qpE aHnYX05na3Djn1vtaCmj4rNmXCctxmDEfI3CqaBscWkTNLyJU6g1l0F/L Z8cd76J7Hhv3r5nQ/45nZ87qAsvoM6kojKiTngJcu+ExGYWek/W/2iDOf g==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=l/EI5MsB Subject: [Intel-wired-lan] [PATCH iwl-next 09/13] virtchnl: support raw packet in protocol header X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcin Szycik , Junfeng Guo , Ahmed Zaki Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Junfeng Guo 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. Reviewed-by: Marcin Szycik Signed-off-by: Qi Zhang Signed-off-by: Junfeng Guo Signed-off-by: Ahmed Zaki --- include/linux/avf/virtchnl.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h index 8e177b67e82f..4f78a65e33dc 100644 --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h @@ -1121,6 +1121,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) #define PROTO_HDR_FIELD_MASK ((1UL << PROTO_HDR_SHIFT) - 1) @@ -1266,13 +1267,22 @@ struct virtchnl_proto_hdrs { u8 pad[3]; /** * 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]; + 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.43.0