From: Geetha sowjanya <gakula@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <kuba@kernel.org>, <davem@davemloft.net>, <pabeni@redhat.com>,
<jiri@resnulli.us>, <edumazet@google.com>, <sgoutham@marvell.com>,
<gakula@marvell.com>, <sbhatta@marvell.com>, <hkelam@marvell.com>
Subject: [net-next PATCH v12 07/12] octeontx2-pf: Configure VF mtu via representor
Date: Thu, 7 Nov 2024 21:38:34 +0530 [thread overview]
Message-ID: <20241107160839.23707-8-gakula@marvell.com> (raw)
In-Reply-To: <20241107160839.23707-1-gakula@marvell.com>
Adds support to manage the mtu configuration for VF through representor.
On update of representor mtu a mbox notification is send
to VF to update its mtu.
This feature is implemented based on the "Network Function Representors"
kernel documentation.
"
Setting an MTU on the representor should cause that same MTU
to be reported to the representee.
"
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
.../ethernet/marvell/octeontx2/nic/otx2_pf.c | 5 +++++
.../net/ethernet/marvell/octeontx2/nic/rep.c | 17 +++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index ea5183fc8414..0d62f16af68b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -854,6 +854,11 @@ static int otx2_mbox_up_handler_rep_event_up_notify(struct otx2_nic *pf,
{
struct net_device *netdev = pf->netdev;
+ if (info->event == RVU_EVENT_MTU_CHANGE) {
+ netdev->mtu = info->evt_data.mtu;
+ return 0;
+ }
+
if (info->event == RVU_EVENT_PORT_STATE) {
if (info->evt_data.port_state) {
pf->flags |= OTX2_FLAG_PORT_UP;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
index eec3e0dc7fdf..d4e78015ef71 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
@@ -79,6 +79,22 @@ int rvu_event_up_notify(struct otx2_nic *pf, struct rep_event *info)
return 0;
}
+static int rvu_rep_change_mtu(struct net_device *dev, int new_mtu)
+{
+ struct rep_dev *rep = netdev_priv(dev);
+ struct otx2_nic *priv = rep->mdev;
+ struct rep_event evt = {0};
+
+ netdev_info(dev, "Changing MTU from %d to %d\n",
+ dev->mtu, new_mtu);
+ dev->mtu = new_mtu;
+
+ evt.evt_data.mtu = new_mtu;
+ evt.pcifunc = rep->pcifunc;
+ rvu_rep_notify_pfvf(priv, RVU_EVENT_MTU_CHANGE, &evt);
+ return 0;
+}
+
static void rvu_rep_get_stats(struct work_struct *work)
{
struct delayed_work *del_work = to_delayed_work(work);
@@ -226,6 +242,7 @@ static const struct net_device_ops rvu_rep_netdev_ops = {
.ndo_stop = rvu_rep_stop,
.ndo_start_xmit = rvu_rep_xmit,
.ndo_get_stats64 = rvu_rep_get_stats64,
+ .ndo_change_mtu = rvu_rep_change_mtu,
};
static int rvu_rep_napi_init(struct otx2_nic *priv,
--
2.25.1
next prev parent reply other threads:[~2024-11-07 16:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 16:08 [net-next PATCH v12 00/12] Introduce RVU representors Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 01/12] octeontx2-pf: RVU representor driver Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 02/12] octeontx2-pf: Create representor netdev Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 03/12] octeontx2-pf: Add basic net_device_ops Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 04/12] octeontx2-af: Add packet path between representor and VF Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 05/12] octeontx2-pf: Get VF stats via representor Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 06/12] octeontx2-pf: Add support to sync link state between representor and VFs Geetha sowjanya
2024-11-07 16:08 ` Geetha sowjanya [this message]
2024-11-07 16:08 ` [net-next PATCH v12 08/12] octeontx2-pf: Add representors for sdp MAC Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 09/12] octeontx2-pf: Add devlink port support Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 10/12] octeontx2-pf: Implement offload stats ndo for representors Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 11/12] octeontx2-pf: Adds TC offload support Geetha sowjanya
2024-11-15 20:53 ` Kees Bakker
2024-11-07 16:08 ` [net-next PATCH v12 12/12] Documentation: octeontx2: Add Documentation for RVU representors Geetha sowjanya
2024-11-13 12:00 ` [net-next PATCH v12 00/12] Introduce " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241107160839.23707-8-gakula@marvell.com \
--to=gakula@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkelam@marvell.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®