From patchwork Fri Apr 29 09:19:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Liu X-Patchwork-Id: 110463 X-Patchwork-Delegate: qi.z.zhang@intel.com 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 9677FA0093; Fri, 29 Apr 2022 03:22:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 118B742833; Fri, 29 Apr 2022 03:22:36 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 7D8FD42824 for ; Fri, 29 Apr 2022 03:22:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651195349; x=1682731349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HfXaZqLdVExQqbVcF/5HisiK3yEnonzQidoM0GkTRaw=; b=NETt3yapTbxdXtDwo9IncinPFhhNOXXsdiXW1wE+lRlTQh7xCjZ1Nm40 WatuHsPlUyksQIKmYnUeyF11Y1oASHJU4+6YgMYqxZ3dTyBp5v43SNyI/ aXYKpx2wEDem9wCCKPxuufVNFk+lA7a3Y3n8r6ysS9pllb4bkl4G/YQo2 SgEA1mR2tKpyhVt2qkD9Nd84u+WDTxn06IDaBGI7KpRALnYlPex/6kQoV SWyV2+CZijQaIN+UHHyi3LO1nPmqXF8F8EfeKnfmBF7tM1tgTZ/4qieEw Gg7NlZZdQ93Rvc+YTxne0UQAmdo9rZtDjtxj5T325T1bEPh+I7pBs0JL1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="266013691" X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="266013691" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 18:22:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="581767833" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 18:22:26 -0700 From: Kevin Liu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Jie Wang , Kevin Liu Subject: [PATCH v7 04/12] net/ice: support for MTU configure in DCF mode Date: Fri, 29 Apr 2022 09:19:50 +0000 Message-Id: <20220429091958.3103384-5-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220429091958.3103384-1-kevinx.liu@intel.com> References: <20220427181301.1414196-1-kevinx.liu@intel.com> <20220429091958.3103384-1-kevinx.liu@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: Jie Wang add API "mtu_set" to dcf, and it can configure the port mtu through cmdline. Signed-off-by: Jie Wang Signed-off-by: Kevin Liu --- doc/guides/nics/features/ice_dcf.ini | 1 + doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/doc/guides/nics/features/ice_dcf.ini b/doc/guides/nics/features/ice_dcf.ini index d9c1b25407..be34ab4692 100644 --- a/doc/guides/nics/features/ice_dcf.ini +++ b/doc/guides/nics/features/ice_dcf.ini @@ -17,6 +17,7 @@ Inner L3 checksum = P Inner L4 checksum = P RSS reta update = Y RSS key update = Y +MTU update = Y Basic stats = Y Linux = Y x86-32 = Y diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index 866af8c0b3..3c8412c82e 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -64,6 +64,7 @@ New Features * Added support for RSS RETA configure in DCF mode. * Added support for RSS HASH configure in DCF mode. + * Added support for MTU configure in DCF mode. Removed Items ------------- diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index d8b5961514..06d752fd61 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -1081,6 +1081,19 @@ ice_dcf_link_update(struct rte_eth_dev *dev, return rte_eth_linkstatus_set(dev, &new_link); } +static int +ice_dcf_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 != 0) { + PMD_DRV_LOG(ERR, "port %d must be stopped before configuration", + dev->data->port_id); + return -EBUSY; + } + + return 0; +} + bool ice_dcf_adminq_need_retry(struct ice_adapter *ad) { @@ -1236,6 +1249,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = { .rss_hash_update = ice_dcf_dev_rss_hash_update, .rss_hash_conf_get = ice_dcf_dev_rss_hash_conf_get, .tx_done_cleanup = ice_tx_done_cleanup, + .mtu_set = ice_dcf_dev_mtu_set, }; static int diff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h index 11a1305038..f2faf26f58 100644 --- a/drivers/net/ice/ice_dcf_ethdev.h +++ b/drivers/net/ice/ice_dcf_ethdev.h @@ -15,6 +15,12 @@ #define ICE_DCF_MAX_RINGS 1 +#define ICE_DCF_FRAME_SIZE_MAX 9728 +#define ICE_DCF_VLAN_TAG_SIZE 4 +#define ICE_DCF_ETH_OVERHEAD \ + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2) +#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD) + struct ice_dcf_queue { uint64_t dummy; };