linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Matteo Croce <mcroce@redhat.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.14 12/70] net: thunderx: dont allow jumbo frames with XDP
Date: Wed, 24 Apr 2019 19:09:32 +0200	[thread overview]
Message-ID: <20190424170909.117118061@linuxfoundation.org> (raw)
In-Reply-To: <20190424170906.751869122@linuxfoundation.org>

From: Matteo Croce <mcroce@redhat.com>

[ Upstream commit 1f227d16083b2e280b7dde4ca78883d75593f2fd ]

The thunderx driver forbids to load an eBPF program if the MTU is too high,
but this can be circumvented by loading the eBPF, then raising the MTU.

Fix this by limiting the MTU if an eBPF program is already loaded.

Fixes: 05c773f52b96e ("net: thunderx: Add basic XDP support")
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -1461,6 +1461,15 @@ static int nicvf_change_mtu(struct net_d
 	struct nicvf *nic = netdev_priv(netdev);
 	int orig_mtu = netdev->mtu;
 
+	/* For now just support only the usual MTU sized frames,
+	 * plus some headroom for VLAN, QinQ.
+	 */
+	if (nic->xdp_prog && new_mtu > MAX_XDP_MTU) {
+		netdev_warn(netdev, "Jumbo frames not yet supported with XDP, current MTU %d.\n",
+			    netdev->mtu);
+		return -EINVAL;
+	}
+
 	netdev->mtu = new_mtu;
 
 	if (!netif_running(netdev))



  parent reply	other threads:[~2019-04-24 17:57 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 17:09 [PATCH 4.14 00/70] 4.14.114-stable review Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 01/70] bonding: fix event handling for stacked bonds Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 02/70] net: atm: Fix potential Spectre v1 vulnerabilities Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 03/70] net: bridge: fix per-port af_packet sockets Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 04/70] net: bridge: multicast: use rcu to access port list from br_multicast_start_querier Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 05/70] net: fou: do not use guehdr after iptunnel_pull_offloads in gue_udp_recv Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 06/70] tcp: tcp_grow_window() needs to respect tcp_space() Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 07/70] team: set slave to promisc if team is already in promisc mode Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 08/70] vhost: reject zero size iova range Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 09/70] ipv4: recompile ip options in ipv4_link_failure Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 10/70] ipv4: ensure rcu_read_lock() in ipv4_link_failure() Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 11/70] net: thunderx: raise XDP MTU to 1508 Greg Kroah-Hartman
2019-04-24 17:09 ` Greg Kroah-Hartman [this message]
2019-04-24 17:09 ` [PATCH 4.14 13/70] CIFS: keep FileInfo handle live during oplock break Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 14/70] KVM: x86: Dont clear EFER during SMM transitions for 32-bit vCPU Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 15/70] KVM: x86: svm: make sure NMI is injected after nmi_singlestep Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 16/70] Staging: iio: meter: fixed typo Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 17/70] staging: iio: ad7192: Fix ad7193 channel address Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 18/70] iio: gyro: mpu3050: fix chip ID reading Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 19/70] iio/gyro/bmg160: Use millidegrees for temperature scale Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 20/70] iio: cros_ec: Fix the maths for gyro scale calculation Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 21/70] iio: ad_sigma_delta: select channel when reading register Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 22/70] iio: dac: mcp4725: add missing powerdown bits in store eeprom Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 23/70] iio: Fix scan mask selection Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 24/70] iio: adc: at91: disable adc channel interrupt in timeout case Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 25/70] iio: core: fix a possible circular locking dependency Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 26/70] io: accel: kxcjk1013: restore the range after resume Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 27/70] staging: comedi: vmk80xx: Fix use of uninitialized semaphore Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 28/70] staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 29/70] staging: comedi: ni_usb6501: Fix use of uninitialized mutex Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 30/70] staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 31/70] ALSA: hda/realtek - add two more pin configuration sets to quirk table Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 32/70] ALSA: core: Fix card races between register and disconnect Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 33/70] scsi: core: set result when the command cannot be dispatched Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 34/70] Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO" Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 35/70] Revert "svm: Fix AVIC incomplete IPI emulation" Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 36/70] coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 37/70] crypto: x86/poly1305 - fix overflow during partial reduction Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 38/70] arm64: futex: Restore oldval initialization to work around buggy compilers Greg Kroah-Hartman
2019-04-24 17:09 ` [PATCH 4.14 39/70] x86/kprobes: Verify stack frame on kretprobe Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 40/70] kprobes: Mark ftrace mcount handler functions nokprobe Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 41/70] kprobes: Fix error check when reusing optimized probes Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 42/70] rt2x00: do not increment sequence number while re-transmitting Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 43/70] mac80211: do not call driver wake_tx_queue op during reconfig Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 44/70] perf/x86/amd: Add event map for AMD Family 17h Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 45/70] x86/cpu/bugs: Use __initconst for const init data Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 46/70] perf/x86: Fix incorrect PEBS_REGS Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 47/70] x86/speculation: Prevent deadlock on ssb_state::lock Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 48/70] crypto: crypto4xx - properly set IV after de- and encrypt Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 49/70] mmc: sdhci: Fix data command CRC error handling Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 50/70] mmc: sdhci: Rename SDHCI_ACMD12_ERR and SDHCI_INT_ACMD12ERR Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 51/70] mmc: sdhci: Handle auto-command errors Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 52/70] modpost: file2alias: go back to simple devtable lookup Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 53/70] modpost: file2alias: check prototype of handler Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 54/70] tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 55/70] ipv6: frags: fix a lockdep false positive Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 56/70] net: IP defrag: encapsulate rbtree defrag code into callable functions Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 57/70] ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 58/70] net: IP6 defrag: use rbtrees for IPv6 defrag Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 59/70] net: IP6 defrag: use rbtrees in nf_conntrack_reasm.c Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 60/70] Revert "kbuild: use -Oz instead of -Os when using clang" Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 61/70] sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 62/70] device_cgroup: fix RCU imbalance in error case Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 63/70] mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 64/70] ALSA: info: Fix racy addition/deletion of nodes Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 65/70] percpu: stop printing kernel addresses Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 66/70] tools include: Adopt linux/bits.h Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 67/70] iomap: report collisions between directio and buffered writes to userspace Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 68/70] xfs: add the ability to join a held buffer to a defer_ops Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 69/70] xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute Greg Kroah-Hartman
2019-04-24 17:10 ` [PATCH 4.14 70/70] i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array Greg Kroah-Hartman
2019-04-24 22:05 ` [PATCH 4.14 00/70] 4.14.114-stable review kernelci.org bot
2019-04-25  5:58 ` Naresh Kamboju
2019-04-25 11:55 ` Jon Hunter
2019-04-25 16:25 ` shuah
2019-04-25 19:38 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190424170909.117118061@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcroce@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).