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 BC707A0C4B; Wed, 14 Jul 2021 12:43:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3058041329; Wed, 14 Jul 2021 12:43:33 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id C90DA4131F for ; Wed, 14 Jul 2021 12:43:31 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id a18so2804603lfs.10 for ; Wed, 14 Jul 2021 03:43:31 -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=MZVb4Vqy6GbTQqHahMSqen3J60dnKf/tFo9gipS/ULYG2S2O0Oi3lyJpJf7LcrWlN3 hGwgzv/MBzRrStWihkxda+vVluIKD2tnnn9JQkzKIu8fDxWsVDUz/Zk4YbCCksHvrrR1 8rde0US/Jh2Eh0//r8IzYFpNPD1k7iLStmexTG6x/9SX0jduiR3rsE8gIjh0c6tQfOjC AxlWCVECzhz+TOqKXAfERpJWQoFz1FzTzClTpluh703QnmlfAdb/4rLYebFdN9st094E f6n+aD8iZMohR16W2VfP3Un8XOyf9Fppyr9bspSc0oFvSln/v+N2kTfD5zQqZdOfMzSi T3aw== 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=KSNiXg5XCkYIXoLBHzSaQfBjZ+vtbSMd3wywNJr4FVsxHvJ7VnS9a49Od1H0YF/Lia guzSA7FdDuocCmsUb3ilQMXXGarylhbDCInmKyI702ZwzFc/pNPKMp6pcdi2cS/8/8E5 SWxVzWQqyZZPaVh3/kWhuejrjHGBLIMvIREniDOse5pONsKFmqCmRRwgFNqqkwAYlJ/h pme4z263+IVNcuPIllIrq2amof02vRU3Wyv5uUg0DAnzTJkFfgSMY4havxfi6kBaBsqU xIoAHIehY9b+yBMDgChqc/l5To5mN4q+IVwr7nBDqaseZOUoKalsGS5xfZ77VzjEfzdz NonA== X-Gm-Message-State: AOAM531K4af1t46JQIko046ygkps3me3DI1aIhIlvHL7m5JzvzH8hQTZ rACDU+nekM9PvhRI02XrifjU//E4UJEU+AUu X-Google-Smtp-Source: ABdhPJxAgeM/+CuajwnVNpJOmwxz4xa/AaRcBxpCRWngeTKKVDVkuB6awjGl3wj5ORNIJkiPdF10tA== X-Received: by 2002:a05:6512:3182:: with SMTP id i2mr7721854lfe.652.1626259411125; Wed, 14 Jul 2021 03:43:31 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id d3sm188928lji.101.2021.07.14.03.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:43:30 -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: Wed, 14 Jul 2021 12:43:17 +0200 Message-Id: <20210714104320.4096-4-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210714104320.4096-1-mk@semihalf.com> References: <20210714103435.3388-1-mk@semihalf.com> <20210714104320.4096-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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