From patchwork Fri Apr 5 12:49:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 139119 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 554CD43E01; Fri, 5 Apr 2024 14:51:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EBAC4064C; Fri, 5 Apr 2024 14:51:22 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 51B524067D for ; Fri, 5 Apr 2024 14:51:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712321479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ygup4MIWR3cOAla0vzg8zMHbr/SPgXKVLvmN29pqqW0=; b=C3Q2R54aNPhTj3CUmKVcEgRIsaDJKc+4wRuLrF7rgZgzkUfrvabKGslAIoTM6x5W02mGmB uwyM7MaKkXJa2gZ59Nm2KFx5Le2GpaAfVudmJCeS88ku57ripnT8jtbfVtrZE9LsQ03hAk wXc4N539NjDHRXAvUzNdBx1mBNZ7UdA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-385-ZCyyVVxNPVOX7KEs2gdbnA-1; Fri, 05 Apr 2024 08:51:18 -0400 X-MC-Unique: ZCyyVVxNPVOX7KEs2gdbnA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 343DF3C0CD27; Fri, 5 Apr 2024 12:51:18 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 756841C060A4; Fri, 5 Apr 2024 12:51:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com Subject: [PATCH 2/8] net/ice: enhance debug when HW fails to transmit Date: Fri, 5 Apr 2024 14:49:41 +0200 Message-ID: <20240405125039.897933-3-david.marchand@redhat.com> In-Reply-To: <20240405125039.897933-1-david.marchand@redhat.com> References: <20240405125039.897933-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org At the moment, if the driver sets an incorrect Tx descriptor, the HW will raise a MDD event reported as: ice_interrupt_handler(): OICR: MDD event Add some debug info for this case and the VF index in all logs. Signed-off-by: David Marchand --- drivers/net/ice/ice_ethdev.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 87385d2649..fd494e6b3b 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1389,6 +1389,7 @@ ice_interrupt_handler(void *param) uint32_t oicr; uint32_t reg; uint8_t pf_num; + uint16_t vf_num; uint8_t event; uint16_t queue; int ret; @@ -1432,28 +1433,48 @@ ice_interrupt_handler(void *param) if (reg & GL_MDET_TX_PQM_VALID_M) { pf_num = (reg & GL_MDET_TX_PQM_PF_NUM_M) >> GL_MDET_TX_PQM_PF_NUM_S; + vf_num = (reg & GL_MDET_TX_PQM_VF_NUM_M) >> + GL_MDET_TX_PQM_VF_NUM_S; event = (reg & GL_MDET_TX_PQM_MAL_TYPE_M) >> GL_MDET_TX_PQM_MAL_TYPE_S; queue = (reg & GL_MDET_TX_PQM_QNUM_M) >> GL_MDET_TX_PQM_QNUM_S; PMD_DRV_LOG(WARNING, "Malicious Driver Detection event " - "%d by PQM on TX queue %d PF# %d", - event, queue, pf_num); + "%d by PQM on TX queue %d PF# %d VF# %d", + event, queue, pf_num, vf_num); } reg = ICE_READ_REG(hw, GL_MDET_TX_TCLAN); if (reg & GL_MDET_TX_TCLAN_VALID_M) { pf_num = (reg & GL_MDET_TX_TCLAN_PF_NUM_M) >> GL_MDET_TX_TCLAN_PF_NUM_S; + vf_num = (reg & GL_MDET_TX_TCLAN_VF_NUM_M) >> + GL_MDET_TX_TCLAN_VF_NUM_S; event = (reg & GL_MDET_TX_TCLAN_MAL_TYPE_M) >> GL_MDET_TX_TCLAN_MAL_TYPE_S; queue = (reg & GL_MDET_TX_TCLAN_QNUM_M) >> GL_MDET_TX_TCLAN_QNUM_S; PMD_DRV_LOG(WARNING, "Malicious Driver Detection event " - "%d by TCLAN on TX queue %d PF# %d", - event, queue, pf_num); + "%d by TCLAN on TX queue %d PF# %d VF# %d", + event, queue, pf_num, vf_num); + } + + reg = ICE_READ_REG(hw, GL_MDET_TX_TDPU); + if (reg & GL_MDET_TX_TDPU_VALID_M) { + pf_num = (reg & GL_MDET_TX_TDPU_PF_NUM_M) >> + GL_MDET_TX_TDPU_PF_NUM_S; + vf_num = (reg & GL_MDET_TX_TDPU_VF_NUM_M) >> + GL_MDET_TX_TDPU_VF_NUM_S; + event = (reg & GL_MDET_TX_TDPU_MAL_TYPE_M) >> + GL_MDET_TX_TDPU_MAL_TYPE_S; + queue = (reg & GL_MDET_TX_TDPU_QNUM_M) >> + GL_MDET_TX_TDPU_QNUM_S; + + PMD_DRV_LOG(WARNING, "Malicious Driver Detection event " + "%d by TDPU on TX queue %d PF# %d VF# %d", + event, queue, pf_num, vf_num); } } done: