All of lore.kernel.org
 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,
	Pieter Jansen van Vuuren  <pieter.jansenvanvuuren@netronome.com>,
	Simon Horman <simon.horman@netronome.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.17 047/101] nfp: flower: fix mpls ether type detection
Date: Fri, 20 Jul 2018 14:13:53 +0200	[thread overview]
Message-ID: <20180720121425.018481590@linuxfoundation.org> (raw)
In-Reply-To: <20180720121422.837870592@linuxfoundation.org>

4.17-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>

[ Upstream commit a64119415ff248efa61301783bc26551df5dabf6 ]

Previously it was not possible to distinguish between mpls ether types and
other ether types. This leads to incorrect classification of offloaded
filters that match on mpls ether type. For example the following two
filters overlap:

 # tc filter add dev eth0 parent ffff: \
    protocol 0x8847 flower \
    action mirred egress redirect dev eth1

 # tc filter add dev eth0 parent ffff: \
    protocol 0x0800 flower \
    action mirred egress redirect dev eth2

The driver now correctly includes the mac_mpls layer where HW stores mpls
fields, when it detects an mpls ether type. It also sets the MPLS_Q bit to
indicate that the filter should match mpls packets.

Fixes: bb055c198d9b ("nfp: add mpls match offloading support")
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/netronome/nfp/flower/match.c   |   14 ++++++++++++++
 drivers/net/ethernet/netronome/nfp/flower/offload.c |    8 ++++++++
 2 files changed, 22 insertions(+)

--- a/drivers/net/ethernet/netronome/nfp/flower/match.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/match.c
@@ -123,6 +123,20 @@ nfp_flower_compile_mac(struct nfp_flower
 			 NFP_FLOWER_MASK_MPLS_Q;
 
 		frame->mpls_lse = cpu_to_be32(t_mpls);
+	} else if (dissector_uses_key(flow->dissector,
+				      FLOW_DISSECTOR_KEY_BASIC)) {
+		/* Check for mpls ether type and set NFP_FLOWER_MASK_MPLS_Q
+		 * bit, which indicates an mpls ether type but without any
+		 * mpls fields.
+		 */
+		struct flow_dissector_key_basic *key_basic;
+
+		key_basic = skb_flow_dissector_target(flow->dissector,
+						      FLOW_DISSECTOR_KEY_BASIC,
+						      flow->key);
+		if (key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_UC) ||
+		    key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_MC))
+			frame->mpls_lse = cpu_to_be32(NFP_FLOWER_MASK_MPLS_Q);
 	}
 }
 
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -264,6 +264,14 @@ nfp_flower_calculate_key_layers(struct n
 		case cpu_to_be16(ETH_P_ARP):
 			return -EOPNOTSUPP;
 
+		case cpu_to_be16(ETH_P_MPLS_UC):
+		case cpu_to_be16(ETH_P_MPLS_MC):
+			if (!(key_layer & NFP_FLOWER_LAYER_MAC)) {
+				key_layer |= NFP_FLOWER_LAYER_MAC;
+				key_size += sizeof(struct nfp_flower_mac_mpls);
+			}
+			break;
+
 		/* Will be included in layer 2. */
 		case cpu_to_be16(ETH_P_8021Q):
 			break;



  parent reply	other threads:[~2018-07-20 12:41 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 12:13 [PATCH 4.17 000/101] 4.17.9-stable review Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 001/101] compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations Greg Kroah-Hartman
2018-07-20 12:13   ` Greg Kroah-Hartman
2018-07-20 12:13 ` Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 002/101] x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h> Greg Kroah-Hartman
2018-07-20 12:13   ` Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 003/101] x86/paravirt: Make native_save_fl() extern inline Greg Kroah-Hartman
2018-07-20 12:13 ` Greg Kroah-Hartman
2018-07-20 12:13   ` Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 005/101] pinctrl: mt7622: fix error path on failing at groups building Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 006/101] pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 007/101] pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 008/101] alx: take rtnl before calling __alx_open from resume Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 010/101] atm: zatm: Fix potential Spectre v1 Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 011/101] hv_netvsc: split sub-channel setup into async and sync Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 012/101] ipv6: sr: fix passing wrong flags to crypto_alloc_shash() Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 013/101] ipvlan: fix IFLA_MTU ignored on NEWLINK Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 014/101] ixgbe: split XDP_TX tail and XDP_REDIRECT map flushing Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 015/101] net: dccp: avoid crash in ccid3_hc_rx_send_feedback() Greg Kroah-Hartman
2018-07-20 12:13   ` Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 016/101] net: dccp: switch rx_tstamp_last_feedback to monotonic clock Greg Kroah-Hartman
2018-07-20 12:13   ` Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 017/101] net: fix use-after-free in GRO with ESP Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 018/101] net: macb: Fix ptp time adjustment for large negative delta Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 019/101] net/mlx5e: Avoid dealing with vport representors if not being e-switch manager Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 020/101] net/mlx5e: Dont attempt to dereference the ppriv struct if not being eswitch manager Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 021/101] net/mlx5: E-Switch, Avoid setup attempt if not being e-switch manager Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 022/101] net/mlx5: Fix command interface race in polling mode Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 023/101] net/mlx5: Fix incorrect raw command length parsing Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 024/101] net/mlx5: Fix required capability for manipulating MPFS Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 025/101] net/mlx5: Fix wrong size allocation for QoS ETC TC regitster Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 026/101] net: mvneta: fix the Rx desc DMA address in the Rx path Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 027/101] net/packet: fix use-after-free Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 028/101] net/sched: act_ife: fix recursive lock and idr leak Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 029/101] net/sched: act_ife: preserve the action control in case of error Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 030/101] net_sched: blackhole: tell upper qdisc about dropped packets Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 031/101] net: sungem: fix rx checksum support Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 032/101] net/tcp: Fix socket lookups with SO_BINDTODEVICE Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 033/101] qede: Adverstise software timestamp caps when PHC is not available Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 034/101] qed: Fix setting of incorrect eswitch mode Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 035/101] qed: Fix use of incorrect size in memcpy call Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 036/101] qed: Limit msix vectors in kdump kernel to the minimum required count Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 038/101] r8152: napi hangup fix after disconnect Greg Kroah-Hartman
2018-07-20 12:13   ` [4.17,038/101] " Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 039/101] s390/qeth: dont clobber buffer on async TX completion Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 040/101] stmmac: fix DMA channel hang in half-duplex mode Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 041/101] strparser: Remove early eaten to fix full tcp receive buffer stall Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 042/101] tcp: fix Fast Open key endianness Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 044/101] vhost_net: validate sock before trying to put its fd Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 045/101] VSOCK: fix loopback on big-endian systems Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 046/101] hinic: reset irq affinity before freeing irq Greg Kroah-Hartman
2018-07-20 12:13 ` Greg Kroah-Hartman [this message]
2018-07-20 12:13   ` [PATCH 4.17 047/101] nfp: flower: fix mpls ether type detection Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 048/101] net: macb: initialize bp->queues[0].bp for at91rm9200 Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 049/101] net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 050/101] nfp: reject binding to shared blocks Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 051/101] xen-netfront: Fix mismatched rtnl_unlock Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 052/101] xen-netfront: Update features after registering netdev Greg Kroah-Hartman
2018-07-20 12:13 ` [PATCH 4.17 053/101] enic: do not overwrite error code Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 055/101] IB/mlx5: Avoid dealing with vport representors if not being e-switch manager Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 056/101] Revert "s390/qeth: use Read device to query hypervisor for MAC" Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 057/101] s390/qeth: avoid using is_multicast_ether_addr_64bits on (u8 *)[6] Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 058/101] s390/qeth: fix race when setting MAC address Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 059/101] sfc: correctly initialise filter rwsem for farch Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 060/101] virtio_net: split XDP_TX kick and XDP_REDIRECT map flushing Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 061/101] x86/kvm/Kconfig: Ensure CRYPTO_DEV_CCP_DD state at minimum matches KVM_AMD Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 062/101] net: cxgb3_main: fix potential Spectre v1 Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 063/101] rtlwifi: Fix kernel Oops "Fw download fail!!" Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 064/101] rtlwifi: rtl8821ae: fix firmware is not ready to run Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 065/101] net: lan78xx: Fix race in tx pending skb size calculation Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 066/101] crypto: af_alg - Initialize sg_num_bytes in error code path Greg Kroah-Hartman
2018-07-20 13:08   ` KMSAN: uninit-value in af_alg_free_areq_sgls syzbot
2018-07-20 12:14 ` [PATCH 4.17 067/101] PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg() Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 068/101] netfilter: ebtables: reject non-bridge targets Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 069/101] reiserfs: fix buffer overflow with long warning messages Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 070/101] KEYS: DNS: fix parsing multiple options Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 071/101] tls: Stricter error checking in zerocopy sendmsg path Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 072/101] autofs: fix slab out of bounds read in getname_kernel() Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 073/101] nsh: set mac len based on inner packet Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 074/101] netfilter: ipv6: nf_defrag: drop skb dst before queueing Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 075/101] bdi: Fix another oops in wb_workfn() Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 076/101] bpf: reject any prog that failed read-only lock Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 077/101] rds: avoid unenecessary cong_update in loop transport Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 078/101] block: dont use blocking queue entered for recursive bio submits Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 079/101] bpf: sockmap, fix crash when ipv6 sock is added Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 080/101] bpf: sockmap, consume_skb in close path Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 081/101] bpf: dont leave partial mangled prog in jit_subprogs error path Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 082/101] net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 083/101] ipvs: initialize tbl->entries after allocation Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 084/101] ipvs: initialize tbl->entries in ip_vs_lblc_init_svc() Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 085/101] arm/arm64: smccc: Add SMCCC-specific return codes Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 086/101] arm64: Call ARCH_WORKAROUND_2 on transitions between EL0 and EL1 Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 087/101] arm64: Add per-cpu infrastructure to call ARCH_WORKAROUND_2 Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 088/101] arm64: Add ARCH_WORKAROUND_2 probing Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 089/101] arm64: Add ssbd command-line option Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 090/101] arm64: ssbd: Add global mitigation state accessor Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 091/101] arm64: ssbd: Skip apply_ssbd if not using dynamic mitigation Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 092/101] arm64: ssbd: Restore mitigation status on CPU resume Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 093/101] arm64: ssbd: Introduce thread flag to control userspace mitigation Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 094/101] arm64: ssbd: Add prctl interface for per-thread mitigation Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 095/101] arm64: KVM: Add HYP per-cpu accessors Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 096/101] arm64: KVM: Add ARCH_WORKAROUND_2 support for guests Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 097/101] arm64: KVM: Handle guests ARCH_WORKAROUND_2 requests Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 098/101] arm64: KVM: Add ARCH_WORKAROUND_2 discovery through ARCH_FEATURES_FUNC_ID Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 099/101] bpf: enforce correct alignment for instructions Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 100/101] bpf, arm32: fix to use bpf_jit_binary_lock_ro api Greg Kroah-Hartman
2018-07-20 12:14 ` [PATCH 4.17 101/101] bpf: undo prog rejection on read-only lock failure Greg Kroah-Hartman
2018-07-21  7:54 ` [PATCH 4.17 000/101] 4.17.9-stable review Naresh Kamboju
2018-07-22 11:42   ` Greg Kroah-Hartman
2018-07-21 13:42 ` 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=20180720121425.018481590@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pieter.jansenvanvuuren@netronome.com \
    --cc=simon.horman@netronome.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.