Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1849467lqp; Mon, 15 Apr 2024 22:10:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVb/mjdHgEIbGYz01uNmGxo76KIMOv4EONnDHvsftg1btS+BggLbxyxLQ3zfIPmKnewjkO/75mZYUFsBhUREE8Ds3/Or1RNhJerOJRGjA== X-Google-Smtp-Source: AGHT+IFfscEW9ysTjQ6UKV+CFiFcz7FNTQ9CY7jp6EiicNhLVNv6/OrLFiSQ/82I7n2T/IFTLx31 X-Received: by 2002:a17:902:b717:b0:1e1:1791:3681 with SMTP id d23-20020a170902b71700b001e117913681mr9027705pls.61.1713244212551; Mon, 15 Apr 2024 22:10:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713244212; cv=pass; d=google.com; s=arc-20160816; b=KCP2g9WMZq5wnNOddU1IO3jekh3ULCibm5lv8YRSlv7F1h9qSU5z7EbhazcfuHPpiL UC9vryo8Q6tKoNMJbpG1JICTqo7KV2ThHlv1JJEsHjyIyn3Tk9/bEzN8a9KyRT//jJ9P TQeATfrIhajC64nbQLXcKuUL7D3sGRmsSDy4V206gnl8lUd27WmbXad6tI7vQDoV8vPn 739CPpCcm4e4LZuFFaOQ9nAsPhh+Oe8nkZXj5vwqAkPWqQr538KHXiOuotM6CcY3GR0Z v903q79Rq6EVvmeJJj5u1KGZcbMs75RJKfazY/aTO+e9Y+hzhSoPrrtUMeTBGyt90Jc3 o3uA== 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=Vp/1QmTC5fXHkdokF4sUlHGTmtCFGEvbYJDLiLMbJAI=; fh=wPv/fmS7iNNmCH0mdUKjkT6XsNx1nMbXFeqwvq2D6q0=; b=0+D+Jy+lFB825gxjyPZ/Fnyh6XsE5r8A5bWpe4NnF7ZSxz3ovIShSGP2hQO6nbidSv 1xjbMQpqPj9KQikYLdKLJQHhu7ng2PnAFcIwZxzWkOeylDpJYztvY+YGc32w66sk+Ozf hvUfAo8oXibwcxgXEOj0BExr0SR0r/HDbqqUEgGQnvtx0UF1VGd/fmvjGpBBcXXh1qLv aDMQvBdCuQecGvfahkWFtBCNprHUirhHpTC5b/MaUy1+6tLXiqy1Oayyd8BMR2DtVhHV eZi0MzlIeBAU24mRHMqshA/qihR/bw6UOjWX7H6/EVFEKVIzlnDsJxc9nv7raaMpFa7A BVzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="HLa4dUA/"; 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-146259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146259-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q5-20020a170902bd8500b001e462e3dde8si8710811pls.244.2024.04.15.22.10.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 22:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="HLa4dUA/"; 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-146259-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146259-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 432F9B23578 for ; Tue, 16 Apr 2024 05:09:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CE596E2AE; Tue, 16 Apr 2024 05:06:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="HLa4dUA/" 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 1B4766CDDF; Tue, 16 Apr 2024 05:06:56 +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=1713244018; cv=none; b=cV5U7eModxPA9iKOLWQLMva6IDXYdYK4v0RdDkp2bKkPKpKeA86VI0dx1gFL1+59QXQOYfVPknib+be6VhRbv5ySIgh5Iw986khK3wlAVYclHb4FsoYeh5rc3Q8sbh0nevwal81Ln+DugB6xR1zFBIV32wSa17gAXM3380+v8oU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713244018; c=relaxed/simple; bh=e1tXeROEcclgL33gE9+8uMApuDO4WTKnx1rd/4l7HkM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rh45GAN6qBuBnEjanrvetK04IEE8OynisB6lnQzAVXdXLGCVjJMTRd8kjM5Nh52SYL9AOZQpEyWJ6eVWuUgzReT7+iIreYhjKGIS5dg0f5+TeUfy5/8TvlhALtw5W1UAl6iq2PyBhnE2HTb6zQw53IumVYOd/7g429Ry+9Hiixw= 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=HLa4dUA/; 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.17.1.24/8.17.1.24) with ESMTP id 43G19ETi029786; Mon, 15 Apr 2024 22:06:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=pfpt0220; bh=Vp/1QmTC5fXHkdokF4sUl HGTmtCFGEvbYJDLiLMbJAI=; b=HLa4dUA/cfITHGBs3l82hqm1Lpf980K2X9yCY ruWJGZiAx8PeCejpy0LIS7WDQHhGPQ3jThsJywTkEtVLQ9ZFGdce7SE36rPUYAzC Gmay6DG4q3Y56kMsS6as/76RJqQtHghQPVgEqkAfCbuSIqSSn9l9rWduH2hDQvL4 6UhqmqkI5GlvzVxPeteHTabb83Cw5Qi3IHN11sicP7pyv77eDdQ52BISKWlOu2DO YtT4HJKT8QucdVENonN+q+ye83lRJUWnSOuBQvAFhSzkvgXFE8SzeyMutAgC1WAQ DewkDYLnBcZ7MktVj44szg0F30HLfpEgEbtN+WR9XSVhZ4xew== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3xhfdn0j8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Apr 2024 22:06:51 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 15 Apr 2024 22:06:49 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 15 Apr 2024 22:06:49 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id A64BC3F7083; Mon, 15 Apr 2024 22:06:46 -0700 (PDT) From: Geetha sowjanya To: , CC: , , , , , , , Subject: [net-next PATCH 8/9] octeontx2-pf: Configure VF mtu via representor Date: Tue, 16 Apr 2024 10:36:15 +0530 Message-ID: <20240416050616.6056-9-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240416050616.6056-1-gakula@marvell.com> References: <20240416050616.6056-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: iVbU6jMhMM8PUS1d8lqhqSX-5nRNq2W9 X-Proofpoint-ORIG-GUID: iVbU6jMhMM8PUS1d8lqhqSX-5nRNq2W9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 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 2a1bc8cdea19..8fc26a95a871 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 2677a229a9e7..a2941e3d16be 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); @@ -225,6 +241,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