From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by dpdk.org (Postfix) with ESMTP id 26CE21B19 for ; Sun, 24 Mar 2019 18:11:15 +0100 (CET) Received: by mail-vs1-f68.google.com with SMTP id f22so365779vso.7 for ; Sun, 24 Mar 2019 10:11:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b8eng5idyabGolQJlsdDXze0mX2WV0BkX57uyZUgZkU=; b=pbSKdrqD8HibV+3bsR/ficOPI2g4VxmP67g2SSAKGc5hHA4q7yk4wdN01dZ29PpkqH eK3qawq4oJyG6EwZqb+eb7VO6A0HTy1Gi0ctRcYxd8/GSJKY/FEfchvx/eefxC0H94w0 ZGrOD+BUDUsduaFmzyXnZz4Eq7u9fJ3I3dSbNi9/N+4wtrPQn0g9LoSVQSQ6yU1fiMWp LFqInaGFm9WuHBb+FcCCAR5vqfSa+N3cLlryd4/emG2t5BKCmxY76+suPR7+UqDH2G0A FgTtPu1wFMYX1/It9PObqfKKr/cJCoWxKXGtxw3/eZ8SSLkgB9L5MtjuiVv5GWZ4Scyj q1dA== X-Gm-Message-State: APjAAAWI5drI0yvEyUhPkhEuAfk6xPqbcAbjHD2Vk0UI8Yn5hIbu9od8 M7Pb9gIHjqqeF4AtvMrHFjYsSdTrt8kZ0og8z4RiWQ== X-Google-Smtp-Source: APXvYqxBxqP2HzhTI7d/D/4HHZE0QstoJyoQ7rtx1cNykgSNMQFHNSGg4NeOECa5eWcdpRdIwJhdo5O2lI77W7PXE5M= X-Received: by 2002:a67:c986:: with SMTP id y6mr12292123vsk.198.1553447473106; Sun, 24 Mar 2019 10:11:13 -0700 (PDT) MIME-Version: 1.0 References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> <1553200094-5487-2-git-send-email-david.marchand@redhat.com> <615b76a3-ea73-19b7-c1b2-9ee1862473a6@gmail.com> In-Reply-To: <615b76a3-ea73-19b7-c1b2-9ee1862473a6@gmail.com> From: David Marchand Date: Sun, 24 Mar 2019 18:11:02 +0100 Message-ID: To: Chas Williams <3chas3@gmail.com> Cc: dev , "Yigit, Ferruh" , chas3@att.com, "Zhaohui (zhaohui, Polestar)" , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 2/2] net/bonding: fix oob access in "other" aggregator modes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Mar 2019 17:11:16 -0000 On Sun, Mar 24, 2019 at 2:35 PM Chas Williams <3chas3@gmail.com> wrote: > Have you ever experienced this problem in practice? I ask because I am > considering some fixes that would limit the number of slaves to a more > reasonable number (and reduce the over stack usage of the bonding driver > in general). > Not too hard to reproduce, the problem is not the number of slaves. With a default RTE_MAX_ETHPORTS at 32, any slave whose portid >= 8 would trigger an oob access. Example: # git describe v19.02-294-gad2f555 # gdb ./master/app/testpmd (gdb) b selection_logic (gdb) run -c 0x3 --no-pci --vdev net_ring0 --vdev net_ring1 --vdev net_ring2 --vdev net_ring3 --vdev net_ring4 --vdev net_ring5 --vdev net_ring6 --vdev net_ring7 --vdev net_ring8 --vdev net_ring9 --vdev net_bonding0,mode=4,slave=8,slave=9 -- -i --total-num-mbufs 2048 Breakpoint 1, selection_logic (internals=0x17fe51980, slave_id=8) at /root/dpdk/drivers/net/bonding/rte_eth_bond_8023ad.c:670 670 uint16_t slaves_count, new_agg_id, i, j = 0; Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.3.x86_64 libgcc-4.8.5-36.el7.x86_64 numactl-libs-2.0.9-7.el7.x86_64 (gdb) n 672 uint64_t agg_bandwidth[8] = {0}; (gdb) 673 uint64_t agg_count[8] = {0}; (gdb) 674 uint16_t default_slave = 0; (gdb) p agg_bandwidth $1 = {0, 0, 0, 0, 0, 0, 0, 0} (gdb) p agg_count $2 = {0, 0, 0, 0, 0, 0, 0, 0} (gdb) n 678 slaves = internals->active_slaves; (gdb) 679 slaves_count = internals->active_slave_count; (gdb) 680 port = &bond_mode_8023ad_ports[slave_id]; (gdb) 683 for (i = 0; i < slaves_count; ++i) { (gdb) 684 agg = &bond_mode_8023ad_ports[slaves[i]]; (gdb) 686 if (agg->aggregator_port_id != slaves[i]) (gdb) 689 agg_count[agg->aggregator_port_id] += 1; (gdb) 690 rte_eth_link_get_nowait(slaves[i], &link_info); (gdb) p agg_bandwidth $3 = {1, 0, 0, 0, 0, 0, 0, 0} (gdb) p agg_count $4 = {0, 0, 0, 0, 0, 0, 0, 0} -- David Marchand From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 82120A05D3 for ; Sun, 24 Mar 2019 18:11:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 477462956; Sun, 24 Mar 2019 18:11:18 +0100 (CET) Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by dpdk.org (Postfix) with ESMTP id 26CE21B19 for ; Sun, 24 Mar 2019 18:11:15 +0100 (CET) Received: by mail-vs1-f68.google.com with SMTP id f22so365779vso.7 for ; Sun, 24 Mar 2019 10:11:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b8eng5idyabGolQJlsdDXze0mX2WV0BkX57uyZUgZkU=; b=pbSKdrqD8HibV+3bsR/ficOPI2g4VxmP67g2SSAKGc5hHA4q7yk4wdN01dZ29PpkqH eK3qawq4oJyG6EwZqb+eb7VO6A0HTy1Gi0ctRcYxd8/GSJKY/FEfchvx/eefxC0H94w0 ZGrOD+BUDUsduaFmzyXnZz4Eq7u9fJ3I3dSbNi9/N+4wtrPQn0g9LoSVQSQ6yU1fiMWp LFqInaGFm9WuHBb+FcCCAR5vqfSa+N3cLlryd4/emG2t5BKCmxY76+suPR7+UqDH2G0A FgTtPu1wFMYX1/It9PObqfKKr/cJCoWxKXGtxw3/eZ8SSLkgB9L5MtjuiVv5GWZ4Scyj q1dA== X-Gm-Message-State: APjAAAWI5drI0yvEyUhPkhEuAfk6xPqbcAbjHD2Vk0UI8Yn5hIbu9od8 M7Pb9gIHjqqeF4AtvMrHFjYsSdTrt8kZ0og8z4RiWQ== X-Google-Smtp-Source: APXvYqxBxqP2HzhTI7d/D/4HHZE0QstoJyoQ7rtx1cNykgSNMQFHNSGg4NeOECa5eWcdpRdIwJhdo5O2lI77W7PXE5M= X-Received: by 2002:a67:c986:: with SMTP id y6mr12292123vsk.198.1553447473106; Sun, 24 Mar 2019 10:11:13 -0700 (PDT) MIME-Version: 1.0 References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> <1553200094-5487-2-git-send-email-david.marchand@redhat.com> <615b76a3-ea73-19b7-c1b2-9ee1862473a6@gmail.com> In-Reply-To: <615b76a3-ea73-19b7-c1b2-9ee1862473a6@gmail.com> From: David Marchand Date: Sun, 24 Mar 2019 18:11:02 +0100 Message-ID: To: Chas Williams <3chas3@gmail.com> Cc: dev , "Yigit, Ferruh" , chas3@att.com, "Zhaohui (zhaohui, Polestar)" , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 2/2] net/bonding: fix oob access in "other" aggregator modes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190324171102.1LdELsoGud3BS4nfCRfkNp697fsgkcab3t-FxdIosQQ@z> On Sun, Mar 24, 2019 at 2:35 PM Chas Williams <3chas3@gmail.com> wrote: > Have you ever experienced this problem in practice? I ask because I am > considering some fixes that would limit the number of slaves to a more > reasonable number (and reduce the over stack usage of the bonding driver > in general). > Not too hard to reproduce, the problem is not the number of slaves. With a default RTE_MAX_ETHPORTS at 32, any slave whose portid >= 8 would trigger an oob access. Example: # git describe v19.02-294-gad2f555 # gdb ./master/app/testpmd (gdb) b selection_logic (gdb) run -c 0x3 --no-pci --vdev net_ring0 --vdev net_ring1 --vdev net_ring2 --vdev net_ring3 --vdev net_ring4 --vdev net_ring5 --vdev net_ring6 --vdev net_ring7 --vdev net_ring8 --vdev net_ring9 --vdev net_bonding0,mode=4,slave=8,slave=9 -- -i --total-num-mbufs 2048 Breakpoint 1, selection_logic (internals=0x17fe51980, slave_id=8) at /root/dpdk/drivers/net/bonding/rte_eth_bond_8023ad.c:670 670 uint16_t slaves_count, new_agg_id, i, j = 0; Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.3.x86_64 libgcc-4.8.5-36.el7.x86_64 numactl-libs-2.0.9-7.el7.x86_64 (gdb) n 672 uint64_t agg_bandwidth[8] = {0}; (gdb) 673 uint64_t agg_count[8] = {0}; (gdb) 674 uint16_t default_slave = 0; (gdb) p agg_bandwidth $1 = {0, 0, 0, 0, 0, 0, 0, 0} (gdb) p agg_count $2 = {0, 0, 0, 0, 0, 0, 0, 0} (gdb) n 678 slaves = internals->active_slaves; (gdb) 679 slaves_count = internals->active_slave_count; (gdb) 680 port = &bond_mode_8023ad_ports[slave_id]; (gdb) 683 for (i = 0; i < slaves_count; ++i) { (gdb) 684 agg = &bond_mode_8023ad_ports[slaves[i]]; (gdb) 686 if (agg->aggregator_port_id != slaves[i]) (gdb) 689 agg_count[agg->aggregator_port_id] += 1; (gdb) 690 rte_eth_link_get_nowait(slaves[i], &link_info); (gdb) p agg_bandwidth $3 = {1, 0, 0, 0, 0, 0, 0, 0} (gdb) p agg_count $4 = {0, 0, 0, 0, 0, 0, 0, 0} -- David Marchand