From patchwork Mon Jul 3 09:35:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Maziarz X-Patchwork-Id: 1802568 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=GvfMB57P; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qvgm76wXxz20b1 for ; Mon, 3 Jul 2023 19:36:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3452160E5C; Mon, 3 Jul 2023 09:36:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3452160E5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1688376982; bh=L5564O4N6dayL12OCyA0UpsN2Qs0cCtEbdTCORVIz44=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=GvfMB57PdDs1s0w235uzpIwGbQblzigK/K60XIHWw1SSUiLyx0WgsEXhUSSiNi9ot eeKOhooWm6Di3wVUgXfNXCfZaAiWrZ3NumM6CpL77JT3QRLCV8CkEoruMYcflGED8l 0zI/Wbw0VQbMtu5zuKsN/ZQeRbOxnx/v1aQbpJ2YtdPHqD1N14XNi89ivZSiWHf7z1 qKbdLHdYFhm4HP2CfWyBjcqND+FqaKJbJDpkdpNHdHSw8ZqNeFkuDR03VWWwyqzrwR xZGZpnfDOpEn0SlrECVlmlzrwmEoYOsAaIeWozdEIMuyl/RvEVZE9Wp+ulioXnDeU3 uAW3R4okr7W+A== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R9CsiTsWC9td; Mon, 3 Jul 2023 09:36:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 4482860E07; Mon, 3 Jul 2023 09:36:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4482860E07 X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B268E1BF2F3 for ; Mon, 3 Jul 2023 09:36:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8A7CE40420 for ; Mon, 3 Jul 2023 09:36:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8A7CE40420 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yV5GQDy1FE6r for ; Mon, 3 Jul 2023 09:36:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B891940198 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp2.osuosl.org (Postfix) with ESMTPS id B891940198 for ; Mon, 3 Jul 2023 09:36:18 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="361697746" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="361697746" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 02:35:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="748094035" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="748094035" Received: from gklab-018-208.igk.intel.com ([10.102.18.208]) by orsmga008.jf.intel.com with ESMTP; 03 Jul 2023 02:35:49 -0700 From: Kamil Maziarz To: intel-wired-lan@lists.osuosl.org Date: Mon, 3 Jul 2023 11:35:46 +0200 Message-Id: <20230703093546.74984-1-kamil.maziarz@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688376978; x=1719912978; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yJZyMGUVU0AYcGQHZkYf8KR/YDM/PK7ZdyNNdswlYss=; b=Ap6x6EvU7Z/gvfh/6L3bVMa1LGpxrecVsAFe22Q/uEn85y7y6AED19BE HWjAqrYx7uzN9N3ekvBjvbigSfrDDl4Pbhcfmig+weaC1VCmxYgzAo7v7 lAiZNB2kz6NFMN8o5y1b2x6zLIXg2uOSqRGrvuvEfEomsso3P9iUH7gT1 WtNlG88p6RV1VMzkWHZqCZU7Rj/Nk8w9aqVTWnQUvNQau5xUuXSM1VwVd BWLuduQ81sEhiVTRw9PjeEwMXLtJlh2RPCrFsqPOjao7MKWuctNDcZ7k6 wCrd8k6Lvu0y9oQxZkWfGo6UMTuixOQUWde38hGXili96gjKztrYzCDcC A==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Ap6x6EvU Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: Fix RDMA VSI removal during queue rebuild X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamil Maziarz , Rafal Rogalski Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Rafal Rogalski During qdisc create/delete, it is necessary to rebuild the queue of VSIs. An error occurred because the VSIs created by RDMA were still active. Added check if RDMA is active. If yes, it disallows qdisc changes and writes a message in the system logs. Fixes: 348048e724a0 ("ice: Implement iidc operations") Signed-off-by: Rafal Rogalski Signed-off-by: Mateusz Palczewski Signed-off-by: Kamil Maziarz Tested-by: Bharathi Sreenivas --- drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a1f7c8edc22f..23f41393395f 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -9031,6 +9031,7 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type, { struct ice_netdev_priv *np = netdev_priv(netdev); struct ice_pf *pf = np->vsi->back; + bool locked = false; int err; switch (type) { @@ -9040,10 +9041,27 @@ ice_setup_tc(struct net_device *netdev, enum tc_setup_type type, ice_setup_tc_block_cb, np, np, true); case TC_SETUP_QDISC_MQPRIO: + if (pf->adev) { + mutex_lock(&pf->adev_mutex); + device_lock(&pf->adev->dev); + locked = true; + if (pf->adev->dev.driver) { + netdev_err(netdev, "Cannot change qdisc when RDMA is active\n"); + err = -EBUSY; + goto adev_unlock; + } + } + /* setup traffic classifier for receive side */ mutex_lock(&pf->tc_mutex); err = ice_setup_tc_mqprio_qdisc(netdev, type_data); mutex_unlock(&pf->tc_mutex); + +adev_unlock: + if (locked) { + device_unlock(&pf->adev->dev); + mutex_unlock(&pf->adev_mutex); + } return err; default: return -EOPNOTSUPP;