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 4FB04455AD for ; Mon, 15 Jul 2024 17:29:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BADC40A71; Mon, 15 Jul 2024 17:29:10 +0200 (CEST) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mails.dpdk.org (Postfix) with ESMTP id B4124402DD for ; Mon, 15 Jul 2024 17:29:09 +0200 (CEST) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2eedebccfa4so24287291fa.1 for ; Mon, 15 Jul 2024 08:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721057349; x=1721662149; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sT42DByGLr7VaaDHH5lIu4gDFUnO/LPx6y2ZMj0bZnI=; b=QkDV1bayKTx8xvOKMYiV/5Ert1pRccVgkjSW9SY6DA1dSkf757SfAbgX65apG4OT/K BSvkjmwW8ZIfy7E29rbQjqO57O4rsXlVZ6se5dGvEANsSxtCrK4C6OwBi9KGgesttYPv ZMqWnQjB55I26/qxpMgmWEQ6iTN8UDgSttYdcaYwQ4RrL7ivVOl6mEiJ7fsk6OBu21Of 0nP55sE+QdH/5XfNv4vHgBc2PsRAYdw2+qkmLS5WQ1/EBD4440cLtdq63jMCiC3s5s+o mP6HHp0HfKDos3RGZA9In3e2zq+vbFQOmqFiRkbV0bS7rVDEqCvYRqqaTXN0+pJZeaIT BKiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721057349; x=1721662149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sT42DByGLr7VaaDHH5lIu4gDFUnO/LPx6y2ZMj0bZnI=; b=hfIgBCw22Y2jY6BhLOcYSNWPP1RAAQxSW6ljqb5+dQOeGvI0ZpUTWBfb8ICJ462j3D kuMcKKfyAeRHcHbKdkwKbimTXQzEVVdDRdrZJF+ZsD5GeUVrcixWbQdD1u4aHWKDtImS qiEC7IKaWlE5/hocLhF1UMbkJgqsBmm59u3PuH9UCBW4JoeuAC7xAqgIkQ/RLznPd9XQ 1LXheUnJLAYzS635kywVMWyzf+twb/AvEc3DQW+/cX6c4miliPUo6sIEqHswIvRUVo3W ki3Zlk93vYrx5Q+Xf3kXbI19WiaXLnRUedwhIPHFIwBI1iDWu25+MprWNHIb6NuEJWiG 64yw== X-Forwarded-Encrypted: i=1; AJvYcCU/QcKihE6qLA75GRRnwlhLi5vnDBjss0++EU4KjicXtjqOAc9r1C6/pz9beuojEOpbraZMr7ri+AcPyPpt4Vo= X-Gm-Message-State: AOJu0YzNVQ2XMeDC8PAoFE6LpgmrlzxaZ+5dxLKAPOADutcGii3wH7Gf Dz12B+egJiVCkKM2rwL0VXAF9n/crGQEKJKKysS/kDyLEDLrvkpxINRuLIB0 X-Google-Smtp-Source: AGHT+IEuptLnN3Wb74ZouXnDbkhlsQtV4E+XgtFABw2ycoUeI8W/+0ExyyGYEMlbN/zwWn8lPZnUtQ== X-Received: by 2002:a2e:9d03:0:b0:2ec:4de9:7334 with SMTP id 38308e7fff4ca-2eef2d6f3b4mr1769911fa.11.1721057348918; Mon, 15 Jul 2024 08:29:08 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680db049f6sm6637419f8f.113.2024.07.15.08.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 08:29:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Rohit Raj Cc: Vanshika Shukla , dpdk stable Subject: patch 'net/dpaa: forbid MTU configuration for shared interface' has been queued to stable release 22.11.6 Date: Mon, 15 Jul 2024 16:26:18 +0100 Message-Id: <20240715152704.2229503-40-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240715152704.2229503-1-luca.boccassi@gmail.com> References: <20240624235907.885628-81-luca.boccassi@gmail.com> <20240715152704.2229503-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/17/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c1257d39c700b7bf9fe7c73a23e21adf64193ff7 Thanks. Luca Boccassi --- >From c1257d39c700b7bf9fe7c73a23e21adf64193ff7 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Wed, 10 Jul 2024 14:25:33 +0530 Subject: [PATCH] net/dpaa: forbid MTU configuration for shared interface [ upstream commit ee0fa7552a0af02e2151414aeec2ce4e12a2e806 ] Since DPDK was able to configure mtu in VSP/Shared interface mode, it was causing misconfiguration of the hw which further caused crashes. This patch allows only kernel to config MTU in such cases. Fixes: e4abd4ff183c ("net/dpaa: support virtual storage profile") Signed-off-by: Rohit Raj Signed-off-by: Vanshika Shukla --- drivers/net/dpaa/dpaa_ethdev.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 779bdc5860..bcb28f33ee 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -165,9 +166,15 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) uint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE; uint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; + struct fman_if *fif = dev->process_private; PMD_INIT_FUNC_TRACE(); + if (fif->is_shared_mac) { + DPAA_PMD_ERR("Cannot configure mtu from DPDK in VSP mode."); + return -ENOTSUP; + } + /* * Refuse mtu that requires the support of scattered packets * when this feature has not been enabled before. @@ -206,7 +213,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) struct rte_intr_handle *intr_handle; uint32_t max_rx_pktlen; int speed, duplex; - int ret, rx_status; + int ret, rx_status, socket_fd; + struct ifreq ifr; PMD_INIT_FUNC_TRACE(); @@ -222,6 +230,26 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dpaa_intf->name); return -EHOSTDOWN; } + + socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (socket_fd == -1) { + DPAA_PMD_ERR("Cannot open IF socket"); + return -errno; + } + + strncpy(ifr.ifr_name, dpaa_intf->name, IFNAMSIZ - 1); + + if (ioctl(socket_fd, SIOCGIFMTU, &ifr) < 0) { + DPAA_PMD_ERR("Cannot get interface mtu"); + close(socket_fd); + return -errno; + } + + close(socket_fd); + DPAA_PMD_INFO("Using kernel configured mtu size(%u)", + ifr.ifr_mtu); + + eth_conf->rxmode.mtu = ifr.ifr_mtu; } /* Rx offloads which are enabled by default */ @@ -249,7 +277,8 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) max_rx_pktlen = DPAA_MAX_RX_PKT_LEN; } - fman_if_set_maxfrm(dev->process_private, max_rx_pktlen); + if (!fif->is_shared_mac) + fman_if_set_maxfrm(dev->process_private, max_rx_pktlen); if (rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) { DPAA_PMD_DEBUG("enabling scatter mode"); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-15 16:19:36.683813201 +0100 +++ 0040-net-dpaa-forbid-MTU-configuration-for-shared-interfa.patch 2024-07-15 16:19:34.536205780 +0100 @@ -1 +1 @@ -From ee0fa7552a0af02e2151414aeec2ce4e12a2e806 Mon Sep 17 00:00:00 2001 +From c1257d39c700b7bf9fe7c73a23e21adf64193ff7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ee0fa7552a0af02e2151414aeec2ce4e12a2e806 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 44bac67803..060b8c678f 100644 +index 779bdc5860..bcb28f33ee 100644