Merge tag 'ipsec-2024-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/klasser...
authorJakub Kicinski <kuba@kernel.org>
Wed, 20 Mar 2024 02:44:02 +0000 (19:44 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Mar 2024 02:44:03 +0000 (19:44 -0700)
Steffen Klassert says:

====================
pull request (net): ipsec 2024-03-19

1) Fix possible page_pool leak triggered by esp_output.
   From Dragos Tatulea.

2) Fix UDP encapsulation in software GSO path.
   From Leon Romanovsky.

* tag 'ipsec-2024-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec:
  xfrm: Allow UDP encapsulation only in offload modes
  net: esp: fix bad handling of pages from page_pool
====================

Link: https://lore.kernel.org/r/20240319110151.409825-1-steffen.klassert@secunet.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
28 files changed:
Documentation/networking/net_cachelines/net_device.rst
drivers/net/dsa/mt7530.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
drivers/net/phy/phy_device.c
drivers/net/veth.c
drivers/net/wireguard/device.c
drivers/net/wireguard/netlink.c
drivers/net/wireguard/receive.c
include/linux/netdevice.h
include/linux/skbuff.h
include/net/request_sock.h
net/core/dev.c
net/devlink/port.c
net/hsr/hsr_main.c
net/ipv4/ip_output.c
net/ipv4/raw.c
net/ipv4/syncookies.c
net/ipv6/ip6_output.c
net/ipv6/raw.c
net/ipv6/syncookies.c
net/packet/af_packet.c
net/rds/send.c
net/sched/sch_fq_pie.c
tools/net/ynl/Makefile.deps
tools/testing/selftests/net/udpgro_fwd.sh
tools/testing/selftests/net/veth.sh
tools/testing/selftests/wireguard/qemu/arch/riscv32.config
tools/testing/selftests/wireguard/qemu/arch/riscv64.config

index dceb49d..70c4fb9 100644 (file)
@@ -13,7 +13,7 @@ struct_dev_ifalias*                 ifalias
 unsigned_long                       mem_end                                                         
 unsigned_long                       mem_start                                                       
 unsigned_long                       base_addr                                                       
-unsigned_long                       state                                                           
+unsigned_long                       state                   read_mostly         read_mostly         netif_running(dev)
 struct_list_head                    dev_list                                                        
 struct_list_head                    napi_list                                                       
 struct_list_head                    unreg_list                                                      
index 678b51f..6986f53 100644 (file)
@@ -2192,22 +2192,16 @@ mt7530_setup(struct dsa_switch *ds)
                }
        }
 
-       /* Disable LEDs before reset to prevent the MT7530 sampling a
-        * potentially incorrect HT_XTAL_FSEL value.
-        */
-       mt7530_write(priv, MT7530_LED_EN, 0);
-       usleep_range(1000, 1100);
-
        /* Reset whole chip through gpio pin or memory-mapped registers for
         * different type of hardware
         */
        if (priv->mcm) {
                reset_control_assert(priv->rstc);
-               usleep_range(1000, 1100);
+               usleep_range(5000, 5100);
                reset_control_deassert(priv->rstc);
        } else {
                gpiod_set_value_cansleep(priv->reset, 0);
-               usleep_range(1000, 1100);
+               usleep_range(5000, 5100);
                gpiod_set_value_cansleep(priv->reset, 1);
        }
 
@@ -2420,11 +2414,11 @@ mt7531_setup(struct dsa_switch *ds)
         */
        if (priv->mcm) {
                reset_control_assert(priv->rstc);
-               usleep_range(1000, 1100);
+               usleep_range(5000, 5100);
                reset_control_deassert(priv->rstc);
        } else {
                gpiod_set_value_cansleep(priv->reset, 0);
-               usleep_range(1000, 1100);
+               usleep_range(5000, 5100);
                gpiod_set_value_cansleep(priv->reset, 1);
        }
 
index d8b1824..0bc1367 100644 (file)
@@ -1002,9 +1002,6 @@ static inline void bnx2x_set_fw_mac_addr(__le16 *fw_hi, __le16 *fw_mid,
 static inline void bnx2x_free_rx_mem_pool(struct bnx2x *bp,
                                          struct bnx2x_alloc_pool *pool)
 {
-       if (!pool->page)
-               return;
-
        put_page(pool->page);
 
        pool->page = NULL;
@@ -1015,6 +1012,9 @@ static inline void bnx2x_free_rx_sge_range(struct bnx2x *bp,
 {
        int i;
 
+       if (!fp->page_pool.page)
+               return;
+
        if (fp->mode == TPA_MODE_DISABLED)
                return;
 
index 8297ef6..6c6ec94 100644 (file)
@@ -2831,8 +2831,8 @@ EXPORT_SYMBOL(genphy_resume);
 int genphy_loopback(struct phy_device *phydev, bool enable)
 {
        if (enable) {
-               u16 val, ctl = BMCR_LOOPBACK;
-               int ret;
+               u16 ctl = BMCR_LOOPBACK;
+               int ret, val;
 
                ctl |= mii_bmcr_encode_fixed(phydev->speed, phydev->duplex);
 
index 13d9024..bcdfbf6 100644 (file)
@@ -1464,8 +1464,6 @@ static netdev_features_t veth_fix_features(struct net_device *dev,
                if (peer_priv->_xdp_prog)
                        features &= ~NETIF_F_GSO_SOFTWARE;
        }
-       if (priv->_xdp_prog)
-               features |= NETIF_F_GRO;
 
        return features;
 }
@@ -1569,14 +1567,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog,
                }
 
                if (!old_prog) {
-                       if (!veth_gro_requested(dev)) {
-                               /* user-space did not require GRO, but adding
-                                * XDP is supposed to get GRO working
-                                */
-                               dev->features |= NETIF_F_GRO;
-                               netdev_features_change(dev);
-                       }
-
                        peer->hw_features &= ~NETIF_F_GSO_SOFTWARE;
                        peer->max_mtu = max_mtu;
                }
@@ -1592,14 +1582,6 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog,
                        if (dev->flags & IFF_UP)
                                veth_disable_xdp(dev);
 
-                       /* if user-space did not require GRO, since adding XDP
-                        * enabled it, clear it now
-                        */
-                       if (!veth_gro_requested(dev)) {
-                               dev->features &= ~NETIF_F_GRO;
-                               netdev_features_change(dev);
-                       }
-
                        if (peer) {
                                peer->hw_features |= NETIF_F_GSO_SOFTWARE;
                                peer->max_mtu = ETH_MAX_MTU;
index deb9636..3feb36e 100644 (file)
@@ -237,7 +237,6 @@ static const struct net_device_ops netdev_ops = {
        .ndo_open               = wg_open,
        .ndo_stop               = wg_stop,
        .ndo_start_xmit         = wg_xmit,
-       .ndo_get_stats64        = dev_get_tstats64
 };
 
 static void wg_destruct(struct net_device *dev)
@@ -262,7 +261,6 @@ static void wg_destruct(struct net_device *dev)
        rcu_barrier(); /* Wait for all the peers to be actually freed. */
        wg_ratelimiter_uninit();
        memzero_explicit(&wg->static_identity, sizeof(wg->static_identity));
-       free_percpu(dev->tstats);
        kvfree(wg->index_hashtable);
        kvfree(wg->peer_hashtable);
        mutex_unlock(&wg->device_update_lock);
@@ -297,6 +295,7 @@ static void wg_setup(struct net_device *dev)
        dev->hw_enc_features |= WG_NETDEV_FEATURES;
        dev->mtu = ETH_DATA_LEN - overhead;
        dev->max_mtu = round_down(INT_MAX, MESSAGE_PADDING_MULTIPLE) - overhead;
+       dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
 
        SET_NETDEV_DEVTYPE(dev, &device_type);
 
@@ -331,14 +330,10 @@ static int wg_newlink(struct net *src_net, struct net_device *dev,
        if (!wg->index_hashtable)
                goto err_free_peer_hashtable;
 
-       dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
-       if (!dev->tstats)
-               goto err_free_index_hashtable;
-
        wg->handshake_receive_wq = alloc_workqueue("wg-kex-%s",
                        WQ_CPU_INTENSIVE | WQ_FREEZABLE, 0, dev->name);
        if (!wg->handshake_receive_wq)
-               goto err_free_tstats;
+               goto err_free_index_hashtable;
 
        wg->handshake_send_wq = alloc_workqueue("wg-kex-%s",
                        WQ_UNBOUND | WQ_FREEZABLE, 0, dev->name);
@@ -397,8 +392,6 @@ err_destroy_handshake_send:
        destroy_workqueue(wg->handshake_send_wq);
 err_destroy_handshake_receive:
        destroy_workqueue(wg->handshake_receive_wq);
-err_free_tstats:
-       free_percpu(dev->tstats);
 err_free_index_hashtable:
        kvfree(wg->index_hashtable);
 err_free_peer_hashtable:
index e220d76..f705518 100644 (file)
@@ -164,8 +164,8 @@ get_peer(struct wg_peer *peer, struct sk_buff *skb, struct dump_ctx *ctx)
        if (!allowedips_node)
                goto no_allowedips;
        if (!ctx->allowedips_seq)
-               ctx->allowedips_seq = peer->device->peer_allowedips.seq;
-       else if (ctx->allowedips_seq != peer->device->peer_allowedips.seq)
+               ctx->allowedips_seq = ctx->wg->peer_allowedips.seq;
+       else if (ctx->allowedips_seq != ctx->wg->peer_allowedips.seq)
                goto no_allowedips;
 
        allowedips_nest = nla_nest_start(skb, WGPEER_A_ALLOWEDIPS);
@@ -255,17 +255,17 @@ static int wg_get_device_dump(struct sk_buff *skb, struct netlink_callback *cb)
        if (!peers_nest)
                goto out;
        ret = 0;
-       /* If the last cursor was removed via list_del_init in peer_remove, then
+       lockdep_assert_held(&wg->device_update_lock);
+       /* If the last cursor was removed in peer_remove or peer_remove_all, then
         * we just treat this the same as there being no more peers left. The
         * reason is that seq_nr should indicate to userspace that this isn't a
         * coherent dump anyway, so they'll try again.
         */
        if (list_empty(&wg->peer_list) ||
-           (ctx->next_peer && list_empty(&ctx->next_peer->peer_list))) {
+           (ctx->next_peer && ctx->next_peer->is_dead)) {
                nla_nest_cancel(skb, peers_nest);
                goto out;
        }
-       lockdep_assert_held(&wg->device_update_lock);
        peer = list_prepare_entry(ctx->next_peer, &wg->peer_list, peer_list);
        list_for_each_entry_continue(peer, &wg->peer_list, peer_list) {
                if (get_peer(peer, skb, ctx)) {
index df275b4..eb88511 100644 (file)
@@ -251,7 +251,7 @@ static bool decrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair)
 
        if (unlikely(!READ_ONCE(keypair->receiving.is_valid) ||
                  wg_birthdate_has_expired(keypair->receiving.birthdate, REJECT_AFTER_TIME) ||
-                 keypair->receiving_counter.counter >= REJECT_AFTER_MESSAGES)) {
+                 READ_ONCE(keypair->receiving_counter.counter) >= REJECT_AFTER_MESSAGES)) {
                WRITE_ONCE(keypair->receiving.is_valid, false);
                return false;
        }
@@ -318,7 +318,7 @@ static bool counter_validate(struct noise_replay_counter *counter, u64 their_cou
                for (i = 1; i <= top; ++i)
                        counter->backtrack[(i + index_current) &
                                ((COUNTER_BITS_TOTAL / BITS_PER_LONG) - 1)] = 0;
-               counter->counter = their_counter;
+               WRITE_ONCE(counter->counter, their_counter);
        }
 
        index &= (COUNTER_BITS_TOTAL / BITS_PER_LONG) - 1;
@@ -463,7 +463,7 @@ int wg_packet_rx_poll(struct napi_struct *napi, int budget)
                        net_dbg_ratelimited("%s: Packet has invalid nonce %llu (max %llu)\n",
                                            peer->device->dev->name,
                                            PACKET_CB(skb)->nonce,
-                                           keypair->receiving_counter.counter);
+                                           READ_ONCE(keypair->receiving_counter.counter));
                        goto next;
                }
 
index c6f6ac7..cb37817 100644 (file)
@@ -2072,6 +2072,7 @@ struct net_device {
                struct pcpu_sw_netstats __percpu        *tstats;
                struct pcpu_dstats __percpu             *dstats;
        };
+       unsigned long           state;
        unsigned int            flags;
        unsigned short          hard_header_len;
        netdev_features_t       features;
@@ -2117,7 +2118,6 @@ struct net_device {
         *      part of the usual set specified in Space.c.
         */
 
-       unsigned long           state;
 
        struct list_head        dev_list;
        struct list_head        napi_list;
index b49a7d6..0c7c67b 100644 (file)
@@ -822,9 +822,9 @@ typedef unsigned char *sk_buff_data_t;
  *     @decrypted: Decrypted SKB
  *     @slow_gro: state present at GRO time, slower prepare step required
  *     @mono_delivery_time: When set, skb->tstamp has the
- *             delivery_time in mono clock base (i.e., EDT) or a clock base chosen
- *             by SO_TXTIME. If zero, skb->tstamp has the (rcv) timestamp at
- *             ingress.
+ *             delivery_time in mono clock base (i.e. EDT).  Otherwise, the
+ *             skb->tstamp has the (rcv) timestamp at ingress and
+ *             delivery_time at egress.
  *     @napi_id: id of the NAPI struct this skb came from
  *     @sender_cpu: (aka @napi_id) source CPU in XPS
  *     @alloc_cpu: CPU which did the skb allocation.
index 8839133..004e651 100644 (file)
@@ -61,7 +61,11 @@ struct request_sock {
        struct request_sock             *dl_next;
        u16                             mss;
        u8                              num_retrans; /* number of retransmits */
-       u8                              syncookie:1; /* syncookie: encode tcpopts in timestamp */
+       u8                              syncookie:1; /* True if
+                                                     * 1) tcpopts needs to be encoded in
+                                                     *    TS of SYN+ACK
+                                                     * 2) ACK is validated by BPF kfunc.
+                                                     */
        u8                              num_timeout:7; /* number of timeouts */
        u32                             ts_recent;
        struct timer_list               rsk_timer;
@@ -144,6 +148,7 @@ reqsk_alloc(const struct request_sock_ops *ops, struct sock *sk_listener,
        sk_node_init(&req_to_sk(req)->sk_node);
        sk_tx_queue_clear(req_to_sk(req));
        req->saved_syn = NULL;
+       req->syncookie = 0;
        req->timeout = 0;
        req->num_timeout = 0;
        req->num_retrans = 0;
index 722787c..303a6ff 100644 (file)
@@ -11665,11 +11665,12 @@ static void __init net_dev_struct_check(void)
 
        /* TXRX read-mostly hotpath */
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, lstats);
+       CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, state);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, flags);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, hard_header_len);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, features);
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_txrx, ip6_ptr);
-       CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 38);
+       CACHELINE_ASSERT_GROUP_SIZE(struct net_device, net_device_read_txrx, 46);
 
        /* RX read-mostly hotpath */
        CACHELINE_ASSERT_GROUP_MEMBER(struct net_device, net_device_read_rx, ptype_specific);
index 4b2d46c..118d130 100644 (file)
@@ -889,7 +889,7 @@ int devlink_nl_port_new_doit(struct sk_buff *skb, struct genl_info *info)
                err = -ENOMEM;
                goto err_out_port_del;
        }
-       err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_NEW,
+       err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW,
                                   info->snd_portid, info->snd_seq, 0, NULL);
        if (WARN_ON_ONCE(err))
                goto err_out_msg_free;
index cb83c8f..9756e65 100644 (file)
@@ -148,14 +148,21 @@ static struct notifier_block hsr_nb = {
 
 static int __init hsr_init(void)
 {
-       int res;
+       int err;
 
        BUILD_BUG_ON(sizeof(struct hsr_tag) != HSR_HLEN);
 
-       register_netdevice_notifier(&hsr_nb);
-       res = hsr_netlink_init();
+       err = register_netdevice_notifier(&hsr_nb);
+       if (err)
+               return err;
+
+       err = hsr_netlink_init();
+       if (err) {
+               unregister_netdevice_notifier(&hsr_nb);
+               return err;
+       }
 
-       return res;
+       return 0;
 }
 
 static void __exit hsr_exit(void)
index 33f93dc..1fe7949 100644 (file)
@@ -1458,7 +1458,6 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
        skb->priority = (cork->tos != -1) ? cork->priority: READ_ONCE(sk->sk_priority);
        skb->mark = cork->mark;
        skb->tstamp = cork->transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
        /*
         * Steal rt from cork.dst to avoid a pair of atomic_inc/atomic_dec
         * on dst refcount
index 42ac434..dcb11f2 100644 (file)
@@ -357,10 +357,10 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
                goto error;
        skb_reserve(skb, hlen);
 
+       skb->protocol = htons(ETH_P_IP);
        skb->priority = READ_ONCE(sk->sk_priority);
        skb->mark = sockc->mark;
        skb->tstamp = sockc->transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
        skb_dst_set(skb, &rt->dst);
        *rtp = NULL;
 
index 7972ad3..500f665 100644 (file)
@@ -474,6 +474,9 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
                                  ireq->wscale_ok, &rcv_wscale,
                                  dst_metric(&rt->dst, RTAX_INITRWND));
 
+       /* req->syncookie is set true only if ACK is validated
+        * by BPF kfunc, then, rcv_wscale is already configured.
+        */
        if (!req->syncookie)
                ireq->rcv_wscale = rcv_wscale;
        ireq->ecn_ok &= cookie_ecn_ok(net, &rt->dst);
index 02eeca5..b9dd3a6 100644 (file)
@@ -1925,7 +1925,7 @@ struct sk_buff *__ip6_make_skb(struct sock *sk,
        skb->priority = READ_ONCE(sk->sk_priority);
        skb->mark = cork->base.mark;
        skb->tstamp = cork->base.transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
+
        ip6_cork_steal_dst(skb, cork);
        IP6_INC_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUTREQUESTS);
        if (proto == IPPROTO_ICMPV6) {
index ca49e66..0d896ca 100644 (file)
@@ -622,7 +622,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
        skb->priority = READ_ONCE(sk->sk_priority);
        skb->mark = sockc->mark;
        skb->tstamp = sockc->transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
+
        skb_put(skb, length);
        skb_reset_network_header(skb);
        iph = ipv6_hdr(skb);
index 8bad0a4..6d8286c 100644 (file)
@@ -258,6 +258,9 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
                                  ireq->wscale_ok, &rcv_wscale,
                                  dst_metric(dst, RTAX_INITRWND));
 
+       /* req->syncookie is set true only if ACK is validated
+        * by BPF kfunc, then, rcv_wscale is already configured.
+        */
        if (!req->syncookie)
                ireq->rcv_wscale = rcv_wscale;
        ireq->ecn_ok &= cookie_ecn_ok(net, dst);
index 7cfc7d3..18f616f 100644 (file)
@@ -2057,7 +2057,7 @@ retry:
        skb->priority = READ_ONCE(sk->sk_priority);
        skb->mark = READ_ONCE(sk->sk_mark);
        skb->tstamp = sockc.transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
+
        skb_setup_tx_timestamp(skb, sockc.tsflags);
 
        if (unlikely(extra_len == 4))
@@ -2586,7 +2586,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
        skb->priority = READ_ONCE(po->sk.sk_priority);
        skb->mark = READ_ONCE(po->sk.sk_mark);
        skb->tstamp = sockc->transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
        skb_setup_tx_timestamp(skb, sockc->tsflags);
        skb_zcopy_set_nouarg(skb, ph.raw);
 
@@ -3065,7 +3064,6 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
        skb->priority = READ_ONCE(sk->sk_priority);
        skb->mark = sockc.mark;
        skb->tstamp = sockc.transmit_time;
-       skb->mono_delivery_time = !!skb->tstamp;
 
        if (unlikely(extra_len == 4))
                skb->no_fcs = 1;
index 2899def..09a2801 100644 (file)
@@ -103,13 +103,12 @@ EXPORT_SYMBOL_GPL(rds_send_path_reset);
 
 static int acquire_in_xmit(struct rds_conn_path *cp)
 {
-       return test_and_set_bit(RDS_IN_XMIT, &cp->cp_flags) == 0;
+       return test_and_set_bit_lock(RDS_IN_XMIT, &cp->cp_flags) == 0;
 }
 
 static void release_in_xmit(struct rds_conn_path *cp)
 {
-       clear_bit(RDS_IN_XMIT, &cp->cp_flags);
-       smp_mb__after_atomic();
+       clear_bit_unlock(RDS_IN_XMIT, &cp->cp_flags);
        /*
         * We don't use wait_on_bit()/wake_up_bit() because our waking is in a
         * hot path and finding waiters is very rare.  We don't want to walk
index 5b59577..358cf30 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/jhash.h>
+#include <linux/module.h>
 #include <linux/sizes.h>
 #include <linux/vmalloc.h>
 #include <net/pkt_cls.h>
@@ -563,6 +564,7 @@ static struct Qdisc_ops fq_pie_qdisc_ops __read_mostly = {
        .dump_stats     = fq_pie_dump_stats,
        .owner          = THIS_MODULE,
 };
+MODULE_ALIAS_NET_SCH("fq_pie");
 
 static int __init fq_pie_module_init(void)
 {
index 07373c5..f4e8eb7 100644 (file)
@@ -20,6 +20,7 @@ CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h)
 CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h)
 CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h)
 CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h)
+CFLAGS_nlctrl:=$(call get_hdr_inc,__LINUX_GENERIC_NETLINK_H,genetlink.h)
 CFLAGS_nfsd:=$(call get_hdr_inc,_LINUX_NFSD_NETLINK_H,nfsd_netlink.h)
 CFLAGS_ovs_datapath:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
 CFLAGS_ovs_flow:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)
index 9cd5e88..380cb15 100755 (executable)
@@ -217,6 +217,7 @@ for family in 4 6; do
        cleanup
 
        create_ns
+       ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
        ip netns exec $NS_DST ethtool -K veth$DST rx-gro-list on
        run_test "GRO frag list" $BM_NET$DST 1 0
        cleanup
@@ -227,6 +228,7 @@ for family in 4 6; do
        # use NAT to circumvent GRO FWD check
        create_ns
        ip -n $NS_DST addr add dev veth$DST $BM_NET$DST_NAT/$SUFFIX
+       ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
        ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
        ip netns exec $NS_DST $IPT -t nat -I PREROUTING -d $BM_NET$DST_NAT \
                                        -j DNAT --to-destination $BM_NET$DST
@@ -240,6 +242,7 @@ for family in 4 6; do
        cleanup
 
        create_vxlan_pair
+       ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
        ip netns exec $NS_DST ethtool -K veth$DST rx-gro-list on
        run_test "GRO frag list over UDP tunnel" $OL_NET$DST 1 1
        cleanup
@@ -247,6 +250,7 @@ for family in 4 6; do
        # use NAT to circumvent GRO FWD check
        create_vxlan_pair
        ip -n $NS_DST addr add dev $VXDEV$DST $OL_NET$DST_NAT/$SUFFIX
+       ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
        ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
        ip netns exec $NS_DST $IPT -t nat -I PREROUTING -d $OL_NET$DST_NAT \
                                        -j DNAT --to-destination $OL_NET$DST
index 5ae85de..3a394b4 100755 (executable)
@@ -249,9 +249,9 @@ cleanup
 create_ns
 ip -n $NS_DST link set dev veth$DST up
 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
-chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
+chk_gro_flag "gro vs xdp while down - gro flag off" $DST off
 ip -n $NS_DST link set dev veth$DST down
-chk_gro_flag "                      - after down" $DST on
+chk_gro_flag "                      - after down" $DST off
 ip -n $NS_DST link set dev veth$DST xdp off
 chk_gro_flag "                      - after xdp off" $DST off
 ip -n $NS_DST link set dev veth$DST up
@@ -260,6 +260,21 @@ ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp
 chk_gro_flag "                      - after peer xdp" $DST off
 cleanup
 
+create_ns
+ip -n $NS_DST link set dev veth$DST up
+ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp
+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
+chk_gro_flag "gro vs xdp while down - gro flag on" $DST on
+ip -n $NS_DST link set dev veth$DST down
+chk_gro_flag "                      - after down" $DST on
+ip -n $NS_DST link set dev veth$DST xdp off
+chk_gro_flag "                      - after xdp off" $DST on
+ip -n $NS_DST link set dev veth$DST up
+chk_gro_flag "                      - after up" $DST on
+ip -n $NS_SRC link set dev veth$SRC xdp object ${BPF_FILE} section xdp
+chk_gro_flag "                      - after peer xdp" $DST on
+cleanup
+
 create_ns
 chk_channels "default channels" $DST 1 1
 
@@ -327,11 +342,14 @@ if [ $CPUS -gt 2 ]; then
 fi
 
 ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} section xdp 2>/dev/null
-chk_gro_flag "with xdp attached - gro flag" $DST on
+chk_gro_flag "with xdp attached - gro flag" $DST off
 chk_gro_flag "        - peer gro flag" $SRC off
 chk_tso_flag "        - tso flag" $SRC off
 chk_tso_flag "        - peer tso flag" $DST on
 ip netns exec $NS_DST ethtool -K veth$DST rx-udp-gro-forwarding on
+chk_gro "        - no aggregation" 10
+ip netns exec $NS_DST ethtool -K veth$DST generic-receive-offload on
+chk_gro_flag "        - gro flag with GRO on" $DST on
 chk_gro "        - aggregation" 1
 
 
index 2fc36ef..a7f8e8a 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_ARCH_RV32I=y
 CONFIG_MMU=y
 CONFIG_FPU=y
 CONFIG_SOC_VIRT=y
+CONFIG_RISCV_ISA_FALLBACK=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
index dc266f3..daeb3e5 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARCH_RV64I=y
 CONFIG_MMU=y
 CONFIG_FPU=y
 CONFIG_SOC_VIRT=y
+CONFIG_RISCV_ISA_FALLBACK=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y