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 D41FDA0032; Mon, 15 Nov 2021 19:24:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B482041152; Mon, 15 Nov 2021 19:24:18 +0100 (CET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id C0A004114F for ; Mon, 15 Nov 2021 19:24:17 +0100 (CET) Received: by mail-pf1-f178.google.com with SMTP id m14so15754981pfc.9 for ; Mon, 15 Nov 2021 10:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=v6QfqQD6OmCHVD7l1hFU2CJbXmJfj33POfFv8M0pdvE=; b=ZfTK5drSI7ZRCqQ7K6oNX1W/XLEBB3/Wenk8xLHBBEHb83q1WEtXsl4xjjol5QsIke cWzRUJ4rLn+SzZ1QgITJWjN3xOfHcNXeps+LYrFdj5Xad4nfFNHjre6SCbgEyzpngk2f cNs5Ij8qQa7S/2x1XTXIhuMnDO3DYfwxdCOYQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=v6QfqQD6OmCHVD7l1hFU2CJbXmJfj33POfFv8M0pdvE=; b=glhUSxtgqBiqWizRYu4n0hvAqiuDmlHIk6YQF6H88MivzWMDHG+Tvp94KaCShEjRoj wwAzKK59NoXfc903LZ76O1lskiOw+qydLSgR4kliFKFSECumZvhVMVtAlyLGqYIRvJ/8 64pPZ/hJTTC/Uyygs+5Aw2Mmev4GS4kWOJSLQzYkGfrBzKwkBC9ndTb+tIJnKOAfppkl RkVF0JCFci0quTGQ+DwOs/avaVEG2orjiC9ga3hyEeoXkZlg9RaA7TacSWjj6Vw7qRy8 vSmzvgNZkuMWSmQyXVYSqVaJbpKYjNnXDgyDqgcU3NGSVdt4ZS4hskfzkAD/kjGcfKxE 2EXA== X-Gm-Message-State: AOAM532K2yvYF6y0YMAkZVpmPXDF1Mw6K7WSS6wvnF6juRPE2ZRBwIbA cPSQN4zexBN8RFwNI2L4yV6Arg== X-Google-Smtp-Source: ABdhPJx0sGVtDD80cDhtuJPVMKxLhsAcjeaX82cu+0ZebtazsfhlcYHIXxl77GzDhHDZKdrFyg4B/w== X-Received: by 2002:a63:d00c:: with SMTP id z12mr615839pgf.334.1637000657006; Mon, 15 Nov 2021 10:24:17 -0800 (PST) Received: from lrichardson-VirtualBox.dhcp.broadcom.net ([192.19.11.250]) by smtp.gmail.com with ESMTPSA id w7sm12419785pgo.56.2021.11.15.10.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 10:24:16 -0800 (PST) From: Lance Richardson To: Bruce Richardson , Konstantin Ananyev , Ajit Khaparde , Somnath Kotur Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH 1/2] net/bnxt: avoid unnecessary work in AVX2 Rx path Date: Mon, 15 Nov 2021 13:24:09 -0500 Message-Id: <20211115182410.5545-2-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211115182410.5545-1-lance.richardson@broadcom.com> References: <20211115182410.5545-1-lance.richardson@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000ac3a3205d0d7ea84" 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 --000000000000ac3a3205d0d7ea84 Content-Transfer-Encoding: 8bit Each call to the AVX2 vector burst receive function makes at least one pass through the function's inner loop, loading 256 bytes of completion descriptors and copying 8 rte_mbuf pointers regardless of whether there are any packets to be received. Unidirectional forwarding performance is improved by about 3-4% if we ensure that at least one packet can be received before entering the inner loop. Fixes: c4e4c18963b0 ("net/bnxt: add AVX2 RX/Tx") Cc: stable@dpdk.org Signed-off-by: Lance Richardson --- drivers/net/bnxt/bnxt_rxtx_vec_avx2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c index e4905b4fd1..54e3af22ac 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c @@ -98,6 +98,10 @@ recv_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_prefetch0(&cp_desc_ring[cons + 8]); rte_prefetch0(&cp_desc_ring[cons + 12]); + /* Return immediately if there is not at least one completed packet. */ + if (!bnxt_cpr_cmp_valid(&cp_desc_ring[cons], raw_cons, cp_ring_size)) + return 0; + /* Ensure that we do not go past the ends of the rings. */ nb_pkts = RTE_MIN(nb_pkts, RTE_MIN(rx_ring_size - mbcons, (cp_ring_size - cons) / 2)); -- 2.25.1 --000000000000ac3a3205d0d7ea84 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQeQYJKoZIhvcNAQcCoIIQajCCEGYCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3QMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMD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