Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1131421lqb; Thu, 18 Apr 2024 00:30:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJfLmQHW/6q3SWAyaxbdiMk1Y2+R1lYrO5V5zHXCMdYTsr/IBhceYwVenN+eBpc/LTEz1FiCN2NgjYGWwFc4YOv+O0lftFyXpOHFd4UQ== X-Google-Smtp-Source: AGHT+IGwgd8iTzwEmMXxcN1JuXFLL/Z9V5RTu0SwZvSS4hxfar5e6Gzu1xRPZJq6ljUqOnAeaOQW X-Received: by 2002:a05:6214:88:b0:6a0:577a:c0f8 with SMTP id n8-20020a056214008800b006a0577ac0f8mr677264qvr.31.1713425439613; Thu, 18 Apr 2024 00:30:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713425439; cv=pass; d=google.com; s=arc-20160816; b=bXKfK/8h9lXYP/rbgZxMjYOkmKSgtKJq5D7wZUnnCK3dgkmroobYtYX7Vu0hTBgXoi diQT6hDlpBQY4cB47VK9hOVFC9uV1rbRlNtChDCQUpzqcmdBeZMQDst6ZaQyAnp6Y5Fk pFDv7eIggSy5IQrn51cj+OaRqS7NCsqIJZyIwqpe6FBqUof6Fc8pUbR4gCMi2Mp41VMg MTNMxbMM0m/4/7PgcUwn23bngq/vEhe9ktiZ+f1yj4btnWtpXxmA/7u2+n7rgkEt1Jeo 8RKx5qWqVs+enZ2r+2eQMIzPcEXBehK2oF2qz9jhlP/Iifn/EHDmnzcgacoy8WT4vo7n 6gbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LBchh3ctoKIyTg1KvRtEpcHY08UPnQa/BKEUg3A0GaA=; fh=yFYirF+rZNl34QRweaDH6Oqwl6PE7g9sJcf+ta+01PI=; b=uK2kX0UFecyAWZwk5gfhoUNHwrlBohibXVSWmsBtO4OHMRWxO530OV7F+S3Z87VEl3 5avziSgTSApG7OUGH2ma/ZaMpzqRrXGcjAWDsJ6hgWpCpRSz86TNYwW4/239aiCMRK7X ZiRNBhpNXFdrMm1kKzf9YQM3MIBaoVkihoXk0MDLu9I0oV2mHwjFT/u7QdHrfyCvuo+j NkqNPyKvzcR1xGowHRfTWnkXMGirKp7gvRiVH5HnpCIEKNkk+pH3iGCreINitjkHgd6M BnO317bkNI+ZeNjVmt+iUQyuzyH4HnXp0dLbEX/HZCZX7HPo68RljaVkGoUkPk0PCEu0 aKXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="QY/N9fun"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-149650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ee18-20020a0562140a5200b006a05988b8fcsi57206qvb.317.2024.04.18.00.30.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 00:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="QY/N9fun"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-149650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 57A021C20AEC for ; Thu, 18 Apr 2024 07:30:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9196654BED; Thu, 18 Apr 2024 07:30:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QY/N9fun" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 E154D38F96; Thu, 18 Apr 2024 07:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713425428; cv=none; b=Ixd5fDEKHIwfM+SKVp3poT59Hfc93DrJU/7E84YxbgxdExnODpEAFJEg3RHiwFSV5F4Pot8DPKrBRg6Kqz0i+9br109pRJV5BZjJgIuEXAvPcU8vpp8i8wMr0eCNnGQgvejO2dDVPKt9N7C/eOqTLsy7+Ds0efITFvJC6HopoQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713425428; c=relaxed/simple; bh=5g7iu/VVAy/L+SP4+CheknDrk8WwulKiELdeRGtgDF8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M/MVCJyhMyZRF9YAsMSzda+yQs0rnNHxnOixg5tIqF5AS1hYkJKBMoyfRVsfImJhMt7u1K4AQqrYXbfQzGFbE2Te4N4uHpkuUzi2BjGEr6dPXKvZkpL5xGvj2Rk4RdFmdO+ApPB5P+mXsv1FSHhvmW2qD6zBRZnfpfPKkbcxBMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QY/N9fun; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713425427; x=1744961427; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=5g7iu/VVAy/L+SP4+CheknDrk8WwulKiELdeRGtgDF8=; b=QY/N9fundHkAsTf2cChu4e4/6lr9980bnzNQ21h/OQP7ztb0yckr1Da1 i34raXWOw5n6RxnrdiN8af7KZs+2bkdOOdDWu+rktqUIdESRRczVvAfbb byMtCuht0zcmgaRUfSCcYNSZw0a0lQH41/mYZVroRvnok8HJ0D7gLl1RA kBJPpyyc28KBXpHU0lXAAgeKStSL4k8e2Q62SsYoDDSGiQXhjCtFL0cK7 IEmlY6ktAiUY/udcclDF9l2QlEE7/Ok2sNkfLfCVCiHSll9FpA6lYUf5L KQ9bCwOxgkL4AyRlo5ClX4WXKd1f5tqkRGSFpopUBOQ6kA74s5ls7/kJk w==; X-CSE-ConnectionGUID: PqrORcytQjq02UOIjScVZw== X-CSE-MsgGUID: HKcH8GKpRCKGXTbzgpFAEw== X-IronPort-AV: E=McAfee;i="6600,9927,11047"; a="9502750" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="9502750" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 00:30:26 -0700 X-CSE-ConnectionGUID: iks+W5Y9Q5K1RKF6sS7HkQ== X-CSE-MsgGUID: KqH5QFqvRm68XI9aFxiv3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="23316867" Received: from unknown (HELO mev-dev) ([10.237.112.144]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2024 00:30:24 -0700 Date: Thu, 18 Apr 2024 09:30:01 +0200 From: Michal Swiatkowski To: =?iso-8859-1?Q?Asbj=F8rn_Sloth_T=F8nnesen?= Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Dumazet , Tony Nguyen , Jakub Kicinski , Paolo Abeni , "David S. Miller" Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: flower: validate control flags Message-ID: References: <20240416144331.15336-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240416144331.15336-1-ast@fiberby.net> On Tue, Apr 16, 2024 at 02:43:30PM +0000, Asbj?rn Sloth T?nnesen wrote: > This driver currently doesn't support any control flags. > > Use flow_rule_has_control_flags() to check for control flags, > such as can be set through `tc flower ... ip_flags frag`. > > In case any control flags are masked, flow_rule_has_control_flags() > sets a NL extended error message, and we return -EOPNOTSUPP. > > Only compile-tested. > > Signed-off-by: Asbj?rn Sloth T?nnesen > --- > drivers/net/ethernet/intel/ice/ice_tc_lib.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c > index 2f2fce285ecd..361abd7d7561 100644 > --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c > +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c > @@ -1673,6 +1673,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi, > flow_rule_match_control(rule, &match); > > addr_type = match.key->addr_type; > + > + if (flow_rule_has_control_flags(match.mask->flags, > + fltr->extack)) > + return -EOPNOTSUPP; > } > Thanks, Reviewed-by: Michal Swiatkowski > if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) { > -- > 2.43.0 >