Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp466462lqp; Tue, 11 Jun 2024 09:25:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeEUqBXHYvRnSV8yaFnFFZihnqBBghM/Cwzc1iGBGH1DL3e3n8Mm9+gwF1/26GzuKyowNolkNv/tCUpVrdng9l7Kyv76nqcP0alxqLKw== X-Google-Smtp-Source: AGHT+IHwz1uj4YFcD8A+c6rCdS++VDkP52MvvInW+LdNIj6cPCpU59mSuyNVA55YyvLU7l4uqgIP X-Received: by 2002:a05:620a:24ca:b0:795:57e5:aeef with SMTP id af79cd13be357-79557e5b25fmr952660485a.49.1718123130303; Tue, 11 Jun 2024 09:25:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718123130; cv=pass; d=google.com; s=arc-20160816; b=FCbTKn7HmPOqJbiSIHa0UeK5ByINjpLyZFFcZ31QsJm9xSxRY484L78MADq7R1RMMr U/1M8Ds//TjIdkgeRugNa5AYBSsHTHuZkA0xRZ2kL2P2ckS5OexTXpccB1wQTyEOwPd+ x2WSg8AdK3EzZ1+/+lOfPeNjyABpDWye7tslDj+JkShj9d8qqxO08QhuF/3IrLbZoDAR EylERLV3MUu8vbnfQe5J49gXMTMajBsmV94gVpcf2t2QszKzP2T36Mg3TU9s2urDXPQy XR/qjg0kEe5+cwve/ddb2FgZV19ISlHVY7ewSKTo9FEzZw1HA75Yu/hYErs2bgmbt7dj S4ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oCCqOfpNqYQ9/lY5Wf/iO4M7xnfMhpvsc28RqiMHpCE=; fh=wPv/fmS7iNNmCH0mdUKjkT6XsNx1nMbXFeqwvq2D6q0=; b=CShfhrpz2InZ+qNNqbqssRDS2bAC9ttJ+GNsNiKX42mA2QxerJYV0EfXl2C5x8If+M xGHR2PdC/RvldiWjk8IsXLxQCyemOMw/9Wa9BVN0exWu9MQBeh+hzhJueil0JXxc6mOn lgdYYY70vlykCmX9Ou6rliiELXR5MM9z3vbR8HnpZNyybf3N8dPRz8BNT8lDJvg6ogUn EM8fECk4zs2i9Dso3eNvqu8kaidv7jha1HPVKQvHnAePW8MifTw0m78NQ/Pj39es5fv1 W4f+My8HLA0/bV8w6jlbw+aPtSloD0H6qxCV89Qpy2bYzzEjh5drlDziuuajkjauv2UQ aJOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=MMK+u8aJ; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-210237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795fb13b2a1si514194485a.440.2024.06.11.09.25.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 09:25:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=MMK+u8aJ; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-210237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210237-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A0721C23FC9 for ; Tue, 11 Jun 2024 16:25:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F7867CF30; Tue, 11 Jun 2024 16:22:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="MMK+u8aJ" Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0967A78C88; Tue, 11 Jun 2024 16:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.156.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718122977; cv=none; b=WreQ4/8AAmFxL6Gju2JI/S6NY4BRPPcPCQ66qN7plA1np686UxCgjWi4as9ihaTEnHKYyJhhS4wJGCUpgslvjv8cVx2UapgyIBdceI01LkEsHBCP6o7rdA7f4rUg+/UklojfHToBcmVlXB9iLbqCOnMycnUe6W4MhKSvQoq44rc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718122977; c=relaxed/simple; bh=/vZvduUP4Jcb/xXodAzJYL1w7O4WoH/d8cEZ9PInfPU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cVzzFLNx395K5IP4qd4ZoBpl8vfXf7uy/rRE/XoGY2Xaag1bOu249C8JtCv1UpCJGPPsGDtJGARM0+xrMGT+3aW+0wxmG0QOM8RrWfE/chx+E37csGapdBCTgHCmLXd8bvrOf0giUz3bXoKmhpQeZxuDyA21RTaEId7VNrCBYQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=MMK+u8aJ; arc=none smtp.client-ip=67.231.156.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45BGJSN5024152; Tue, 11 Jun 2024 09:22:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pfpt0220; bh=oCCqOfpNqYQ9/lY5Wf/iO4M7x nfMhpvsc28RqiMHpCE=; b=MMK+u8aJ1fU5Iy/hEfuJ4u6II0NNqu9YR8G7du8VZ S5su4OjEZ2S8qPaNnNsW4Hz0Ii+1h0cTuzenAlJlKdXVMkYneBiqkdoR9tdHrHQZ WEiXndSuNfXdPcr5dXvnJgAsKExfjU5PoRK1DqYasAG1OkQhjhrBttIdbCOxIRYs ax2Io/vY9kCycuI1k/85+tA60Xc92F7VmIDURT0ImVqepINgMBFP2uAEnmvGU60q oQ7aFxiCdG9qeUYet4gxKnrV5Q8C7NRqp1toj76RBNHI4gp6ZXoM9d4MPrYwMRdi wJl9R4yRtf1w2/8mA6xRRpaVtQcimW8NdrJM2ADLy5Pww== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ympthaya6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 09:22:46 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 11 Jun 2024 09:22:46 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 11 Jun 2024 09:22:45 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id D015D3F7059; Tue, 11 Jun 2024 09:22:42 -0700 (PDT) From: Geetha sowjanya To: , CC: , , , , , , , Subject: [net-next PATCH v4 08/10] octeontx2-pf: Configure VF mtu via representor Date: Tue, 11 Jun 2024 21:52:11 +0530 Message-ID: <20240611162213.22213-9-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240611162213.22213-1-gakula@marvell.com> References: <20240611162213.22213-1-gakula@marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: 3roULdbkhpDk0sStHT2LESr_19xW1dqs X-Proofpoint-ORIG-GUID: 3roULdbkhpDk0sStHT2LESr_19xW1dqs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-11_09,2024-06-11_01,2024-05-17_01 Add 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. Signed-off-by: Sai Krishna Signed-off-by: Geetha sowjanya --- .../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 0f17e8af4f76..91a458c5028a 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 6a527b824f33..d984b7d9dc64 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