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 E55F5A0C4F for ; Tue, 13 Jul 2021 17:41:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C89B1412D5; Tue, 13 Jul 2021 17:41:48 +0200 (CEST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by mails.dpdk.org (Postfix) with ESMTP id E1C2E412C5 for ; Tue, 13 Jul 2021 17:41:45 +0200 (CEST) Received: by mail-lj1-f172.google.com with SMTP id 141so14091715ljj.2 for ; Tue, 13 Jul 2021 08:41:45 -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=L+9597Zfuxz74N443sDPNA/zq5BiuthOp6KxGgW3cRdHsC0g9QMgYFzveRQ/Ng2Gfc 2fajfcShnEJoisvW0lfrfo3tl6juIl4cOPbt747Q1DEf+EACy+Yte3vpvMaLXJVvuPgj 8j4RuDGiFJLYiO+PqmJ041HDvN/kHvSMyHfxjOW/SB0bKcTvspphKbLxzvJ6sFxMUzFM JIRlReC65JTs7KloZYfivdb1n1W/9veD3e5FGCtbSzUM1wtMu4N6n8TlW0hbhUlrHc2z 39aCU6rRtKgA0UhTfEiG9ioIg5rzYc/DUNEPSU9EXXz1G9Ng6EZ2cvL5b0Qzl06J/+YF 0ZNw== X-Gm-Message-State: AOAM533gCCoC7DsY8U4Uoac/PZUGDCfal1qBBjmzrH9FezN1DhnsPrRV pQPiQTH7KnG4YqOgO8CsaXTZ1A== 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-stable] [PATCH 3/6] net/ena: trigger reset when Tx prepare fails X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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