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 B6F33A04FD; Wed, 26 Oct 2022 12:13:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBF0A42C5F; Wed, 26 Oct 2022 12:12:35 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 1965442C39 for ; Wed, 26 Oct 2022 12:12:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666779148; x=1698315148; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gvF0YWYamUdXmqnFD93iRjixKuwkdKp6G1CqdGnVow8=; b=dRJ0S/b9y4xVipy+WhKGVifdYa1Jl9hgNH34YhXyjGov+CkM3asikZHs AUa2uCsE3J8kJaRe43rICs/gw8BP8e76R6KJypoVI0UIbvInDVjb0MKfV n2uQ5nR3T+LlV8wwO6E6fX2ohbe4B54Fia4FB+gxIVCVV6JBNQ1vfGC8O yKc/7h3PxO8P+J5oW2x66KRzEP/+gQwal6WGBN37Ay9DMP/uUqFFJ5U/8 2443RjPZFOGX+dHeJ/InqUhT6D9TxXNfuYmzSiCIjnvjWYSYzJPEPQqdA tutKC7zL51517SyfJh3wUiZLLyU3vn64dgUWt+c4YxfLu0U7xvHXEAXys Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="307904657" X-IronPort-AV: E=Sophos;i="5.95,214,1661842800"; d="scan'208";a="307904657" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2022 03:12:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="695306309" X-IronPort-AV: E=Sophos;i="5.95,214,1661842800"; d="scan'208";a="695306309" Received: from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104]) by fmsmga008.fm.intel.com with ESMTP; 26 Oct 2022 03:12:26 -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 v12 09/18] net/idpf: add support for MTU configuration Date: Wed, 26 Oct 2022 18:10:18 +0800 Message-Id: <20221026101027.240583-10-junfeng.guo@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221026101027.240583-1-junfeng.guo@intel.com> References: <20221024131227.1062446-2-junfeng.guo@intel.com> <20221026101027.240583-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 | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/guides/nics/features/idpf.ini b/doc/guides/nics/features/idpf.ini index c25fa5de3f..c8f4a0d6ed 100644 --- a/doc/guides/nics/features/idpf.ini +++ b/doc/guides/nics/features/idpf.ini @@ -5,6 +5,7 @@ ; [Features] Queue start/stop = Y +MTU update = Y Linux = Y x86-32 = Y x86-64 = Y diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index dee1e03d43..94f4671057 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -35,6 +35,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); static int @@ -68,6 +69,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 @@ -110,6 +112,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) { -- 2.34.1