Message ID | 20211123163955.154512-24-alexandr.lobakin@intel.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <linux-rdma-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8EC5C4332F for <linux-rdma@archiver.kernel.org>; Tue, 23 Nov 2021 16:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238547AbhKWQpy (ORCPT <rfc822;linux-rdma@archiver.kernel.org>); Tue, 23 Nov 2021 11:45:54 -0500 Received: from mga14.intel.com ([192.55.52.115]:62320 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238945AbhKWQpV (ORCPT <rfc822;linux-rdma@vger.kernel.org>); Tue, 23 Nov 2021 11:45:21 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10177"; a="235294780" X-IronPort-AV: E=Sophos;i="5.87,258,1631602800"; d="scan'208";a="235294780" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 08:42:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,258,1631602800"; d="scan'208";a="740631519" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga006.fm.intel.com with ESMTP; 23 Nov 2021 08:42:03 -0800 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 1ANGf4X1016784; Tue, 23 Nov 2021 16:42:00 GMT From: Alexander Lobakin <alexandr.lobakin@intel.com> To: "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org> Cc: Alexander Lobakin <alexandr.lobakin@intel.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Michal Swiatkowski <michal.swiatkowski@linux.intel.com>, Maciej Fijalkowski <maciej.fijalkowski@intel.com>, Jonathan Corbet <corbet@lwn.net>, Shay Agroskin <shayagr@amazon.com>, Arthur Kiyanovski <akiyano@amazon.com>, David Arinzon <darinzon@amazon.com>, Noam Dagan <ndagan@amazon.com>, Saeed Bishara <saeedb@amazon.com>, Ioana Ciornei <ioana.ciornei@nxp.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Marcin Wojtas <mw@semihalf.com>, Russell King <linux@armlinux.org.uk>, Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer <hawk@kernel.org>, =?utf-8?q?Toke_H=C3=B8iland-J?= =?utf-8?q?=C3=B8rgensen?= <toke@redhat.com>, John Fastabend <john.fastabend@gmail.com>, Edward Cree <ecree.xilinx@gmail.com>, Martin Habets <habetsm.xilinx@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Andrii Nakryiko <andrii@kernel.org>, Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>, Lorenzo Bianconi <lorenzo@kernel.org>, Yajun Deng <yajun.deng@linux.dev>, Sergey Ryazanov <ryazanov.s.a@gmail.com>, David Ahern <dsahern@kernel.org>, Andrei Vagin <avagin@gmail.com>, Johannes Berg <johannes.berg@intel.com>, Vladimir Oltean <vladimir.oltean@nxp.com>, Cong Wang <cong.wang@bytedance.com>, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v2 net-next 23/26] igc: bail out early on XSK xmit if no descs are available Date: Tue, 23 Nov 2021 17:39:52 +0100 Message-Id: <20211123163955.154512-24-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211123163955.154512-1-alexandr.lobakin@intel.com> References: <20211123163955.154512-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-rdma.vger.kernel.org> X-Mailing-List: linux-rdma@vger.kernel.org |
Series |
net: introduce and use generic XDP stats
|
expand
|
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 8e448288ee26..7d0c540d6b76 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -2604,6 +2604,8 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring) __netif_tx_lock(nq, cpu); budget = igc_desc_unused(ring); + if (unlikely(!budget)) + goto out_unlock; while (xsk_tx_peek_desc(pool, &xdp_desc) && budget--) { u32 cmd_type, olinfo_status; @@ -2644,6 +2646,7 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring) xsk_tx_release(pool); } +out_unlock: __netif_tx_unlock(nq); }