Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2205090/?format=api
{ "id": 2205090, "url": "http://patchwork.ozlabs.org/api/patches/2205090/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260304160345.1340940-8-larysa.zaremba@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260304160345.1340940-8-larysa.zaremba@intel.com>", "list_archive_url": null, "date": "2026-03-04T16:03:39", "name": "[iwl-next,v3,07/10] ixgbevf: support XDP_REDIRECT and .ndo_xdp_xmit", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "0c5bc055d69c5b5abe73201faecb0033d4b40f15", "submitter": { "id": 84900, "url": "http://patchwork.ozlabs.org/api/people/84900/?format=api", "name": "Larysa Zaremba", "email": "larysa.zaremba@intel.com" }, "delegate": { "id": 109701, "url": "http://patchwork.ozlabs.org/api/users/109701/?format=api", "username": "anguy11", "first_name": "Anthony", "last_name": "Nguyen", "email": "anthony.l.nguyen@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260304160345.1340940-8-larysa.zaremba@intel.com/mbox/", "series": [ { "id": 494412, "url": "http://patchwork.ozlabs.org/api/series/494412/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=494412", "date": "2026-03-04T16:03:32", "name": "libeth and full XDP for ixgbevf", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/494412/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2205090/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2205090/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=rea2oUAV;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fQywg34h8z1xws\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 05 Mar 2026 03:36:19 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id C1E408135F;\n\tWed, 4 Mar 2026 16:36:14 +0000 (UTC)", "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id EUipzUEwNlEr; Wed, 4 Mar 2026 16:36:13 +0000 (UTC)", "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 53BE981359;\n\tWed, 4 Mar 2026 16:36:13 +0000 (UTC)", "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by lists1.osuosl.org (Postfix) with ESMTP id 84697231\n for <intel-wired-lan@lists.osuosl.org>; Wed, 4 Mar 2026 16:36:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 82B426086F\n for <intel-wired-lan@lists.osuosl.org>; Wed, 4 Mar 2026 16:36:11 +0000 (UTC)", "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 0H_j0wGBDY1I for <intel-wired-lan@lists.osuosl.org>;\n Wed, 4 Mar 2026 16:36:10 +0000 (UTC)", "from mgamail.intel.com (mgamail.intel.com [192.198.163.18])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 8E51A6086D\n for <intel-wired-lan@lists.osuosl.org>; Wed, 4 Mar 2026 16:36:10 +0000 (UTC)", "from fmviesa002.fm.intel.com ([10.60.135.142])\n by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 04 Mar 2026 08:36:10 -0800", "from irvmail002.ir.intel.com ([10.43.11.120])\n by fmviesa002.fm.intel.com with ESMTP; 04 Mar 2026 08:36:05 -0800", "from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235])\n by irvmail002.ir.intel.com (Postfix) with ESMTP id 98269312C8;\n Wed, 4 Mar 2026 16:36:03 +0000 (GMT)" ], "X-Virus-Scanned": [ "amavis at osuosl.org", "amavis at osuosl.org" ], "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ", "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 smtp1.osuosl.org 53BE981359", "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8E51A6086D" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1772642173;\n\tbh=5DCqAgnqDbAslR2RoXgoAW409P/CQNHiLMb69nVCC/A=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=rea2oUAVjHK8o63IKJZhSqDYRiCLKtm8Wg7ZV0y8KNiBlIbc+obNhGRGexxxRQqg1\n\t lrkpXCorT/7Z3qSzqGP2ikHNJUQf184///UI1Zm6CjZVR6pMSazlqgA6uXd2FTUH7V\n\t ZPwyvEMohOz7lbtOVcvzweZ+KtaY2ihBGdGYM3yr6zx/ScC8lTsdy3DkkXT7mjL6sg\n\t FciJ3GUcjswcbJ9QJmSG6i6yjn4yr7wWw6HvkyBuykvdu6ZvGoiqK2mYBvTs3Z07VO\n\t io8HCInVCOPHrZdWMfjf0uDqeqbkakT8yj6uq8Iluw4YIjS7zb3tpchN9+Sr/454Rn\n\t XAPtSdbt/hlqA==", "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.18;\n helo=mgamail.intel.com; envelope-from=larysa.zaremba@intel.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp3.osuosl.org 8E51A6086D", "X-CSE-ConnectionGUID": [ "tRvuQDHASQKK+qoZhR6aZQ==", "jTaVhzu5QByvoLnfA4dngg==" ], "X-CSE-MsgGUID": [ "pyIiDsRWRqO8AymJfpV/Mw==", "YLdtvP/RTkGRyJ1x6Z0wXw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11719\"; a=\"72906403\"", "E=Sophos;i=\"6.21,324,1763452800\"; d=\"scan'208\";a=\"72906403\"", "E=Sophos;i=\"6.21,324,1763452800\"; d=\"scan'208\";a=\"241404985\"" ], "X-ExtLoop1": "1", "From": "Larysa Zaremba <larysa.zaremba@intel.com>", "To": "Tony Nguyen <anthony.l.nguyen@intel.com>, intel-wired-lan@lists.osuosl.org", "Cc": "Larysa Zaremba <larysa.zaremba@intel.com>,\n Przemek Kitszel <przemyslaw.kitszel@intel.com>,\n Andrew Lunn <andrew+netdev@lunn.ch>,\n \"David S. Miller\" <davem@davemloft.net>,\n Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>,\n Paolo Abeni <pabeni@redhat.com>,\n Alexander Lobakin <aleksander.lobakin@intel.com>,\n Simon Horman <horms@kernel.org>, Alexei Starovoitov <ast@kernel.org>,\n Daniel Borkmann <daniel@iogearbox.net>,\n Jesper Dangaard Brouer <hawk@kernel.org>,\n John Fastabend <john.fastabend@gmail.com>,\n Stanislav Fomichev <sdf@fomichev.me>,\n Aleksandr Loktionov <aleksandr.loktionov@intel.com>,\n Natalia Wochtman <natalia.wochtman@intel.com>, netdev@vger.kernel.org,\n linux-kernel@vger.kernel.org, bpf@vger.kernel.org", "Date": "Wed, 4 Mar 2026 17:03:39 +0100", "Message-ID": "<20260304160345.1340940-8-larysa.zaremba@intel.com>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260304160345.1340940-1-larysa.zaremba@intel.com>", "References": "<20260304160345.1340940-1-larysa.zaremba@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1772642170; x=1804178170;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=xsT59N4NUbcB5J49JMTpLAAeLxkARBASaG8PLm+l12g=;\n b=mu8wvhgWXzUG2HRkBWk+PNry1l/xaoPGrvmTPelC0kmgtJqJuLfyjSGL\n iBtF9B/dZ347PIaqrWUnwKwmPGb9MMn9ksmnjqLvFAswxi3OImUu2O2z9\n atBBIgq3cv2XG48fJ0V1NOQ+bPlqsXwhrGCwDDKqbbbZIQsscEfGSTpRW\n FRdiLlbL5HGxC/yvHs0lq2h8T83IA9nUssLLZA5iGgq9YgRENgpoooNNv\n Id+aFE434Ky3+iSZo80n14Xb0WJ97sfixSLdfijNQ0EeV85Cl4E+6tKJk\n iWrpwHmv78LgmwlgyHBuQfSMUxGAlTs1tjSmaM0df6hPzVa0czxQPWpyL\n w==;", "X-Mailman-Original-Authentication-Results": [ "smtp3.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com", "smtp3.osuosl.org;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.a=rsa-sha256 header.s=Intel header.b=mu8wvhgW" ], "Subject": "[Intel-wired-lan] [PATCH iwl-next v3 07/10] ixgbevf: support\n XDP_REDIRECT and .ndo_xdp_xmit", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "To fully support XDP_REDIRECT, utilize more libeth helpers in XDP Rx path,\nhence save cached_ntu in the ring structure instead of stack.\n\nixgbevf-supported VFs usually have few queues, so use libeth_xdpsq_lock\nfunctionality for XDP queue sharing. Adjust filling-in of XDP Tx\ndescriptors to use data from xdp frame. Otherwise, simply use libeth\nhelpers to implement .ndo_xdp_xmit().\n\nWhile at it, fix a typo in libeth docs.\n\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\nSigned-off-by: Larysa Zaremba <larysa.zaremba@intel.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 +\n .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 142 ++++++++----------\n include/net/libeth/xdp.h | 2 +-\n 3 files changed, 64 insertions(+), 82 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\nindex a27081ee764b..ea86679e4f81 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h\n@@ -98,6 +98,8 @@ struct ixgbevf_ring {\n \t\tstruct ixgbevf_tx_buffer *tx_buffer_info;\n \t\tstruct libeth_sqe *xdp_sqes;\n \t};\n+\tstruct libeth_xdpsq_lock xdpq_lock;\n+\tu32 cached_ntu;\n \tunsigned long state;\n \tstruct ixgbevf_stats stats;\n \tstruct u64_stats_sync syncp;\ndiff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex 177eb141e22d..2f3b4954ded8 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -649,10 +649,6 @@ static inline void ixgbevf_irq_enable_queues(struct ixgbevf_adapter *adapter,\n \tIXGBE_WRITE_REG(hw, IXGBE_VTEIMS, qmask);\n }\n \n-#define IXGBEVF_XDP_PASS 0\n-#define IXGBEVF_XDP_CONSUMED 1\n-#define IXGBEVF_XDP_TX 2\n-\n static void ixgbevf_clean_xdp_num(struct ixgbevf_ring *xdp_ring, bool in_napi,\n \t\t\t\t u16 to_clean)\n {\n@@ -710,12 +706,14 @@ static u16 ixgbevf_tx_get_num_sent(struct ixgbevf_ring *xdp_ring)\n static void ixgbevf_clean_xdp_ring(struct ixgbevf_ring *xdp_ring)\n {\n \tixgbevf_clean_xdp_num(xdp_ring, false, xdp_ring->pending);\n+\tlibeth_xdpsq_put(&xdp_ring->xdpq_lock, xdp_ring->netdev);\n }\n \n static u32 ixgbevf_prep_xdp_sq(void *xdpsq, struct libeth_xdpsq *sq)\n {\n \tstruct ixgbevf_ring *xdp_ring = xdpsq;\n \n+\tlibeth_xdpsq_lock(&xdp_ring->xdpq_lock);\n \tif (unlikely(ixgbevf_desc_unused(xdp_ring) < LIBETH_XDP_TX_BULK)) {\n \t\tu16 to_clean = ixgbevf_tx_get_num_sent(xdp_ring);\n \n@@ -749,7 +747,7 @@ static u32 ixgbevf_prep_xdp_sq(void *xdpsq, struct libeth_xdpsq *sq)\n \t*sq = (struct libeth_xdpsq) {\n \t\t.count = xdp_ring->count,\n \t\t.descs = xdp_ring->desc,\n-\t\t.lock = NULL,\n+\t\t.lock = &xdp_ring->xdpq_lock,\n \t\t.ntu = &xdp_ring->next_to_use,\n \t\t.pending = &xdp_ring->pending,\n \t\t.pool = NULL,\n@@ -775,9 +773,13 @@ static void ixgbevf_xdp_xmit_desc(struct libeth_xdp_tx_desc desc, u32 i,\n \t\tcmd_type |= IXGBE_TXD_CMD_EOP;\n \n \tif (desc.flags & LIBETH_XDP_TX_FIRST) {\n-\t\tstruct skb_shared_info *sinfo = sq->sqes[i].sinfo;\n-\t\tu16 full_len = desc.len + sinfo->xdp_frags_size;\n+\t\tstruct libeth_sqe *sqe = &sq->sqes[i];\n+\t\tstruct skb_shared_info *sinfo;\n+\t\tu16 full_len;\n \n+\t\tsinfo = sqe->type == LIBETH_SQE_XDP_TX ? sqe->sinfo :\n+\t\t\t\t xdp_get_shared_info_from_frame(sqe->xdpf);\n+\t\tfull_len = desc.len + sinfo->xdp_frags_size;\n \t\ttx_desc->read.olinfo_status =\n \t\t\tcpu_to_le32((full_len << IXGBE_ADVTXD_PAYLEN_SHIFT) |\n \t\t\t\t IXGBE_ADVTXD_CC);\n@@ -787,76 +789,36 @@ static void ixgbevf_xdp_xmit_desc(struct libeth_xdp_tx_desc desc, u32 i,\n \ttx_desc->read.cmd_type_len = cpu_to_le32(cmd_type);\n }\n \n-LIBETH_XDP_DEFINE_START();\n-LIBETH_XDP_DEFINE_FLUSH_TX(static ixgbevf_xdp_flush_tx, ixgbevf_prep_xdp_sq,\n-\t\t\t ixgbevf_xdp_xmit_desc);\n-LIBETH_XDP_DEFINE_END();\n-\n-static void ixgbevf_xdp_set_rs(struct ixgbevf_ring *xdp_ring, u32 cached_ntu)\n+static void ixgbevf_xdp_rs_and_bump(void *xdpsq, bool sent, bool flush)\n {\n-\tu32 ltu = (xdp_ring->next_to_use ? : xdp_ring->count) - 1;\n+\tstruct ixgbevf_ring *xdp_ring = xdpsq;\n \tunion ixgbe_adv_tx_desc *desc;\n+\tu32 ltu;\n+\n+\tif ((!flush && xdp_ring->pending < xdp_ring->count - 1) ||\n+\t xdp_ring->cached_ntu == xdp_ring->next_to_use)\n+\t\treturn;\n \n+\tltu = (xdp_ring->next_to_use ? : xdp_ring->count) - 1;\n \tdesc = IXGBEVF_TX_DESC(xdp_ring, ltu);\n-\txdp_ring->xdp_sqes[cached_ntu].rs_idx = ltu + 1;\n+\txdp_ring->xdp_sqes[xdp_ring->cached_ntu].rs_idx = ltu + 1;\n \tdesc->read.cmd_type_len |= cpu_to_le32(IXGBE_TXD_CMD);\n-}\n-\n-static void ixgbevf_rx_finalize_xdp(struct libeth_xdp_tx_bulk *tx_bulk,\n-\t\t\t\t bool xdp_xmit, u32 cached_ntu)\n-{\n-\tstruct ixgbevf_ring *xdp_ring = tx_bulk->xdpsq;\n-\n-\tif (!xdp_xmit)\n-\t\tgoto unlock;\n-\n-\tif (tx_bulk->count)\n-\t\tixgbevf_xdp_flush_tx(tx_bulk, LIBETH_XDP_TX_DROP);\n-\n-\tixgbevf_xdp_set_rs(xdp_ring, cached_ntu);\n+\txdp_ring->cached_ntu = xdp_ring->next_to_use;\n \n \t/* Finish descriptor writes before bumping tail */\n \twmb();\n \tixgbevf_write_tail(xdp_ring, xdp_ring->next_to_use);\n-unlock:\n-\trcu_read_unlock();\n }\n \n-static int ixgbevf_run_xdp(struct libeth_xdp_tx_bulk *tx_bulk,\n-\t\t\t struct libeth_xdp_buff *xdp)\n-{\n-\tint result = IXGBEVF_XDP_PASS;\n-\tconst struct bpf_prog *xdp_prog;\n-\tu32 act;\n-\n-\txdp_prog = tx_bulk->prog;\n-\tif (!xdp_prog)\n-\t\tgoto xdp_out;\n-\n-\tact = bpf_prog_run_xdp(xdp_prog, &xdp->base);\n-\tswitch (act) {\n-\tcase XDP_PASS:\n-\t\tbreak;\n-\tcase XDP_TX:\n-\t\tresult = IXGBEVF_XDP_TX;\n-\t\tif (!libeth_xdp_tx_queue_bulk(tx_bulk, xdp,\n-\t\t\t\t\t ixgbevf_xdp_flush_tx))\n-\t\t\tresult = IXGBEVF_XDP_CONSUMED;\n-\t\tbreak;\n-\tdefault:\n-\t\tbpf_warn_invalid_xdp_action(tx_bulk->dev, xdp_prog, act);\n-\t\tfallthrough;\n-\tcase XDP_ABORTED:\n-\t\ttrace_xdp_exception(tx_bulk->dev, xdp_prog, act);\n-\t\tfallthrough; /* handle aborts by dropping packet */\n-\tcase XDP_DROP:\n-\t\tresult = IXGBEVF_XDP_CONSUMED;\n-\t\tlibeth_xdp_return_buff(xdp);\n-\t\tbreak;\n-\t}\n-xdp_out:\n-\treturn result;\n-}\n+LIBETH_XDP_DEFINE_START();\n+LIBETH_XDP_DEFINE_FLUSH_TX(static ixgbevf_xdp_flush_tx, ixgbevf_prep_xdp_sq,\n+\t\t\t ixgbevf_xdp_xmit_desc);\n+LIBETH_XDP_DEFINE_FLUSH_XMIT(static ixgbevf_xdp_flush_xmit, ixgbevf_prep_xdp_sq,\n+\t\t\t ixgbevf_xdp_xmit_desc);\n+LIBETH_XDP_DEFINE_RUN_PROG(static ixgbevf_xdp_run_prog, ixgbevf_xdp_flush_tx);\n+LIBETH_XDP_DEFINE_FINALIZE(static ixgbevf_xdp_finalize_xdp_napi,\n+\t\t\t ixgbevf_xdp_flush_tx, ixgbevf_xdp_rs_and_bump);\n+LIBETH_XDP_DEFINE_END();\n \n static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,\n \t\t\t\tstruct ixgbevf_ring *rx_ring,\n@@ -867,17 +829,11 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,\n \tu16 cleaned_count = ixgbevf_desc_unused(rx_ring);\n \tLIBETH_XDP_ONSTACK_BULK(xdp_tx_bulk);\n \tLIBETH_XDP_ONSTACK_BUFF(xdp);\n-\tu32 cached_ntu;\n-\tbool xdp_xmit = false;\n-\tint xdp_res = 0;\n \n \tlibeth_xdp_init_buff(xdp, &rx_ring->xdp_stash, &rx_ring->xdp_rxq);\n \tlibeth_xdp_tx_init_bulk(&xdp_tx_bulk, rx_ring->xdp_prog,\n \t\t\t\tadapter->netdev, adapter->xdp_ring,\n \t\t\t\tadapter->num_xdp_queues);\n-\tif (xdp_tx_bulk.prog)\n-\t\tcached_ntu =\n-\t\t\t((struct ixgbevf_ring *)xdp_tx_bulk.xdpsq)->next_to_use;\n \n \twhile (likely(total_rx_packets < budget)) {\n \t\tunion ixgbe_adv_rx_desc *rx_desc;\n@@ -910,11 +866,8 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,\n \t\tif (ixgbevf_is_non_eop(rx_ring, rx_desc))\n \t\t\tcontinue;\n \n-\t\txdp_res = ixgbevf_run_xdp(&xdp_tx_bulk, xdp);\n-\t\tif (xdp_res) {\n-\t\t\tif (xdp_res == IXGBEVF_XDP_TX)\n-\t\t\t\txdp_xmit = true;\n-\n+\t\tif (xdp_tx_bulk.prog &&\n+\t\t !ixgbevf_xdp_run_prog(xdp, &xdp_tx_bulk)) {\n \t\t\txdp->data = NULL;\n \t\t\ttotal_rx_packets++;\n \t\t\ttotal_rx_bytes += xdp_get_buff_len(&xdp->base);\n@@ -960,7 +913,7 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,\n \t/* place incomplete frames back on ring for completion */\n \tlibeth_xdp_save_buff(&rx_ring->xdp_stash, xdp);\n \n-\tixgbevf_rx_finalize_xdp(&xdp_tx_bulk, xdp_xmit, cached_ntu);\n+\tixgbevf_xdp_finalize_xdp_napi(&xdp_tx_bulk);\n \n \tu64_stats_update_begin(&rx_ring->syncp);\n \trx_ring->stats.packets += total_rx_packets;\n@@ -972,6 +925,23 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,\n \treturn total_rx_packets;\n }\n \n+static int ixgbevf_xdp_xmit(struct net_device *dev, int n,\n+\t\t\t struct xdp_frame **frames, u32 flags)\n+{\n+\tstruct ixgbevf_adapter *adapter = netdev_priv(dev);\n+\n+\tif (unlikely(test_bit(__IXGBEVF_DOWN, &adapter->state)))\n+\t\treturn -ENETDOWN;\n+\n+\tif (unlikely(!adapter->num_xdp_queues))\n+\t\treturn -ENXIO;\n+\n+\treturn libeth_xdp_xmit_do_bulk(dev, n, frames, flags, adapter->xdp_ring,\n+\t\t\t\t adapter->num_xdp_queues,\n+\t\t\t\t ixgbevf_xdp_flush_xmit,\n+\t\t\t\t ixgbevf_xdp_rs_and_bump);\n+}\n+\n /**\n * ixgbevf_poll - NAPI polling calback\n * @napi: napi struct with our devices info in it\n@@ -1432,6 +1402,7 @@ static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter,\n \tring->next_to_clean = 0;\n \tring->next_to_use = 0;\n \tring->pending = 0;\n+\tring->cached_ntu = 0;\n \n \t/* In order to avoid issues WTHRESH + PTHRESH should always be equal\n \t * to or less than the number of on chip descriptors, which is\n@@ -1444,12 +1415,15 @@ static void ixgbevf_configure_tx_ring(struct ixgbevf_adapter *adapter,\n \t\t 32; /* PTHRESH = 32 */\n \n \t/* reinitialize tx_buffer_info */\n-\tif (!ring_is_xdp(ring))\n+\tif (!ring_is_xdp(ring)) {\n \t\tmemset(ring->tx_buffer_info, 0,\n \t\t sizeof(struct ixgbevf_tx_buffer) * ring->count);\n-\telse\n+\t} else {\n \t\tmemset(ring->xdp_sqes, 0,\n \t\t sizeof(struct libeth_sqe) * ring->count);\n+\t\tlibeth_xdpsq_get(&ring->xdpq_lock, ring->netdev,\n+\t\t\t\t num_possible_cpus() > adapter->num_xdp_queues);\n+\t}\n \n \tclear_bit(__IXGBEVF_HANG_CHECK_ARMED, &ring->state);\n \tclear_bit(__IXGBEVF_TX_XDP_RING_PRIMED, &ring->state);\n@@ -4177,6 +4151,8 @@ static int ixgbevf_xdp_setup(struct net_device *dev, struct bpf_prog *prog,\n \n \t/* If transitioning XDP modes reconfigure rings */\n \tif (!!prog != !!old_prog) {\n+\t\txdp_features_clear_redirect_target(dev);\n+\n \t\t/* Hardware has to reinitialize queues and interrupts to\n \t\t * match packet buffer alignment. Unfortunately, the\n \t\t * hardware is not flexible enough to do this dynamically.\n@@ -4194,6 +4170,9 @@ static int ixgbevf_xdp_setup(struct net_device *dev, struct bpf_prog *prog,\n \t\t\txchg(&adapter->rx_ring[i]->xdp_prog, adapter->xdp_prog);\n \t}\n \n+\tif (prog)\n+\t\txdp_features_set_redirect_target(dev, true);\n+\n \tif (old_prog)\n \t\tbpf_prog_put(old_prog);\n \n@@ -4224,6 +4203,7 @@ static const struct net_device_ops ixgbevf_netdev_ops = {\n \t.ndo_vlan_rx_kill_vid\t= ixgbevf_vlan_rx_kill_vid,\n \t.ndo_features_check\t= ixgbevf_features_check,\n \t.ndo_bpf\t\t= ixgbevf_xdp,\n+\t.ndo_xdp_xmit\t\t= ixgbevf_xdp_xmit,\n };\n \n static void ixgbevf_assign_netdev_ops(struct net_device *dev)\n@@ -4356,7 +4336,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t\t\t NETIF_F_HW_VLAN_CTAG_TX;\n \n \tnetdev->priv_flags |= IFF_UNICAST_FLT;\n-\tnetdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_RX_SG;\n+\tlibeth_xdp_set_features_noredir(netdev, NULL, 0, NULL);\n \n \t/* MTU range: 68 - 1504 or 9710 */\n \tnetdev->min_mtu = ETH_MIN_MTU;\ndiff --git a/include/net/libeth/xdp.h b/include/net/libeth/xdp.h\nindex 898723ab62e8..2e2154ccecae 100644\n--- a/include/net/libeth/xdp.h\n+++ b/include/net/libeth/xdp.h\n@@ -1094,7 +1094,7 @@ __libeth_xdp_xmit_do_bulk(struct libeth_xdp_tx_bulk *bq,\n * @xqs: array of XDPSQs driver structs\n * @nqs: number of active XDPSQs, the above array length\n * @fl: driver callback to flush an XDP xmit bulk\n- * @fin: driver cabback to finalize the queue\n+ * @fin: driver callback to finalize the queue\n *\n * If the driver has active XDPSQs, perform common checks and send the frames.\n * Finalize the queue, if requested.\n", "prefixes": [ "iwl-next", "v3", "07/10" ] }