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 4603942D54; Mon, 26 Jun 2023 07:47:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C23541148; Mon, 26 Jun 2023 07:47:57 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3BEA940223 for ; Mon, 26 Jun 2023 07:47:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687758475; x=1719294475; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dsH13RCCojn0NFW8a2C0CzmflBgj+62hstHjSPw+mao=; b=AmGQdMKg6Nn+m6NdcBw9fEMqw3wKxMXN74Y6mpSuJLkp5bxnZXk48cCg VUvvDYligk4+eOJ92+fc7FgE0lFx3JRyoNH4ufa298lroxtj15mdoHG1K yQp3rLBUKBxdn55rS43+Hj7D+/d9AvKmNRhSsd/vHctAk9pOWBZDt/OpC YKDIeYmQfnhOc40lOs7mWdQm+UdeyGFFxjr2QxQrC8bbkvWGRODPmvFGd rsJ+zM8gQyQa2GHdRptwP0TZgUSzA8sbM2dwgsSom5XKae7ZkztieMLdC V1ElSvqjh1pJfCU0HyJmP7h+PzSiVAkbCwwmOsBIHKISznA1FX9RLEjJy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="340767663" X-IronPort-AV: E=Sophos;i="6.01,158,1684825200"; d="scan'208";a="340767663" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2023 22:47:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="786016571" X-IronPort-AV: E=Sophos;i="6.01,158,1684825200"; d="scan'208";a="786016571" Received: from dpdk-mingxial-ice.sh.intel.com ([10.67.110.210]) by fmsmga004.fm.intel.com with ESMTP; 25 Jun 2023 22:47:48 -0700 From: Mingxia Liu To: dev@dpdk.org Cc: jingjing.wu@intel.com, beilei.xing@intel.com, Mingxia Liu Subject: [PATCH] net/idpf: optimize the code of IDPF PMD Date: Mon, 26 Jun 2023 14:05:31 +0000 Message-Id: <20230626140531.490850-1-mingxia.liu@intel.com> X-Mailer: git-send-email 2.34.1 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 This patch moves 'struct eth_dev_ops idpf_eth_dev_ops = {...}' block just after idpf_dev_close(), to group dev_ops related code together. Signed-off-by: Mingxia Liu --- drivers/net/idpf/idpf_ethdev.c | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index bfdac92b95..801da57472 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -839,6 +839,34 @@ idpf_dev_close(struct rte_eth_dev *dev) return 0; } +static const struct eth_dev_ops idpf_eth_dev_ops = { + .dev_configure = idpf_dev_configure, + .dev_close = idpf_dev_close, + .rx_queue_setup = idpf_rx_queue_setup, + .tx_queue_setup = idpf_tx_queue_setup, + .dev_infos_get = idpf_dev_info_get, + .dev_start = idpf_dev_start, + .dev_stop = idpf_dev_stop, + .link_update = idpf_dev_link_update, + .rx_queue_start = idpf_rx_queue_start, + .tx_queue_start = idpf_tx_queue_start, + .rx_queue_stop = idpf_rx_queue_stop, + .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, + .dev_supported_ptypes_get = idpf_dev_supported_ptypes_get, + .stats_get = idpf_dev_stats_get, + .stats_reset = idpf_dev_stats_reset, + .reta_update = idpf_rss_reta_update, + .reta_query = idpf_rss_reta_query, + .rss_hash_update = idpf_rss_hash_update, + .rss_hash_conf_get = idpf_rss_hash_conf_get, + .xstats_get = idpf_dev_xstats_get, + .xstats_get_names = idpf_dev_xstats_get_names, + .xstats_reset = idpf_dev_xstats_reset, +}; + static int insert_value(struct idpf_devargs *devargs, uint16_t id) { @@ -1206,34 +1234,6 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a return ret; } -static const struct eth_dev_ops idpf_eth_dev_ops = { - .dev_configure = idpf_dev_configure, - .dev_close = idpf_dev_close, - .rx_queue_setup = idpf_rx_queue_setup, - .tx_queue_setup = idpf_tx_queue_setup, - .dev_infos_get = idpf_dev_info_get, - .dev_start = idpf_dev_start, - .dev_stop = idpf_dev_stop, - .link_update = idpf_dev_link_update, - .rx_queue_start = idpf_rx_queue_start, - .tx_queue_start = idpf_tx_queue_start, - .rx_queue_stop = idpf_rx_queue_stop, - .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, - .dev_supported_ptypes_get = idpf_dev_supported_ptypes_get, - .stats_get = idpf_dev_stats_get, - .stats_reset = idpf_dev_stats_reset, - .reta_update = idpf_rss_reta_update, - .reta_query = idpf_rss_reta_query, - .rss_hash_update = idpf_rss_hash_update, - .rss_hash_conf_get = idpf_rss_hash_conf_get, - .xstats_get = idpf_dev_xstats_get, - .xstats_get_names = idpf_dev_xstats_get_names, - .xstats_reset = idpf_dev_xstats_reset, -}; - static uint16_t idpf_vport_idx_alloc(struct idpf_adapter_ext *ad) { -- 2.34.1