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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB30EC6FD1E for ; Fri, 10 Mar 2023 11:33:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 25A42414CE; Fri, 10 Mar 2023 11:33:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 25A42414CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1678448033; bh=P0JiwyI3ymLoQ82gCb+5O6Aa9L5eA6vRblyndhL1Af8=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=gJ3R4aM4xu4j5vOH6+E4y1IlU8CROxr9wiypvxXrmnRCTfmrjPq0VuaLDrJjHOUXD Vn2iQAyyLUP/0VsKj7nlHfRqMJWDXB+iGpSuiyBIHDgM6ohT+oz+dop+oDwUMSdY1k LES6pcMoWYkzNy3bcHZUyfJ0e8Sb5xcSmO+3L+GIRQ60PkvNh0k28zA+n9DqQ6PziX 4javwSYu/vDaNJLU1hN9r1v5ZGKprlSwUY2d4kLYrwJOWy/WwZTmfl9DpJyw72daHq P6IzpEikzi9r7J4+gPWto8mNhMtwqX0YSGXaLh9pi8130Yi2L4ylFkuFqhErxT3VNy cOxFZuKAqlAQQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iapOuAYadJiW; Fri, 10 Mar 2023 11:33:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0733C415D4; Fri, 10 Mar 2023 11:33:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0733C415D4 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 70A741BF336 for ; Fri, 10 Mar 2023 11:33:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 456BB82026 for ; Fri, 10 Mar 2023 11:33:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 456BB82026 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jcSnjMMvxx1W for ; Fri, 10 Mar 2023 11:33:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4DC4982016 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4DC4982016 for ; Fri, 10 Mar 2023 11:33:49 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="336726904" X-IronPort-AV: E=Sophos;i="5.98,249,1673942400"; d="scan'208";a="336726904" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 03:33:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="707978046" X-IronPort-AV: E=Sophos;i="5.98,249,1673942400"; d="scan'208";a="707978046" Received: from unknown (HELO fedora.igk.intel.com) ([10.123.220.50]) by orsmga008.jf.intel.com with ESMTP; 10 Mar 2023 03:33:47 -0800 From: Kalyan Kodamagula To: intel-wired-lan@lists.osuosl.org Date: Fri, 10 Mar 2023 12:33:44 +0100 Message-Id: <20230310113344.199393-1-kalyan.kodamagula@intel.com> X-Mailer: git-send-email 2.39.2 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=1678448029; x=1709984029; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TQcOPItVYoFVPZX5KLhMGNxOfxtdlz9VG5bRTbkY/0s=; b=Hk1/3ppf5he7JKNBEepwyr+Vdfv9ox8S/Dqn6HX3Kn2+XMZqrZSUFox1 SXZTmcAeOFvI+8bvY6DtKJe8ldhqJMcelKQW7ZL64LJm3cCbuZe2KpRmh 5fn1p3YU+i/LDpQ5j1Bix66GA+4o4xsQTMXSDV+7oZNEPnbWbPP56jcHx soxM95AdHYf5WjD0INEwOElGB+pPT4aNOU3XsL8ixND95nS58Jri2GFIR gzYGCt5FAB8H4QY+KsKLBhF9r8YUfDTov6fxjE/MLT+HE3xaIpz+P/bp2 fl+b9UPzIw/dXXQOUHkzNyVbOwGVt6v4HXWGJ2mkZH9pLsOKay0Q5LdtL Q==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Hk1/3ppf Subject: [Intel-wired-lan] [PATCH net v2] ice: check if VF exists before mode check 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: Michal Swiatkowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Michal Swiatkowski Setting trust on VF should return EINVAL when there is no VF. Move checking for switchdev mode after checking if VF exists. Fixes: c54d209c78b8a ("ice: Wait for VF to be reset/ready before configuration") Signed-off-by: Michal Swiatkowski Signed-off-by: Kalyan Kodamagula --- V1->V2: Added Fixes tag --- drivers/net/ethernet/intel/ice/ice_sriov.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index 96a64c25e2ef..0cc05e54a781 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -1341,15 +1341,15 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted) struct ice_vf *vf; int ret; + vf = ice_get_vf_by_id(pf, vf_id); + if (!vf) + return -EINVAL; + if (ice_is_eswitch_mode_switchdev(pf)) { dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n"); return -EOPNOTSUPP; } - vf = ice_get_vf_by_id(pf, vf_id); - if (!vf) - return -EINVAL; - ret = ice_check_vf_ready_for_cfg(vf); if (ret) goto out_put_vf; -- 2.39.2 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan