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 D4DF5A0503; Wed, 18 May 2022 10:27:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 311F742BC9; Wed, 18 May 2022 10:25:44 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 20EDB42BC0 for ; Wed, 18 May 2022 10:25:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652862339; x=1684398339; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PChvsMPu1okuNMNU+1ch7XMuvItquUXcbdxBo1HGpJY=; b=BHNHbxvVKCfBpVs25RAEscAE3oiehADBttCi0nZUBnUTftRm5PSdve7S Nogk9Sv208t3uRH26Cz+jd1WZ8zg2/plEn1aFieDRB7LxZf/DWP6JrPRa aBwJvfYJdmFfUWngSYFRE+T3uubGjT/oFY78ZQ3jK7dPYXYXrIA7dREWD CwcQC446zc6UIIUr3Mr99Qq4uI7EKiWB4JdI7AOXL5BO0V0VYPO4qbKvJ FGLAvlyWNGowwseDMFWDV5wfI/1C45n4tf6dJtRq5x0wNIbntQyNnEYAS GJIc1WzAYh43a9gm+SiPMb6v3iCa09JEQvfNl9lOIE368r0lbwnjgbtMz g==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="296841929" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="296841929" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 01:25:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="545326799" Received: from dpdk-jf-ntb-v2.sh.intel.com ([10.67.119.111]) by orsmga006.jf.intel.com with ESMTP; 18 May 2022 01:25:37 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com Subject: [RFC v3 10/11] net/idpf: support MTU configuration Date: Wed, 18 May 2022 16:25:30 +0800 Message-Id: <20220518082531.1604266-11-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518082531.1604266-1-junfeng.guo@intel.com> References: <20220509091133.3752306-10-junfeng.guo@intel.com> <20220518082531.1604266-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 support ops mtu_set. Signed-off-by: Beilei Xing Signed-off-by: Junfeng Guo --- drivers/net/idpf/idpf_ethdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index e46cadf83a..9b0bbca4a5 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); int idpf_dev_link_update(struct rte_eth_dev *dev, @@ -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 @@ -142,6 +144,18 @@ idpf_dev_info_get(__rte_unused struct rte_eth_dev *dev, struct rte_eth_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.25.1