Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2149006lqt; Mon, 22 Apr 2024 02:56:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWGjB8z+GtfdcO3vO2G1jzBRpyPQwS1tHjc37Guu+PbukP0YBDWw56zl+sCgG6UBKzCpNBl5wZqu8QTodspoSTozpyh+cy+iODuYJqQA== X-Google-Smtp-Source: AGHT+IHVPRnes5D4SkN/xuAP+2pgSs/ouIgrqXDTYFxMWsqN8O51nX9y+auGxzigYdE2ca6Mg4UR X-Received: by 2002:a05:6512:3e0d:b0:51a:c8bb:fcf7 with SMTP id i13-20020a0565123e0d00b0051ac8bbfcf7mr6200305lfv.3.1713779802424; Mon, 22 Apr 2024 02:56:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713779802; cv=pass; d=google.com; s=arc-20160816; b=vc9nM6WeX5gKHrIWL/mmu7mWZx+utwT8n9Lh7STOVqSc1CzbS4YBDmfd9N/+hOzvAu z00cLKDfMPKpsTgiHez6RgAR/f0Krj5AcM31vshRqtIIAzx+w27EWXKLN29GRjWwHjzQ alLTDe/HB7R4Y043c6x6Ye1/9NrSya1YMG4l+6t2fLuktH/4/vHaSMI17Rlan7OGeyBl HxC9DGqkfxHALct54HKEA9PqitIqfGrK+SUWvW1Cq+UWaUnECuULY8RZlOdbyVs9fbks v5DKOVMfj3mBmM1Hlii1o3nTnmx2QvDX2GoRtZHNsMebPB2+qqrW6poSPe32FZlfpztC k+xQ== 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=ABMs5zvuE1f02xsEU5y9lISEf2A/U7m/xhTOIQ4v+I0=; fh=wPv/fmS7iNNmCH0mdUKjkT6XsNx1nMbXFeqwvq2D6q0=; b=YqXRjZBJRiXZalOz5NjvJjxONFmhGV4rvrhBnmxH7WueiMHHV0a5/wAlu5rr0SPZv/ XrTLiR0CXCAxA5QI50SZTRXMazxdumoqkGdpyCnTRaEYbB1mLYU0ZS8r9DQTMnxaOyih 38JNgupzQiXH05zFRY/8ISh9Nie+46toJ873CfYpbYX7asBchk90jIQn12y8aANt9zXR PfdsKQeHwYDBEFX9OHq3XxtewylDohblZfV5Z4zG+9cd4a8zWVdFAo2C0ui7F+NfpswZ 5FSMzUirRpT4TPEUor0aD8K0PSd3y82PZlVIfzfQcssSQF7kWP7pa1XMWvC6ssCD68K3 3CFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=WomHXHCF; 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-153138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153138-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r1-20020a50aac1000000b00571b67239f2si5596256edc.523.2024.04.22.02.56.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 02:56:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=WomHXHCF; 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-153138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153138-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1CDAC1F21D63 for ; Mon, 22 Apr 2024 09:56:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DB16142E93; Mon, 22 Apr 2024 09:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="WomHXHCF" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (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 E58AF13DB98; Mon, 22 Apr 2024 09:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713779683; cv=none; b=gZf4F8RJdwqkubb536ByGCERKolKc4ftUKCbyZrD6jHjTrzvS/c4bPqHqBiHobXpkV01JVJHVxZgYdv1+pM2Fr2Hs0ZeG0WL/8jSBgxhRmxZTMyYvLGv6AJD3cRQLX4IJCpKLp+EJoPexwIenZOQcYx35QPlHRrzR0fOQapRq/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713779683; c=relaxed/simple; bh=C2mmdZp/4i4nfrE7VTLn68jRtevsieKenNhJqUY+Yws=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lsCKYf4vNa6qMF/yshnu+VZdCPhYyEUjP2QSHTlvDTs7sz4RNqpuiWzZ3SDK+tBhCB1lQq5vp4YZ9kxCqBrCmA08TVz7VFw9R4Bk74uk6lDVABLGeFD7K5/f0lkMKbH3iDHS6Fojjcu1muleDihlJ14O7ohUbwWb2QTJuGAwpHw= 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=WomHXHCF; arc=none smtp.client-ip=67.231.148.174 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 (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43M9gh7M011793; Mon, 22 Apr 2024 02:54:35 -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=ABMs5zvuE1f02xsEU5y9l ISEf2A/U7m/xhTOIQ4v+I0=; b=WomHXHCFmq4UNFIahbSRBl88hIIFeLpyeXbnj J+rH4p8u0LUUJn9VbGUVcVLmDXfXDkNRqB9eq7DfsnTy+isYw/cfCLryHwLVCoiI LuCJ2C2BspUEq8p2dlcqagHyq31erj+BwQwoC/YLcFJFKu/sxpyVCrJBP10iVnkb NFu4NEMgnKBsfHo0fQRASyTcbKGUtqi8RMMz5pdFmgcxBVP69jDU+lvPNyoZWIbt ETLsx2MyrnV1ijU6dG24wuADDREChrQ/xKhUJHBoP7COvEBZQrSgEPyftq/k6sra EYQOt8PCVTeWzVKhohRXOUraP/mztbS2om4h4+wWr5mea/wdg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3xnngcr182-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Apr 2024 02:54:35 -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, 22 Apr 2024 02:54:34 -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, 22 Apr 2024 02:54:34 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 5D2A03F705C; Mon, 22 Apr 2024 02:54:31 -0700 (PDT) From: Geetha sowjanya To: , CC: , , , , , , , Subject: [net-next PATCH v2 8/9] octeontx2-pf: Configure VF mtu via representor Date: Mon, 22 Apr 2024 15:24:00 +0530 Message-ID: <20240422095401.14245-9-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240422095401.14245-1-gakula@marvell.com> References: <20240422095401.14245-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: sVdeTssqpo7r4SL2gjiui0GwygZVjrhd X-Proofpoint-ORIG-GUID: sVdeTssqpo7r4SL2gjiui0GwygZVjrhd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-22_07,2024-04-19_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 304c8bb2812d..c2c13385a86d 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