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 796E9A034F; Fri, 8 Oct 2021 12:57:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AE4A4119E; Fri, 8 Oct 2021 12:56:19 +0200 (CEST) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 5665441217 for ; Thu, 7 Oct 2021 20:45:05 +0200 (CEST) Received: by mail-pf1-f179.google.com with SMTP id m26so6101258pff.3 for ; Thu, 07 Oct 2021 11:45:05 -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=Pn8spd5I00csyAb2sT0M/wzgAvkrbycX4akFBa0r9bk=; b=AIVzsdRP3q+R7us4e7RJ28Bq2TeZ8aYLow/2BLKA8Pom8EdhPoGH3UYNvZs8zhtfqZ glvwGMlpqt8WanPHwzszlFsIkxjkQV0R14/sIevtyRYxI7jvtJI0VubXHz3xW+66HdBe AT+lkslOxmf0OSOh2wzgodwV/LRmpxiwz4k+M= 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=Pn8spd5I00csyAb2sT0M/wzgAvkrbycX4akFBa0r9bk=; b=fy9rw1I/S7VQxjYvp82D07cDw/MOyq7gvqjOEhB7WvdE6264Iu0EBtG/1dcvGW+B/L OKpVrQW1d1V+iw+f4OqzdvYzVezhkQvyEEBWBv73Tildvl4wKh6RnOL3qUgL6g8HGHre F2GUnV43abP+p87W0XpNKZWso63J7tVYjj4dfCVQtzR9ScdQxOKsyOwZV2Q5KSnHD/qS P6IJZjDk5VrcQoTJ5VMKhMZ/fAOitNxoshQn90esh3WCvAl58Af335SFegqABMdFxD/r vELYpu7ojOj0K1AisitEhOnut1oa7x8zqggI47uxnx7B7A+z7auG1UYOJLZQeLisUTtp yNLg== X-Gm-Message-State: AOAM531r2j1hR3QOPjWkiXlU19PKw0XaTwVt4V66Y4Hp2QsmLgfzppeg qMxOWtvr3u/LgZr1BsGWOpvDfQ== X-Google-Smtp-Source: ABdhPJyJ0ZVi6qTbDdGqhOQl6pxoDNb3KAdWM1iJc9q5NUpmHQY0JPlwNyq025kVeJNHzb4PbsGykQ== X-Received: by 2002:a63:7e11:: with SMTP id z17mr1013764pgc.114.1633632304585; Thu, 07 Oct 2021 11:45:04 -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.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 11:45:04 -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:28 +0530 Message-Id: <20211007184350.73858-20-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 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 08 Oct 2021 12:55:54 +0200 Subject: [dpdk-dev] [PATCH v2 19/41] net/mlx5: add get MTU 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" MTU is retrieved by making an IOCTL call Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/net/mlx5/freebsd/mlx5_ethdev_os.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c index 9aa38de649..b470c4ddec 100644 --- a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c @@ -96,6 +96,29 @@ mlx5_ifreq(const struct rte_eth_dev *dev, int req, struct ifreq *ifr) return mlx5_ifreq_by_ifname(ifname, req, ifr); } +/** + * Get device MTU. + * + * @param dev + * Pointer to Ethernet device. + * @param[out] mtu + * MTU value output buffer. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +int +mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu) +{ + struct ifreq request; + int ret = mlx5_ifreq(dev, SIOCGIFMTU, &request); + + if (ret) + return ret; + *mtu = request.ifr_mtu; + return 0; +} + /** * Get MAC address by querying netdevice. * -- 2.30.2