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 1E8D5A0540; Sun, 19 Jul 2020 12:19:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1D471C10F; Sun, 19 Jul 2020 12:18:39 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2052.outbound.protection.outlook.com [40.107.22.52]) by dpdk.org (Postfix) with ESMTP id AE5A61C0B4 for ; Sun, 19 Jul 2020 12:18:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UWsPKwzzHC/971FjQSdYrNfxh10yrkftPi+arI2c3hyY63m3s03lkTJw7HrwkSDCIcqZTozcK5y+qUGAGGftsQpcCzHl33uTzIh4yOdRjBg/OCPpfIwkyhH7w7n/Hz4RaSw7XnOUFTdeXK5B0kFDfgcREFxK/ztPZQjHRG3J5Z08t9RjFrWZE1VlnJe9ZkXfxos/XaEIT/aNjqqxQPMC21X0DcSZpZqOj5l+sjR183LLnpJshYV/rg88VqrQEg/sVQYCNWM+UOBfjI0Ko2a6iXiCu+Fe0ilewhk9iuQX3zWzGl8rDS3moinxCumzyrn6sW/W//zmLPFjFluRah5Z8Q== 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=wszeCeCVS1NNdxQtXANU2QVDHf/FvAJJlfRxiBYWm7c=; b=A5N3wX/nLBo/XQdZlMzaEveoQMdzweCrnxvDeE2kyOq5o5MTbFL2RHnIQmPqBiWq+CL4YU4hoaZYSohA4RbHMlUP1dh0Z1HqIFKd3QivAWkEqQaasQhULB07G0bRepRN6WOOZkk9PNwP88GYOWh48Bb9SRAnzxq3gtZslLIHaTZCz6pRqjiLFOfj6gcYEKoVc3a2dNSTSQY4LWuXmkgPjq/LQwWkp+KvtG8mFODRNm5+7CmIwsp0CHBsfhEXDNt/eK7zRIIInnDa1/HbN5xHxee8JvI7c9P02/LpREMnd8So5sDGysTAxTnfcxRmJxk2GnOdna8MGacOcvRrfggjfw== 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=wszeCeCVS1NNdxQtXANU2QVDHf/FvAJJlfRxiBYWm7c=; b=igvI7eHb2zl6TLy5pZHq2FJ0v3DTDb9wJq2lPc9yMfhKBCFUITmbe1NqNERxFZf89Rol75tjocHNa9/KEYB9OwilPt9Ev4rdD0hz4SZmUhiRg7HIAoRXviXz5Iv3xrWRqPS86H4rEcR++9QI0P8rXpRgLRwpxx0N1L+TLchU9zc= 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 AM0PR05MB6324.eurprd05.prod.outlook.com (2603:10a6:208:143::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.25; Sun, 19 Jul 2020 10:18:30 +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.3195.024; Sun, 19 Jul 2020 10:18:30 +0000 From: Ophir Munk To: dev@dpdk.org Cc: Raslan Darawsheh , Ophir Munk , Matan Azrad Date: Sun, 19 Jul 2020 10:18:14 +0000 Message-Id: <20200719101816.16406-7-ophirmu@mellanox.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200719101816.16406-1-ophirmu@mellanox.com> References: <20200719071112.8540-9-ophirmu@mellanox.com> <20200719101816.16406-1-ophirmu@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM0PR05CA0090.eurprd05.prod.outlook.com (2603:10a6:208:136::30) 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 AM0PR05CA0090.eurprd05.prod.outlook.com (2603:10a6:208:136::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Sun, 19 Jul 2020 10:18:30 +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: 57b841e0-c675-441d-16fb-08d82bcd15bd X-MS-TrafficTypeDiagnostic: AM0PR05MB6324: 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: SrXwp3bQTjCVcDcwUQbRATDQrMdI4gXtsuWwvgEULz0hOxGCG4IR/ZtEuVSRf/XYUUovx6iu3e+IjmicauqOp3wZ1OY7zvNdz8KIOlBkCpAJVOPRBsuTmp0ODuIJFNa20b0mn7/5iYGBY/lt629pm8FjhIsmEycgJSQ3Z0/F1PEuYAWSN7A8uLtFMJ6+HwaTJwgALgpPeBaYJku0JWj9O1u9gUBbxNpLUWBAqn3UuTIus4CqzRFHRgH0pXL6CzySFO2ux70fYpx9guDdCUmhJRczAtQkhTKtrSgb46VIqCnN9Y9GKsD9S5L0KI/LZU2l 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)(396003)(346002)(376002)(136003)(39860400002)(366004)(5660300002)(316002)(2906002)(36756003)(54906003)(186003)(2616005)(6666004)(16526019)(4326008)(83380400001)(956004)(6916009)(26005)(478600001)(52116002)(7696005)(107886003)(66556008)(86362001)(66476007)(66946007)(1076003)(55016002)(8936002)(8676002)(8886007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: n1aUZ/vPHJ3F2pmBR8ZajI8AZcVq5Nm5RqXb0fJPOkAcnyXFnfNNIe1Aq72eL7OzjiP8/ROlIN650F2oYzTJhQZBh6k4rPxyW7maHeJcgL+b3dmlv1+xEOmmlFGxoVBAVlSvF7IbnVUZQobM14AAtNE/5pVWUzZiPQj4KJdPrWQtlCoUh5Q0ipo1qgp2813bKrlWHvqNcQbkAgs52moBNgw4zgg7KbcRrPcTzQ46rUZ6zT/pmBYLTz4Pe5utSYpXuvBUHzM0GznIuXXYlpHzoxqvG6gmdx/QA3P2mWv+INAJn7USaNWK5RpZbr+esIdzIjyhofJHsbCha/D40yDClIuTESm9zJm3s9CZpY3r/QrBMIWsGbFGR4rsDfFOlmmhqwIjY+AXlY8UtAdYNWCsX+/eylphnCIoHwdHFsxXmnOjFepPWxf3/Z2oTpX7ROZzLMr6oiB+6/5n7yfSf9aojljiTFdneJbKYb9HcDOMJSbI4DAlLWI2vathODfsc7Vi X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57b841e0-c675-441d-16fb-08d82bcd15bd X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4209.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2020 10:18:30.8277 (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: Ou4hB0QFo4wisEl/uzrEcc4y3fohMtHKZtxugna3YCN0vPIYFTND39n6C97Knc1d2oPqXBebm3AbBRqbeT6w1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6324 Subject: [dpdk-dev] [PATCH v3 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 | 18 +++--- 2 files changed, 58 insertions(+), 62 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index e79d576..1735157 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -973,6 +973,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 @@ -1051,57 +1102,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 9fa7e47..911fd33 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -814,6 +814,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 */ @@ -824,27 +828,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, @@ -853,7 +847,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); @@ -1044,4 +1037,7 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev, unsigned int n, unsigned int n_used); void mlx5_txpp_interrupt_handler(void *cb_arg); +/* mlx5_rxtx.c */ + +eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev); #endif /* RTE_PMD_MLX5_H_ */ -- 2.8.4