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 1B8E5A00C3; Thu, 21 Apr 2022 05:16:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00C7342804; Thu, 21 Apr 2022 05:16:08 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A25F6427EC for ; Thu, 21 Apr 2022 05:16:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650510963; x=1682046963; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uhH6sbpPFSDqWF8L5yx2JMPlQrbIgO+TzDOmyZdVXeM=; b=mLgVUbF/xfahqIgfh5i2UKPdKnLCIFQW6VOZzDfvgUb5K3LSHZ/WG35s ZqOIYhWsOIkxmql/j/7iggOavkjA8qkXW25I7tkuTK7RNTux3pgwSeJZ5 ON8UDDjcBFDqmwIj0Ve30O4A0z/aKYqtlm4TBOJZNy9u6TYgDFTmwT9D3 avSZqfC5ISa9K0jr9cvGlFzCe2Q7f6078/Bdam2CuyVZWjROybUsIgkqN DL4i9tyXM7bbaKfW7t6FDmqeVu9NDhJ3ZEFq4q8bBSxlb4sPrG5S3XyWo cCiZ/B8beHHfJ05gWZr7no7x5mURyRBxlVdQQHdozaoAYT6xRIncRBInb g==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="244804170" X-IronPort-AV: E=Sophos;i="5.90,277,1643702400"; d="scan'208";a="244804170" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 20:16:02 -0700 X-IronPort-AV: E=Sophos;i="5.90,277,1643702400"; d="scan'208";a="555535398" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 20:16:00 -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 v5 04/12] net/ice: add ops MTU-SET to dcf Date: Thu, 21 Apr 2022 11:13:55 +0000 Message-Id: <20220421111403.1334288-5-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220421111403.1334288-1-kevinx.liu@intel.com> References: <20220419154614.476154-1-kevinx.liu@intel.com> <20220421111403.1334288-1-kevinx.liu@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 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 --- drivers/net/ice/ice_dcf_ethdev.c | 14 ++++++++++++++ drivers/net/ice/ice_dcf_ethdev.h | 6 ++++++ 2 files changed, 20 insertions(+) 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; }; -- 2.33.1