From patchwork Thu Feb 4 19:58:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 87767 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 62F41A0524; Thu, 4 Feb 2021 21:00:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01AB2240834; Thu, 4 Feb 2021 20:59:45 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id BC086240814 for ; Thu, 4 Feb 2021 20:59:41 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id e9so2453887pjj.0 for ; Thu, 04 Feb 2021 11:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2kfekS1x4dpqWhbQAHFgXZX8ebWJOEQPx4URoTCjI7Q=; b=Zoyk5gMeuhCKsuZYjsHrKvWPf+AzaKW7LR6lOky4YxeBgbmvTFojLA22AoN4O8lfxs ATkULTcKPSNr5QYufWUoXuSK82a0ZeaOzM/F8wtUBf4zqXS4OhEblGrlZInGOAYKA0xY 6n1PWGpJbim52kuLTMv1Ku7HdO3dXlDEPus0+trslFIk66/fTEci7VcDI9oaRpUuIP8I KEkrT0HgbTJWzf4Vs1ul7lt2MGH8N592/d+9fJqscbHQ8BOQvhAs5RRyn6tyuomQh0b3 NCl+fGoPp0ZP88LLyJmimXwWcs6ZbslfkMtriSD6jenBlUnJC3DXkmfqP5WgycCN02tb 413w== 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; bh=2kfekS1x4dpqWhbQAHFgXZX8ebWJOEQPx4URoTCjI7Q=; b=DMjFKAMGDb3LsocaaNBVvCGh57d3Qo4ODbSq9nRN25KgJv3FSPxGQFjhKqdc5KEb9t VQcINUcMq5auwizb8P/8gJJnNl8fbGIfwKsKM3TeXtJ3jVUKg7tUfDOaMInmRL+yO7D0 09XmFLQ3FtLssCBrn3mtny7RHYh2I6zOAFKFrYECbX9GH2mGb95JxrVDJTUdjF2vurQk BOwvg8Abzma0DgC4MuoN3k9OxFRXbIt8W3mRZw8GRghr0qX8upLeFTDuk3eHpbUTvzIP e/nXY8zuaFTJ3tIrYP0+bDO/eJ8Cq3K/xdWFmq6x61NFG8reaNu3CJbnpMWrckEpJ4Ud IZQQ== X-Gm-Message-State: AOAM530mo/khmd4DjrrwcKx72uqpvi0VM5+W7hRbsQdDxT/Xr65H0wVd YuZe5EBKSt0IW7oh3ijAwHosX5dUO4RgIQ== X-Google-Smtp-Source: ABdhPJxjfMgsXwRIVix6cQMiGsviWEVvaC11vDRkwZhuCUPNCeiov0C2mvHjfigVpADcVvWRJf9IHA== X-Received: by 2002:a17:90b:1017:: with SMTP id gm23mr596869pjb.172.1612468780875; Thu, 04 Feb 2021 11:59:40 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id r14sm7757915pgi.27.2021.02.04.11.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 11:59:40 -0800 (PST) From: Andrew Boyer To: dev@dpdk.org Cc: Alfredo Cardigliano , Andrew Boyer , Vishwas Danivas Date: Thu, 4 Feb 2021 11:58:51 -0800 Message-Id: <20210204195853.13411-13-aboyer@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210204195853.13411-1-aboyer@pensando.io> References: <20210204195853.13411-1-aboyer@pensando.io> Subject: [dpdk-dev] [PATCH 12/14] net/ionic: send as many packets as possible 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" Rather than dropping the whole burst if some don't fit. This improves performance. Signed-off-by: Andrew Boyer Signed-off-by: Vishwas Danivas --- drivers/net/ionic/ionic_rxtx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 2522c8283a..81182b5dc4 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -536,15 +536,16 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, struct ionic_tx_stats *stats = &txq->stats; uint32_t next_q_head_idx; uint32_t bytes_tx = 0; - uint16_t nb_tx = 0; + uint16_t nb_avail, nb_tx = 0; int err; /* Cleaning old buffers */ ionic_tx_flush(txq); - if (unlikely(ionic_q_space_avail(q) < nb_pkts)) { - stats->stop += nb_pkts; - return 0; + nb_avail = ionic_q_space_avail(q); + if (unlikely(nb_avail < nb_pkts)) { + stats->stop += nb_pkts - nb_avail; + nb_pkts = nb_avail; } while (nb_tx < nb_pkts) {