--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Wei Wang <weiwan@google.com>
+Date: Wed, 16 Oct 2019 12:03:15 -0700
+Subject: ipv4: fix race condition between route lookup and invalidation
+
+From: Wei Wang <weiwan@google.com>
+
+[ Upstream commit 5018c59607a511cdee743b629c76206d9c9e6d7b ]
+
+Jesse and Ido reported the following race condition:
+<CPU A, t0> - Received packet A is forwarded and cached dst entry is
+taken from the nexthop ('nhc->nhc_rth_input'). Calls skb_dst_set()
+
+<t1> - Given Jesse has busy routers ("ingesting full BGP routing tables
+from multiple ISPs"), route is added / deleted and rt_cache_flush() is
+called
+
+<CPU B, t2> - Received packet B tries to use the same cached dst entry
+from t0, but rt_cache_valid() is no longer true and it is replaced in
+rt_cache_route() by the newer one. This calls dst_dev_put() on the
+original dst entry which assigns the blackhole netdev to 'dst->dev'
+
+<CPU A, t3> - dst_input(skb) is called on packet A and it is dropped due
+to 'dst->dev' being the blackhole netdev
+
+There are 2 issues in the v4 routing code:
+1. A per-netns counter is used to do the validation of the route. That
+means whenever a route is changed in the netns, users of all routes in
+the netns needs to redo lookup. v6 has an implementation of only
+updating fn_sernum for routes that are affected.
+2. When rt_cache_valid() returns false, rt_cache_route() is called to
+throw away the current cache, and create a new one. This seems
+unnecessary because as long as this route does not change, the route
+cache does not need to be recreated.
+
+To fully solve the above 2 issues, it probably needs quite some code
+changes and requires careful testing, and does not suite for net branch.
+
+So this patch only tries to add the deleted cached rt into the uncached
+list, so user could still be able to use it to receive packets until
+it's done.
+
+Fixes: 95c47f9cf5e0 ("ipv4: call dst_dev_put() properly")
+Signed-off-by: Wei Wang <weiwan@google.com>
+Reported-by: Ido Schimmel <idosch@idosch.org>
+Reported-by: Jesse Hathaway <jesse@mbuki-mvuki.org>
+Tested-by: Jesse Hathaway <jesse@mbuki-mvuki.org>
+Acked-by: Martin KaFai Lau <kafai@fb.com>
+Cc: David Ahern <dsahern@gmail.com>
+Reviewed-by: Ido Schimmel <idosch@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/route.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/route.c
++++ b/net/ipv4/route.c
+@@ -1482,7 +1482,7 @@ static bool rt_cache_route(struct fib_nh
+ prev = cmpxchg(p, orig, rt);
+ if (prev == orig) {
+ if (orig) {
+- dst_dev_put(&orig->dst);
++ rt_add_uncached_list(orig);
+ dst_release(&orig->dst);
+ }
+ } else {
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Stefano Brivio <sbrivio@redhat.com>
+Date: Wed, 16 Oct 2019 20:52:09 +0200
+Subject: ipv4: Return -ENETUNREACH if we can't create route but saddr is valid
+
+From: Stefano Brivio <sbrivio@redhat.com>
+
+[ Upstream commit 595e0651d0296bad2491a4a29a7a43eae6328b02 ]
+
+...instead of -EINVAL. An issue was found with older kernel versions
+while unplugging a NFS client with pending RPCs, and the wrong error
+code here prevented it from recovering once link is back up with a
+configured address.
+
+Incidentally, this is not an issue anymore since commit 4f8943f80883
+("SUNRPC: Replace direct task wakeups from softirq context"), included
+in 5.2-rc7, had the effect of decoupling the forwarding of this error
+by using SO_ERROR in xs_wake_error(), as pointed out by Benjamin
+Coddington.
+
+To the best of my knowledge, this isn't currently causing any further
+issue, but the error code doesn't look appropriate anyway, and we
+might hit this in other paths as well.
+
+In detail, as analysed by Gonzalo Siero, once the route is deleted
+because the interface is down, and can't be resolved and we return
+-EINVAL here, this ends up, courtesy of inet_sk_rebuild_header(),
+as the socket error seen by tcp_write_err(), called by
+tcp_retransmit_timer().
+
+In turn, tcp_write_err() indirectly calls xs_error_report(), which
+wakes up the RPC pending tasks with a status of -EINVAL. This is then
+seen by call_status() in the SUN RPC implementation, which aborts the
+RPC call calling rpc_exit(), instead of handling this as a
+potentially temporary condition, i.e. as a timeout.
+
+Return -EINVAL only if the input parameters passed to
+ip_route_output_key_hash_rcu() are actually invalid (this is the case
+if the specified source address is multicast, limited broadcast or
+all zeroes), but return -ENETUNREACH in all cases where, at the given
+moment, the given source address doesn't allow resolving the route.
+
+While at it, drop the initialisation of err to -ENETUNREACH, which
+was added to __ip_route_output_key() back then by commit
+0315e3827048 ("net: Fix behaviour of unreachable, blackhole and
+prohibit routes"), but actually had no effect, as it was, and is,
+overwritten by the fib_lookup() return code assignment, and anyway
+ignored in all other branches, including the if (fl4->saddr) one:
+I find this rather confusing, as it would look like -ENETUNREACH is
+the "default" error, while that statement has no effect.
+
+Also note that after commit fc75fc8339e7 ("ipv4: dont create routes
+on down devices"), we would get -ENETUNREACH if the device is down,
+but -EINVAL if the source address is specified and we can't resolve
+the route, and this appears to be rather inconsistent.
+
+Reported-by: Stefan Walter <walteste@inf.ethz.ch>
+Analysed-by: Benjamin Coddington <bcodding@redhat.com>
+Analysed-by: Gonzalo Siero <gsierohu@redhat.com>
+Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/route.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/net/ipv4/route.c
++++ b/net/ipv4/route.c
+@@ -2470,14 +2470,17 @@ struct rtable *ip_route_output_key_hash_
+ int orig_oif = fl4->flowi4_oif;
+ unsigned int flags = 0;
+ struct rtable *rth;
+- int err = -ENETUNREACH;
++ int err;
+
+ if (fl4->saddr) {
+- rth = ERR_PTR(-EINVAL);
+ if (ipv4_is_multicast(fl4->saddr) ||
+ ipv4_is_lbcast(fl4->saddr) ||
+- ipv4_is_zeronet(fl4->saddr))
++ ipv4_is_zeronet(fl4->saddr)) {
++ rth = ERR_PTR(-EINVAL);
+ goto out;
++ }
++
++ rth = ERR_PTR(-ENETUNREACH);
+
+ /* I removed check for oif == dev_out->oif here.
+ It was wrong for two reasons:
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+Date: Fri, 11 Oct 2019 13:45:23 +0000
+Subject: net: aquantia: correctly handle macvlan and multicast coexistence
+
+From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+
+[ Upstream commit 9f051db566da1e8110659ab4ab188af1c2510bb4 ]
+
+macvlan and multicast handling is now mixed up.
+The explicit issue is that macvlan interface gets broken (no traffic)
+after clearing MULTICAST flag on the real interface.
+
+We now do separate logic and consider both ALLMULTI and MULTICAST
+flags on the device.
+
+Fixes: 11ba961c9161 ("net: aquantia: Fix IFF_ALLMULTI flag functionality")
+Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/aquantia/atlantic/aq_main.c | 4 -
+ drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 32 +++++++-------
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 7 +--
+ 3 files changed, 21 insertions(+), 22 deletions(-)
+
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
+@@ -194,9 +194,7 @@ static void aq_ndev_set_multicast_settin
+ {
+ struct aq_nic_s *aq_nic = netdev_priv(ndev);
+
+- aq_nic_set_packet_filter(aq_nic, ndev->flags);
+-
+- aq_nic_set_multicast_list(aq_nic, ndev);
++ (void)aq_nic_set_multicast_list(aq_nic, ndev);
+ }
+
+ static int aq_ndo_vlan_rx_add_vid(struct net_device *ndev, __be16 proto,
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+@@ -631,9 +631,12 @@ err_exit:
+
+ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev)
+ {
+- unsigned int packet_filter = self->packet_filter;
++ const struct aq_hw_ops *hw_ops = self->aq_hw_ops;
++ struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg;
++ unsigned int packet_filter = ndev->flags;
+ struct netdev_hw_addr *ha = NULL;
+ unsigned int i = 0U;
++ int err = 0;
+
+ self->mc_list.count = 0;
+ if (netdev_uc_count(ndev) > AQ_HW_MULTICAST_ADDRESS_MAX) {
+@@ -641,29 +644,26 @@ int aq_nic_set_multicast_list(struct aq_
+ } else {
+ netdev_for_each_uc_addr(ha, ndev) {
+ ether_addr_copy(self->mc_list.ar[i++], ha->addr);
+-
+- if (i >= AQ_HW_MULTICAST_ADDRESS_MAX)
+- break;
+ }
+ }
+
+- if (i + netdev_mc_count(ndev) > AQ_HW_MULTICAST_ADDRESS_MAX) {
+- packet_filter |= IFF_ALLMULTI;
+- } else {
+- netdev_for_each_mc_addr(ha, ndev) {
+- ether_addr_copy(self->mc_list.ar[i++], ha->addr);
+-
+- if (i >= AQ_HW_MULTICAST_ADDRESS_MAX)
+- break;
++ cfg->is_mc_list_enabled = !!(packet_filter & IFF_MULTICAST);
++ if (cfg->is_mc_list_enabled) {
++ if (i + netdev_mc_count(ndev) > AQ_HW_MULTICAST_ADDRESS_MAX) {
++ packet_filter |= IFF_ALLMULTI;
++ } else {
++ netdev_for_each_mc_addr(ha, ndev) {
++ ether_addr_copy(self->mc_list.ar[i++],
++ ha->addr);
++ }
+ }
+ }
+
+ if (i > 0 && i <= AQ_HW_MULTICAST_ADDRESS_MAX) {
+- packet_filter |= IFF_MULTICAST;
+ self->mc_list.count = i;
+- self->aq_hw_ops->hw_multicast_list_set(self->aq_hw,
+- self->mc_list.ar,
+- self->mc_list.count);
++ err = hw_ops->hw_multicast_list_set(self->aq_hw,
++ self->mc_list.ar,
++ self->mc_list.count);
+ }
+ return aq_nic_set_packet_filter(self, packet_filter);
+ }
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+@@ -818,14 +818,15 @@ static int hw_atl_b0_hw_packet_filter_se
+ cfg->is_vlan_force_promisc);
+
+ hw_atl_rpfl2multicast_flr_en_set(self,
+- IS_FILTER_ENABLED(IFF_ALLMULTI), 0);
++ IS_FILTER_ENABLED(IFF_ALLMULTI) &&
++ IS_FILTER_ENABLED(IFF_MULTICAST), 0);
+
+ hw_atl_rpfl2_accept_all_mc_packets_set(self,
+- IS_FILTER_ENABLED(IFF_ALLMULTI));
++ IS_FILTER_ENABLED(IFF_ALLMULTI) &&
++ IS_FILTER_ENABLED(IFF_MULTICAST));
+
+ hw_atl_rpfl2broadcast_en_set(self, IS_FILTER_ENABLED(IFF_BROADCAST));
+
+- cfg->is_mc_list_enabled = IS_FILTER_ENABLED(IFF_MULTICAST);
+
+ for (i = HW_ATL_B0_MAC_MIN; i < HW_ATL_B0_MAC_MAX; ++i)
+ hw_atl_rpfl2_uc_flr_en_set(self,
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+Date: Fri, 11 Oct 2019 13:45:22 +0000
+Subject: net: aquantia: do not pass lro session with invalid tcp checksum
+
+From: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+
+[ Upstream commit d08b9a0a3ebdf71b0aabe576c7dd48e57e80e0f0 ]
+
+Individual descriptors on LRO TCP session should be checked
+for CRC errors. It was discovered that HW recalculates
+L4 checksums on LRO session and does not break it up on bad L4
+csum.
+
+Thus, driver should aggregate HW LRO L4 statuses from all individual
+buffers of LRO session and drop packet if one of the buffers has bad
+L4 checksum.
+
+Fixes: f38f1ee8aeb2 ("net: aquantia: check rx csum for all packets in LRO session")
+Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
+Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
+@@ -313,6 +313,7 @@ int aq_ring_rx_clean(struct aq_ring_s *s
+ break;
+
+ buff->is_error |= buff_->is_error;
++ buff->is_cso_err |= buff_->is_cso_err;
+
+ } while (!buff_->is_eop);
+
+@@ -320,7 +321,7 @@ int aq_ring_rx_clean(struct aq_ring_s *s
+ err = 0;
+ goto err_exit;
+ }
+- if (buff->is_error) {
++ if (buff->is_error || buff->is_cso_err) {
+ buff_ = buff;
+ do {
+ next_ = buff_->next,
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Igor Russkikh <Igor.Russkikh@aquantia.com>
+Date: Fri, 11 Oct 2019 13:45:19 +0000
+Subject: net: aquantia: temperature retrieval fix
+
+From: Igor Russkikh <Igor.Russkikh@aquantia.com>
+
+[ Upstream commit 06b0d7fe7e5ff3ba4c7e265ef41135e8bcc232bb ]
+
+Chip temperature is a two byte word, colocated internally with cable
+length data. We do all readouts from HW memory by dwords, thus
+we should clear extra high bytes, otherwise temperature output
+gets weird as soon as we attach a cable to the NIC.
+
+Fixes: 8f8940118654 ("net: aquantia: add infrastructure to readout chip temperature")
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+@@ -337,7 +337,7 @@ static int aq_fw2x_get_phy_temp(struct a
+ /* Convert PHY temperature from 1/256 degree Celsius
+ * to 1/1000 degree Celsius.
+ */
+- *temp = temp_res * 1000 / 256;
++ *temp = (temp_res & 0xFFFF) * 1000 / 256;
+
+ return 0;
+ }
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Igor Russkikh <Igor.Russkikh@aquantia.com>
+Date: Fri, 11 Oct 2019 13:45:20 +0000
+Subject: net: aquantia: when cleaning hw cache it should be toggled
+
+From: Igor Russkikh <Igor.Russkikh@aquantia.com>
+
+[ Upstream commit ed4d81c4b3f28ccf624f11fd66f67aec5b58859c ]
+
+>From HW specification to correctly reset HW caches (this is a required
+workaround when stopping the device), register bit should actually
+be toggled.
+
+It was previosly always just set. Due to the way driver stops HW this
+never actually caused any issues, but it still may, so cleaning this up.
+
+Fixes: 7a1bb49461b1 ("net: aquantia: fix potential IOMMU fault after driver unbind")
+Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 16 +++++++-
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | 17 +++++++-
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h | 7 ++-
+ drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 19 ++++++++++
+ 4 files changed, 53 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+@@ -968,14 +968,26 @@ static int hw_atl_b0_hw_interrupt_modera
+
+ static int hw_atl_b0_hw_stop(struct aq_hw_s *self)
+ {
++ int err;
++ u32 val;
++
+ hw_atl_b0_hw_irq_disable(self, HW_ATL_B0_INT_MASK);
+
+ /* Invalidate Descriptor Cache to prevent writing to the cached
+ * descriptors and to the data pointer of those descriptors
+ */
+- hw_atl_rdm_rx_dma_desc_cache_init_set(self, 1);
++ hw_atl_rdm_rx_dma_desc_cache_init_tgl(self);
++
++ err = aq_hw_err_from_flags(self);
++
++ if (err)
++ goto err_exit;
++
++ readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get,
++ self, val, val == 1, 1000U, 10000U);
+
+- return aq_hw_err_from_flags(self);
++err_exit:
++ return err;
+ }
+
+ static int hw_atl_b0_hw_ring_tx_stop(struct aq_hw_s *self,
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
+@@ -606,12 +606,25 @@ void hw_atl_rpb_rx_flow_ctl_mode_set(str
+ HW_ATL_RPB_RX_FC_MODE_SHIFT, rx_flow_ctl_mode);
+ }
+
+-void hw_atl_rdm_rx_dma_desc_cache_init_set(struct aq_hw_s *aq_hw, u32 init)
++void hw_atl_rdm_rx_dma_desc_cache_init_tgl(struct aq_hw_s *aq_hw)
+ {
++ u32 val;
++
++ val = aq_hw_read_reg_bit(aq_hw, HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_ADR,
++ HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_MSK,
++ HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_SHIFT);
++
+ aq_hw_write_reg_bit(aq_hw, HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_ADR,
+ HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_MSK,
+ HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_SHIFT,
+- init);
++ val ^ 1);
++}
++
++u32 hw_atl_rdm_rx_dma_desc_cache_init_done_get(struct aq_hw_s *aq_hw)
++{
++ return aq_hw_read_reg_bit(aq_hw, RDM_RX_DMA_DESC_CACHE_INIT_DONE_ADR,
++ RDM_RX_DMA_DESC_CACHE_INIT_DONE_MSK,
++ RDM_RX_DMA_DESC_CACHE_INIT_DONE_SHIFT);
+ }
+
+ void hw_atl_rpb_rx_pkt_buff_size_per_tc_set(struct aq_hw_s *aq_hw,
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
+@@ -313,8 +313,11 @@ void hw_atl_rpb_rx_pkt_buff_size_per_tc_
+ u32 rx_pkt_buff_size_per_tc,
+ u32 buffer);
+
+-/* set rdm rx dma descriptor cache init */
+-void hw_atl_rdm_rx_dma_desc_cache_init_set(struct aq_hw_s *aq_hw, u32 init);
++/* toggle rdm rx dma descriptor cache init */
++void hw_atl_rdm_rx_dma_desc_cache_init_tgl(struct aq_hw_s *aq_hw);
++
++/* get rdm rx dma descriptor cache init done */
++u32 hw_atl_rdm_rx_dma_desc_cache_init_done_get(struct aq_hw_s *aq_hw);
+
+ /* set rx xoff enable (per tc) */
+ void hw_atl_rpb_rx_xoff_en_per_tc_set(struct aq_hw_s *aq_hw, u32 rx_xoff_en_per_tc,
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
+@@ -318,6 +318,25 @@
+ /* default value of bitfield rdm_desc_init_i */
+ #define HW_ATL_RDM_RX_DMA_DESC_CACHE_INIT_DEFAULT 0x0
+
++/* rdm_desc_init_done_i bitfield definitions
++ * preprocessor definitions for the bitfield rdm_desc_init_done_i.
++ * port="pif_rdm_desc_init_done_i"
++ */
++
++/* register address for bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_ADR 0x00005a10
++/* bitmask for bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_MSK 0x00000001U
++/* inverted bitmask for bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_MSKN 0xfffffffe
++/* lower bit position of bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_SHIFT 0U
++/* width of bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_WIDTH 1
++/* default value of bitfield rdm_desc_init_done_i */
++#define RDM_RX_DMA_DESC_CACHE_INIT_DONE_DEFAULT 0x0
++
++
+ /* rx int_desc_wrb_en bitfield definitions
+ * preprocessor definitions for the bitfield "int_desc_wrb_en".
+ * port="pif_rdm_int_desc_wrb_en_i"
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Davide Caratti <dcaratti@redhat.com>
+Date: Sat, 12 Oct 2019 13:55:06 +0200
+Subject: net: avoid errors when trying to pop MLPS header on non-MPLS packets
+
+From: Davide Caratti <dcaratti@redhat.com>
+
+[ Upstream commit dedc5a08da07874c6e0d411e7f39c5c2cf137014 ]
+
+the following script:
+
+ # tc qdisc add dev eth0 clsact
+ # tc filter add dev eth0 egress matchall action mpls pop
+
+implicitly makes the kernel drop all packets transmitted by eth0, if they
+don't have a MPLS header. This behavior is uncommon: other encapsulations
+(like VLAN) just let the packet pass unmodified. Since the result of MPLS
+'pop' operation would be the same regardless of the presence / absence of
+MPLS header(s) in the original packet, we can let skb_mpls_pop() return 0
+when dealing with non-MPLS packets.
+
+For the OVS use-case, this is acceptable because __ovs_nla_copy_actions()
+already ensures that MPLS 'pop' operation only occurs with packets having
+an MPLS Ethernet type (and there are no other callers in current code, so
+the semantic change should be ok).
+
+v2: better documentation of use-cases for skb_mpls_pop(), thanks to Simon
+ Horman
+
+Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
+Reviewed-by: Simon Horman <simon.horman@netronome.com>
+Acked-by: John Hurley <john.hurley@netronome.com>
+Signed-off-by: Davide Caratti <dcaratti@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/skbuff.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/core/skbuff.c
++++ b/net/core/skbuff.c
+@@ -5524,7 +5524,7 @@ int skb_mpls_pop(struct sk_buff *skb, __
+ int err;
+
+ if (unlikely(!eth_p_mpls(skb->protocol)))
+- return -EINVAL;
++ return 0;
+
+ err = skb_ensure_writable(skb, skb->mac_len + MPLS_HLEN);
+ if (unlikely(err))
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Eric Dumazet <edumazet@google.com>
+Date: Mon, 14 Oct 2019 11:22:30 -0700
+Subject: net: avoid potential infinite loop in tc_ctl_action()
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 39f13ea2f61b439ebe0060393e9c39925c9ee28c ]
+
+tc_ctl_action() has the ability to loop forever if tcf_action_add()
+returns -EAGAIN.
+
+This special case has been done in case a module needed to be loaded,
+but it turns out that tcf_add_notify() could also return -EAGAIN
+if the socket sk_rcvbuf limit is hit.
+
+We need to separate the two cases, and only loop for the module
+loading case.
+
+While we are at it, add a limit of 10 attempts since unbounded
+loops are always scary.
+
+syzbot repro was something like :
+
+socket(PF_NETLINK, SOCK_RAW|SOCK_NONBLOCK, NETLINK_ROUTE) = 3
+write(3, ..., 38) = 38
+setsockopt(3, SOL_SOCKET, SO_RCVBUF, [0], 4) = 0
+sendmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{..., 388}], msg_controllen=0, msg_flags=0x10}, ...)
+
+NMI backtrace for cpu 0
+CPU: 0 PID: 1054 Comm: khungtaskd Not tainted 5.4.0-rc1+ #0
+Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+Call Trace:
+ __dump_stack lib/dump_stack.c:77 [inline]
+ dump_stack+0x172/0x1f0 lib/dump_stack.c:113
+ nmi_cpu_backtrace.cold+0x70/0xb2 lib/nmi_backtrace.c:101
+ nmi_trigger_cpumask_backtrace+0x23b/0x28b lib/nmi_backtrace.c:62
+ arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
+ trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
+ check_hung_uninterruptible_tasks kernel/hung_task.c:205 [inline]
+ watchdog+0x9d0/0xef0 kernel/hung_task.c:289
+ kthread+0x361/0x430 kernel/kthread.c:255
+ ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
+Sending NMI from CPU 0 to CPUs 1:
+NMI backtrace for cpu 1
+CPU: 1 PID: 8859 Comm: syz-executor910 Not tainted 5.4.0-rc1+ #0
+Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
+RIP: 0010:arch_local_save_flags arch/x86/include/asm/paravirt.h:751 [inline]
+RIP: 0010:lockdep_hardirqs_off+0x1df/0x2e0 kernel/locking/lockdep.c:3453
+Code: 5c 08 00 00 5b 41 5c 41 5d 5d c3 48 c7 c0 58 1d f3 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 d3 00 00 00 <48> 83 3d 21 9e 99 07 00 0f 84 b9 00 00 00 9c 58 0f 1f 44 00 00 f6
+RSP: 0018:ffff8880a6f3f1b8 EFLAGS: 00000046
+RAX: 1ffffffff11e63ab RBX: ffff88808c9c6080 RCX: 0000000000000000
+RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88808c9c6914
+RBP: ffff8880a6f3f1d0 R08: ffff88808c9c6080 R09: fffffbfff16be5d1
+R10: fffffbfff16be5d0 R11: 0000000000000003 R12: ffffffff8746591f
+R13: ffff88808c9c6080 R14: ffffffff8746591f R15: 0000000000000003
+FS: 00000000011e4880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: ffffffffff600400 CR3: 00000000a8920000 CR4: 00000000001406e0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+Call Trace:
+ trace_hardirqs_off+0x62/0x240 kernel/trace/trace_preemptirq.c:45
+ __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
+ _raw_spin_lock_irqsave+0x6f/0xcd kernel/locking/spinlock.c:159
+ __wake_up_common_lock+0xc8/0x150 kernel/sched/wait.c:122
+ __wake_up+0xe/0x10 kernel/sched/wait.c:142
+ netlink_unlock_table net/netlink/af_netlink.c:466 [inline]
+ netlink_unlock_table net/netlink/af_netlink.c:463 [inline]
+ netlink_broadcast_filtered+0x705/0xb80 net/netlink/af_netlink.c:1514
+ netlink_broadcast+0x3a/0x50 net/netlink/af_netlink.c:1534
+ rtnetlink_send+0xdd/0x110 net/core/rtnetlink.c:714
+ tcf_add_notify net/sched/act_api.c:1343 [inline]
+ tcf_action_add+0x243/0x370 net/sched/act_api.c:1362
+ tc_ctl_action+0x3b5/0x4bc net/sched/act_api.c:1410
+ rtnetlink_rcv_msg+0x463/0xb00 net/core/rtnetlink.c:5386
+ netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477
+ rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5404
+ netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
+ netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328
+ netlink_sendmsg+0x8a5/0xd60 net/netlink/af_netlink.c:1917
+ sock_sendmsg_nosec net/socket.c:637 [inline]
+ sock_sendmsg+0xd7/0x130 net/socket.c:657
+ ___sys_sendmsg+0x803/0x920 net/socket.c:2311
+ __sys_sendmsg+0x105/0x1d0 net/socket.c:2356
+ __do_sys_sendmsg net/socket.c:2365 [inline]
+ __se_sys_sendmsg net/socket.c:2363 [inline]
+ __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2363
+ do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+RIP: 0033:0x440939
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reported-by: syzbot+cf0adbb9c28c8866c788@syzkaller.appspotmail.com
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/act_api.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/net/sched/act_api.c
++++ b/net/sched/act_api.c
+@@ -1353,11 +1353,16 @@ static int tcf_action_add(struct net *ne
+ struct netlink_ext_ack *extack)
+ {
+ size_t attr_size = 0;
+- int ret = 0;
++ int loop, ret;
+ struct tc_action *actions[TCA_ACT_MAX_PRIO] = {};
+
+- ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0, actions,
+- &attr_size, true, extack);
++ for (loop = 0; loop < 10; loop++) {
++ ret = tcf_action_init(net, NULL, nla, NULL, NULL, ovr, 0,
++ actions, &attr_size, true, extack);
++ if (ret != -EAGAIN)
++ break;
++ }
++
+ if (ret < 0)
+ return ret;
+ ret = tcf_add_notify(net, n, actions, portid, attr_size, extack);
+@@ -1407,11 +1412,8 @@ static int tc_ctl_action(struct sk_buff
+ */
+ if (n->nlmsg_flags & NLM_F_REPLACE)
+ ovr = 1;
+-replay:
+ ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr,
+ extack);
+- if (ret == -EAGAIN)
+- goto replay;
+ break;
+ case RTM_DELACTION:
+ ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Tue, 15 Oct 2019 10:45:47 -0700
+Subject: net: bcmgenet: Fix RGMII_MODE_EN value for GENET v1/2/3
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+[ Upstream commit efb86fede98cdc70b674692ff617b1162f642c49 ]
+
+The RGMII_MODE_EN bit value was 0 for GENET versions 1 through 3, and
+became 6 for GENET v4 and above, account for that difference.
+
+Fixes: aa09677cba42 ("net: bcmgenet: add MDIO routines")
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Acked-by: Doug Berger <opendmb@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/broadcom/genet/bcmgenet.h | 1 +
+ drivers/net/ethernet/broadcom/genet/bcmmii.c | 6 +++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+@@ -366,6 +366,7 @@ struct bcmgenet_mib_counters {
+ #define EXT_PWR_DOWN_PHY_EN (1 << 20)
+
+ #define EXT_RGMII_OOB_CTRL 0x0C
++#define RGMII_MODE_EN_V123 (1 << 0)
+ #define RGMII_LINK (1 << 4)
+ #define OOB_DISABLE (1 << 5)
+ #define RGMII_MODE_EN (1 << 6)
+--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
+@@ -258,7 +258,11 @@ int bcmgenet_mii_config(struct net_devic
+ */
+ if (priv->ext_phy) {
+ reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
+- reg |= RGMII_MODE_EN | id_mode_dis;
++ reg |= id_mode_dis;
++ if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
++ reg |= RGMII_MODE_EN_V123;
++ else
++ reg |= RGMII_MODE_EN;
+ bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
+ }
+
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Fri, 11 Oct 2019 12:53:49 -0700
+Subject: net: bcmgenet: Set phydev->dev_flags only for internal PHYs
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+[ Upstream commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ]
+
+phydev->dev_flags is entirely dependent on the PHY device driver which
+is going to be used, setting the internal GENET PHY revision in those
+bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
+being used.
+
+Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Acked-by: Doug Berger <opendmb@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/broadcom/genet/bcmmii.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
+@@ -277,11 +277,12 @@ int bcmgenet_mii_probe(struct net_device
+ struct bcmgenet_priv *priv = netdev_priv(dev);
+ struct device_node *dn = priv->pdev->dev.of_node;
+ struct phy_device *phydev;
+- u32 phy_flags;
++ u32 phy_flags = 0;
+ int ret;
+
+ /* Communicate the integrated PHY revision */
+- phy_flags = priv->gphy_rev;
++ if (priv->internal_phy)
++ phy_flags = priv->gphy_rev;
+
+ /* Initialize link state variables that bcmgenet_mii_setup() uses */
+ priv->old_link = -1;
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Randy Dunlap <rdunlap@infradead.org>
+Date: Fri, 11 Oct 2019 21:03:33 -0700
+Subject: net: ethernet: broadcom: have drivers select DIMLIB as needed
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+[ Upstream commit ddc790e92b3afa4e366ffb41818cfcd19015031e ]
+
+NET_VENDOR_BROADCOM is intended to control a kconfig menu only.
+It should not have anything to do with code generation.
+As such, it should not select DIMLIB for all drivers under
+NET_VENDOR_BROADCOM. Instead each driver that needs DIMLIB should
+select it (being the symbols SYSTEMPORT, BNXT, and BCMGENET).
+
+Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1907021810220.13058@ramsan.of.borg/
+
+Fixes: 4f75da3666c0 ("linux/dim: Move implementation to .c files")
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
+Cc: Tal Gilboa <talgi@mellanox.com>
+Cc: Saeed Mahameed <saeedm@mellanox.com>
+Cc: netdev@vger.kernel.org
+Cc: linux-rdma@vger.kernel.org
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
+Cc: Doug Ledford <dledford@redhat.com>
+Cc: Jason Gunthorpe <jgg@mellanox.com>
+Cc: Leon Romanovsky <leonro@mellanox.com>
+Cc: Or Gerlitz <ogerlitz@mellanox.com>
+Cc: Sagi Grimberg <sagi@grimberg.me>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/broadcom/Kconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/Kconfig
++++ b/drivers/net/ethernet/broadcom/Kconfig
+@@ -8,7 +8,6 @@ config NET_VENDOR_BROADCOM
+ default y
+ depends on (SSB_POSSIBLE && HAS_DMA) || PCI || BCM63XX || \
+ SIBYTE_SB1xxx_SOC
+- select DIMLIB
+ ---help---
+ If you have a network (Ethernet) chipset belonging to this class,
+ say Y.
+@@ -69,6 +68,7 @@ config BCMGENET
+ select FIXED_PHY
+ select BCM7XXX_PHY
+ select MDIO_BCM_UNIMAC
++ select DIMLIB
+ help
+ This driver supports the built-in Ethernet MACs found in the
+ Broadcom BCM7xxx Set Top Box family chipset.
+@@ -188,6 +188,7 @@ config SYSTEMPORT
+ select MII
+ select PHYLIB
+ select FIXED_PHY
++ select DIMLIB
+ help
+ This driver supports the built-in Ethernet MACs found in the
+ Broadcom BCM7xxx Set Top Box family chipset using an internal
+@@ -200,6 +201,7 @@ config BNXT
+ select LIBCRC32C
+ select NET_DEVLINK
+ select PAGE_POOL
++ select DIMLIB
+ ---help---
+ This driver supports Broadcom NetXtreme-C/E 10/25/40/50 gigabit
+ Ethernet cards. To compile this driver as a module, choose M here:
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+Date: Tue, 15 Oct 2019 16:42:45 +0200
+Subject: net: i82596: fix dma_alloc_attr for sni_82596
+
+From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+
+[ Upstream commit 61c1d33daf7b5146f44d4363b3322f8cda6a6c43 ]
+
+Commit 7f683b920479 ("i825xx: switch to switch to dma_alloc_attrs")
+switched dma allocation over to dma_alloc_attr, but didn't convert
+the SNI part to request consistent DMA memory. This broke sni_82596
+since driver doesn't do dma_cache_sync for performance reasons.
+Fix this by using different DMA_ATTRs for lasi_82596 and sni_82596.
+
+Fixes: 7f683b920479 ("i825xx: switch to switch to dma_alloc_attrs")
+Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/i825xx/lasi_82596.c | 4 +++-
+ drivers/net/ethernet/i825xx/lib82596.c | 4 ++--
+ drivers/net/ethernet/i825xx/sni_82596.c | 4 +++-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/i825xx/lasi_82596.c
++++ b/drivers/net/ethernet/i825xx/lasi_82596.c
+@@ -96,6 +96,8 @@
+
+ #define OPT_SWAP_PORT 0x0001 /* Need to wordswp on the MPU port */
+
++#define LIB82596_DMA_ATTR DMA_ATTR_NON_CONSISTENT
++
+ #define DMA_WBACK(ndev, addr, len) \
+ do { dma_cache_sync((ndev)->dev.parent, (void *)addr, len, DMA_TO_DEVICE); } while (0)
+
+@@ -200,7 +202,7 @@ static int __exit lan_remove_chip(struct
+
+ unregister_netdev (dev);
+ dma_free_attrs(&pdev->dev, sizeof(struct i596_private), lp->dma,
+- lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
++ lp->dma_addr, LIB82596_DMA_ATTR);
+ free_netdev (dev);
+ return 0;
+ }
+--- a/drivers/net/ethernet/i825xx/lib82596.c
++++ b/drivers/net/ethernet/i825xx/lib82596.c
+@@ -1065,7 +1065,7 @@ static int i82596_probe(struct net_devic
+
+ dma = dma_alloc_attrs(dev->dev.parent, sizeof(struct i596_dma),
+ &lp->dma_addr, GFP_KERNEL,
+- DMA_ATTR_NON_CONSISTENT);
++ LIB82596_DMA_ATTR);
+ if (!dma) {
+ printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
+ return -ENOMEM;
+@@ -1087,7 +1087,7 @@ static int i82596_probe(struct net_devic
+ i = register_netdev(dev);
+ if (i) {
+ dma_free_attrs(dev->dev.parent, sizeof(struct i596_dma),
+- dma, lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
++ dma, lp->dma_addr, LIB82596_DMA_ATTR);
+ return i;
+ }
+
+--- a/drivers/net/ethernet/i825xx/sni_82596.c
++++ b/drivers/net/ethernet/i825xx/sni_82596.c
+@@ -24,6 +24,8 @@
+
+ static const char sni_82596_string[] = "snirm_82596";
+
++#define LIB82596_DMA_ATTR 0
++
+ #define DMA_WBACK(priv, addr, len) do { } while (0)
+ #define DMA_INV(priv, addr, len) do { } while (0)
+ #define DMA_WBACK_INV(priv, addr, len) do { } while (0)
+@@ -152,7 +154,7 @@ static int sni_82596_driver_remove(struc
+
+ unregister_netdev(dev);
+ dma_free_attrs(dev->dev.parent, sizeof(struct i596_private), lp->dma,
+- lp->dma_addr, DMA_ATTR_NON_CONSISTENT);
++ lp->dma_addr, LIB82596_DMA_ATTR);
+ iounmap(lp->ca);
+ iounmap(lp->mpu_port);
+ free_netdev (dev);
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: "Cédric Le Goater" <clg@kaod.org>
+Date: Fri, 11 Oct 2019 07:52:54 +0200
+Subject: net/ibmvnic: Fix EOI when running in XIVE mode.
+
+From: "Cédric Le Goater" <clg@kaod.org>
+
+[ Upstream commit 11d49ce9f7946dfed4dcf5dbde865c78058b50ab ]
+
+pSeries machines on POWER9 processors can run with the XICS (legacy)
+interrupt mode or with the XIVE exploitation interrupt mode. These
+interrupt contollers have different interfaces for interrupt
+management : XICS uses hcalls and XIVE loads and stores on a page.
+H_EOI being a XICS interface the enable_scrq_irq() routine can fail
+when the machine runs in XIVE mode.
+
+Fix that by calling the EOI handler of the interrupt chip.
+
+Fixes: f23e0643cd0b ("ibmvnic: Clear pending interrupt after device reset")
+Signed-off-by: Cédric Le Goater <clg@kaod.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -2772,12 +2772,10 @@ static int enable_scrq_irq(struct ibmvni
+
+ if (adapter->resetting &&
+ adapter->reset_reason == VNIC_RESET_MOBILITY) {
+- u64 val = (0xff000000) | scrq->hw_irq;
++ struct irq_desc *desc = irq_to_desc(scrq->irq);
++ struct irq_chip *chip = irq_desc_get_chip(desc);
+
+- rc = plpar_hcall_norets(H_EOI, val);
+- if (rc)
+- dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
+- val, rc);
++ chip->irq_eoi(&desc->irq_data);
+ }
+
+ rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Xin Long <lucien.xin@gmail.com>
+Date: Fri, 23 Aug 2019 19:33:03 +0800
+Subject: net: ipv6: fix listify ip6_rcv_finish in case of forwarding
+
+From: Xin Long <lucien.xin@gmail.com>
+
+[ Upstream commit c7a42eb49212f93a800560662d17d5293960d3c3 ]
+
+We need a similar fix for ipv6 as Commit 0761680d5215 ("net: ipv4: fix
+listify ip_rcv_finish in case of forwarding") does for ipv4.
+
+This issue can be reprocuded by syzbot since Commit 323ebb61e32b ("net:
+use listified RX for handling GRO_NORMAL skbs") on net-next. The call
+trace was:
+
+ kernel BUG at include/linux/skbuff.h:2225!
+ RIP: 0010:__skb_pull include/linux/skbuff.h:2225 [inline]
+ RIP: 0010:skb_pull+0xea/0x110 net/core/skbuff.c:1902
+ Call Trace:
+ sctp_inq_pop+0x2f1/0xd80 net/sctp/inqueue.c:202
+ sctp_endpoint_bh_rcv+0x184/0x8d0 net/sctp/endpointola.c:385
+ sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:80
+ sctp_rcv+0x2807/0x3590 net/sctp/input.c:256
+ sctp6_rcv+0x17/0x30 net/sctp/ipv6.c:1049
+ ip6_protocol_deliver_rcu+0x2fe/0x1660 net/ipv6/ip6_input.c:397
+ ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:438
+ NF_HOOK include/linux/netfilter.h:305 [inline]
+ NF_HOOK include/linux/netfilter.h:299 [inline]
+ ip6_input+0xe4/0x3f0 net/ipv6/ip6_input.c:447
+ dst_input include/net/dst.h:442 [inline]
+ ip6_sublist_rcv_finish+0x98/0x1e0 net/ipv6/ip6_input.c:84
+ ip6_list_rcv_finish net/ipv6/ip6_input.c:118 [inline]
+ ip6_sublist_rcv+0x80c/0xcf0 net/ipv6/ip6_input.c:282
+ ipv6_list_rcv+0x373/0x4b0 net/ipv6/ip6_input.c:316
+ __netif_receive_skb_list_ptype net/core/dev.c:5049 [inline]
+ __netif_receive_skb_list_core+0x5fc/0x9d0 net/core/dev.c:5097
+ __netif_receive_skb_list net/core/dev.c:5149 [inline]
+ netif_receive_skb_list_internal+0x7eb/0xe60 net/core/dev.c:5244
+ gro_normal_list.part.0+0x1e/0xb0 net/core/dev.c:5757
+ gro_normal_list net/core/dev.c:5755 [inline]
+ gro_normal_one net/core/dev.c:5769 [inline]
+ napi_frags_finish net/core/dev.c:5782 [inline]
+ napi_gro_frags+0xa6a/0xea0 net/core/dev.c:5855
+ tun_get_user+0x2e98/0x3fa0 drivers/net/tun.c:1974
+ tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2020
+
+Fixes: d8269e2cbf90 ("net: ipv6: listify ipv6_rcv() and ip6_rcv_finish()")
+Fixes: 323ebb61e32b ("net: use listified RX for handling GRO_NORMAL skbs")
+Reported-by: syzbot+eb349eeee854e389c36d@syzkaller.appspotmail.com
+Reported-by: syzbot+4a0643a653ac375612d1@syzkaller.appspotmail.com
+Signed-off-by: Xin Long <lucien.xin@gmail.com>
+Acked-by: Edward Cree <ecree@solarflare.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/ip6_input.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/net/ipv6/ip6_input.c
++++ b/net/ipv6/ip6_input.c
+@@ -80,8 +80,10 @@ static void ip6_sublist_rcv_finish(struc
+ {
+ struct sk_buff *skb, *next;
+
+- list_for_each_entry_safe(skb, next, head, list)
++ list_for_each_entry_safe(skb, next, head, list) {
++ skb_list_del_init(skb);
+ dst_input(skb);
++ }
+ }
+
+ static void ip6_list_rcv_finish(struct net *net, struct sock *sk,
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Yonglong Liu <liuyonglong@huawei.com>
+Date: Wed, 16 Oct 2019 10:30:39 +0800
+Subject: net: phy: Fix "link partner" information disappear issue
+
+From: Yonglong Liu <liuyonglong@huawei.com>
+
+[ Upstream commit 3de5ae54712c75cf3c517a288e0a704784ec6cf5 ]
+
+Some drivers just call phy_ethtool_ksettings_set() to set the
+links, for those phy drivers that use genphy_read_status(), if
+autoneg is on, and the link is up, than execute "ethtool -s
+ethx autoneg on" will cause "link partner" information disappear.
+
+The call trace is phy_ethtool_ksettings_set()->phy_start_aneg()
+->linkmode_zero(phydev->lp_advertising)->genphy_read_status(),
+the link didn't change, so genphy_read_status() just return, and
+phydev->lp_advertising is zero now.
+
+This patch moves the clear operation of lp_advertising from
+phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and
+if autoneg on and autoneg not complete, just clear what the
+generic functions care about.
+
+Fixes: 88d6272acaaa ("net: phy: avoid unneeded MDIO reads in genphy_read_status")
+Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
+Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/phy/phy-c45.c | 2 ++
+ drivers/net/phy/phy.c | 3 ---
+ drivers/net/phy/phy_device.c | 9 ++++++++-
+ 3 files changed, 10 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/phy-c45.c
++++ b/drivers/net/phy/phy-c45.c
+@@ -323,6 +323,8 @@ int genphy_c45_read_pma(struct phy_devic
+ {
+ int val;
+
++ linkmode_zero(phydev->lp_advertising);
++
+ val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1);
+ if (val < 0)
+ return val;
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -566,9 +566,6 @@ int phy_start_aneg(struct phy_device *ph
+ if (AUTONEG_DISABLE == phydev->autoneg)
+ phy_sanitize_settings(phydev);
+
+- /* Invalidate LP advertising flags */
+- linkmode_zero(phydev->lp_advertising);
+-
+ err = phy_config_aneg(phydev);
+ if (err < 0)
+ goto out_unlock;
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -1823,7 +1823,14 @@ int genphy_read_status(struct phy_device
+
+ linkmode_zero(phydev->lp_advertising);
+
+- if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
++ if (phydev->autoneg == AUTONEG_ENABLE) {
++ if (!phydev->autoneg_complete) {
++ mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising,
++ 0);
++ mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, 0);
++ return 0;
++ }
++
+ if (phydev->is_gigabit_capable) {
+ lpagb = phy_read(phydev, MII_STAT1000);
+ if (lpagb < 0)
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Marek Vasut <marex@denx.de>
+Date: Wed, 16 Oct 2019 15:35:06 +0200
+Subject: net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit 8b95599c55ed24b36cf44a4720067cfe67edbcb4 ]
+
+The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
+same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
+in the micrel PHY driver, it is used even with the KSZ87xx switch. This
+is wrong, since the KSZ8051 configures registers of the PHY which are
+not present on the simplified KSZ87xx switch PHYs and misconfigures
+other registers of the KSZ87xx switch PHYs.
+
+Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
+KSZ87xx switch by checking the Basic Status register Bit 0, which is
+read-only and indicates presence of the Extended Capability Registers.
+The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
+
+This patch implements simple check for the presence of this bit for
+both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
+PHY driver instance.
+
+Fixes: 9d162ed69f51 ("net: phy: micrel: add support for KSZ8795")
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Florian Fainelli <f.fainelli@gmail.com>
+Cc: George McCollister <george.mccollister@gmail.com>
+Cc: Heiner Kallweit <hkallweit1@gmail.com>
+Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
+Cc: Tristram Ha <Tristram.Ha@microchip.com>
+Cc: Woojung Huh <woojung.huh@microchip.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/phy/micrel.c | 40 ++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 36 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/phy/micrel.c
++++ b/drivers/net/phy/micrel.c
+@@ -341,6 +341,35 @@ static int ksz8041_config_aneg(struct ph
+ return genphy_config_aneg(phydev);
+ }
+
++static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
++ const u32 ksz_phy_id)
++{
++ int ret;
++
++ if ((phydev->phy_id & MICREL_PHY_ID_MASK) != ksz_phy_id)
++ return 0;
++
++ ret = phy_read(phydev, MII_BMSR);
++ if (ret < 0)
++ return ret;
++
++ /* KSZ8051 PHY and KSZ8794/KSZ8795/KSZ8765 switch share the same
++ * exact PHY ID. However, they can be told apart by the extended
++ * capability registers presence. The KSZ8051 PHY has them while
++ * the switch does not.
++ */
++ ret &= BMSR_ERCAP;
++ if (ksz_phy_id == PHY_ID_KSZ8051)
++ return ret;
++ else
++ return !ret;
++}
++
++static int ksz8051_match_phy_device(struct phy_device *phydev)
++{
++ return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8051);
++}
++
+ static int ksz8081_config_init(struct phy_device *phydev)
+ {
+ /* KSZPHY_OMSO_FACTORY_TEST is set at de-assertion of the reset line
+@@ -364,6 +393,11 @@ static int ksz8061_config_init(struct ph
+ return kszphy_config_init(phydev);
+ }
+
++static int ksz8795_match_phy_device(struct phy_device *phydev)
++{
++ return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8795);
++}
++
+ static int ksz9021_load_values_from_of(struct phy_device *phydev,
+ const struct device_node *of_node,
+ u16 reg,
+@@ -1017,8 +1051,6 @@ static struct phy_driver ksphy_driver[]
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ }, {
+- .phy_id = PHY_ID_KSZ8051,
+- .phy_id_mask = MICREL_PHY_ID_MASK,
+ .name = "Micrel KSZ8051",
+ /* PHY_BASIC_FEATURES */
+ .driver_data = &ksz8051_type,
+@@ -1029,6 +1061,7 @@ static struct phy_driver ksphy_driver[]
+ .get_sset_count = kszphy_get_sset_count,
+ .get_strings = kszphy_get_strings,
+ .get_stats = kszphy_get_stats,
++ .match_phy_device = ksz8051_match_phy_device,
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ }, {
+@@ -1141,13 +1174,12 @@ static struct phy_driver ksphy_driver[]
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ }, {
+- .phy_id = PHY_ID_KSZ8795,
+- .phy_id_mask = MICREL_PHY_ID_MASK,
+ .name = "Micrel KSZ8795",
+ /* PHY_BASIC_FEATURES */
+ .config_init = kszphy_config_init,
+ .config_aneg = ksz8873mll_config_aneg,
+ .read_status = ksz8873mll_read_status,
++ .match_phy_device = ksz8795_match_phy_device,
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ }, {
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Marek Vasut <marex@denx.de>
+Date: Wed, 16 Oct 2019 15:35:07 +0200
+Subject: net: phy: micrel: Update KSZ87xx PHY name
+
+From: Marek Vasut <marex@denx.de>
+
+[ Upstream commit 1d951ba3da67bbc7a9b0e05987e09552c2060e18 ]
+
+The KSZ8795 PHY ID is in fact used by KSZ8794/KSZ8795/KSZ8765 switches.
+Update the PHY ID and name to reflect that, as this family of switches
+is commonly refered to as KSZ87xx
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Florian Fainelli <f.fainelli@gmail.com>
+Cc: George McCollister <george.mccollister@gmail.com>
+Cc: Heiner Kallweit <hkallweit1@gmail.com>
+Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
+Cc: Tristram Ha <Tristram.Ha@microchip.com>
+Cc: Woojung Huh <woojung.huh@microchip.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/phy/micrel.c | 4 ++--
+ include/linux/micrel_phy.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/phy/micrel.c
++++ b/drivers/net/phy/micrel.c
+@@ -395,7 +395,7 @@ static int ksz8061_config_init(struct ph
+
+ static int ksz8795_match_phy_device(struct phy_device *phydev)
+ {
+- return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8795);
++ return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ87XX);
+ }
+
+ static int ksz9021_load_values_from_of(struct phy_device *phydev,
+@@ -1174,7 +1174,7 @@ static struct phy_driver ksphy_driver[]
+ .suspend = genphy_suspend,
+ .resume = genphy_resume,
+ }, {
+- .name = "Micrel KSZ8795",
++ .name = "Micrel KSZ87XX Switch",
+ /* PHY_BASIC_FEATURES */
+ .config_init = kszphy_config_init,
+ .config_aneg = ksz8873mll_config_aneg,
+--- a/include/linux/micrel_phy.h
++++ b/include/linux/micrel_phy.h
+@@ -31,7 +31,7 @@
+ #define PHY_ID_KSZ886X 0x00221430
+ #define PHY_ID_KSZ8863 0x00221435
+
+-#define PHY_ID_KSZ8795 0x00221550
++#define PHY_ID_KSZ87XX 0x00221550
+
+ #define PHY_ID_KSZ9477 0x00221631
+
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Davide Caratti <dcaratti@redhat.com>
+Date: Sat, 12 Oct 2019 13:55:07 +0200
+Subject: net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions
+
+From: Davide Caratti <dcaratti@redhat.com>
+
+[ Upstream commit fa4e0f8855fcba600e0be2575ee29c69166f74bd ]
+
+the following script:
+
+ # tc qdisc add dev eth0 clsact
+ # tc filter add dev eth0 egress protocol ip matchall \
+ > action mpls push protocol mpls_uc label 0x355aa bos 1
+
+causes corruption of all IP packets transmitted by eth0. On TC egress, we
+can't rely on the value of skb->mac_len, because it's 0 and a MPLS 'push'
+operation will result in an overwrite of the first 4 octets in the packet
+L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same
+error pattern is present also in the MPLS 'pop' operation. Fix this error
+in act_mpls data plane, computing 'mac_len' as the difference between the
+network header and the mac header (when not at TC ingress), and use it in
+MPLS 'push'/'pop' core functions.
+
+v2: unbreak 'make htmldocs' because of missing documentation of 'mac_len'
+ in skb_mpls_pop(), reported by kbuild test robot
+
+CC: Lorenzo Bianconi <lorenzo@kernel.org>
+Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
+Reviewed-by: Simon Horman <simon.horman@netronome.com>
+Acked-by: John Hurley <john.hurley@netronome.com>
+Signed-off-by: Davide Caratti <dcaratti@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/skbuff.h | 5 +++--
+ net/core/skbuff.c | 19 +++++++++++--------
+ net/openvswitch/actions.c | 5 +++--
+ net/sched/act_mpls.c | 12 ++++++++----
+ 4 files changed, 25 insertions(+), 16 deletions(-)
+
+--- a/include/linux/skbuff.h
++++ b/include/linux/skbuff.h
+@@ -3465,8 +3465,9 @@ int skb_ensure_writable(struct sk_buff *
+ int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci);
+ int skb_vlan_pop(struct sk_buff *skb);
+ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
+-int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto);
+-int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto);
++int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto,
++ int mac_len);
++int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len);
+ int skb_mpls_update_lse(struct sk_buff *skb, __be32 mpls_lse);
+ int skb_mpls_dec_ttl(struct sk_buff *skb);
+ struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
+--- a/net/core/skbuff.c
++++ b/net/core/skbuff.c
+@@ -5465,12 +5465,14 @@ static void skb_mod_eth_type(struct sk_b
+ * @skb: buffer
+ * @mpls_lse: MPLS label stack entry to push
+ * @mpls_proto: ethertype of the new MPLS header (expects 0x8847 or 0x8848)
++ * @mac_len: length of the MAC header
+ *
+ * Expects skb->data at mac header.
+ *
+ * Returns 0 on success, -errno otherwise.
+ */
+-int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto)
++int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto,
++ int mac_len)
+ {
+ struct mpls_shim_hdr *lse;
+ int err;
+@@ -5487,15 +5489,15 @@ int skb_mpls_push(struct sk_buff *skb, _
+ return err;
+
+ if (!skb->inner_protocol) {
+- skb_set_inner_network_header(skb, skb->mac_len);
++ skb_set_inner_network_header(skb, mac_len);
+ skb_set_inner_protocol(skb, skb->protocol);
+ }
+
+ skb_push(skb, MPLS_HLEN);
+ memmove(skb_mac_header(skb) - MPLS_HLEN, skb_mac_header(skb),
+- skb->mac_len);
++ mac_len);
+ skb_reset_mac_header(skb);
+- skb_set_network_header(skb, skb->mac_len);
++ skb_set_network_header(skb, mac_len);
+
+ lse = mpls_hdr(skb);
+ lse->label_stack_entry = mpls_lse;
+@@ -5514,29 +5516,30 @@ EXPORT_SYMBOL_GPL(skb_mpls_push);
+ *
+ * @skb: buffer
+ * @next_proto: ethertype of header after popped MPLS header
++ * @mac_len: length of the MAC header
+ *
+ * Expects skb->data at mac header.
+ *
+ * Returns 0 on success, -errno otherwise.
+ */
+-int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto)
++int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len)
+ {
+ int err;
+
+ if (unlikely(!eth_p_mpls(skb->protocol)))
+ return 0;
+
+- err = skb_ensure_writable(skb, skb->mac_len + MPLS_HLEN);
++ err = skb_ensure_writable(skb, mac_len + MPLS_HLEN);
+ if (unlikely(err))
+ return err;
+
+ skb_postpull_rcsum(skb, mpls_hdr(skb), MPLS_HLEN);
+ memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb),
+- skb->mac_len);
++ mac_len);
+
+ __skb_pull(skb, MPLS_HLEN);
+ skb_reset_mac_header(skb);
+- skb_set_network_header(skb, skb->mac_len);
++ skb_set_network_header(skb, mac_len);
+
+ if (skb->dev && skb->dev->type == ARPHRD_ETHER) {
+ struct ethhdr *hdr;
+--- a/net/openvswitch/actions.c
++++ b/net/openvswitch/actions.c
+@@ -165,7 +165,8 @@ static int push_mpls(struct sk_buff *skb
+ {
+ int err;
+
+- err = skb_mpls_push(skb, mpls->mpls_lse, mpls->mpls_ethertype);
++ err = skb_mpls_push(skb, mpls->mpls_lse, mpls->mpls_ethertype,
++ skb->mac_len);
+ if (err)
+ return err;
+
+@@ -178,7 +179,7 @@ static int pop_mpls(struct sk_buff *skb,
+ {
+ int err;
+
+- err = skb_mpls_pop(skb, ethertype);
++ err = skb_mpls_pop(skb, ethertype, skb->mac_len);
+ if (err)
+ return err;
+
+--- a/net/sched/act_mpls.c
++++ b/net/sched/act_mpls.c
+@@ -55,7 +55,7 @@ static int tcf_mpls_act(struct sk_buff *
+ struct tcf_mpls *m = to_mpls(a);
+ struct tcf_mpls_params *p;
+ __be32 new_lse;
+- int ret;
++ int ret, mac_len;
+
+ tcf_lastuse_update(&m->tcf_tm);
+ bstats_cpu_update(this_cpu_ptr(m->common.cpu_bstats), skb);
+@@ -63,8 +63,12 @@ static int tcf_mpls_act(struct sk_buff *
+ /* Ensure 'data' points at mac_header prior calling mpls manipulating
+ * functions.
+ */
+- if (skb_at_tc_ingress(skb))
++ if (skb_at_tc_ingress(skb)) {
+ skb_push_rcsum(skb, skb->mac_len);
++ mac_len = skb->mac_len;
++ } else {
++ mac_len = skb_network_header(skb) - skb_mac_header(skb);
++ }
+
+ ret = READ_ONCE(m->tcf_action);
+
+@@ -72,12 +76,12 @@ static int tcf_mpls_act(struct sk_buff *
+
+ switch (p->tcfm_action) {
+ case TCA_MPLS_ACT_POP:
+- if (skb_mpls_pop(skb, p->tcfm_proto))
++ if (skb_mpls_pop(skb, p->tcfm_proto, mac_len))
+ goto drop;
+ break;
+ case TCA_MPLS_ACT_PUSH:
+ new_lse = tcf_mpls_get_lse(NULL, p, !eth_p_mpls(skb->protocol));
+- if (skb_mpls_push(skb, new_lse, p->tcfm_proto))
++ if (skb_mpls_push(skb, new_lse, p->tcfm_proto, mac_len))
+ goto drop;
+ break;
+ case TCA_MPLS_ACT_MODIFY:
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Biao Huang <biao.huang@mediatek.com>
+Date: Tue, 15 Oct 2019 11:24:44 +0800
+Subject: net: stmmac: disable/enable ptp_ref_clk in suspend/resume flow
+
+From: Biao Huang <biao.huang@mediatek.com>
+
+[ Upstream commit e497c20e203680aba9ccf7bb475959595908ca7e ]
+
+disable ptp_ref_clk in suspend flow, and enable it in resume flow.
+
+Fixes: f573c0b9c4e0 ("stmmac: move stmmac_clk, pclk, clk_ptp_ref and stmmac_rst to platform structure")
+Signed-off-by: Biao Huang <biao.huang@mediatek.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -4480,8 +4480,10 @@ int stmmac_suspend(struct device *dev)
+ stmmac_mac_set(priv, priv->ioaddr, false);
+ pinctrl_pm_select_sleep_state(priv->device);
+ /* Disable clock in case of PWM is off */
+- clk_disable(priv->plat->pclk);
+- clk_disable(priv->plat->stmmac_clk);
++ if (priv->plat->clk_ptp_ref)
++ clk_disable_unprepare(priv->plat->clk_ptp_ref);
++ clk_disable_unprepare(priv->plat->pclk);
++ clk_disable_unprepare(priv->plat->stmmac_clk);
+ }
+ mutex_unlock(&priv->lock);
+
+@@ -4544,8 +4546,10 @@ int stmmac_resume(struct device *dev)
+ } else {
+ pinctrl_pm_select_default_state(priv->device);
+ /* enable the clk previously disabled */
+- clk_enable(priv->plat->stmmac_clk);
+- clk_enable(priv->plat->pclk);
++ clk_prepare_enable(priv->plat->stmmac_clk);
++ clk_prepare_enable(priv->plat->pclk);
++ if (priv->plat->clk_ptp_ref)
++ clk_prepare_enable(priv->plat->clk_ptp_ref);
+ /* reset the phy so that it's ready */
+ if (priv->mii)
+ stmmac_mdio_reset(priv->mii);
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: YueHaibing <yuehaibing@huawei.com>
+Date: Fri, 11 Oct 2019 17:46:53 +0800
+Subject: netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit
+
+From: YueHaibing <yuehaibing@huawei.com>
+
+[ Upstream commit 33902b4a4227877896dd9368ac10f4ca0d100de5 ]
+
+In nsim_fib_init(), if register_fib_notifier failed, nsim_fib_net_ops
+should be unregistered before return.
+
+In nsim_fib_exit(), unregister_fib_notifier should be called before
+nsim_fib_net_ops be unregistered, otherwise may cause use-after-free:
+
+BUG: KASAN: use-after-free in nsim_fib_event_nb+0x342/0x570 [netdevsim]
+Read of size 8 at addr ffff8881daaf4388 by task kworker/0:3/3499
+
+CPU: 0 PID: 3499 Comm: kworker/0:3 Not tainted 5.3.0-rc7+ #30
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
+Workqueue: ipv6_addrconf addrconf_dad_work [ipv6]
+Call Trace:
+ __dump_stack lib/dump_stack.c:77 [inline]
+ dump_stack+0xa9/0x10e lib/dump_stack.c:113
+ print_address_description+0x65/0x380 mm/kasan/report.c:351
+ __kasan_report+0x149/0x18d mm/kasan/report.c:482
+ kasan_report+0xe/0x20 mm/kasan/common.c:618
+ nsim_fib_event_nb+0x342/0x570 [netdevsim]
+ notifier_call_chain+0x52/0xf0 kernel/notifier.c:95
+ __atomic_notifier_call_chain+0x78/0x140 kernel/notifier.c:185
+ call_fib_notifiers+0x30/0x60 net/core/fib_notifier.c:30
+ call_fib6_entry_notifiers+0xc1/0x100 [ipv6]
+ fib6_add+0x92e/0x1b10 [ipv6]
+ __ip6_ins_rt+0x40/0x60 [ipv6]
+ ip6_ins_rt+0x84/0xb0 [ipv6]
+ __ipv6_ifa_notify+0x4b6/0x550 [ipv6]
+ ipv6_ifa_notify+0xa5/0x180 [ipv6]
+ addrconf_dad_completed+0xca/0x640 [ipv6]
+ addrconf_dad_work+0x296/0x960 [ipv6]
+ process_one_work+0x5c0/0xc00 kernel/workqueue.c:2269
+ worker_thread+0x5c/0x670 kernel/workqueue.c:2415
+ kthread+0x1d7/0x200 kernel/kthread.c:255
+ ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
+
+Allocated by task 3388:
+ save_stack+0x19/0x80 mm/kasan/common.c:69
+ set_track mm/kasan/common.c:77 [inline]
+ __kasan_kmalloc.constprop.3+0xa0/0xd0 mm/kasan/common.c:493
+ kmalloc include/linux/slab.h:557 [inline]
+ kzalloc include/linux/slab.h:748 [inline]
+ ops_init+0xa9/0x220 net/core/net_namespace.c:127
+ __register_pernet_operations net/core/net_namespace.c:1135 [inline]
+ register_pernet_operations+0x1d4/0x420 net/core/net_namespace.c:1212
+ register_pernet_subsys+0x24/0x40 net/core/net_namespace.c:1253
+ nsim_fib_init+0x12/0x70 [netdevsim]
+ veth_get_link_ksettings+0x2b/0x50 [veth]
+ do_one_initcall+0xd4/0x454 init/main.c:939
+ do_init_module+0xe0/0x330 kernel/module.c:3490
+ load_module+0x3c2f/0x4620 kernel/module.c:3841
+ __do_sys_finit_module+0x163/0x190 kernel/module.c:3931
+ do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+
+Freed by task 3534:
+ save_stack+0x19/0x80 mm/kasan/common.c:69
+ set_track mm/kasan/common.c:77 [inline]
+ __kasan_slab_free+0x130/0x180 mm/kasan/common.c:455
+ slab_free_hook mm/slub.c:1423 [inline]
+ slab_free_freelist_hook mm/slub.c:1474 [inline]
+ slab_free mm/slub.c:3016 [inline]
+ kfree+0xe9/0x2d0 mm/slub.c:3957
+ ops_free net/core/net_namespace.c:151 [inline]
+ ops_free_list.part.7+0x156/0x220 net/core/net_namespace.c:184
+ ops_free_list net/core/net_namespace.c:182 [inline]
+ __unregister_pernet_operations net/core/net_namespace.c:1165 [inline]
+ unregister_pernet_operations+0x221/0x2a0 net/core/net_namespace.c:1224
+ unregister_pernet_subsys+0x1d/0x30 net/core/net_namespace.c:1271
+ nsim_fib_exit+0x11/0x20 [netdevsim]
+ nsim_module_exit+0x16/0x21 [netdevsim]
+ __do_sys_delete_module kernel/module.c:1015 [inline]
+ __se_sys_delete_module kernel/module.c:958 [inline]
+ __x64_sys_delete_module+0x244/0x330 kernel/module.c:958
+ do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296
+ entry_SYSCALL_64_after_hwframe+0x49/0xbe
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Fixes: 59c84b9fcf42 ("netdevsim: Restore per-network namespace accounting for fib entries")
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Acked-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/netdevsim/fib.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/netdevsim/fib.c
++++ b/drivers/net/netdevsim/fib.c
+@@ -241,8 +241,8 @@ static struct pernet_operations nsim_fib
+
+ void nsim_fib_exit(void)
+ {
+- unregister_pernet_subsys(&nsim_fib_net_ops);
+ unregister_fib_notifier(&nsim_fib_nb);
++ unregister_pernet_subsys(&nsim_fib_net_ops);
+ }
+
+ int nsim_fib_init(void)
+@@ -258,6 +258,7 @@ int nsim_fib_init(void)
+ err = register_fib_notifier(&nsim_fib_nb, nsim_fib_dump_inconsistent);
+ if (err < 0) {
+ pr_err("Failed to register fib notifier\n");
++ unregister_pernet_subsys(&nsim_fib_net_ops);
+ goto err_out;
+ }
+
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: David Howells <dhowells@redhat.com>
+Date: Thu, 10 Oct 2019 15:52:34 +0100
+Subject: rxrpc: Fix possible NULL pointer access in ICMP handling
+
+From: David Howells <dhowells@redhat.com>
+
+[ Upstream commit f0308fb0708078d6c1d8a4d533941a7a191af634 ]
+
+If an ICMP packet comes in on the UDP socket backing an AF_RXRPC socket as
+the UDP socket is being shut down, rxrpc_error_report() may get called to
+deal with it after sk_user_data on the UDP socket has been cleared, leading
+to a NULL pointer access when this local endpoint record gets accessed.
+
+Fix this by just returning immediately if sk_user_data was NULL.
+
+The oops looks like the following:
+
+#PF: supervisor read access in kernel mode
+#PF: error_code(0x0000) - not-present page
+...
+RIP: 0010:rxrpc_error_report+0x1bd/0x6a9
+...
+Call Trace:
+ ? sock_queue_err_skb+0xbd/0xde
+ ? __udp4_lib_err+0x313/0x34d
+ __udp4_lib_err+0x313/0x34d
+ icmp_unreach+0x1ee/0x207
+ icmp_rcv+0x25b/0x28f
+ ip_protocol_deliver_rcu+0x95/0x10e
+ ip_local_deliver+0xe9/0x148
+ __netif_receive_skb_one_core+0x52/0x6e
+ process_backlog+0xdc/0x177
+ net_rx_action+0xf9/0x270
+ __do_softirq+0x1b6/0x39a
+ ? smpboot_register_percpu_thread+0xce/0xce
+ run_ksoftirqd+0x1d/0x42
+ smpboot_thread_fn+0x19e/0x1b3
+ kthread+0xf1/0xf6
+ ? kthread_delayed_work_timer_fn+0x83/0x83
+ ret_from_fork+0x24/0x30
+
+Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
+Reported-by: syzbot+611164843bd48cc2190c@syzkaller.appspotmail.com
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/rxrpc/peer_event.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/rxrpc/peer_event.c
++++ b/net/rxrpc/peer_event.c
+@@ -151,6 +151,9 @@ void rxrpc_error_report(struct sock *sk)
+ struct rxrpc_peer *peer;
+ struct sk_buff *skb;
+
++ if (unlikely(!local))
++ return;
++
+ _enter("%p{%d}", sk, local->debug_id);
+
+ /* Clear the outstanding error value on the socket so that it doesn't
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
+Date: Mon, 14 Oct 2019 13:38:22 -0700
+Subject: sched: etf: Fix ordering of packets with same txtime
+
+From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
+
+[ Upstream commit 28aa7c86c2b49f659c8460a89e53b506c45979bb ]
+
+When a application sends many packets with the same txtime, they may
+be transmitted out of order (different from the order in which they
+were enqueued).
+
+This happens because when inserting elements into the tree, when the
+txtime of two packets are the same, the new packet is inserted at the
+left side of the tree, causing the reordering. The only effect of this
+change should be that packets with the same txtime will be transmitted
+in the order they are enqueued.
+
+The application in question (the AVTP GStreamer plugin, still in
+development) is sending video traffic, in which each video frame have
+a single presentation time, the problem is that when packetizing,
+multiple packets end up with the same txtime.
+
+The receiving side was rejecting packets because they were being
+received out of order.
+
+Fixes: 25db26a91364 ("net/sched: Introduce the ETF Qdisc")
+Reported-by: Ederson de Souza <ederson.desouza@intel.com>
+Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/sch_etf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/sched/sch_etf.c
++++ b/net/sched/sch_etf.c
+@@ -177,7 +177,7 @@ static int etf_enqueue_timesortedlist(st
+
+ parent = *p;
+ skb = rb_to_skb(parent);
+- if (ktime_after(txtime, skb->tstamp)) {
++ if (ktime_compare(txtime, skb->tstamp) >= 0) {
+ p = &parent->rb_right;
+ leftmost = false;
+ } else {
--- /dev/null
+From foo@baz Thu 24 Oct 2019 09:37:07 PM EDT
+From: Xin Long <lucien.xin@gmail.com>
+Date: Tue, 15 Oct 2019 15:24:38 +0800
+Subject: sctp: change sctp_prot .no_autobind with true
+
+From: Xin Long <lucien.xin@gmail.com>
+
+[ Upstream commit 63dfb7938b13fa2c2fbcb45f34d065769eb09414 ]
+
+syzbot reported a memory leak:
+
+ BUG: memory leak, unreferenced object 0xffff888120b3d380 (size 64):
+ backtrace:
+
+ [...] slab_alloc mm/slab.c:3319 [inline]
+ [...] kmem_cache_alloc+0x13f/0x2c0 mm/slab.c:3483
+ [...] sctp_bucket_create net/sctp/socket.c:8523 [inline]
+ [...] sctp_get_port_local+0x189/0x5a0 net/sctp/socket.c:8270
+ [...] sctp_do_bind+0xcc/0x200 net/sctp/socket.c:402
+ [...] sctp_bindx_add+0x4b/0xd0 net/sctp/socket.c:497
+ [...] sctp_setsockopt_bindx+0x156/0x1b0 net/sctp/socket.c:1022
+ [...] sctp_setsockopt net/sctp/socket.c:4641 [inline]
+ [...] sctp_setsockopt+0xaea/0x2dc0 net/sctp/socket.c:4611
+ [...] sock_common_setsockopt+0x38/0x50 net/core/sock.c:3147
+ [...] __sys_setsockopt+0x10f/0x220 net/socket.c:2084
+ [...] __do_sys_setsockopt net/socket.c:2100 [inline]
+
+It was caused by when sending msgs without binding a port, in the path:
+inet_sendmsg() -> inet_send_prepare() -> inet_autobind() ->
+.get_port/sctp_get_port(), sp->bind_hash will be set while bp->port is
+not. Later when binding another port by sctp_setsockopt_bindx(), a new
+bucket will be created as bp->port is not set.
+
+sctp's autobind is supposed to call sctp_autobind() where it does all
+things including setting bp->port. Since sctp_autobind() is called in
+sctp_sendmsg() if the sk is not yet bound, it should have skipped the
+auto bind.
+
+THis patch is to avoid calling inet_autobind() in inet_send_prepare()
+by changing sctp_prot .no_autobind with true, also remove the unused
+.get_port.
+
+Reported-by: syzbot+d44f7bbebdea49dbc84a@syzkaller.appspotmail.com
+Signed-off-by: Xin Long <lucien.xin@gmail.com>
+Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sctp/socket.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/sctp/socket.c
++++ b/net/sctp/socket.c
+@@ -9353,7 +9353,7 @@ struct proto sctp_prot = {
+ .backlog_rcv = sctp_backlog_rcv,
+ .hash = sctp_hash,
+ .unhash = sctp_unhash,
+- .get_port = sctp_get_port,
++ .no_autobind = true,
+ .obj_size = sizeof(struct sctp_sock),
+ .useroffset = offsetof(struct sctp_sock, subscribe),
+ .usersize = offsetof(struct sctp_sock, initmsg) -
+@@ -9395,7 +9395,7 @@ struct proto sctpv6_prot = {
+ .backlog_rcv = sctp_backlog_rcv,
+ .hash = sctp_hash,
+ .unhash = sctp_unhash,
+- .get_port = sctp_get_port,
++ .no_autobind = true,
+ .obj_size = sizeof(struct sctp6_sock),
+ .useroffset = offsetof(struct sctp6_sock, sctp.subscribe),
+ .usersize = offsetof(struct sctp6_sock, sctp.initmsg) -
revert-drm-radeon-fix-eeh-during-kexec.patch
ocfs2-fix-panic-due-to-ocfs2_wq-is-null.patch
nvme-pci-set-the-prp2-correctly-when-using-more-than-4k-page.patch
+ipv4-fix-race-condition-between-route-lookup-and-invalidation.patch
+ipv4-return-enetunreach-if-we-can-t-create-route-but-saddr-is-valid.patch
+net-avoid-potential-infinite-loop-in-tc_ctl_action.patch
+net-bcmgenet-fix-rgmii_mode_en-value-for-genet-v1-2-3.patch
+net-bcmgenet-set-phydev-dev_flags-only-for-internal-phys.patch
+net-i82596-fix-dma_alloc_attr-for-sni_82596.patch
+net-ibmvnic-fix-eoi-when-running-in-xive-mode.patch
+net-ipv6-fix-listify-ip6_rcv_finish-in-case-of-forwarding.patch
+net-stmmac-disable-enable-ptp_ref_clk-in-suspend-resume-flow.patch
+rxrpc-fix-possible-null-pointer-access-in-icmp-handling.patch
+sched-etf-fix-ordering-of-packets-with-same-txtime.patch
+sctp-change-sctp_prot-.no_autobind-with-true.patch
+net-aquantia-temperature-retrieval-fix.patch
+net-aquantia-when-cleaning-hw-cache-it-should-be-toggled.patch
+net-aquantia-do-not-pass-lro-session-with-invalid-tcp-checksum.patch
+net-aquantia-correctly-handle-macvlan-and-multicast-coexistence.patch
+net-phy-micrel-discern-ksz8051-and-ksz8795-phys.patch
+net-phy-micrel-update-ksz87xx-phy-name.patch
+net-avoid-errors-when-trying-to-pop-mlps-header-on-non-mpls-packets.patch
+net-sched-fix-corrupted-l2-header-with-mpls-push-and-pop-actions.patch
+netdevsim-fix-error-handling-in-nsim_fib_init-and-nsim_fib_exit.patch
+net-ethernet-broadcom-have-drivers-select-dimlib-as-needed.patch
+net-phy-fix-link-partner-information-disappear-issue.patch