From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 483141E520C; Sun, 20 Jul 2025 09:11:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753002709; cv=none; b=KPnCxdJDd2TcrBqjSriEkBh61wCNLuzCk4RykXaHald3zMFpoOPSvZ+9KNyyjskkNneZpBmG33hXYTzRlbYP6LvutdMTovDSPSkmqEvg8Z5wOcqGilBmWMnYQ2npbGZA0+mnD058XX6kDqBHe9V6TRzyYDyaSx7R4Qkshd5t20I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753002709; c=relaxed/simple; bh=c+3narHnZorj4My5QLVAzIE2WB1tt9M5m95t3zaHXAA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d8uy1j8MX2C1XxyQ+jzfXI+7BdtCWJp7tRHiFfIWMiXlijOdEKlzmZLt941lcWf5ZmoII6QlxKRAO8jhFAd9TjLNelAxsJocOW5wT8ytp7x/yGgzwuE9MJqgxcReywgkAagijDVH6F3BzHla1+Hy6oexxsHOgDu1tvsiguEL7aY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gdzwQYyC; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gdzwQYyC" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-74931666cbcso2869945b3a.0; Sun, 20 Jul 2025 02:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753002707; x=1753607507; darn=vger.kernel.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=XweBJ/0MYVVQb+Ps7XFsEfRMQO+tmpbLCmT+yp+uezc=; b=gdzwQYyCQ0zvmVdz7zWDkmy6Mdv6mjnB31k9Eq7/lbXwe/cqnmdo4Pl6mQMT6Ngef1 IgL63uW4LKmHw323K0uPvWBlTSvj39f+FyktKG/68NBraW3BsQgpd43Uw0NdGJoXJ1jQ m2BZkdbxyl9L/AN1YE1EmDzaNFctCETVjwPI0d7UG0LYC1KQC/XOdCHQDu1JgmY5QQzb qDTclfCODflT8++tFAiu0D07b8Iy4GUva3LmoMcpybR7xCb98jR5GCRurUrq9HIVSL6Z 9/bZyoqk50UMC8IlWW0TUc/+NJ7UqDZVnD94Vtks6rxibA/HCU1JNtGFJSGxhbWsTJrm BPCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753002707; x=1753607507; 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=XweBJ/0MYVVQb+Ps7XFsEfRMQO+tmpbLCmT+yp+uezc=; b=RmaNrenq9Y1E0LvDFROdfefDCMEpUw6SCimztgdVZsPzAIUi/Q72F/vgWcS1/F6mgz ggjr1dg1WJtMsPMflGelHwINaTE7d1mEgPYnqdXUuFhjDYKgDT6o1gsU9MLOvPyweAAG pMQddHRjJnH6r0Sv+drZ8goVsZfp8U98ogq8e0oNNj3oJkamnmxq93yHrzGtd/NM9LZc Os/c/mKeQfaTM5KVWCbqbklfm4SV0d4n+nZtitpm9N502BfZh9lwJZwtyq/VdIQqPoGw /bJIstzlDL1GrOEOtsvluxzxUYuJzKm7lbjtGIePJO68aKVPafJedvmQB7yIsQ/wqvBs tjDA== X-Forwarded-Encrypted: i=1; AJvYcCXW5yQscAjdp9lKnnTwZRARPnwo+Sc+nuiitksAf9qOzF63kc0nC6OfgzdrXNnrjtSeauUDoxo=@vger.kernel.org X-Gm-Message-State: AOJu0YwMVcs4cdXNvDRzmpZzVY/8I44rWuRzAiRF6aVCl/acEiPJpqKy 8KAMNNpVCjaX0jDq17Uf4Zv2EKRHH8JZW26V84uC8sr5fvGT6zhVl8iv X-Gm-Gg: ASbGnctgaTyAz4bvWpb592Cin39tydbm4nCNTdHjRqdo4y9dq1Um8gfAgel4TfJ9WwF oThQetcDUR88ntE34msTe+lzPYRFjk27k0DOXmkdyL6KYPcwA33e38TzaLkE+hHqC9PPf/9eRTS BKi5KYQ4g46v3kfmlP1JbrG0uOpZlSQAIhQvQeRl5G7eEMrvAh2HgZs8AKdhDJRy3TKEZLtiifm dzPWTnX8nHihwZ8reOg5wLrZHtSjBQofjQ1YI/kqa4cbHVbpLdT5/axghh5b69cdNCEfZ57DHi8 cmTnVhGBQQIBFMBdukdU+AQ/Q19igqvnm/ER1xb9J83bjCXgD5iSeUHI71ILx1gwRE5fb9njT3l o0shjLusgDNconbMsb+Jl47SqXpzw37mU1oAWnGriDqFl2mhX+E0hBRGD7Eg= X-Google-Smtp-Source: AGHT+IHorp1bRu9HtmMw6GlN9olv5TOncXRl5qHg8FrQc9eBehnphTLcYkb51Og0pTgG0T7xRZI0+w== X-Received: by 2002:a05:6a00:1a8b:b0:74e:ac5b:17ff with SMTP id d2e1a72fcca58-7584aa4d084mr17167004b3a.13.1753002707459; Sun, 20 Jul 2025 02:11:47 -0700 (PDT) Received: from KERNELXING-MC1.tencent.com ([111.201.24.59]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-759cb76d53fsm3902585b3a.105.2025.07.20.02.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jul 2025 02:11:47 -0700 (PDT) From: Jason Xing To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, bjorn@kernel.org, magnus.karlsson@intel.com, maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com, sdf@fomichev.me, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com Cc: bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Jason Xing Subject: [PATCH net-next 3/5] ixgbe: xsk: use ixgbe_desc_unused as the budget in ixgbe_xmit_zc Date: Sun, 20 Jul 2025 17:11:21 +0800 Message-Id: <20250720091123.474-4-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250720091123.474-1-kerneljasonxing@gmail.com> References: <20250720091123.474-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jason Xing - Adjust ixgbe_desc_unused as the budget value. - Avoid checking desc_unused over and over again in the loop. The patch makes ixgbe follow i40e driver that was done in commit 1fd972ebe523 ("i40e: move check of full Tx ring to outside of send loop"). [ Note that the above i40e patch has problem when ixgbe_desc_unused(tx_ring) returns zero. The zero value as the budget value means we don't have any possible descs to be sent, so it should return true instead to tell the napi poll not to launch another poll to handle tx packets. Even though that patch behaves correctly by returning true in this case, it happens because of the unexpected underflow of the budget. Taking the current version of i40e_xmit_zc() as an example, it returns true as expected. ] Hence, this patch adds a standalone if statement of zero budget in front of ixgbe_xmit_zc() as explained before. Use ixgbe_desc_unused to replace the original fixed budget with the number of available slots in the Tx ring. It can gain some performance. Signed-off-by: Jason Xing --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index a463c5ac9c7c..f3d3f5c1cdc7 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -393,17 +393,14 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) struct xsk_buff_pool *pool = xdp_ring->xsk_pool; union ixgbe_adv_tx_desc *tx_desc = NULL; struct ixgbe_tx_buffer *tx_bi; - bool work_done = true; struct xdp_desc desc; dma_addr_t dma; u32 cmd_type; - while (likely(budget)) { - if (unlikely(!ixgbe_desc_unused(xdp_ring))) { - work_done = false; - break; - } + if (!budget) + return true; + while (likely(budget)) { if (!netif_carrier_ok(xdp_ring->netdev)) break; @@ -442,7 +439,7 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) xsk_tx_release(pool); } - return !!budget && work_done; + return !!budget; } static void ixgbe_clean_xdp_tx_buffer(struct ixgbe_ring *tx_ring, @@ -505,7 +502,7 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector, if (xsk_uses_need_wakeup(pool)) xsk_set_tx_need_wakeup(pool); - return ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit); + return ixgbe_xmit_zc(tx_ring, ixgbe_desc_unused(tx_ring)); } int ixgbe_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags) -- 2.41.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7285AC83F22 for ; Sun, 20 Jul 2025 09:11:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4C79461062; Sun, 20 Jul 2025 09:11:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Udc7H5QOKMGt; Sun, 20 Jul 2025 09:11:50 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C5C6160E44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1753002710; bh=XweBJ/0MYVVQb+Ps7XFsEfRMQO+tmpbLCmT+yp+uezc=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ACVxdJRRr47zx+fO/OlpkslnR9MPyEfUM2YyZgbUCkeU3XAdaVnHLnTZSkdnVxt1+ ify5rQgVBh6boXN2NyoASUSAOAx8H9t+km2WRR9xWF/URApU1Pm/Q+PKmeK5s0U9V7 fkHVBXHgWiXNp1BDY2hjEqWFJUPn9sjR5jOkMF42WxVQs0JQXeHXSzN7cFuZziKWiG zbuAokdkaZ10HZw9N5xUkSiceQM2VqLdBxTG5kDK2WVi3BAOebkbIfDxF3KxeKkgTL 1Ds+ggl9CG6oyWAzaw7sKnOtlMTaFMEkd2EyAHgFQFY5xpXjS9zZKFFHM9zBTecuxU +CjU27VAdtXqQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id C5C6160E44; Sun, 20 Jul 2025 09:11:50 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 287AADA for ; Sun, 20 Jul 2025 09:11:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C61FD61028 for ; Sun, 20 Jul 2025 09:11:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wMZFkZP5N4VS for ; Sun, 20 Jul 2025 09:11:48 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::433; helo=mail-pf1-x433.google.com; envelope-from=kerneljasonxing@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 3901061062 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3901061062 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3901061062 for ; Sun, 20 Jul 2025 09:11:48 +0000 (UTC) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-748fe69a7baso3110604b3a.3 for ; Sun, 20 Jul 2025 02:11:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753002707; x=1753607507; 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=XweBJ/0MYVVQb+Ps7XFsEfRMQO+tmpbLCmT+yp+uezc=; b=O4xa06inq/LwP854CDzg8t7QQ48wpYBbxQ2KS8GwILOkwsWDwfVF10ZpY0gaexV1Kd Ns5Ixy3QhCrcdnJeczAjp3a1o6k5yQBigfUjFfNsaQX0YOKB/Y3haYrIiJawpqJZZjP8 EJTBxIwAltnVOwXDEUpMl0HsyQmajTTZqIBO1ex0WhIBNi5H2osReS8ftfVnCrPRay82 WqTT1jl9dARD56Og8p4NvoA+Ux+f3zn2DAhk3DDnqtzkWcvzArSp2LP6EDL79Pt0EhCQ //W2sRMLUOWHvrY43V8FwC4BoFvhvYbdfQfb5iTpt8TL3iq4WCq3els8gSfR9KWOrHMk kTVg== X-Forwarded-Encrypted: i=1; AJvYcCXR5eVcWf631FHjbWJ7l0cGwOTCtapPkpoA4IUCyXJ1tcisBVg9rmxx1acVqFG6StOhudjDrbYZ6+v1g3mWgeQ=@lists.osuosl.org X-Gm-Message-State: AOJu0YxYxPlFAfLK7qlV/58ktshUsZPlIQ3mwWcBIuyAbe+MhzjfSU09 oHQeCnRL8+gUv/OWjHCbKeXXjGKqfefvCOwqsK+AJa+vU69AaG4W96/q X-Gm-Gg: ASbGncsBWt6404GQcq0B1/bcEH5m/8fEHg5dBSi6g47UTc3Hjg95Uq3i4ooCOUFCkah Zo8zMTNSe7w6BwfVwNnAUPuqBjpaN1A8zr+oiTobthLtwUeMCZcSs7fUlF09ydxiy7kfpZm0uVJ PfnrZxGtcyBUUQxYrvA7pk1QhxYFs4A6ZBYvAW7MIe39mDCt5AONDO+vhG+cUXZLgkhege3Fjn/ BlrZPapEi+FSbMMfoWmA2XBYAhbU9Al8YSlOi4XDkdLM6HPBfMiKZy7lrnDdexiFiY8a2ldA8Lv FMjpeArvx/PS3kczPvHt+hZFHkfSKXNSv/+ByZags6HCnzpozLPvas5GFQUTYQmxSmJ74CFPG6E 7WlLt5uX1wibMYpfKfkIExML+M458cGR1uHLJ1cYvChWrXroA0X5YDSkpWPA= X-Google-Smtp-Source: AGHT+IHorp1bRu9HtmMw6GlN9olv5TOncXRl5qHg8FrQc9eBehnphTLcYkb51Og0pTgG0T7xRZI0+w== X-Received: by 2002:a05:6a00:1a8b:b0:74e:ac5b:17ff with SMTP id d2e1a72fcca58-7584aa4d084mr17167004b3a.13.1753002707459; Sun, 20 Jul 2025 02:11:47 -0700 (PDT) Received: from KERNELXING-MC1.tencent.com ([111.201.24.59]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-759cb76d53fsm3902585b3a.105.2025.07.20.02.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jul 2025 02:11:47 -0700 (PDT) From: Jason Xing To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, bjorn@kernel.org, magnus.karlsson@intel.com, maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com, sdf@fomichev.me, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com Cc: bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Jason Xing Date: Sun, 20 Jul 2025 17:11:21 +0800 Message-Id: <20250720091123.474-4-kerneljasonxing@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250720091123.474-1-kerneljasonxing@gmail.com> References: <20250720091123.474-1-kerneljasonxing@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753002707; x=1753607507; darn=lists.osuosl.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=XweBJ/0MYVVQb+Ps7XFsEfRMQO+tmpbLCmT+yp+uezc=; b=B4wstQ7gFBgJOFf65B+vit1xxaCwFNTDszXtS1sm5gZRFj50PGmJnh7z66L9/Lmz2w K8IWYwiCw+1M1uB0kYNK7YhJ6pt1A3HpJ0UjBYXABJMgQ396j0l8DOM/1g0wwzXlkuSr sUSMAVPR4V8Yoc9A19XgiAvAo2jqrrRh1nbu6qeJasZzEryZziZ5Zebr5+Jwl/3KHGVP jIPpNGGspvAc9ZN1qOahARZvTYVrc5Y8EbAIJvTSBouAgTCLkRQGk1l7YjHZyaOMSuSe SjvrHX71Erp5JM4KFIOCa/8I4L4xQSpMUv5yelLMbB2fMAfsnZFzh4ihXzEz0xk6VNAP efRQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=B4wstQ7g Subject: [Intel-wired-lan] [PATCH net-next 3/5] ixgbe: xsk: use ixgbe_desc_unused as the budget in ixgbe_xmit_zc X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Jason Xing - Adjust ixgbe_desc_unused as the budget value. - Avoid checking desc_unused over and over again in the loop. The patch makes ixgbe follow i40e driver that was done in commit 1fd972ebe523 ("i40e: move check of full Tx ring to outside of send loop"). [ Note that the above i40e patch has problem when ixgbe_desc_unused(tx_ring) returns zero. The zero value as the budget value means we don't have any possible descs to be sent, so it should return true instead to tell the napi poll not to launch another poll to handle tx packets. Even though that patch behaves correctly by returning true in this case, it happens because of the unexpected underflow of the budget. Taking the current version of i40e_xmit_zc() as an example, it returns true as expected. ] Hence, this patch adds a standalone if statement of zero budget in front of ixgbe_xmit_zc() as explained before. Use ixgbe_desc_unused to replace the original fixed budget with the number of available slots in the Tx ring. It can gain some performance. Signed-off-by: Jason Xing --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index a463c5ac9c7c..f3d3f5c1cdc7 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -393,17 +393,14 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) struct xsk_buff_pool *pool = xdp_ring->xsk_pool; union ixgbe_adv_tx_desc *tx_desc = NULL; struct ixgbe_tx_buffer *tx_bi; - bool work_done = true; struct xdp_desc desc; dma_addr_t dma; u32 cmd_type; - while (likely(budget)) { - if (unlikely(!ixgbe_desc_unused(xdp_ring))) { - work_done = false; - break; - } + if (!budget) + return true; + while (likely(budget)) { if (!netif_carrier_ok(xdp_ring->netdev)) break; @@ -442,7 +439,7 @@ static bool ixgbe_xmit_zc(struct ixgbe_ring *xdp_ring, unsigned int budget) xsk_tx_release(pool); } - return !!budget && work_done; + return !!budget; } static void ixgbe_clean_xdp_tx_buffer(struct ixgbe_ring *tx_ring, @@ -505,7 +502,7 @@ bool ixgbe_clean_xdp_tx_irq(struct ixgbe_q_vector *q_vector, if (xsk_uses_need_wakeup(pool)) xsk_set_tx_need_wakeup(pool); - return ixgbe_xmit_zc(tx_ring, q_vector->tx.work_limit); + return ixgbe_xmit_zc(tx_ring, ixgbe_desc_unused(tx_ring)); } int ixgbe_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags) -- 2.41.3