Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp222269lqg; Thu, 11 Apr 2024 00:05:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUCQA/D6gzrrbpB5Vb4qPFJWmc67T+aKGoFBAuQtNRt5zzX8s+tHAXN8jTHpgBAKLOhA3Tt5TEzuMBxI/j7P1z9q11pPp7jkIGqfq29zQ== X-Google-Smtp-Source: AGHT+IGSeen9AF5BQdb/rPLvT4ZadO49TWBqFsvB3lDm1z3WLMl0oDfTrZiAVAEhGdamB4zT85Kq X-Received: by 2002:a17:902:ec90:b0:1e3:d4a2:387e with SMTP id x16-20020a170902ec9000b001e3d4a2387emr5350918plg.1.1712819101640; Thu, 11 Apr 2024 00:05:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712819101; cv=pass; d=google.com; s=arc-20160816; b=ap+X3siUGAQRqda7d7UPgwacx8OwwYgnyeH5D7aJc9Dbtb1M2B12S9PkdxigyBOUqn DPtahu2+/CcrYxxXxKMUgfaSMkKZlkcC5IYbvcI48II40Qc6IvKHPLCb7d+3jfVnzOOE iwBrxaAwZdq4Z2t/cMdW6wo2KhAYAdj6EO8yRdsDlDNJA6h2FYfLKagxI457YD5CWRde jyzL7H5ERyLSd52YBk3ZCI546IfqlSsJ85Zg6Pfhzc3jWroDqlIuBSsLOZwmAeM+XDbC 1PCJPLSIgZwANzhes12FF98xB7hLley0c07uC+2l/scMMiMfcOOeZEgNo0scjLbMzZCX 10Ag== 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=UAQLm8LQsMKlBPBvhmn1c0EE+CpTJDCHu3ttQoOAivg=; fh=9Ye7886e+0kKvI8DGwy/LcTOlNNmhGfnBBqtZmnn9UA=; b=em1zWxquVDszqr3e1rdnjhcoOvriUbxH/c43e2sFUnoB41DEYBHfSskbGfDni60mmv PzS5+rlMMoxmkS4qR/ZCnM9w3mEDej4ptt4moqyqrQwdMn2YYBgqNnKT47FpIU+MvQee dxQl/UVytKPvUoZlhElb6grO9mAzN+RooCZeFrIbmfL7Tztszt2oh8m7uOLC9z/darGN lSsKCrf/fBm4B0k19y8yZCT794eCtauTEzI5zHOdOEUBWaxGXWHv9IhYkN4e/ghtOMVu xWo7sS85kcIYjjFkjDDIQCenD/X55Ht6kxLTdD+I9RWNOA7Q1oQaXNn6u+nMzqwEYmxR UpRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=w97xjmBZ; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-139911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p10-20020a170902e74a00b001e531d64793si779958plf.17.2024.04.11.00.05.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:05:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=w97xjmBZ; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-139911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 496DA2829A1 for ; Thu, 11 Apr 2024 07:05:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53E7B13DDC2; Thu, 11 Apr 2024 07:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="w97xjmBZ" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 17320523A; Thu, 11 Apr 2024 07:04:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819088; cv=none; b=F8Uk7a/Rg5PObN7ekXuqMeJU5roPUST2dFYfNCdPtlNyYi0un28FUK9n8Sm46bRMg5VcCaA0HacRjor/ETmt5HiqLhThYgvXX0hAp0MOROkyMw6O3vyQq18Z2EykMeeqB6ubKXSfdk5C2awuehGOLxNiv1QlJqSNY8RM+9pwH48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819088; c=relaxed/simple; bh=0OAlRLFkgYzXEC0BlyzffbfPcf/pRXaaT8I3u/trQ00=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t0PeYC2PKVHFwK4RElE3y9/eNAr71nyt/b7wesit6+iCblJZ3cPxcUEs57LPTa7x5rFWk05CJWguzqzP96kuAx1z+MPqEG1b93sNhLNmuH31LC5uEfNVv7wVqifiSSLrBNN7ntqKPhlaErqTIKLxh7bswn9uDbz7ZBtyZ+c53KQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=w97xjmBZ; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712819086; x=1744355086; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=0OAlRLFkgYzXEC0BlyzffbfPcf/pRXaaT8I3u/trQ00=; b=w97xjmBZPPIvpc0D3NNbuISVYnpLElJqBNfHvx+q6d6hLPyZ0Jd4nfXm HZfMmGDAAfi4D/6fzxwI42lhNbHu2VBFBLUa7MFq+JDGXVFaDZ5TnZdxp iMezS+DgnKZIVHQI1ngWzPkxAwExlkE7lliGwiPq+1iRHM/d0i80nTM0u SIO8g09S3aA6Tr4pvlxCs1rbdmtRPIWS5LnkgaUb4rvJbgM38tbM2VZCE g4lCjCExuLfyA2sUqQkoHWEb1FqWZ4AOZKJTk1TojCHl69rH3gWzhOwaq LRO/tJaOl1xCzNmHc2Dnc1lj/jjEieK92YfFx77AqEkMDrgAgI7JSEBMC g==; X-CSE-ConnectionGUID: umr+2rzeTmeMDSDDw69iGA== X-CSE-MsgGUID: tkV1ScQ/R72oUu+yKOdD7A== X-IronPort-AV: E=Sophos;i="6.07,192,1708412400"; d="scan'208";a="20531085" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Apr 2024 00:04:39 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 11 Apr 2024 00:04:11 -0700 Received: from DEN-DL-M70577 (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 11 Apr 2024 00:04:08 -0700 Date: Thu, 11 Apr 2024 07:04:08 +0000 From: Daniel Machon To: =?utf-8?Q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= CC: , Steen Hegelund , Lars Povlsen , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Subject: Re: [PATCH net v2] net: sparx5: flower: fix fragment flags handling Message-ID: <20240411070408.jtic3ndd2zxngga6@DEN-DL-M70577> References: <20240410095224.6372-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: <20240410095224.6372-1-ast@fiberby.net> Hi Asbj?rn, I know I am nitpicking here, but could you please sneak in below changes. > static int > sparx5_tc_flower_es0_tpid(struct vcap_tc_flower_parse_usage *st) > { > @@ -145,29 +166,27 @@ sparx5_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) > flow_rule_match_control(st->frule, &mt); > > if (mt.mask->flags) { > - if (mt.mask->flags & FLOW_DIS_FIRST_FRAG) { > - if (mt.key->flags & FLOW_DIS_FIRST_FRAG) { > - value = 1; /* initial fragment */ > - mask = 0x3; > - } else { > - if (mt.mask->flags & FLOW_DIS_IS_FRAGMENT) { > - value = 3; /* follow up fragment */ > - mask = 0x3; > - } else { > - value = 0; /* no fragment */ > - mask = 0x3; > - } > - } > - } else { > - if (mt.mask->flags & FLOW_DIS_IS_FRAGMENT) { > - value = 3; /* follow up fragment */ > - mask = 0x3; > - } else { > - value = 0; /* no fragment */ > - mask = 0x3; > - } > + u8 is_frag_key = !!(mt.key->flags & FLOW_DIS_IS_FRAGMENT); > + u8 is_frag_mask = !!(mt.mask->flags & FLOW_DIS_IS_FRAGMENT); > + u8 is_frag_idx = (is_frag_key << 1) | is_frag_mask; > + > + u8 first_frag_key = !!(mt.key->flags & FLOW_DIS_FIRST_FRAG); > + u8 first_frag_mask = !!(mt.mask->flags & FLOW_DIS_FIRST_FRAG); > + u8 first_frag_idx = (first_frag_key << 1) | first_frag_mask; > + > + /* lookup verdict based on the 2 + 2 input bits */ > + u8 vdt = sparx5_vcap_frag_map[is_frag_idx][first_frag_idx]; > + > + if (vdt == FRAG_INVAL) { > + NL_SET_ERR_MSG_MOD(st->fco->common.extack, > + "match on invalid fragment flag combination"); Please start this NL msg with a capital letter. All (AFAICS) other places in this file do this - nice to stay consistent. As a matter of fact, also do this to the new comments introduced. > + return -EINVAL; > } > > + /* extract VCAP fragment key and mask from verdict */ > + value = (vdt >> 4) & 0x3; > + mask = vdt & 0x3; > + > err = vcap_rule_add_key_u32(st->vrule, > VCAP_KF_L3_FRAGMENT_TYPE, > value, mask); > -- > 2.43.0 > Checkpatch is producing a warning about the placement of the version information of the patch. Might as well fix this while at it. Thanks, /Daniel