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 5EF49A0C4B; Wed, 14 Jul 2021 12:35:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6637841319; Wed, 14 Jul 2021 12:35:00 +0200 (CEST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mails.dpdk.org (Postfix) with ESMTP id CAE2841312 for ; Wed, 14 Jul 2021 12:34:57 +0200 (CEST) Received: by mail-lj1-f174.google.com with SMTP id h19so2664839ljl.4 for ; Wed, 14 Jul 2021 03:34:57 -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=2rFmWrYqaj0tzyKSmL/glJKqExTy201t0xRu8WszzCw=; b=TvTjwhKwge9qkmqzy1BmPKAsFp/+F+Wuq/m0s8NqH9K54mYMA63lwpyCYokYDdQkmq buEyNjLHmw34AWjhgeMRshycNoEFmSBxAZ1HPCnvbsityxZDpLw9gaGRr8w7L+ENWKUJ ZIOb2heY3I9400f72+z9Vap2VNz//0fD5RdFcC3wsHTTRncVI1LhnrXkVwifTbxGIhLd TuWbfqqk/A7PPl0vLFXUPy+8/HGtDybxiyCXQu7X5KTzzWaIBKjiwHKcWaWER4HpJyf4 c90+rb6NMIsUJj3SORHiPmDyvmxfn4noTut04cXH5vJvUAM4UZARsqNSBRv3GnJz4CDO myHA== 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=2rFmWrYqaj0tzyKSmL/glJKqExTy201t0xRu8WszzCw=; b=QhzP+F1VeLHPKPtGEi/EZyKemkH/eGEWCYhsekfv+3AjgPLC2i5evglzlQ0h6zC6Y1 /avb8IwvuKiz9DacSMfqmCFq3I61GZre0edKJ8AXYP/Q7lSdZoGNZZfKtpfwycDLxRWt KYDIVYAIZp4068cafRj/KKmdwKFHRaxFZpSJbiFhggR8hQ9fesWAvLDrCKdr5ST0AouJ 3IsAOHLKuFoErNgd1F6KXMzTdCnYHxkw8BPTHhSuOiRjNIzVMM7FrcKSZ1iI6NFP1vcH R/4Tu9ehSvqALfuW8Ths/lfRZ3DRlyTSXowmdQWGFtfn3/9U8cfkAR2pEJHDcyJQCNRy gmqQ== X-Gm-Message-State: AOAM533kw6unUwbf/UtDNqkSPoUbLly01JkBRbae4hPNPXrCMOVa4M0E SgRKeEZFYMMkPrSeFZV9wrEgSKEVFQq0l+/H X-Google-Smtp-Source: ABdhPJx87JDi3V3prbHpHF0BzCLo308Bwh7JUv9by8Jph1fbG5IGPeIz2rSKigqrW1KFUAn50rzJeA== X-Received: by 2002:a2e:5810:: with SMTP id m16mr8600787ljb.323.1626258897147; Wed, 14 Jul 2021 03:34:57 -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 l2sm191642ljc.78.2021.07.14.03.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:34:56 -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:34:32 +0200 Message-Id: <20210714103435.3388-4-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210714103435.3388-1-mk@semihalf.com> References: <20210713154118.32111-1-mk@semihalf.com> <20210714103435.3388-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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 Change-Id: Iff7b3a0e8b0b8e52f5230331b8486bb04a076d5b --- 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