From patchwork Thu Oct 7 18:43:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srikanth Kaka X-Patchwork-Id: 100777 X-Patchwork-Delegate: rasland@nvidia.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 2A39BA034F; Fri, 8 Oct 2021 12:56:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E5334115C; Fri, 8 Oct 2021 12:56:07 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 2F7FA411E0 for ; Thu, 7 Oct 2021 20:44:38 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id w11so4459694plz.13 for ; Thu, 07 Oct 2021 11:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneconvergence.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cOqwjSVXND9RTMldJZrp6ccQyMXReo0ANSwSaR7VQ2M=; b=gqb4lZB815oAgQbhx532jD10iZbROsw6jzaEpJ0VVYXYyxNTYWeNlSo42yrLNEVfZI 68i64ka9HCG/lU3eIJDgkS5ur5fel6IV0uLvG1vdLR9q0rZBpEmQjHpMhZHr9LdupbQA u/wO1FZp30YAFWBwjUMzG1ba8BjO6TTOfscW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cOqwjSVXND9RTMldJZrp6ccQyMXReo0ANSwSaR7VQ2M=; b=XVABp2UAXHO9NL5IlX45FfixzWODrdzhA2lbYxkyvszhHRlvozFVt2Ky7VP4i55+Ed N1oaf0bV4wIZDMOvyhySb7uajGVzKrLotZVdZ5ly9191myi3CMDkKuKwbWygYZttUeXj cjJqEUpLd3iUDLczNjVhr0Zhi1tGW4kCdfsKOt+3tkOEGk3mwqd59LAuUTNFDrTIHb8P fO36GQKbmnpdARADxq7uEhOqgQtOdRf9Am/0lm9GTP7c5TWhuDyTy8JQSkI60rKTW/ST 5ReEZBbXGR9SPOjqYdZ3fMfunucAiSD9KV1GEtKkqbXY7cB5w7IszWiSWHq0VJv0N9oc ROdQ== X-Gm-Message-State: AOAM5314aV1wdSIPHC27gkp0J3aFLWnKqV01XcUutkjpULj9VyJuE4mB 9XoM1k/5i+kQItphkhNnYLdRWw== X-Google-Smtp-Source: ABdhPJxy84NBwW+7v3LuEOM9Zht4NL3aLm1UJaiXwuQGAOSdzrpNSTdOXinO2IVy/VJk0u6/umVBkw== X-Received: by 2002:a17:90a:b382:: with SMTP id e2mr6693892pjr.119.1633632277471; Thu, 07 Oct 2021 11:44:37 -0700 (PDT) Received: from srikanth-ThinkPad-T450.domain.name ([136.185.113.102]) by smtp.gmail.com with ESMTPSA id c11sm3311586pji.38.2021.10.07.11.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 11:44:37 -0700 (PDT) From: Srikanth Kaka To: Matan Azrad , Viacheslav Ovsiienko Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Date: Fri, 8 Oct 2021 00:13:18 +0530 Message-Id: <20211007184350.73858-10-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211007184350.73858-1-srikanth.k@oneconvergence.com> References: <20211007184350.73858-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 08 Oct 2021 12:55:54 +0200 Subject: [dpdk-dev] [PATCH v2 09/41] net/mlx5: get the FreeBSD interface name 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 Sender: "dev" Using the dev structure, mlx5_get_ifname can get the MLX interface name Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/net/mlx5/freebsd/mlx5_ethdev_os.c | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 drivers/net/mlx5/freebsd/mlx5_ethdev_os.c diff --git a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c new file mode 100644 index 0000000000..ad53ec5968 --- /dev/null +++ b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2015 6WIND S.A. + * Copyright 2015 Mellanox Technologies, Ltd + */ + +#include + +#include + +#include + +#include "mlx5.h" + +/** + * Get interface name from private structure. + * + * @param[in] dev + * Pointer to Ethernet device. + * @param[out] ifname + * Interface name output buffer. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +int +mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[MLX5_NAMESIZE]) +{ + struct mlx5_priv *priv = dev->data->dev_private; + + MLX5_ASSERT(priv); + MLX5_ASSERT(priv->sh); + return mlx5_get_ifname_sysfs(priv->sh->ibdev_path, *ifname); +}