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 F2047A0C4C; Tue, 13 Jul 2021 17:42:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF758412E0; Tue, 13 Jul 2021 17:41:48 +0200 (CEST) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mails.dpdk.org (Postfix) with ESMTP id 3D0F7412C9 for ; Tue, 13 Jul 2021 17:41:46 +0200 (CEST) Received: by mail-lj1-f171.google.com with SMTP id h9so15304401ljm.5 for ; Tue, 13 Jul 2021 08:41:46 -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=0XG4mOUrcrM+bU7KH7HmgDlcCK8VamdoRZv532NM5k4lXcIKLP8Ujr2Ow3JIV1hTye m1/eKRbHitupwT2qKtZCvIcV9kILUsKec1lFGeAW5in1fIIPyTIcKhL6AXBdCHIUJRxl TCjP5fd++iCNe9C6HdhxDqA3pl2NYoq0R26V/41C0oXvpPV17YUkYb4U2aCpwwI6cHiS qOq6Onn/XePftQkA1h8pj2rO59R4hh2Jw+ib/rQIn2ApikectiNCQ0G8YqBvXEnF3IYv L/UJswFoGEkewmOQYxu2PXiV9jhf5Bj1g0IBqban9jli0rMaNJeimeiEaMqOMj3ubOja w38w== 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=V3D1iyjA+Zu+SOc2HyI+TLiX4GhdP6P+dAek7yDn2AseUb0JuMuTyy5NfIrNnSYDd7 cBOagp8EkviXK38+pjjhbhWjMDR5uuo7S8gZ24LGSYU4eD/19W1Lx4+JbQ025ecTCoqj In0VFTQLM73V/Nnc8t599AFOKm3L9pebjtxTkEf1sOAJpu7qWu11tdtJj8nXDxihBHXe su08YcHCCx74awQms1TdZIN249UQ4Cfmumu1lvHpJlnON8xRxa4CMOoT4uoE8gp6SYM/ 8iJmYNk8f1d1yBsnpfQx/YWI5maTzBBLqmNyzzCBPh1aWfIKkNr1HXLF6Y2f23jUd2yZ BDZg== X-Gm-Message-State: AOAM530tD7t08SgSpx8oUyW2qD5/ptV49FRGaN9o0l9ST0Qj3hy6ZyGi Lvwt2I6ekgxWQ9Tzv7KoU2rdguAy3bYjXi7k X-Google-Smtp-Source: ABdhPJyEcXXEhJMl3e+w5VTnMz2R1dhoOjEYkcDjH645Gg/qybr/ZDm2W/i4FF/b4krxfgi9FNlmZA== X-Received: by 2002:a2e:9f11:: with SMTP id u17mr4718319ljk.16.1626190905584; Tue, 13 Jul 2021 08:41:45 -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 s15sm1488415lfp.216.2021.07.13.08.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 08:41:44 -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: Tue, 13 Jul 2021 17:41:15 +0200 Message-Id: <20210713154118.32111-4-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713154118.32111-1-mk@semihalf.com> References: <20210713154118.32111-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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