From patchwork Thu Jan 25 12:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Swiatkowski X-Patchwork-Id: 13530760 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) (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 E98EF17578 for ; Thu, 25 Jan 2024 12:49:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.93 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706186952; cv=none; b=PqBmL3zzK0UdA5m6U97GBz2se16y++Lc8s/ZAiE5il3sdi0rnobpt3KSD8edYoJ6WXo20cGUApybZv3m62VVqCpclT9V4CE3eXVvenO5+TAJ0CeRxJVJDxn6Wh8H9yLTD+x+UrKLaWMiAD5BBemdRa5DcmkIF4tIhlShBqDMR5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706186952; c=relaxed/simple; bh=JyukL+6Tfu3LvG2RP3hHG5PkAXU5TOrq60m31mUDiDw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uf6dsTC+AEnt7lPkKA9bUNVbvytiKSZFovV1vzqySaw7Zv8ZJ4W5fJ8+HlE08Z3tsCtHSPfUbjC6vqW6acLsd9KIpyPeFu7uUEqHxozoFonx2lGCB0hs3qJweHr7EMs5yPgHXQPv/NRRB3Cz8Hh9ea1Ew1CPH2tVBID4J8mTHK0= 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=b2z8kkS2; arc=none smtp.client-ip=192.55.52.93 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="b2z8kkS2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706186950; x=1737722950; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JyukL+6Tfu3LvG2RP3hHG5PkAXU5TOrq60m31mUDiDw=; b=b2z8kkS28YWXKrV5xcV/FXZ1lfTFpeVpmvuqZV+XSFLm4/Ak2P4Xt+Ji vHfCvA1T+jn72enbp2dwTPmHNFhl7j+DtOzU/ezvJSQ8Wd1bAByjlhOb5 hragXxZhZBqgKhiFSjG36kB6vDME0XE+3jNXhVDWTI87eVfzjavUgcxVe uG2zkQU7vqf9ac/VEUVn0U7iKmnZvSa1APhbFbnrvU33QdpdHYGZ59zYK zdTizg7DaxChzs6l0afxL2EMSlcbx6GM0YkmF5khzkrMnu5pPfbGgLYZg GjvmwrL2ShdURMtdrM7+mDEqn3eTCWEuagnAcaSHBSIyLs0MBld1F+OLp Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="399313520" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="399313520" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 04:49:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="905956640" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="905956640" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by fmsmga002.fm.intel.com with ESMTP; 25 Jan 2024 04:49:08 -0800 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, marcin.szycik@intel.com, wojciech.drewek@intel.com, sridhar.samudrala@intel.com, przemyslaw.kitszel@intel.com, Michal Swiatkowski Subject: [iwl-next v1 0/8] ice: use less resources in switchdev Date: Thu, 25 Jan 2024 13:53:06 +0100 Message-ID: <20240125125314.852914-1-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi, Switchdev is using one queue per created port representor. This can quickly lead to Rx queue shortage, as with subfunction support user can create high number of PRs. Save one MSI-X and 'number of PRs' * 1 queues. Refactor switchdev slow-path to use less resources (even no additional resources). Do this by removing control plane VSI and move its functionality to PF VSI. Even with current solution PF is acting like uplink and can't be used simultaneously for other use cases (adding filters can break slow-path). In short, do Tx via PF VSI and Rx packets using PF resources. Rx needs additional code in interrupt handler to choose correct PR netdev. Previous solution had to queue filters, it was way more elegant but needed one queue per PRs. Beside that this refactor mostly simplifies switchdev configuration. Michal Swiatkowski (8): ice: remove eswitch changing queues algorithm ice: do Tx through PF netdev in slow-path ice: default Tx rule instead of to queue ice: control default Tx rule in lag ice: remove switchdev control plane VSI ice: change repr::id values ice: do switchdev slow-path Rx using PF VSI ice: count representor stats drivers/net/ethernet/intel/ice/ice.h | 7 - drivers/net/ethernet/intel/ice/ice_base.c | 44 +-- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 4 +- drivers/net/ethernet/intel/ice/ice_eswitch.c | 362 +++--------------- drivers/net/ethernet/intel/ice/ice_eswitch.h | 13 +- drivers/net/ethernet/intel/ice/ice_lag.c | 48 ++- drivers/net/ethernet/intel/ice/ice_lag.h | 3 +- drivers/net/ethernet/intel/ice/ice_lib.c | 49 +-- drivers/net/ethernet/intel/ice/ice_main.c | 10 +- drivers/net/ethernet/intel/ice/ice_repr.c | 126 +++--- drivers/net/ethernet/intel/ice/ice_repr.h | 24 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 3 - drivers/net/ethernet/intel/ice/ice_switch.c | 4 + drivers/net/ethernet/intel/ice/ice_switch.h | 5 +- drivers/net/ethernet/intel/ice/ice_txrx.h | 1 + drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 11 +- drivers/net/ethernet/intel/ice/ice_type.h | 1 - .../net/ethernet/intel/ice/ice_vsi_vlan_ops.c | 1 - 18 files changed, 227 insertions(+), 489 deletions(-)