From patchwork Mon Oct 31 05:15:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 119326 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 18887A00C4; Mon, 31 Oct 2022 06:47:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A549D4281A; Mon, 31 Oct 2022 06:46:40 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id D85F840695 for ; Mon, 31 Oct 2022 06:46:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667195193; x=1698731193; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FClQ5w/Mk2hiM5LjmdmDKQGn+U+zyfYc8YYh1s1BujM=; b=KLxQMrdQLgyaAj1hSUYmtF3h5fGvj3AgheeAkI8/3iwYv9nebyVUHwbF OGbjNWIzShzvcmycn582KgXOyBd6uF75NwQErYGyf9Ut0cgodt5zoU+xr 5gJJGSV6IBZHeLhruFJGHSzV+anI/qViwbkuq1wwM0D/JNIFEW4Vpqtxk 8p1N61ezSuY6RxziOskVD/AsiMb1D5/nc/6elskAmZB3OVCyEZhTw+Sf7 AtakFyWcFlDN/Aaq48F8LdQWprLIW+VbIgk5h4yBip7oXr9o79Q+9rbxk +8Tg0oy8W9QqPsvihlwIHUdMpGSrZ/Lk10QcvtCa7g/pp4cxqM76KtyN3 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="292114114" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="292114114" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2022 22:46:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="664664040" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="664664040" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.253]) by orsmga008.jf.intel.com with ESMTP; 30 Oct 2022 22:46:24 -0700 From: beilei.xing@intel.com To: andrew.rybchenko@oktetlabs.ru, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, Junfeng Guo Subject: [PATCH v17 09/18] net/idpf: add support for MTU configuration Date: Mon, 31 Oct 2022 05:15:47 +0000 Message-Id: <20221031051556.98549-10-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20221031051556.98549-1-beilei.xing@intel.com> References: <20221031033651.98072-1-beilei.xing@intel.com> <20221031051556.98549-1-beilei.xing@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 From: Junfeng Guo 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 | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/guides/nics/features/idpf.ini b/doc/guides/nics/features/idpf.ini index 46aab2eb61..d722c49fde 100644 --- a/doc/guides/nics/features/idpf.ini +++ b/doc/guides/nics/features/idpf.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +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 1485f40e71..856f3d7266 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -83,6 +83,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) { @@ -760,6 +772,7 @@ static const struct eth_dev_ops idpf_eth_dev_ops = { .tx_queue_stop = idpf_tx_queue_stop, .rx_queue_release = idpf_dev_rx_queue_release, .tx_queue_release = idpf_dev_tx_queue_release, + .mtu_set = idpf_dev_mtu_set, }; static uint16_t