From patchwork Wed Jul 24 21:36:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ahmed Zaki X-Patchwork-Id: 13741388 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 630CE65E20 for ; Wed, 24 Jul 2024 21:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721857068; cv=none; b=f7/cSfVwDthUg1q/z7/0OLnTilGiuNOrFXuKRc9rqiAJruAiXSn5YGpnyv6a+raMgfL/o7DfdwhdDhW1bXUBMLhUpidPtxxYUHSsbunfA22k4KT12jymcwPPryhb/VRSHyVL+FKho8iJjS/BQe/v2oQkdOiVfM2BODSTq7g9jks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721857068; c=relaxed/simple; bh=yOMvGONTz6voeoYDVKKif51gxiH/fasIzag5jalvqfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T5ZUTgqr1TPI8q07/hZIL3pU6lBz9osghJ5g0u3CM8vLdDsfRhelZGCAyquOW+/9ickrn+UAVSiT/Q66Mgjc9mRBXUG9J2I5zapLfG7nvEf3cSWY9rf/7fn2LQUzjEPU3mfT8380PXSDRg1ZPTr4uPzhlmhcUi+4DDN+VRaTBoY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dHhJTuag; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dHhJTuag" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721857068; x=1753393068; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yOMvGONTz6voeoYDVKKif51gxiH/fasIzag5jalvqfo=; b=dHhJTuagIa52ZHICd9hKOByF8xkwjD/oofvsuovguWVQs1X5i7njQER8 KXKa2nqZQqb3Gyhznr659NIZTL2NUEI+Bdzo9BtGQOK+Igvkm28aO5B7/ y6+ffaLPVx+EmPzTBSTVcQ/sCVR2Zb01ZDFa2mpJ/SQh4YHFb45evrvoh w7DUMnD+r5uAZCGEuqeKIHKmRSvm26MgMwz+ncYcnZOlpNY0HSlmAIJ+K cr35HwVWVW9rNjrkfuNm5Emy5leEbhkMzH43VGwWGFpkBQyxPtpcNTp3F LSbERj/VA7lM6XEerTcPJ5PnIO036Delu4QW1clIq44sFpNHRD2jKOrAG g==; X-CSE-ConnectionGUID: LHAZF1DdTH+uGeMQN3vuwQ== X-CSE-MsgGUID: lLxdO7zKS6eyWRZ8D+78OA== X-IronPort-AV: E=McAfee;i="6700,10204,11143"; a="19704262" X-IronPort-AV: E=Sophos;i="6.09,233,1716274800"; d="scan'208";a="19704262" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2024 14:37:47 -0700 X-CSE-ConnectionGUID: pB2XcB0qRcedHZT7g4h5gg== X-CSE-MsgGUID: 6Y0ksdpUR9mTKu0+cTPr7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,233,1716274800"; d="scan'208";a="52579619" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO azaki-desk1.intel.com) ([10.245.246.206]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2024 14:37:38 -0700 From: Ahmed Zaki To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, horms@kernel.org, przemyslaw.kitszel@intel.com, Junfeng Guo , Marcin Szycik , Ahmed Zaki , Rafal Romanowski Subject: [PATCH iwl-next v4 09/13] virtchnl: support raw packet in protocol header Date: Wed, 24 Jul 2024 15:36:18 -0600 Message-ID: <20240724213623.324532-10-ahmed.zaki@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240724213623.324532-1-ahmed.zaki@intel.com> References: <20240724213623.324532-1-ahmed.zaki@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: Simon Horman Reviewed-by: Marcin Szycik Signed-off-by: Qi Zhang Signed-off-by: Junfeng Guo Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski --- 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);