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 46E26A034C; Mon, 24 Oct 2022 15:04:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 333AD42B9C; Mon, 24 Oct 2022 15:04:21 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 7C43A42B9C for ; Mon, 24 Oct 2022 15:04:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666616658; x=1698152658; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3G4Zjh0wjq8MW6Fi+hX2Mos/kj+JH/PS/CGq2od2HQI=; b=N2u9TA9aQ9CYJX3XbMmYamuQ10zhSeCpROeKM/U2yWWuVPWgxhi/ipa4 A0m6HMrjYQcYL13Zbum1uWnFOciaZnVhvB8n9EhOswBK84naWZdt5n4EH N21OZDBLZ8k4TX3QX2G5lM5bUHrxv/yQrFAFLefyZ0XNT3Ws0EPuonrln 3krxJ3g2xM8rU0ZWUreTfDlL4MtLVYMGudSeX07SjgE2Gz8AAFR1OtB0i ngDmrap2DaasQnC9q2IhNoOG/niqONpY2kAomMwigPTephj2vR+UXR892 nA+WfrGF4ER7xbvk+8JK53o/RzKoGhAvIlOlQVaE7IiHTnUUaEStveQOf w==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="305018770" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="305018770" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 06:03:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="631248313" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="631248313" Received: from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104]) by orsmga002.jf.intel.com with ESMTP; 24 Oct 2022 06:03:21 -0700 From: Junfeng Guo To: andrew.rybchenko@oktetlabs.ru, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Junfeng Guo Subject: [PATCH v10 06/14] net/idpf: add support for MTU configuration Date: Mon, 24 Oct 2022 21:01:26 +0800 Message-Id: <20221024130134.1046536-7-junfeng.guo@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024130134.1046536-1-junfeng.guo@intel.com> References: <20221021051821.2164939-2-junfeng.guo@intel.com> <20221024130134.1046536-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Add dev ops mtu_set. Signed-off-by: Beilei Xing Signed-off-by: Junfeng Guo --- doc/guides/nics/features/idpf.ini | 1 + drivers/net/idpf/idpf_ethdev.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/guides/nics/features/idpf.ini b/doc/guides/nics/features/idpf.ini index a03068df85..d4eb9b374c 100644 --- a/doc/guides/nics/features/idpf.ini +++ b/doc/guides/nics/features/idpf.ini @@ -8,5 +8,6 @@ ; [Features] Queue start/stop = Y +MTU update = Y Packet type parsing = Y Linux = Y diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index 80826569c8..1654af0053 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -34,6 +34,7 @@ static int idpf_dev_stop(struct rte_eth_dev *dev); static int idpf_dev_close(struct rte_eth_dev *dev); static int idpf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); +static int idpf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static void idpf_adapter_rel(struct idpf_adapter *adapter); int @@ -72,6 +73,7 @@ static const struct eth_dev_ops idpf_eth_dev_ops = { .tx_queue_release = idpf_dev_tx_queue_release, .dev_infos_get = idpf_dev_info_get, .link_update = idpf_dev_link_update, + .mtu_set = idpf_dev_mtu_set, }; static int @@ -122,6 +124,18 @@ idpf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) return 0; } +static int +idpf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) +{ + /* mtu setting is forbidden if port is start */ + if (dev->data->dev_started) { + PMD_DRV_LOG(ERR, "port must be stopped before configuration"); + return -EBUSY; + } + + return 0; +} + static int idpf_init_vport_req_info(struct rte_eth_dev *dev) { @@ -209,6 +223,7 @@ idpf_init_vport(struct rte_eth_dev *dev) vport->num_tx_complq = vport_info->num_tx_complq; vport->num_rx_q = vport_info->num_rx_q; vport->num_rx_bufq = vport_info->num_rx_bufq; + vport->max_mtu = vport_info->max_mtu; rte_memcpy(vport->default_mac_addr, vport_info->default_mac_addr, ETH_ALEN); vport->sw_idx = idx; -- 2.34.1