From patchwork Tue Aug 13 18:27:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 1972054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=GiE0hlo4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk0Hp6t5bz1yYl for ; Wed, 14 Aug 2024 04:28:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C277340574; Tue, 13 Aug 2024 18:28:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tBrZEXh2SAti; Tue, 13 Aug 2024 18:28:04 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D6BFA4068A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1723573683; bh=0FUwl2486l/jeLoGKzs9tmDqeNS+tAHZe3YD3ALXm7s=; h=Date:In-Reply-To:References:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=GiE0hlo4WJQDFwKZyECCZiPn/TM3uiIDVa6CgOL5K9+yqAzQ+kkWQMD+uh2uFcoBE RIYhyk1R32wm7+9lAKlgZS3A+knwlEx2ckkK7ACwQH+p1qFfOI1a0rjeEapyWpI2g1 6Vv0BQGOodD33B+dc85LNF4dBkg0T+/L3QKMUMtoFCvWDQhyn4HW+1a+9I/Ea+hRh7 Pn5fyH0Cljvkeb84fPDIrreCl3/3/2E272yF+Hebm2VeE3Y9DlupCRX76Z9++RWkh+ t1KckHG5KqdDeckLxGeHfMgDsSM/HUSABzHOthNtmbRd0qagktu7EFgMADc4hTkl5m 7jEve+7rVV5iA== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id D6BFA4068A; Tue, 13 Aug 2024 18:28:03 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 097941BF343 for ; Tue, 13 Aug 2024 18:28:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id EBBDD60703 for ; Tue, 13 Aug 2024 18:28:01 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4ER61vlrYl-l for ; Tue, 13 Aug 2024 18:28:01 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b4a; helo=mail-yb1-xb4a.google.com; envelope-from=3r6w7zgokdyyocpqlxkujaiqqing.eqokpvgn-yktgf-ncpnkuvu.quwqun.qti@flex--manojvishy.bounces.google.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2065060629 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2065060629 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2065060629 for ; Tue, 13 Aug 2024 18:28:00 +0000 (UTC) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e0e3eb3feaeso9623422276.2 for ; Tue, 13 Aug 2024 11:28:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723573680; x=1724178480; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0FUwl2486l/jeLoGKzs9tmDqeNS+tAHZe3YD3ALXm7s=; b=sDJsnwuksss9Gq3lbDkMB6yBGafdZ02tu2mQ9CHh8s8GD0tdxTLVVxGhHRlDTD1StR 5LmM4nyQiEb1mto8mNPusB9lA+cKDQU1nd8JBm+JwLSalN5Fx8J/uY0J61rNwkw/X0Re zvO7BlkdCKFfQW2G+on1aiWlLZXo18lzGrWwz7Xc7UZzpZTRSQMPljfEFNMIna3ByEgP YJ46U1nnekBzL70CQvxdKk6ULTWNywFXtwIQWxKcr5xItz8fUsJJxPkQ3+nupV/5tjow YGWPj1fv6zReBOd4r8zLv9xz4+TzceIif65oN/AL7U/YR8uShY9PuadIGSngauxytKk0 8tgg== X-Forwarded-Encrypted: i=1; AJvYcCUzduJA5pN0K57kcEtJdY4U3HZyyVfkT9WUQAXMrzHDtxOrfJVw5dfM5UU9I6E0vCHo1RkQmKBikMQBYEvNJXja4kHHcySCa2CyOx4r3VVr9A== X-Gm-Message-State: AOJu0YyoQrM7a+2My5o/WbC22GO0Y3X+eRqVE5Nf8JhWKcpZwqabVc6v fk8sv3335+PFRE6PPBBNLRqkzlkOvwbpnXTJ6yp2005ki3kEcct2mkR2MswfhJVwZ0W8I+rUG0n 8RIG+u38xnWqMwD9Ung== X-Google-Smtp-Source: AGHT+IEtLel87VI5FBoqzbu00ocynCKeHOTMNEky1uO+1XuJvYBO+DGemsm7Z+Cht2r0k2SIU65ZGd3kOoHSPEw8 X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a25:a223:0:b0:e0b:f1fd:1375 with SMTP id 3f1490d57ef6-e1155bafbf9mr618276.10.1723573679918; Tue, 13 Aug 2024 11:27:59 -0700 (PDT) Date: Tue, 13 Aug 2024 18:27:43 +0000 In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240813182747.1770032-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813182747.1770032-2-manojvishy@google.com> From: Manoj Vishwanathan To: Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723573680; x=1724178480; darn=lists.osuosl.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0FUwl2486l/jeLoGKzs9tmDqeNS+tAHZe3YD3ALXm7s=; b=iO9RGx3SGXj1X/+EKvD/pMST372pJPiJkTdLobvnEyjlKeZx99dEgdaDFo22cx8e8G EUfwG3dfW7euXyQKI+TR8kitonyvM3CFdJjE45FqYvO/6UgfJ0m1Ee8XC34LW9uFkc1m SAJdVu/XfQhRDy5DSPpehpBvn1g4Z0Q9yDxjcj3lQVC7XUd73cEsuqbrrBn0sep5ALwl UfMu0l4QCWDHucFI1vzH6AreI9arCOuiGbqzSisRFOiUkp+hlj2wtgToSSOzGPfbvjSr E7MkV1hqdHIG+j1R0qdbrbDJoKWbc8OqmqBU/KRW8b5nTUfaouFVLOsFIzAr0sNltPT4 7N6w== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=iO9RGx3S Subject: [Intel-wired-lan] [PATCH v1 1/5] idpf: address an rtnl lock splat in tx timeout recovery path 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: netdev@vger.kernel.org, Manoj Vishwanathan , linux-kernel@vger.kernel.org, google-lan-reviews@googlegroups.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Adopt the same pattern as in other places in the code to take the rtnl lock during hard resets. Tested the patch by injecting tx timeout in IDPF , observe that idpf recovers and IDPF comes back reachable Without this patch causes there is a splat: [ 270.145214] WARNING: CPU: PID: at net/sched/sch_generic.c:534 dev_watchdog Signed-off-by: Manoj Vishwanathan --- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index af2879f03b8d..3c01be90fa75 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -4328,14 +4328,26 @@ int idpf_vport_intr_init(struct idpf_vport *vport) { char *int_name; int err; + bool hr_reset_in_prog; err = idpf_vport_intr_init_vec_idx(vport); if (err) return err; idpf_vport_intr_map_vector_to_qs(vport); + /** + * If we're in normal up path, the stack already takes the + * rtnl_lock for us, however, if we're doing up as a part of a + * hard reset, we'll need to take the lock ourself before + * touching the netdev. + */ + hr_reset_in_prog = test_bit(IDPF_HR_RESET_IN_PROG, + vport->adapter->flags); + if (hr_reset_in_prog) + rtnl_lock(); idpf_vport_intr_napi_add_all(vport); - + if (hr_reset_in_prog) + rtnl_unlock(); err = vport->adapter->dev_ops.reg_ops.intr_reg_init(vport); if (err) goto unroll_vectors_alloc; From patchwork Tue Aug 13 18:27:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 1972055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=62QeSNSx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk0Hs3CvXz1yYl for ; Wed, 14 Aug 2024 04:28:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D56B5403BE; Tue, 13 Aug 2024 18:28:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id iiXt_zuFNNaO; Tue, 13 Aug 2024 18:28:06 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 00FCC403C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1723573686; bh=TvCJH3TZ9fBYiYpF5a88AFpsytgjevnUGq5R4un9KfQ=; h=Date:In-Reply-To:References:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=62QeSNSxR1Mxm4KRb4vAOhcx3pkK1lWtsnD/C+0GnwSQEOoShjeWGalOGb4d9+5Vq gxT+AFR59PZI7ZNNDpprPWBiD00/Z4WDeVYkp0RCfeSla7PIqAtJLPqcBRUnkXNS0d B+O9+LNaG4tjmbHRSEy+3LsBcxkLZ/6n0YiL20aNCZpKNtsKr+9JanNrb5jmDgCMqt pMzioC70DYoDqftkdMW3Q8pNAa0f58u4v4NLQL4O2gxr6CNq+KfHbKg2dwZ9k/Qn1S Xe0WZadRvLLPeRPJQH4UoEwR+pLGtmGP6Nlumm7O08+r7pVbDHPBPaBl5JXrth3NeI UwB7hetsVGFfw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 00FCC403C2; Tue, 13 Aug 2024 18:28:05 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 89C5D1BF343 for ; Tue, 13 Aug 2024 18:28:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 75AB080EDE for ; Tue, 13 Aug 2024 18:28:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WJ7m58I6kEql for ; Tue, 13 Aug 2024 18:28:04 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b49; helo=mail-yb1-xb49.google.com; envelope-from=3sqw7zgokdykrfstoanxmdlttlqj.htrnsyjq-bnwji-qfsqnxyx.txztxq.twl@flex--manojvishy.bounces.google.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org B635980ED8 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B635980ED8 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by smtp1.osuosl.org (Postfix) with ESMTPS id B635980ED8 for ; Tue, 13 Aug 2024 18:28:03 +0000 (UTC) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-e0b7922ed63so10501764276.0 for ; Tue, 13 Aug 2024 11:28:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723573682; x=1724178482; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TvCJH3TZ9fBYiYpF5a88AFpsytgjevnUGq5R4un9KfQ=; b=Yp3q6XMbm+C8YCVG3RbgIy58RkkdG6T7fAcCGcqNP82+wPoQMArneH7JOZOCp1kmqw DbVjn28RowVm8on4Aa032A9Ixk5x0uSdEYKNHCudBNLe5pvAbRGzflyczxU+B6pc9lvr Dal1bvpZYqwj+PyvmdWCzqEZipW+P1E/G9NwD0OCWI5DA43lV7abc2y8nHU/YqfWeVHB Y+HzFU11rpm9PUFgzXVkweIGmscHgxuScxqSWXYark/s1Mm7FOE97OAkFPig/E1+xeWV +tmIAdtL4jDbpx6PG7UJHpuGiShrARlNj8hHSraQ4sbDq8LM45f5VMLJHSfsKiNgVYKo fhSw== X-Forwarded-Encrypted: i=1; AJvYcCWVujEW2dqJq3LMusbeThPBEtKBoRy3wY5BY0mztzCSY3fPATT8CX9M5E+giGRTZHOkg7lSxnPYJa5gEewXd7oQ3yKhp5VBRereYlpNmlksxQ== X-Gm-Message-State: AOJu0Yz7GuIXi1RbTOtraZKP/GnRByDAfTymE+7mpWuY/VKWkNpJUqHd REudo49qU3bKCr//FbLqCOv3Vb3Eb7EE5vzf0GGWejcg2tni0YKp+KPLgWUUaYgYdw9f+ezg/nc 7gWakB3YZnVmstOvGcQ== X-Google-Smtp-Source: AGHT+IGj4/G4VHtyu7j84mLj7yhWkQtHtTJEHKj/H2cGvmAy6yo3iqZtz9v6g07d1BL8wXt51Jxah1P72bzfqR2d X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a5b:b43:0:b0:e03:5b06:6db2 with SMTP id 3f1490d57ef6-e1155a57e9amr896276.3.1723573682504; Tue, 13 Aug 2024 11:28:02 -0700 (PDT) Date: Tue, 13 Aug 2024 18:27:44 +0000 In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240813182747.1770032-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813182747.1770032-3-manojvishy@google.com> From: Manoj Vishwanathan To: Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723573682; x=1724178482; darn=lists.osuosl.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=TvCJH3TZ9fBYiYpF5a88AFpsytgjevnUGq5R4un9KfQ=; b=OsplV17/tDKAmZmMGpHLbsFI8hPuJzJX08t1A0l8Y7A80zlZrWu0oITJ36hfb0TvUL AjdjcvMJhOFbOsZD47chiIdQofZknHrcyzeC0VP4zbsMvklC31qwu6ik1eEac9loTv5L YP75TIoxk1xdd1ADFKtROhLPTPAo+DEf9KzWVpINqiL1qwuh93MlF5YrFap5f6CdJ2oO JfCYZQuffNu1Z9M6njTdYkvWu3SG4XIIU2R+hFoHsslg4BdyMpz3VfreszCJVpcD5z2P 5E6yC0UnF0g7pfdwbY0xAqFJ2FajYa46rAOjxBq/Rd4kolg82p6pgdd5P6G4A+n+dVgz IFbg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=OsplV17/ Subject: [Intel-wired-lan] [PATCH v1 2/5] idpf: Acquire the lock before accessing the xn->salt 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: netdev@vger.kernel.org, Manoj Vishwanathan , linux-kernel@vger.kernel.org, google-lan-reviews@googlegroups.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" The transaction salt was being accessed before acquiring the idpf_vc_xn_lock when idpf has to forward the virtchnl reply. Fixes: 34c21fa894a1 ("idpf: implement virtchnl transaction manager") Signed-off-by: Manoj Vishwanathan --- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 70986e12da28..30eec674d594 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -612,14 +612,15 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter, return -EINVAL; } xn = &adapter->vcxn_mngr->ring[xn_idx]; + idpf_vc_xn_lock(xn); salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info); if (xn->salt != salt) { dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n", xn->salt, salt); + idpf_vc_xn_unlock(xn); return -EINVAL; } - idpf_vc_xn_lock(xn); switch (xn->state) { case IDPF_VC_XN_WAITING: /* success */ From patchwork Tue Aug 13 18:27:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 1972056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=Qxbq2C6d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk0Hv3PtYz1yYl for ; Wed, 14 Aug 2024 04:28:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 39AD740708; Tue, 13 Aug 2024 18:28:09 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2eopk1H8N7fE; Tue, 13 Aug 2024 18:28:08 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3C991404ED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1723573688; bh=TP961J72JDd3W/A5AwIhTA95rpBeW3mVlPbF5keUAfI=; h=Date:In-Reply-To:References:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=Qxbq2C6dGOwnULrMsz78hd4r2e0OSB576fYeR2ofYD/HAuV8jDA6ZfSyAI6500gaB bO5/Q1jBpqZ9ALzWItaEh1xljfO1DNw9xd2Rh9q+YFST6lgVraRFOsqhE+SRsSGIMY dy4RF4c3DLoQ+JPhGEDG7RMTjvlMetxVJLM23mVXh6L8KBVZk3IN4YctB/K/yizn38 CR1xkzLo21AKiWht1suyLfVl0IMziDJywPUCiSgofNCkkQbOOmsmPbLJ+39e6U7oQH 6bszZNEEPnEOZE2p2KJqGpOKHEJCrufAq8WT1WRMxEcMCaqe1Prx0ly0SIb8iJqahn 32J+OkJziQImw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 3C991404ED; Tue, 13 Aug 2024 18:28:08 +0000 (UTC) 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 C680D1BF343 for ; Tue, 13 Aug 2024 18:28:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B39E9401CE for ; Tue, 13 Aug 2024 18:28:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7KBYh5dhwIx3 for ; Tue, 13 Aug 2024 18:28:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::b4a; helo=mail-yb1-xb4a.google.com; envelope-from=3taw7zgokdywuivwrdqapgowwotm.kwuqvbmt-eqzml-tivtqaba.wacwat.wzo@flex--manojvishy.bounces.google.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 69AAC40021 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 69AAC40021 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by smtp2.osuosl.org (Postfix) with ESMTPS id 69AAC40021 for ; Tue, 13 Aug 2024 18:28:06 +0000 (UTC) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e0be470f76bso9692579276.3 for ; Tue, 13 Aug 2024 11:28:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723573685; x=1724178485; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TP961J72JDd3W/A5AwIhTA95rpBeW3mVlPbF5keUAfI=; b=VkxDXCKp1/6teKNY8qvvU6WStbL85FT37em4pEtkcTwM1BkDycFeVMVBoptq0/1nfB GCdKS2LzNt2HXjBd5PM/5DgeY0sL99I1gGxvTTmMdmfbK6StaqwQoP68eVKWTJIQXhM7 1jxstSdQ+SNKGO5iCLKsLfSI6HeFfs/gCIhIbNowtxEqOY1rmVfGFN/nNbliQga0+SG/ 4v5OnOtx2fbO2+ctiYE1SggL40HNjEiQqEm5vLiGHlThAeFtIDZPTGRuobKANPssbldh a4eTdUMFBSJOrer1Fi91eXjQzODqhqhgpH3zJhPbcqQU7817nJ8R6jkvnwoOrjFUnaHl wm8g== X-Forwarded-Encrypted: i=1; AJvYcCXKYL8gvl3Mvuj//AVXhe/3WV1OGKi0yI4jTZMqlgxB1uB8+RDszeWJriC8Kooh6qXq+40WbVhTZU6m1zyQm9cVSSk2tXj0XCFoUmBJ/3XZrg== X-Gm-Message-State: AOJu0YzkzoioKTaHuioGQ7olTS/VDqTf9WQOc1aFAsHNbwmxWbCD/Tuw Am2xUTZm3VzbK6Z+LWhG1/DU6JIzAeLiiP9VL4ezzSeIy0JN8OtmoUCb4cQP6Z+Kc1eu80eQRza GGufaWMaYVVLo7/sBbQ== X-Google-Smtp-Source: AGHT+IEcUJ4nno820COmCVkqEY2grkP8CkJXPuWKQlxjBtfvY5Cd6Kury80B6+oOUU3OFR28ZBOqgQRdHfLwWACY X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a25:c5c3:0:b0:e0b:f69b:da30 with SMTP id 3f1490d57ef6-e1155b7c6cbmr11272276.9.1723573685319; Tue, 13 Aug 2024 11:28:05 -0700 (PDT) Date: Tue, 13 Aug 2024 18:27:45 +0000 In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240813182747.1770032-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813182747.1770032-4-manojvishy@google.com> From: Manoj Vishwanathan To: Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723573685; x=1724178485; darn=lists.osuosl.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=TP961J72JDd3W/A5AwIhTA95rpBeW3mVlPbF5keUAfI=; b=w0KOAUZ/UZsqbjfpBSU1aSvXDNSIGx7whMsJraP6C2XsRo9gRTWrEkIeJyf2UZ9m1z 2yEmPOsakNEk8u/EEi0BlZhvgBotAzo0TDux6kH6XK0TfG36wyPJUCauQoe2Yb9oFiLK f9VzUYTYCjk191VBQ+Raxa0MnSqbtz9qiOrLBNq1/GJg2sTjg3cRVWZyJlHWo8KuL4Ww IpIk/EylgDLwbjhb6VpDiUC1N7qKzcF56p5/pZrTPK39edhQclwBkR0jHW29VuEntCqS 3oUEbzZyWemOzj8RezIERUEfiol7Ga6hqqYnyYgSvE+7pFfhLLLB4IoBCvFXJFgI59VZ 1egw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=w0KOAUZ/ Subject: [Intel-wired-lan] [PATCH v1 3/5] idpf: convert workqueues to unbound 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: netdev@vger.kernel.org, Manoj Vishwanathan , linux-kernel@vger.kernel.org, google-lan-reviews@googlegroups.com, Marco Leogrande Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Marco Leogrande When a workqueue is created with `WQ_UNBOUND`, its work items are served by special worker-pools, whose host workers are not bound to any specific CPU. In the default configuration (i.e. when `queue_delayed_work` and friends do not specify which CPU to run the work item on), `WQ_UNBOUND` allows the work item to be executed on any CPU in the same node of the CPU it was enqueued on. While this solution potentially sacrifices locality, it avoids contention with other processes that might dominate the CPU time of the processor the work item was scheduled on. This is not just a theoretical problem: in b/317234476, a misconfigured process was hogging most of the time from CPU0, leaving less than 0.5% of its CPU time to the kworker. The IDPF workqueues that were using the kworker on CPU0 suffered large completion delays as a result, causing performance degradation, timeouts and eventual system crash. Tested: * I have also run a manual test to gauge the performance improvement. The test consists of an antagonist process (`./stress --cpu 2`) consuming as much of CPU 0 as possible. This process is run under `taskset 01` to bind it to CPU0, and its priority is changed with `chrt -pQ 9900 10000 ${pid}` and `renice -n -20 ${pid}` after start. Then, the IDPF driver is forced to prefer CPU0 by editing all calls to `queue_delayed_work`, `mod_delayed_work`, etc... to use CPU 0. Finally, `ktraces` for the workqueue events are collected. Without the current patch, the antagonist process can force arbitrary delays between `workqueue_queue_work` and `workqueue_execute_start`, that in my tests were as high as `30ms`. With the current patch applied, the workqueue can be migrated to another unloaded CPU in the same node, and, keeping everything else equal, the maximum delay I could see was `6us`. Signed-off-by: Marco Leogrande Signed-off-by: Manoj Vishwanathan --- drivers/net/ethernet/intel/idpf/idpf_main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index db476b3314c8..dfd56fc5ff65 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c @@ -174,7 +174,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); pci_set_drvdata(pdev, adapter); - adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0, + adapter->init_wq = alloc_workqueue("%s-%s-init", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->init_wq) { @@ -183,7 +184,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_free; } - adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0, + adapter->serv_wq = alloc_workqueue("%s-%s-service", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->serv_wq) { @@ -192,7 +194,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_serv_wq_alloc; } - adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0, + adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->mbx_wq) { @@ -201,7 +204,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_mbx_wq_alloc; } - adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0, + adapter->stats_wq = alloc_workqueue("%s-%s-stats", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->stats_wq) { @@ -210,7 +214,8 @@ static int idpf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_stats_wq_alloc; } - adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0, + adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", + WQ_UNBOUND | WQ_MEM_RECLAIM, 0, dev_driver_string(dev), dev_name(dev)); if (!adapter->vc_event_wq) { From patchwork Tue Aug 13 18:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 1972057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=QLjisJXF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk0Hx5CSBz1yYl for ; Wed, 14 Aug 2024 04:28:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 390C9406EA; Tue, 13 Aug 2024 18:28:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QqFIDNFP7TYd; Tue, 13 Aug 2024 18:28:11 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 44014406F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1723573691; bh=l/Sac5m4oGMZ3mG4jh/NoF4fykuTzT6XDGolN2ik8MI=; h=Date:In-Reply-To:References:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=QLjisJXFXIBcX4OjfksUEhwqWZVVk05rnUbrvmjmf6sZn6VEeazsVn42VfLoohnOi R+8PfQet/8mXfA2NP9+HwjEKHSICmoAW5ju1iBgBuZNWcA8JHffmCvNGfYwpRjCbEr ptkDiAQmWbfhN1pNgwDsliQkxPtT4QikdhWyO7gtQ2L7RUT3rlSYaGyd7fPEaJrpzM /cyKCWILg5arvUsSCtAsogXo5jzlkVsiMN6tkH4H6tZvAbHfC8WvHX9sowDTlwJTtz u5J1y19CQyDJK5RXPNthSp4yAHLhj5DeAUcmWnDUP0JpXb71qxgi4FHG9Y/KFqDqO7 I3JflP2hcZIKg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 44014406F3; Tue, 13 Aug 2024 18:28:11 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D87E11BF343 for ; Tue, 13 Aug 2024 18:28:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D320E60703 for ; Tue, 13 Aug 2024 18:28:09 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id X_i-4abVntlj for ; Tue, 13 Aug 2024 18:28:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::114a; helo=mail-yw1-x114a.google.com; envelope-from=3t6w7zgokdy4wkxytfscriqyyqvo.mywsxdov-gsbon-vkxvscdc.yceycv.ybq@flex--manojvishy.bounces.google.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org F059860629 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F059860629 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by smtp3.osuosl.org (Postfix) with ESMTPS id F059860629 for ; Tue, 13 Aug 2024 18:28:08 +0000 (UTC) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-672bea19c63so139343767b3.2 for ; Tue, 13 Aug 2024 11:28:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723573688; x=1724178488; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l/Sac5m4oGMZ3mG4jh/NoF4fykuTzT6XDGolN2ik8MI=; b=UOLcX2IUGXsptmPJsH5esIzDO5R/55DyTRYWY/5CYEgxgGSCQVYOIZCzYcYigBkvow 6imZ+oFEN1+YInfWyUCZDX3qdeH7bFdMs9G3MVGJC3ZNC74abYs1flLBskQULruaZpvX kcqiNbSZvViluJOnPDC85jwDFCcsostR5XmrFM1pb7jwvOG9HA0hHBz5KBr1D1ALjKCw uZAC9r+6dqYYOez0WASACGY37TGS6FWyELA7x9HYDxpUtdRr4ZATvcVN+8q9XV9HNvGZ +JWmOy/tnploYLPWI3rnkcJSpBKkD1y7sO7eI2e0/zMCMJD0aZ8HZNWHo/VqyOPhNyv2 OJfA== X-Forwarded-Encrypted: i=1; AJvYcCVOVbDf6g6yYyC3/sR3fQLXeUN1FHYH3Byw9iz/KNhMKJ9pC7leWlCYCSXMUm9PsZ67QG9+bOh+enp18oESMdaU3NwVnQLl6QSVLC+qKkqx8w== X-Gm-Message-State: AOJu0YzIWXJ8GBzEk60qsvjIdfUjcJMJNQDlyQ4xAcCpbEiqeRsffBls h5EMKRz2kpRH/CfuUyfV8USQ5m0YZLdeN2SBvgvW25KFjYBJ4mNevgvdAaK/3eTDYBMMp6HJna3 7uDMTH6ltWOqvR2Rz/w== X-Google-Smtp-Source: AGHT+IGMc7q2tq4LDbjY97g5fn1H9eJpq9yMVM8n/S+oYbY7lnb67UbACWQriHtyDPG5G0lfyfbpfMowGW8x+pG6 X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a81:b810:0:b0:64b:5cc7:bcb7 with SMTP id 00721157ae682-6ac954aa2acmr70637b3.1.1723573687771; Tue, 13 Aug 2024 11:28:07 -0700 (PDT) Date: Tue, 13 Aug 2024 18:27:46 +0000 In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240813182747.1770032-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813182747.1770032-5-manojvishy@google.com> From: Manoj Vishwanathan To: Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723573688; x=1724178488; darn=lists.osuosl.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=l/Sac5m4oGMZ3mG4jh/NoF4fykuTzT6XDGolN2ik8MI=; b=4qks60lQfzIl6wFGH7JgHJidtp/hgh859azwFTAfy9ZH1DuQiAgkmyY0OEzP/dqzK0 t1TUQkOCsaN2Hzwr8/rrE3OZgeSL2E5bWhQxNriSlhSecJndby9t4NPoiNlAdmVEsTpl HjOrFCufNgeC5raVcmj95FHltDGm6sF0LNslJvRR3O/DIMa4ap9HyC4cuWr998eguTpF fP5F71sq4Nu8TnHzf+q2WmrNfVXTZO/hRRlPvWVOsLeXzfmmuwNe8nxMi/LFAQhkL5Ly vgqEDpBP+CAEjwzmPy8aH0aZgWuPnwVZaq2c771PLQhv6cTazLtt1P8sa5+GT8QUmZs3 E9yw== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=4qks60lQ Subject: [Intel-wired-lan] [PATCH v1 4/5] idpf: more info during virtchnl transaction time out 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: netdev@vger.kernel.org, Manoj Vishwanathan , linux-kernel@vger.kernel.org, google-lan-reviews@googlegroups.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Add more information related to the transaction like cookie, vc_op, salt when transaction times out and include info like state, vc_op, chnl_opcode when transaction salt does not match. Sample output for transaction timeout: ------------------- Transaction timed-out (op:5015 cookie:45fe vc_op:5015 salt:45 timeout:60000ms) ------------------- Signed-off-by: Manoj Vishwanathan --- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 30eec674d594..07239afb285e 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -517,8 +517,9 @@ static ssize_t idpf_vc_xn_exec(struct idpf_adapter *adapter, retval = -ENXIO; goto only_unlock; case IDPF_VC_XN_WAITING: - dev_notice_ratelimited(&adapter->pdev->dev, "Transaction timed-out (op %d, %dms)\n", - params->vc_op, params->timeout_ms); + dev_notice_ratelimited(&adapter->pdev->dev, + "Transaction timed-out (op:%d cookie:%04x vc_op:%d salt:%02x timeout:%dms)\n", + params->vc_op, cookie, xn->vc_op, xn->salt, params->timeout_ms); retval = -ETIME; break; case IDPF_VC_XN_COMPLETED_SUCCESS: @@ -615,8 +616,8 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter, idpf_vc_xn_lock(xn); salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info); if (xn->salt != salt) { - dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n", - xn->salt, salt); + dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (exp:%d@%02x(%d) != got:%d@%02x)\n", + xn->vc_op, xn->salt, xn->state, ctlq_msg->cookie.mbx.chnl_opcode, salt); idpf_vc_xn_unlock(xn); return -EINVAL; } From patchwork Tue Aug 13 18:27:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Vishwanathan X-Patchwork-Id: 1972058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=6Dyi36+V; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wk0J04JwMz1yZl for ; Wed, 14 Aug 2024 04:28:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2E38B40720; Tue, 13 Aug 2024 18:28:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AXi1ldos8rmN; Tue, 13 Aug 2024 18:28:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4AE5D40710 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1723573693; bh=2l203xNbbDmQFlGySVGE48ihh5ns60KyrsTrGKa57JU=; h=Date:In-Reply-To:References:From:To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=6Dyi36+VzMutzMnNOM4d1XqNHDbl1vGSmYJxWmifnSfw8Qyo3+y0vzbrRScElKtcd Qn3jwLQMuj36a6OCs2GyVynoSq59Qr1xGk6JPm6mot4QP4lRbEN2twcT4qtqZQazr0 fJSeM01r3ZrH5VUm+kO0H7m0ciKe1y7uuDerELl0U5rIjnEELmhOMRjXwkuozBKdOY 89boQNXiAFfKRhIFTZfHf2s3P9tu0n86e7G8ZI/9zuTWXiQIgyKzzq66G6OfztfOAu F05EfWoG1vs82BsoMKDoygwlvoID+npfl6AJflk5gDBvtGOFm6GKFMIZsCQZ51URdu tMt5cQeOG579A== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 4AE5D40710; Tue, 13 Aug 2024 18:28:13 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id ACF421BF343 for ; Tue, 13 Aug 2024 18:28:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9AD6860703 for ; Tue, 13 Aug 2024 18:28:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 0pmBDAXeD2wl for ; Tue, 13 Aug 2024 18:28:12 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1149; helo=mail-yw1-x1149.google.com; envelope-from=3uqw7zgokdzeznabwivfultbbtyr.pbzvagry-jverq-ynayvfgf.bfhbfy.bet@flex--manojvishy.bounces.google.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org E114660629 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E114660629 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by smtp3.osuosl.org (Postfix) with ESMTPS id E114660629 for ; Tue, 13 Aug 2024 18:28:11 +0000 (UTC) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-68d1d966ef7so124505197b3.1 for ; Tue, 13 Aug 2024 11:28:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723573691; x=1724178491; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2l203xNbbDmQFlGySVGE48ihh5ns60KyrsTrGKa57JU=; b=Czg2L3v3dfLuSbFdjf3i9PMqzFQx2X6HZVtw05WFTO8YDfyhM3+hxGE3cRAEIMXpdi +fdf9jfXQvmmZ0eBItidIc+wRjmaCU7S54XYTsScbFKzyEEapzzi7dYSiCqUcSSKfuNc k+uarC7c8w0NdADSmEwozA+Pk2y2paIqw6pULhQvkRaItP00mBNQF1GJKmVButKPuYj+ 3fEx0xZnZoDp543dXKmzuaYC2gOoVqLWSfmGLVBpyrypS96Yv1Yx4L4Q+TLV38rZ4QxT qGLYXVJWADY7L17A7SGT0If52uG5tJdhCSXBncO7CDbQ+mkCk0cL1Lltvx8y7eKXWbex CBvg== X-Forwarded-Encrypted: i=1; AJvYcCVZ/6xdeOVbzWhIELsA8EegJ3VE/0yVbwmIwWQ0jI1A3PNV3PpJJpDUNSg3JOA14f2j2SXmekqykdZYMlWJHpTikk3uSDNoF2PHTAt0FUUwcA== X-Gm-Message-State: AOJu0YxdtSk8+dYlDaceB9g7UKt4HyjJWL4PUbSSRRlywfZ3EieFePbY ddHN0TR5CGReM45lZyGSaej+OgGTybtNgQYv1qpvE2fGMdWTlXR9IpUwkdfRa7rqYIpFfaESfiy s/26IElrXcHeRAEboeg== X-Google-Smtp-Source: AGHT+IEjC2wQwCxOJBrBI4mvt/RtCshXJNtsKgTfCt4RfM09XRcGt/PRVIU4C6Llzti+4BVUOLQboVqmXWvBEOBm X-Received: from manojvishy.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:413f]) (user=manojvishy job=sendgmr) by 2002:a25:c5d1:0:b0:e0e:3f14:c29d with SMTP id 3f1490d57ef6-e1155a94bdbmr13662276.4.1723573690732; Tue, 13 Aug 2024 11:28:10 -0700 (PDT) Date: Tue, 13 Aug 2024 18:27:47 +0000 In-Reply-To: <20240813182747.1770032-1-manojvishy@google.com> Mime-Version: 1.0 References: <20240813182747.1770032-1-manojvishy@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240813182747.1770032-6-manojvishy@google.com> From: Manoj Vishwanathan To: Tony Nguyen , Przemek Kitszel , "David S. Miller" , Eric Dumazet , intel-wired-lan@lists.osuosl.org X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723573691; x=1724178491; darn=lists.osuosl.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2l203xNbbDmQFlGySVGE48ihh5ns60KyrsTrGKa57JU=; b=0LqsoasRsKt+acqNkcWW/OcpI5RgX4lXMvJhm7+N1s/tfC7LMi+Qvq8aq4+WKdT3xx gsX6ItT523rg00SQ402VUcnXVNUj7v+ECnxS48C02joHWLE8oA84OMfj6/Tp9QrJ02H5 +9WSge93Z9zG+ndjQSuYQ7TFaoKqcwDgohzN2JezZGleMqCr5yFMsftLBAzPi+oHXsdj LVl4IFqWXBoYQKqUCHa+mJR/QFeRk1dDg7mkBH/rUoDr22x2l3kbZQByHowJf62w6qeU +rMr5+EpVZFYV+XFo3SZSog4xinL7YH+j3frycPJngFT6h48JoYnbwhoeBDi5tGhpDub XlMw== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=0LqsoasR Subject: [Intel-wired-lan] [PATCH v1 5/5] idpf: warn on possible ctlq overflow 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: netdev@vger.kernel.org, Willem de Bruijn , Manoj Vishwanathan , linux-kernel@vger.kernel.org, google-lan-reviews@googlegroups.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Willem de Bruijn The virtchannel control queue is lossy to avoid deadlock. Ensure that no losses occur in practice. Detect a full queue, when overflows may have happened. In practice, virtchnl is synchronous currenty and messages generally take a single slot. Using up anywhere near the full ring is not expected. Tested: Running several traffic tests and no logs seen in the dmesg Signed-off-by: Willem de Bruijn Signed-off-by: Manoj Vishwanathan --- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 07239afb285e..1852836d81e4 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -218,6 +218,15 @@ static int idpf_mb_clean(struct idpf_adapter *adapter) if (err) goto err_kfree; + /* Warn if messages may have been dropped */ + if (num_q_msg == IDPF_DFLT_MBX_Q_LEN) { + static atomic_t mbx_full = ATOMIC_INIT(0); + int cnt; + + cnt = atomic_inc_return(&mbx_full); + net_warn_ratelimited("%s: ctlq full (%d)\n", __func__, cnt); + } + for (i = 0; i < num_q_msg; i++) { if (!q_msg[i]) continue;