From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7827CA0540; Tue, 14 Jul 2020 16:22:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B52A1D5B7; Tue, 14 Jul 2020 16:21:21 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00059.outbound.protection.outlook.com [40.107.0.59]) by dpdk.org (Postfix) with ESMTP id CA1421D541 for ; Tue, 14 Jul 2020 16:21:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoQ92SPo1bqB9DQy2YprxyznN5mG4WH3kiBcPaAXYB+WK+RPdVrnFM/b+C67EcIp+B45DpWLVy0AM4N78FjF0Xr3VGUgtkD8ip4VitXim4HM2Ge+ZEuDwrDmx5gdC+JXAM2OwfFcQ9SQw0xhHZfPp8REZDy7mzFGSKhSxP71xrT0knaxRfqIfIZ+XLXAZrgVoNPaO87OsAxt/2ukshHE4z+G9S15RmelLmNMGyuTJFeAfiqSJYjxmX/0790dQPK3lgPFCjFgO+MA9L2WlhaPkfK6bDXIiRPEKfa5cY+IBszZ0uRMPto5gmtdTGUFFcAn/tUYdzhUL6CbJm1wdRiyqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iiOzKvMujde6EDe4hgEhOIf4Re4/GCATKOjChIKMVOQ=; b=eYb256w/N64Z9sag6mJLw3LcJzxrVX+Y2JhtNoSPswuM2eePzFl1+n+9PXyxAtFPJ2d2S8ToNHRg5mUNxBipvnrQNF8p+2lRSv8BkAU6fXZyYYoz/WYMgbU6rSfyGoFYYAdWURmjW+eZ5uttrjRKPI+mUZ+z5z6rqe2j+X1Au0IZQCC6zQi7LYXHh7vXsHOkvHZpE8gr6TdvIQuCEHRkhlN6UWVqCGMCHkQ9nca068/Zy1Xs+WyDLzQlCFYbFKBiy2xV9prCySUssxe7C/ERJj8rG0zigoTgvEKjjxFnu6nXnJqclKLnbL6ItXytOGjSQgkZrOpJPm1j/R+FcApceQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iiOzKvMujde6EDe4hgEhOIf4Re4/GCATKOjChIKMVOQ=; b=T+WTlLAfIwOKIXfcopGVSwsOP3DD1x6ENKdiQm8+FrBS/wYZH05BQWt6wxQToOZtI43O8Ey3/kLUkALeAYYldnPBfp/pJASCWI1TgH0Cl/Un9nH6N7S/+oCYHMxbjgwt/kFjjBOLMbJL9LgIzQezbxDj+EVn5i4Wkp+ulDBalE0= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) by AM0PR05MB5908.eurprd05.prod.outlook.com (2603:10a6:208:123::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Tue, 14 Jul 2020 14:21:15 +0000 Received: from AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::3949:70c3:126:3972]) by AM0PR05MB4209.eurprd05.prod.outlook.com ([fe80::3949:70c3:126:3972%7]) with mapi id 15.20.3174.026; Tue, 14 Jul 2020 14:21:15 +0000 From: Ophir Munk To: dev@dpdk.org Cc: Raslan Darawsheh , Ophir Munk , Matan Azrad Date: Tue, 14 Jul 2020 14:21:00 +0000 Message-Id: <20200714142102.30606-7-ophirmu@mellanox.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200714142102.30606-1-ophirmu@mellanox.com> References: <20200714142102.30606-1-ophirmu@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM3PR05CA0100.eurprd05.prod.outlook.com (2603:10a6:207:1::26) To AM0PR05MB4209.eurprd05.prod.outlook.com (2603:10a6:208:61::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM3PR05CA0100.eurprd05.prod.outlook.com (2603:10a6:207:1::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Tue, 14 Jul 2020 14:21:14 +0000 X-Mailer: git-send-email 2.8.4 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1e028b37-b8ba-4446-3548-08d828012a84 X-MS-TrafficTypeDiagnostic: AM0PR05MB5908: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DsAp6XWpYGP3s21TfjrX/vtggid6f1MGjZzP+R2pfA7w2gZpYvIS6VyG4aLBBWHau+BUQ35zemHSLcvlrk4EkuqvD0TOVypFs0mIHnCXxQhQFwMPI6UkIrKSJ5nzobKH9mID+MIOHMVxN2A1zW9Y882sHHqpabTWd+bIdoL9vyT2dTtA63Z464g5r+d7FWZHYQ73hMpk0FsoVgE3q38ry61kj152hPq1PbHsU+KGKQcj6tohGHxh9AHZUoLn6EeUuuknopBe2CNIRealCcb6pu6/8pJlSxXK1D9mOD0zaqOB1Q7FfZWOFd4eKnohoAPu X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4209.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(366004)(346002)(396003)(136003)(39850400004)(2616005)(86362001)(66946007)(956004)(1076003)(66556008)(66476007)(2906002)(7696005)(316002)(52116002)(36756003)(83380400001)(8676002)(6666004)(5660300002)(8886007)(4326008)(26005)(8936002)(54906003)(6916009)(478600001)(55016002)(16526019)(186003)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5nYJAz2lovczBKoqoSSnx8U9KU44PIVb/rgyDpUd9HM9Yt8IrFU+cjm7Cb7RsOZBT/s//092XNi04pXgv9UX/FfpmjkxvtCx8RWSOYjfS5my2wBtnNw6SSjFhG0/JqLEZM/Dhtpc9+ak0Le5jIaf7T+G+ciVPUhNOa2X7N9UEK2+NFfTRtUYAhqeWvv5Y1IrvTEK1cqzSJGLfILjM+aclOQUn75E8zVfN9mHcn9Pkl5wVlSD3/K/wAKUkxixSl3xubnfk+HS4T1g5/QfQSO3dSCabpM8L/u7V7A4Do0hlsAIsFzEDv8AxSHFxmsuDpqf8Z8Eo7Nt33FVWWwJdttnrB9j1TIufED2lTGgn6WZ7ZF1pBl6YTki5VkKfxLlEjX+dCkjS25I5JYIDcOs6Ovryqndp2utQMImH0FLU3Pczui8lplz95Q+EhKbmcJUY7C5scprTitPnTi1kHhW0378Y8uLDYZhMu7eipqjixPeAmWvbA2J59XNbMFa8Xb3CqqN X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e028b37-b8ba-4446-3548-08d828012a84 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4209.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 14:21:15.2837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d7Mnb7erOO/zSXNtQq/L5OQ+W2+fgrjYMglA07X7ACNQRy0UwoRDVEMa16tTx18r16APbFjn4MilvJg3e/6AtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5908 Subject: [dpdk-dev] [PATCH v1 6/8] net/mlx5: header file cleanup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The cleanup refers to header file mlx5.h. 1. Remove unused prototypes. 2. Move prototypes under their correct title. 3. Change functions to static and remove their prototye from the header file. Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 102 ++++++++++++++++---------------- drivers/net/mlx5/mlx5.h | 19 +++--- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index 765a521..95f33bb 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -972,6 +972,57 @@ mlx5_is_removed(struct rte_eth_dev *dev) } /** + * Analyze gathered port parameters via sysfs to recognize master + * and representor devices for E-Switch configuration. + * + * @param[in] device_dir + * flag of presence of "device" directory under port device key. + * @param[inout] switch_info + * Port information, including port name as a number and port name + * type if recognized + * + * @return + * master and representor flags are set in switch_info according to + * recognized parameters (if any). + */ +static void +mlx5_sysfs_check_switch_info(bool device_dir, + struct mlx5_switch_info *switch_info) +{ + switch (switch_info->name_type) { + case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN: + /* + * Name is not recognized, assume the master, + * check the device directory presence. + */ + switch_info->master = device_dir; + break; + case MLX5_PHYS_PORT_NAME_TYPE_NOTSET: + /* + * Name is not set, this assumes the legacy naming + * schema for master, just check if there is + * a device directory. + */ + switch_info->master = device_dir; + break; + case MLX5_PHYS_PORT_NAME_TYPE_UPLINK: + /* New uplink naming schema recognized. */ + switch_info->master = 1; + break; + case MLX5_PHYS_PORT_NAME_TYPE_LEGACY: + /* Legacy representors naming schema. */ + switch_info->representor = !device_dir; + break; + case MLX5_PHYS_PORT_NAME_TYPE_PFHPF: + /* Fallthrough */ + case MLX5_PHYS_PORT_NAME_TYPE_PFVF: + /* New representors naming schema. */ + switch_info->representor = 1; + break; + } +} + +/** * Get switch information associated with network interface. * * @param ifindex @@ -1050,57 +1101,6 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info) } /** - * Analyze gathered port parameters via sysfs to recognize master - * and representor devices for E-Switch configuration. - * - * @param[in] device_dir - * flag of presence of "device" directory under port device key. - * @param[inout] switch_info - * Port information, including port name as a number and port name - * type if recognized - * - * @return - * master and representor flags are set in switch_info according to - * recognized parameters (if any). - */ -void -mlx5_sysfs_check_switch_info(bool device_dir, - struct mlx5_switch_info *switch_info) -{ - switch (switch_info->name_type) { - case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN: - /* - * Name is not recognized, assume the master, - * check the device directory presence. - */ - switch_info->master = device_dir; - break; - case MLX5_PHYS_PORT_NAME_TYPE_NOTSET: - /* - * Name is not set, this assumes the legacy naming - * schema for master, just check if there is - * a device directory. - */ - switch_info->master = device_dir; - break; - case MLX5_PHYS_PORT_NAME_TYPE_UPLINK: - /* New uplink naming schema recognized. */ - switch_info->master = 1; - break; - case MLX5_PHYS_PORT_NAME_TYPE_LEGACY: - /* Legacy representors naming schema. */ - switch_info->representor = !device_dir; - break; - case MLX5_PHYS_PORT_NAME_TYPE_PFHPF: - /* Fallthrough */ - case MLX5_PHYS_PORT_NAME_TYPE_PFVF: - /* New representors naming schema. */ - switch_info->representor = 1; - break; - } -} - -/** * DPDK callback to retrieve plug-in module EEPROM information (type and size). * * @param dev diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index a1d4734..87cfbfe 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -729,6 +729,10 @@ const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev); int mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu); int mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap); +eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev); +struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid); +struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev); +int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev); /* mlx5_ethdev_os.c */ @@ -739,27 +743,17 @@ int mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu); int mlx5_set_mtu(struct rte_eth_dev *dev, uint16_t mtu); int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock); int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete); -int mlx5_force_link_status_change(struct rte_eth_dev *dev, int status); int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); int mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); -void mlx5_dev_link_status_handler(void *arg); void mlx5_dev_interrupt_handler(void *arg); void mlx5_dev_interrupt_handler_devx(void *arg); -void mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev); -void mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev); int mlx5_set_link_down(struct rte_eth_dev *dev); int mlx5_set_link_up(struct rte_eth_dev *dev); int mlx5_is_removed(struct rte_eth_dev *dev); -eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev); -eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev); -struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid); -struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev); int mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info); -void mlx5_sysfs_check_switch_info(bool device_dir, - struct mlx5_switch_info *switch_info); void mlx5_translate_port_name(const char *port_name_in, struct mlx5_switch_info *port_info_out); void mlx5_intr_callback_unregister(const struct rte_intr_handle *handle, @@ -768,7 +762,6 @@ int mlx5_get_module_info(struct rte_eth_dev *dev, struct rte_eth_dev_module_info *modinfo); int mlx5_get_module_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *info); -int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev); int mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat); int mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats); @@ -944,4 +937,8 @@ int mlx5_os_vf_mac_addr_modify(struct mlx5_priv *priv, unsigned int iface_idx, int vf_index); int mlx5_os_set_promisc(struct rte_eth_dev *dev, int enable); int mlx5_os_set_allmulti(struct rte_eth_dev *dev, int enable); + +/* mlx5_rxtx.c */ + +eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev); #endif /* RTE_PMD_MLX5_H_ */ -- 2.8.4