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 B7A9443F6C; Thu, 2 May 2024 23:37:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4B5A40C35; Thu, 2 May 2024 23:36:48 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 65C1140647 for ; Thu, 2 May 2024 23:36:37 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6ecff9df447so8181926b3a.1 for ; Thu, 02 May 2024 14:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714685796; x=1715290596; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RWwBsJ4ML9/rUkp8HbuF8F4AkryvuWaG44tIHvrqUB8=; b=elvtuz7bxee43NMkZlIRLpN8yTMWbIzEnOQbzdcw+mGg8dKEJw3/3D55iw5s3Ok1mV kHYaHfAPYo6Bs2QYM6lJPoxivMluXSuXSW4/XaTSgGjQPabtpu19QiOXgfw163y1pafP /vy05EfveFSJjtTadvx3W0rMsKlZsgDL3bYqWxhTLqU4sFkeVhMQOcuCt7InxJA5oKSU BCz8j54pAbY/Edk3q6lAL7ih3EbZklwLOgFwZodjVLmXADMgceOHuTiaOwR4Vw2/FjkJ c9fDueRL6PTCBj1KnV8wT8fsEpISjyqN3gG61UdE5VYm1BmJ7rY1NfaTeJrrLrK+H46F 6rTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714685796; x=1715290596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RWwBsJ4ML9/rUkp8HbuF8F4AkryvuWaG44tIHvrqUB8=; b=P/eHrrvqlljbqrgSs9nSNiIg9uEqS10roOPSoTFn2iB2BL2Z7pREe9c7ZubUCh7rKy XoP4YlgJSkNgHDtJlynTkG8N7xfgG1g3mljCQQhOcH2aaK+BDKADn7FlPdgGnClUTlHT 0Aczw6GOXfWYyuVZTNzLHQ8ZIFU/D2xA2ENt2ScreTbe8mfWNSQ05WpmzAx/le3p2/NV Qed+7RCYL/J5ksiZ9Ljfx37Hg+ugi2SzKRmmcmSpxlwVQmvbJwcnXWDRNCN1hWsmaCeF Z8Ht+2e2GS+SOtFHCSK7nPpgXYiyIflnb2zUzstwh164IoS6RG86Oi5hkYAsaoH42LGR Q7/g== X-Gm-Message-State: AOJu0YyeYbNlcdLKgv7T0XsgidJ0oIj+Ygvqyikqf/zRYobLHVlmTlH8 IW2CLS6NhK4prOvDntxIbLawbFGn6nrZlfmzqemV7p0kRNpqupzPuQvtxzZJh2gPBjvHsc8n9Hr Eh984yg== X-Google-Smtp-Source: AGHT+IGlz1FW2+OyBN1QCRw5PGLmnCB3uy1Qcjsh5/Ykjtku0Pii+JCwaY1YGr/h7z3mvfASCpRqiQ== X-Received: by 2002:a05:6a00:2290:b0:6f0:b53c:dfb4 with SMTP id f16-20020a056a00229000b006f0b53cdfb4mr952375pfe.22.1714685796642; Thu, 02 May 2024 14:36:36 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id f14-20020a056a001ace00b006f3eee787d5sm1804829pfv.18.2024.05.02.14.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 14:36:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v12 11/12] net/tap: do not mark queue full as error Date: Thu, 2 May 2024 14:31:47 -0700 Message-ID: <20240502213618.11391-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240502213618.11391-1-stephen@networkplumber.org> References: <20240130034925.44869-1-stephen@networkplumber.org> <20240502213618.11391-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 If tap device in kernel returns EAGAIN that means it is full. That is not an error. Signed-off-by: Stephen Hemminger --- drivers/net/tap/rte_eth_tap.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 2484a82ccb..485bd35912 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -542,7 +542,6 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs, struct rte_mbuf *seg = mbuf; uint64_t l4_ol_flags; int proto; - int n; int j; int k; /* current index in iovecs for copying segments */ @@ -647,14 +646,18 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs, } /* copy the tx frame data */ - n = writev(process_private->fds[txq->queue_id], iovecs, k); - if (n <= 0) - return -1; + if (unlikely(writev(process_private->fds[txq->queue_id], iovecs, k) < 0)) { + TAP_LOG(DEBUG, "writev (qid=%u fd=%d) %s", + txq->queue_id, process_private->fds[txq->queue_id], + strerror(errno)); + return (errno == EAGAIN) ? 0 : -1; + } (*num_packets)++; (*num_tx_bytes) += rte_pktmbuf_pkt_len(mbuf); } - return 0; + + return 1; } /* Callback to handle sending packets from the tap interface -- 2.43.0