From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83A79A0C46; Fri, 23 Jul 2021 12:26:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 197CC410F8; Fri, 23 Jul 2021 12:26:45 +0200 (CEST) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mails.dpdk.org (Postfix) with ESMTP id E93AF40DDA for ; Fri, 23 Jul 2021 12:26:40 +0200 (CEST) Received: by mail-ej1-f54.google.com with SMTP id nd39so2986201ejc.5 for ; Fri, 23 Jul 2021 03:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V4S5VuFuIVM0xDiwmw+bkutu1YZQ0xs0EYeC39TGHVY=; b=cVfCLI+5g6FP+1CJ/rBNAgiwtXl691b3l5IEA2sdWPmtzp0+KsvJJbe2OdPdOwZf9W 4OtNuv6E8dMBn8We4zUl/ZzF3RbWGdYAB+CEld0dqFtwInfWs4y/2oMRnNtOD09wBDk6 GWA9mGZPd2U+/0XC/KgQlhzvEQH52i9aXMj8S6EH8mVs2v0f9JYmosylj8s2OxhPQ1HJ Mrw4GSlKo8cVB4YaQA/KdvyF3xQh0AYFjxpDjc6YsD4ESyo8cua6A5nrhY2eQf7fccGm v4TYcCmrBskByYFjqD0FJEcAHEGnEEtuwu3FZ6XZgQOoktbGYHACI1We3O9aX8HZSjso zy4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V4S5VuFuIVM0xDiwmw+bkutu1YZQ0xs0EYeC39TGHVY=; b=Tr5Q/L/Dy5mSmYHUMsx5Dpt2D7/Zf08ScozJD0wixfmMSRZhs1Ebt/mjbQ4qkPYBFU QyQB1kZ/7CynvBXIBfkkRqphSyXzg9ghK99l/DoF4tfeae7Mw0UnurASo1BiXncf0yab WYfFjOQd/PDZD14wX7HX2Mne3BWq/3P5B3Tn4cAtSoNe01fbnJR1nwb2wujooXxe1lbZ Z5EEcFl8tQv22mOHjZoEDoggUtB5gVfmmcWVvI3v54nWbPLZbqrgvkP129K3bbuL9jhX Em95pSWi50H2u25ZhAnB0cugNdNnjCd/+tXH8nq50OxVWRbRJWu8FfyuGS864Jy+jvn6 wPuQ== X-Gm-Message-State: AOAM532RdT/U7GCBwnDYgYnxLKnvctAQ39+wRjsqoTqY8EPfYIbYXPMb hMEz3beRC6Q91whAMiSGy7HCzDFSG8W+yVxD X-Google-Smtp-Source: ABdhPJyzlWEgTdBoZSMnDSLGqkNDkMhOsHpBo8mrGPnNR1Lu1Z8A9W9StCyW5xFVlzScjg+rlxszrg== X-Received: by 2002:a17:906:3e0b:: with SMTP id k11mr3953237eji.305.1627036000448; Fri, 23 Jul 2021 03:26:40 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (093105178068.dynamic-ww-01.vectranet.pl. [93.105.178.68]) by smtp.gmail.com with ESMTPSA id jp26sm10506142ejb.28.2021.07.23.03.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 03:26:39 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, shaibran@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org, Shay Agroskin Date: Fri, 23 Jul 2021 12:24:51 +0200 Message-Id: <20210723102454.12206-4-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723102454.12206-1-mk@semihalf.com> References: <20210714104320.4096-1-mk@semihalf.com> <20210723102454.12206-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 3/6] net/ena: trigger reset when Tx prepare fails 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 Sender: "dev" If the prepare function failed, then it means the descriptors are in the invalid state. This condition now triggers the reset, which should be further handled by the application. To notify the application about prepare function failure, the error log was added. In general, it should never fail in normal conditions, as the Tx function checks for the available space in the Tx ring before the preparation even starts. Fixes: 2081d5e2e92d ("net/ena: add reset routine") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk Reviewed-by: Shai Brandes Reviewed-by: Shay Agroskin --- drivers/net/ena/ena_ethdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 2335436b6c..67cd91046a 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -2570,7 +2570,11 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf) rc = ena_com_prepare_tx(tx_ring->ena_com_io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc)) { + PMD_DRV_LOG(ERR, "Failed to prepare Tx buffers, rc: %d\n", rc); ++tx_ring->tx_stats.prepare_ctx_err; + tx_ring->adapter->reset_reason = + ENA_REGS_RESET_DRIVER_INVALID_STATE; + tx_ring->adapter->trigger_reset = true; return rc; } -- 2.25.1