From patchwork Thu Dec 14 06:58:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 135184 X-Patchwork-Delegate: qi.z.zhang@intel.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 BA722436E9; Thu, 14 Dec 2023 07:49:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9D4E42FA9; Thu, 14 Dec 2023 07:49:42 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 0353042FA1 for ; Thu, 14 Dec 2023 07:49:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702536580; x=1734072580; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lM3487a78Nv7Q8oZ1LxOSEIkqs0mQtdimUx4wnTwMRg=; b=Gn+byhIouVf90+qLvmqNiIAsCHh/j39PtVgYdMUMlOO1eMyM3jYVa20T fT9RuG2knqM9aP2FRW4TcLxA5eKfAjyYmFgtiatsjWES0xU+ukXWqUNmw xOZC0io1LVDctQiHpFaL4+byjV42mtUM4whb4TmfPFAmEmbv0ojLi9jvS ecEQmsCy04Qf56vxfdjRDGvjApTNENhChA5gpL6kPoHXnR7uDR/J+quKn Hi9laN9Vha1KklfNZWrKwVgjJoxTDvulgyU9UAGCUG+UKTklBOf5Ks8IS qOR437lAWaZVxuIetxcRp6+W5ggjhgF4N89zNAnWdP38D9TEptBT4+wLQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="8440320" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="8440320" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="1105584418" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="1105584418" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:37 -0800 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing Subject: [PATCH v2 1/3] net/iavf: support Tx LLDP on scalar Date: Thu, 14 Dec 2023 14:58:55 +0800 Message-Id: <20231214065857.2142565-2-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214065857.2142565-1-zhichaox.zeng@intel.com> References: <20231206060828.3310347-1-zhichaox.zeng@intel.com> <20231214065857.2142565-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 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 This patch adds an mbuf dynflag IAVF_TX_LLDP_DYNFLAG to determine whether or not to fill the SWTCH_UPLINK bit in the Tx context descriptor to send LLDP packet. Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx.c | 5 +++++ drivers/net/iavf/rte_pmd_iavf.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index f19aa14646..c986fa944a 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2427,6 +2427,8 @@ iavf_calc_context_desc(uint64_t flags, uint8_t vlan_flag) if (flags & RTE_MBUF_F_TX_VLAN && vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) return 1; + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) + return 1; return 0; } @@ -2445,6 +2447,9 @@ iavf_fill_ctx_desc_cmd_field(volatile uint64_t *field, struct rte_mbuf *m, cmd |= IAVF_TX_CTX_DESC_IL2TAG2 << IAVF_TXD_CTX_QW1_CMD_SHIFT; } + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) + cmd |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; *field |= cmd; } diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h index 56d453fc4c..2c442b6a05 100644 --- a/drivers/net/iavf/rte_pmd_iavf.h +++ b/drivers/net/iavf/rte_pmd_iavf.h @@ -23,6 +23,8 @@ extern "C" { #endif +#define IAVF_TX_LLDP_DYNFLAG "intel_pmd_dynflag_tx_lldp" + /** * The supported network flexible descriptor's extraction metadata format. */ From patchwork Thu Dec 14 06:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 135185 X-Patchwork-Delegate: qi.z.zhang@intel.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 F0C44436E9; Thu, 14 Dec 2023 07:49:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE53742FCD; Thu, 14 Dec 2023 07:49:48 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id A8F6242FC7 for ; Thu, 14 Dec 2023 07:49:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702536588; x=1734072588; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PayMww13vDvNi9bb4nWgNitpz+PJ+v4H6/fs66VXX3g=; b=bLrWBnSIBN5w0LZSgnjsa0mdepVs8AGaCDMGllTwtRpi+FC2rTqxZb86 ZMUG/tQZdNQHDHcRYEfOfskrLzYL3zaJJRiwGoGylmQf6gCL2cQrahu9C GDt43nGuFZY+FxmwOdegRyvVxgnZryghL+gG/f+9AnEy61f7LyX6MdVd/ XxECftBxu5xWJ+jowJepU9WsQWtqreVhvI+Af7XBOXGYsefx1PF2QBNmz j+uBBVbA2SJ4WysA1f2PWYeylNwqgwuBsB497Ln3rEe1g/R0B5JcArUIE xAJ4MJTT3FPZMRwGCwqEQv2QZbXPc+UstkTsQ+oPxUhQpETiDmx53dKgh w==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="8440328" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="8440328" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="1105584469" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="1105584469" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:43 -0800 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing , Bruce Richardson , Konstantin Ananyev Subject: [PATCH v2 2/3] net/iavf: support Tx LLDP on AVX512 Date: Thu, 14 Dec 2023 14:58:56 +0800 Message-Id: <20231214065857.2142565-3-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214065857.2142565-1-zhichaox.zeng@intel.com> References: <20231206060828.3310347-1-zhichaox.zeng@intel.com> <20231214065857.2142565-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 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 This patch adds an avx512 ctx Tx path that supports context descriptor, filling in the SWTCH_UPLINK bit based on mbuf dynflag IAVF_TX_LLDP_DYNFLAG to support sending LLDP packet. Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx.c | 5 +++++ drivers/net/iavf/iavf_rxtx.h | 3 +++ drivers/net/iavf/iavf_rxtx_vec_avx512.c | 17 +++++++++++++++++ drivers/net/iavf/iavf_rxtx_vec_common.h | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index c986fa944a..a588b769a8 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -4044,6 +4044,11 @@ iavf_set_tx_function(struct rte_eth_dev *dev) dev->tx_pkt_prepare = iavf_prep_pkts; PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).", dev->data->port_id); + } else if (check_ret == IAVF_VECTOR_CTX_PATH) { + dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx; + dev->tx_pkt_prepare = iavf_prep_pkts; + PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).", + dev->data->port_id); } else { dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx_offload; dev->tx_pkt_prepare = iavf_prep_pkts; diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index f432f9d956..ee52864915 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -66,6 +66,7 @@ #define IAVF_VECTOR_PATH 0 #define IAVF_VECTOR_OFFLOAD_PATH 1 #define IAVF_VECTOR_CTX_OFFLOAD_PATH 2 +#define IAVF_VECTOR_CTX_PATH 3 #define DEFAULT_TX_RS_THRESH 32 #define DEFAULT_TX_FREE_THRESH 32 @@ -752,6 +753,8 @@ uint16_t iavf_xmit_pkts_vec_avx512_offload(void *tx_queue, uint16_t nb_pkts); uint16_t iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq); uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type); diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c index 7a7df6d258..dc3354f331 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -2,6 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ +#include "rte_pmd_iavf.h" #include "iavf_rxtx_vec_common.h" #include @@ -2206,6 +2207,9 @@ ctx_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt, low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM; } } + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) + high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; uint64_t high_data_qw = (IAVF_TX_DESC_DTYPE_DATA | ((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) | ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT)); @@ -2258,6 +2262,9 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp, (uint64_t)pkt[1]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT; } } + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) + hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; if (pkt[0]->ol_flags & RTE_MBUF_F_TX_VLAN) { if (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) { @@ -2270,6 +2277,9 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp, (uint64_t)pkt[0]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT; } } + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) + hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; if (offload) { iavf_txd_enable_offload(pkt[1], &hi_data_qw1); @@ -2520,3 +2530,10 @@ iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts, { return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, true); } + +uint16_t +iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, false); +} diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h index e18cdc3f11..87e1d6c306 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_common.h +++ b/drivers/net/iavf/iavf_rxtx_vec_common.h @@ -10,6 +10,7 @@ #include "iavf.h" #include "iavf_rxtx.h" +#include "rte_pmd_iavf.h" #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wcast-qual" @@ -249,6 +250,11 @@ iavf_tx_vec_queue_default(struct iavf_tx_queue *txq) if (txq->offloads & IAVF_TX_NO_VECTOR_FLAGS) return -1; + if (rte_mbuf_dynflag_lookup(IAVF_TX_LLDP_DYNFLAG, NULL) > 0) { + txq->use_ctx = 1; + return IAVF_VECTOR_CTX_PATH; + } + /** * Vlan tci needs to be inserted via ctx desc, if the vlan_flag is L2TAG2. * Tunneling parameters and other fields need be configured in ctx desc From patchwork Thu Dec 14 06:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 135186 X-Patchwork-Delegate: qi.z.zhang@intel.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 2990E436E9; Thu, 14 Dec 2023 07:49:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 154E042FC7; Thu, 14 Dec 2023 07:49:57 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 803B542FA1 for ; Thu, 14 Dec 2023 07:49:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702536596; x=1734072596; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W0oeh8bLYGf3Unw6q8WvujThrfrsbkjmwKYlq8NfNUc=; b=kWZTJBmQCVGewi661/BpadDN6Z64kLL6CED+bjiC3IftNryjbgAxGbdQ 4FSLbPl1JLdaC/lV6oosUc0G2tn4l0EdLjjKeNfDri3brE2KX0PNxMfTD 6zMLsGf+Zw+RrtqXL7WrdOXBkroRf8FWBxIKTjZ9MYTXYHgmHIh6IkuGU 02lQmxRyi0Lws6ltIarRndglQLWvyzEDM/eExKHzO25fNEClJkypoY2Su 5gv7e5k22E2ohygBGwWTSa1TWTqDtPYxc99mY8jEMzNET65ccRJwav6IB 2bqbXR8PF5jZRVGM097J9ARDSGKboMZTNgKTQb+D/jOypc6sQsNvSpjmg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="8440333" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="8440333" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="1105584496" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="1105584496" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 22:49:48 -0800 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing Subject: [PATCH v2 3/3] net/iavf: add Tx LLDP command Date: Thu, 14 Dec 2023 14:58:57 +0800 Message-Id: <20231214065857.2142565-4-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214065857.2142565-1-zhichaox.zeng@intel.com> References: <20231206060828.3310347-1-zhichaox.zeng@intel.com> <20231214065857.2142565-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 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 This patch adds an IAVF testpmd command "set tx lldp on|off" which will register an mbuf dynflag IAVF_TX_LLDP_DYNFLAG at the application level to indicate the need to send LLDP packet. Currently, it only supports turning on. For avx512, need to close the Tx port first, then "set tx lldp on", and reopen the port to select correct Tx path. Signed-off-by: Zhichao Zeng --- doc/guides/rel_notes/release_24_03.rst | 3 ++ drivers/net/iavf/iavf_testpmd.c | 68 ++++++++++++++++++++++++++ drivers/net/iavf/meson.build | 3 ++ 3 files changed, 74 insertions(+) create mode 100644 drivers/net/iavf/iavf_testpmd.c diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index e9c9717706..46576f62fe 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated Intel iavf driver.** + + * Added support for Tx LLDP packet on scalar and avx512. Removed Items ------------- diff --git a/drivers/net/iavf/iavf_testpmd.c b/drivers/net/iavf/iavf_testpmd.c new file mode 100644 index 0000000000..11788ac69e --- /dev/null +++ b/drivers/net/iavf/iavf_testpmd.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2016 Intel Corporation. + */ + +#include + +#include + +#include +#include + +#include "testpmd.h" + +struct cmd_enable_tx_lldp_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t tx; + cmdline_fixed_string_t lldp; + cmdline_fixed_string_t what; +}; + +static cmdline_parse_token_string_t cmd_enable_tx_lldp_set = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + set, "set"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_tx = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + tx, "tx"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_lldp = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + lldp, "lldp"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_what = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + what, "on#off"); + +static void +cmd_enable_tx_lldp_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, __rte_unused void *data) +{ + struct cmd_enable_tx_lldp_result *res = parsed_result; + const struct rte_mbuf_dynflag iavf_tx_lldp = { .name = { IAVF_TX_LLDP_DYNFLAG } }; + + if (strcmp(res->what, "on") == 0) + rte_mbuf_dynflag_register(&iavf_tx_lldp); +} + +static cmdline_parse_inst_t cmd_enable_tx_lldp = { + .f = cmd_enable_tx_lldp_parsed, + .data = NULL, + .help_str = "set iavf tx lldp on|off", + .tokens = { + (void *)&cmd_enable_tx_lldp_set, + (void *)&cmd_enable_tx_lldp_tx, + (void *)&cmd_enable_tx_lldp_lldp, + (void *)&cmd_enable_tx_lldp_what, + NULL, + }, +}; + +static struct testpmd_driver_commands iavf_cmds = { + .commands = { + { + &cmd_enable_tx_lldp, + "set tx lldp (on|off)\n" + " Set iavf Tx lldp packet(currently only supported on)\n\n", + }, + { NULL, NULL }, + }, +}; +TESTPMD_ADD_DRIVER_COMMANDS(iavf_cmds) diff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build index a6ce2725c3..83aebd5596 100644 --- a/drivers/net/iavf/meson.build +++ b/drivers/net/iavf/meson.build @@ -8,6 +8,9 @@ endif cflags += ['-Wno-strict-aliasing'] includes += include_directories('../../common/iavf') + +testpmd_sources = files('iavf_testpmd.c') + deps += ['common_iavf', 'security', 'cryptodev'] sources = files(