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 6303EA034C; Mon, 24 Oct 2022 15:15:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E35B942BBB; Mon, 24 Oct 2022 15:14:34 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id AB74A42BC1 for ; Mon, 24 Oct 2022 15:14:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666617268; x=1698153268; 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=DugDAQV6hnlvfoXMwpq34NhFugE7yW1QT+7oJAYoqkz+GpIPqYsZXv6u LS3JVTC4WGunP/8OFOQ4bOJUmUnXrNMQ4GAHdngjkwEznA5/KJqrabCmb jhk0ac1ZunapJkfDHUpuwz8/KM0ftol4ZDD2Jg2BPik3Jo9UazL8RRYu/ BNegIGrqAISS6i2TBmFib+ZcLd3S0ab5MDv3KzbOOjamBVdhTNA04V3A1 sN1Kjawd2ByBGuV+WASRTg+t9sOm0yvf2LjrWYwbdy1N8kkx/Mm9MLM5d M/nUOwaWd+KCxdpJxRxdsSStS3wZ0FTHYCaStd6mN8967fY7/EtpoilCt A==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="309100046" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="309100046" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 06:14:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="664540036" X-IronPort-AV: E=Sophos;i="5.95,209,1661842800"; d="scan'208";a="664540036" Received: from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104]) by orsmga001.jf.intel.com with ESMTP; 24 Oct 2022 06:14: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 v11 10/18] net/idpf: add support for MTU configuration Date: Mon, 24 Oct 2022 21:12:19 +0800 Message-Id: <20221024131227.1062446-11-junfeng.guo@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024131227.1062446-1-junfeng.guo@intel.com> References: <20221024130134.1046536-2-junfeng.guo@intel.com> <20221024131227.1062446-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