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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DED56C433F5 for ; Thu, 7 Apr 2022 16:52:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345850AbiDGQyg (ORCPT ); Thu, 7 Apr 2022 12:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232172AbiDGQyd (ORCPT ); Thu, 7 Apr 2022 12:54:33 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC7D363BF7 for ; Thu, 7 Apr 2022 09:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649350353; x=1680886353; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=F5rZhSGdkYD8LFkVCBkEtFpCZtIYlwTjsou5LUuDjmg=; b=H/3jy/1KK62bI2EDCMyrpNOMuofqLj5BTO83xAThSPMjVLpyEtazhvER m0TmmBT+R29LPlAe9cNsrg4gDakoLRDv1kxNpKmngPN09phRKXRkbmvca PVmfIPOn17KDp6n3NqIMlj9dAr77jmZcmq7UMKyKvAaol65VdRC3FPHLW CPxuatr3Tv9O3XDIQZ/f6FNIogiA2AakW0G0sPv+qylotULXkUMLXpZGT xbs2Pnm+TRdP1HFIWtC3b/nxpw4IxYS3xOXpvGkneqVsAK8sj2a2akK0j yGXE4alEK3Jzz93xeZHh1xw54l5CW73q3JdO+LTzruHQOkh3tdfg4AAQZ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="248908218" X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="248908218" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 09:52:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="525003564" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga006.jf.intel.com with ESMTP; 07 Apr 2022 09:52:07 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com Cc: Tony Nguyen , netdev@vger.kernel.org, alexandr.lobakin@intel.com Subject: [PATCH net-next 0/5][pull request] 100GbE Intel Wired LAN Driver Updates 2022-04-07 Date: Thu, 7 Apr 2022 09:52:42 -0700 Message-Id: <20220407165247.1817188-1-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Alexander Lobakin says: This hunts down several places around packet templates/dummies for switch rules which are either repetitive, fragile or just not really readable code. It's a common need to add new packet templates and to review such changes as well, try to simplify both with the help of a pair macros and aliases. ice_find_dummy_packet() became very complex at this point with tons of nested if-elses. It clearly showed this approach does not scale, so convert its logics to the simple mask-match + static const array. bloat-o-meter is happy about that (built w/ LLVM 13): add/remove: 0/1 grow/shrink: 1/1 up/down: 2/-1058 (-1056) Function old new delta ice_fill_adv_dummy_packet 289 291 +2 ice_adv_add_update_vsi_list 201 - -201 ice_add_adv_rule 2950 2093 -857 Total: Before=414512, After=413456, chg -0.25% add/remove: 53/52 grow/shrink: 0/0 up/down: 4660/-3988 (672) RO Data old new delta ice_dummy_pkt_profiles - 672 +672 Total: Before=37895, After=38567, chg +1.77% Diffstat also looks nice, and adding new packet templates now takes less lines. We'll probably come out with dynamic template crafting in a while, but for now let's improve what we have currently. The following are changes since commit e8bd70250a821edb541c3abe1eacdad9f8dc7adf: prestera: acl: add action hw_stats support and are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 100GbE Alexander Lobakin (5): ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h, m}_u ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet() ice: switch: use a struct to pass packet template params ice: switch: use convenience macros to declare dummy pkt templates ice: switch: convert packet template match code to rodata drivers/net/ethernet/intel/ice/ice_switch.c | 489 ++++++++------------ drivers/net/ethernet/intel/ice/ice_switch.h | 12 +- 2 files changed, 211 insertions(+), 290 deletions(-) -- 2.31.1