From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CF12C4360F for ; Tue, 2 Apr 2019 23:11:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E869207E0 for ; Tue, 2 Apr 2019 23:11:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MYt29RC9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E869207E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ylQc5dWT/O7gsv6FAPLSJfeWA+280R1e/INuWawDqFQ=; b=MYt29RC9mkIoQ3 Reih0mgrzdEnzw7zgNCkpT4XR830h/3ceNb3k1mt4Fr+LA2dIoLHKrOYXAnmiSf7xweMFBdA79h4w nO43aD8BoqRLo62b1wMaaKovijxDZ1+KcwD9tSfyT4S8nDiR4sTNR09zJZQbKRa/O8ifMaS8YNPGw bKsPA9NMBrK/MQU3E+bqPbueWmhl5nB8Z58zfrCqEjE0sNnLkv54rdQQRa29TodygFFjB3g9KxDvC ZKVacjEP6kKL5pxpfeeZBFRFsiUOmvH8vZDSZ42eeYQjjrJP1+Yt6cd5C8iSwQCnZ4gtboaWrdpG0 vXtrN8z3jyxWlQYHzCpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBSZF-0003CE-Ec; Tue, 02 Apr 2019 23:11:45 +0000 Received: from mail-wm1-f66.google.com ([209.85.128.66]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBSZC-0003BX-GZ for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2019 23:11:43 +0000 Received: by mail-wm1-f66.google.com with SMTP id w15so5793864wmc.3 for ; Tue, 02 Apr 2019 16:11:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aQd6OsuO/58fEcRFBnPUvdUY6eeJJPZlMr55h0wQjfE=; b=j0HDeu7E2/jSa4W551n8HbJZCFiwTd528XoyP6BpCVXp5nqyK4QopahlxY/XOoi9yx Wl5KpIV1l3q3zwbygEpxRd+1Y08Fa+9P6QCCLml4Dlinna0Gu0SHMX7Z65M7taM9e0Y9 U3eBIWNVb97yxnA0a+x8omoIsW6sbweryxekxkntGA2Oe6hN0q2wLUP+uVMvCU7de0AF OIRGbsgqtTD6RtTasuZButsumz8+Z1HmnAe5xAhyu8KGQUPqUt3mJl+WK+vC4oIjtEoc upiy/zs23OWaPxvY5u7kGSwJulIZDNdnjOzFRfmY2Bbio4ZZciuKyZmPkuIcAsIyIza5 eJrA== X-Gm-Message-State: APjAAAXznAmN77OL+sPU9vsk0lQ1IqanxpnXzpNvNIjTHZ6ClBooc4QU QXFPEiNXUzjFjcqfHmFw5Kox/w== X-Google-Smtp-Source: APXvYqx55OondnNI0sJ1heOX5Jx1ozZ/eEw25KcPIcmbj0PqmAPnVi1eEIqFcO8pK70X8RpDFJGpaA== X-Received: by 2002:a1c:a186:: with SMTP id k128mr5305966wme.54.1554246697621; Tue, 02 Apr 2019 16:11:37 -0700 (PDT) Received: from raver.teknoraver.net (net-93-70-69-135.cust.vodafonedsl.it. [93.70.69.135]) by smtp.gmail.com with ESMTPSA id c10sm18193197wru.83.2019.04.02.16.11.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Apr 2019 16:11:36 -0700 (PDT) From: Matteo Croce To: netdev@vger.kernel.org Subject: [PATCH net] net: thunderx: don't allow jumbo frames with XDP Date: Wed, 3 Apr 2019 01:11:36 +0200 Message-Id: <20190402231136.15156-1-mcroce@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190402_161142_550354_5DF8319C X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sunil Goutham , Robert Richter , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The thunderx driver forbids to load an eBPF program if the MTU is higher than 1500 bytes, but this can be circumvented by first loading the eBPF, and then raising the MTU. XDP assumes that SKBs are linear and fit in a single page, this can lead to undefined behaviours. Fix this by limiting the MTU to 1500 bytes if an eBPF program is loaded. Fixes: 05c773f52b96e ("net: thunderx: Add basic XDP support") Signed-off-by: Matteo Croce --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index aa2be4807191..fe1d7513f01d 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1578,6 +1578,13 @@ static int nicvf_change_mtu(struct net_device *netdev, int new_mtu) struct nicvf *nic = netdev_priv(netdev); int orig_mtu = netdev->mtu; + /* For now just support only the usual MTU sized frames */ + if (nic->xdp_prog && new_mtu > 1500) { + netdev_warn(netdev, "Jumbo frames not yet supported with XDP, current MTU %d.\n", + netdev->mtu); + return -EOPNOTSUPP; + } + netdev->mtu = new_mtu; if (!netif_running(netdev)) -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel