From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by dpdk.org (Postfix) with ESMTP id B1F735F1D for ; Wed, 10 Apr 2019 13:33:52 +0200 (CEST) Received: by mail-yb1-f182.google.com with SMTP id u187so653509ybg.11 for ; Wed, 10 Apr 2019 04:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MKuXOJ/8U5eR0jdn/d5d2psgiKW7y88gBNpfhQnVS1M=; b=njYpbzmReq+p/mV3kQmr3NM+bKk92YfgaC7jWSbAbtQI1W6WZqphzCWMJwwZexFtR+ Pz+V6NqBNs8NpQ58E1ww8sVkwjmO+trA3Vb4WQn0N7J9JUZh5GZQDvG59139cVMplcZj 80ZkuE708c9XsTJItXuniC9vJYRPkH+28q5GZLSlceMXnB9TNpJ80k//guLB03i4VPxZ kmkb1O18aJEKMj0s687gP6Ks8RyBLrolmBfHj5wr8HbhPCLIRh01Zt/4dsn42av2bweF SlOLBEJjanxK+zwO33TyvTg3B0NWNmt9eOvARZWOGJ50CHL3AnNpIxx51RJEp7b6bTTG cTww== 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=MKuXOJ/8U5eR0jdn/d5d2psgiKW7y88gBNpfhQnVS1M=; b=sKADm5s3iHj0r8KYOh+6R3J095Ex1EhQNYsTz7f47UBKjwS7d/Hda14Gry0MhDmrXL PO2dnFPPBi3fc1TWfZJe+c+czhooLFOCzuoZCbVbAQ4Es06ULFw4feipLkSgYNPM+kWM YP1hne2z5J9KY0hrevmssfLkE6pdW2HQooWOrIxQ3gAvUxhIGGE7MmECaH7OYP7GwsYp JHjks+YbqfX+OrXP6iDsc+iCpsQSED/o9x0UXLIOy0wvi6dKCRc2mcYGi+lSVco1Lcpg Y2Oz7e4bakSiruuxQ0ZtM0vW7A456tu4JetUUzp6Vr2bGHCBX7OdmDiFOGpVQFGvECNW YOHw== X-Gm-Message-State: APjAAAWUmM5zJ/qG2hAD3GcVuUqLzlRimGPAgvrFmgSaSZVonmVz23o6 BzqP021Gv8B4DvdnMg4XHkGDD/7Ck5f44H/b8+0= X-Google-Smtp-Source: APXvYqz98vfaWUyecR6AzFUG78uFW0WobGzW+JVc19Zj/c4Nvxj1h3pIntaEnJPR4U63PqOcYDNc7PxG/3wzy1jNvLk= X-Received: by 2002:a25:9b43:: with SMTP id u3mr16693291ybo.24.1554896032178; Wed, 10 Apr 2019 04:33:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?UHJ6ZW15c8WCYXcgT8WCdGFyemV3c2tp?= Date: Wed, 10 Apr 2019 13:39:58 +0200 Message-ID: To: David Marchand Cc: Chas Williams <3chas3@gmail.com>, dev X-Mailman-Approved-At: Wed, 10 Apr 2019 16:02:30 +0200 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [Bug 248] Bonding PMD: Invalid array dimension in TX burst for 802.3ad mode with fast queue leads to SEGFAULT 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: Wed, 10 Apr 2019 11:33:52 -0000 Hello David, I can merge these fixes and run our system using patched DPDK version. Then report back any problems / improvements I observe. I can also walk through source code changes and check for anything questionable. Unfortunately I lack deep enough understanding of DPDK source code to test these fixes comprehensively and I have been short on time recently as well, so that's the best I can do right now. Best Regards, Przemys=C5=82aw O=C5=82tarzewski On Tue, Apr 9, 2019 at 4:51 PM David Marchand wrote: > > > On Tue, Apr 9, 2019 at 4:45 PM wrote: > >> https://bugs.dpdk.org/show_bug.cgi?id=3D248 >> >> Bug ID: 248 >> Summary: Bonding PMD: Invalid array dimension in TX burst for >> 802.3ad mode with fast queue leads to SEGFAULT >> Product: DPDK >> Version: 18.11 >> Hardware: All >> OS: All >> Status: CONFIRMED >> Severity: major >> Priority: Normal >> Component: ethdev >> Assignee: dev@dpdk.org >> Reporter: p.oltarzewski@gmail.com >> Target Milestone: --- >> >> DPDK 18.11.1 >> >> In drivers/net/bonding/rte_eth_bond_pmd.c::bond_ethdev_tx_burst_8023ad, >> bufs_slave_port_idxs array is defined as follows (lines 1293-1294): >> >> /* Mapping array generated by hash function to map mbufs to slaves *= / >> uint16_t bufs_slave_port_idxs[RTE_MAX_ETHPORTS] =3D { 0 }; >> >> Array dimension should be equal to number of packets being transmitted >> (nb_pkts) - as correctly implemented in >> rte_eth_bond_pmd.c::bond_ethdev_tx_burst_balance. >> >> Invalid array dimension causes overflow when number of transmitted >> packets is >> greater than RTE_MAX_ETHPORTS. Some areas of memory end up overwritten >> (in my >> particular case, slave_nb_bufs array), which leads to SIGSEGV and crash. >> >> To work around the issue, ensure that number of packets transmitted in a >> single >> burst is no greater than RTE_MAX_ETHPORTS. >> >> To fix it, it should be sufficient to define bufs_slave_port_idxs as a >> variable-length array, as in bond_ethdev_tx_burst_balance: >> >> /* Mapping array generated by hash function to map mbufs to slaves *= / >> uint16_t bufs_slave_port_idxs[nb_bufs]; >> > > I have a series of fixes for this, and on the rx parts as well but did no= t > have time to properly check them. > Would you have some time to test it if I send it ? > > > -- > 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 DD963A0096 for ; Wed, 10 Apr 2019 16:02:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D1101B14D; Wed, 10 Apr 2019 16:02:32 +0200 (CEST) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by dpdk.org (Postfix) with ESMTP id B1F735F1D for ; Wed, 10 Apr 2019 13:33:52 +0200 (CEST) Received: by mail-yb1-f182.google.com with SMTP id u187so653509ybg.11 for ; Wed, 10 Apr 2019 04:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MKuXOJ/8U5eR0jdn/d5d2psgiKW7y88gBNpfhQnVS1M=; b=njYpbzmReq+p/mV3kQmr3NM+bKk92YfgaC7jWSbAbtQI1W6WZqphzCWMJwwZexFtR+ Pz+V6NqBNs8NpQ58E1ww8sVkwjmO+trA3Vb4WQn0N7J9JUZh5GZQDvG59139cVMplcZj 80ZkuE708c9XsTJItXuniC9vJYRPkH+28q5GZLSlceMXnB9TNpJ80k//guLB03i4VPxZ kmkb1O18aJEKMj0s687gP6Ks8RyBLrolmBfHj5wr8HbhPCLIRh01Zt/4dsn42av2bweF SlOLBEJjanxK+zwO33TyvTg3B0NWNmt9eOvARZWOGJ50CHL3AnNpIxx51RJEp7b6bTTG cTww== 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=MKuXOJ/8U5eR0jdn/d5d2psgiKW7y88gBNpfhQnVS1M=; b=sKADm5s3iHj0r8KYOh+6R3J095Ex1EhQNYsTz7f47UBKjwS7d/Hda14Gry0MhDmrXL PO2dnFPPBi3fc1TWfZJe+c+czhooLFOCzuoZCbVbAQ4Es06ULFw4feipLkSgYNPM+kWM YP1hne2z5J9KY0hrevmssfLkE6pdW2HQooWOrIxQ3gAvUxhIGGE7MmECaH7OYP7GwsYp JHjks+YbqfX+OrXP6iDsc+iCpsQSED/o9x0UXLIOy0wvi6dKCRc2mcYGi+lSVco1Lcpg Y2Oz7e4bakSiruuxQ0ZtM0vW7A456tu4JetUUzp6Vr2bGHCBX7OdmDiFOGpVQFGvECNW YOHw== X-Gm-Message-State: APjAAAWUmM5zJ/qG2hAD3GcVuUqLzlRimGPAgvrFmgSaSZVonmVz23o6 BzqP021Gv8B4DvdnMg4XHkGDD/7Ck5f44H/b8+0= X-Google-Smtp-Source: APXvYqz98vfaWUyecR6AzFUG78uFW0WobGzW+JVc19Zj/c4Nvxj1h3pIntaEnJPR4U63PqOcYDNc7PxG/3wzy1jNvLk= X-Received: by 2002:a25:9b43:: with SMTP id u3mr16693291ybo.24.1554896032178; Wed, 10 Apr 2019 04:33:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?UHJ6ZW15c8WCYXcgT8WCdGFyemV3c2tp?= Date: Wed, 10 Apr 2019 13:39:58 +0200 Message-ID: To: David Marchand Cc: Chas Williams <3chas3@gmail.com>, dev X-Mailman-Approved-At: Wed, 10 Apr 2019 16:02:30 +0200 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [Bug 248] Bonding PMD: Invalid array dimension in TX burst for 802.3ad mode with fast queue leads to SEGFAULT 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: <20190410113958.kzao8U2oVZsU8bRGYNrPYKO9fJzhKgXXpwxB3I09IZY@z> Hello David, I can merge these fixes and run our system using patched DPDK version. Then report back any problems / improvements I observe. I can also walk through source code changes and check for anything questionable. Unfortunately I lack deep enough understanding of DPDK source code to test these fixes comprehensively and I have been short on time recently as well, so that's the best I can do right now. Best Regards, Przemys=C5=82aw O=C5=82tarzewski On Tue, Apr 9, 2019 at 4:51 PM David Marchand wrote: > > > On Tue, Apr 9, 2019 at 4:45 PM wrote: > >> https://bugs.dpdk.org/show_bug.cgi?id=3D248 >> >> Bug ID: 248 >> Summary: Bonding PMD: Invalid array dimension in TX burst for >> 802.3ad mode with fast queue leads to SEGFAULT >> Product: DPDK >> Version: 18.11 >> Hardware: All >> OS: All >> Status: CONFIRMED >> Severity: major >> Priority: Normal >> Component: ethdev >> Assignee: dev@dpdk.org >> Reporter: p.oltarzewski@gmail.com >> Target Milestone: --- >> >> DPDK 18.11.1 >> >> In drivers/net/bonding/rte_eth_bond_pmd.c::bond_ethdev_tx_burst_8023ad, >> bufs_slave_port_idxs array is defined as follows (lines 1293-1294): >> >> /* Mapping array generated by hash function to map mbufs to slaves *= / >> uint16_t bufs_slave_port_idxs[RTE_MAX_ETHPORTS] =3D { 0 }; >> >> Array dimension should be equal to number of packets being transmitted >> (nb_pkts) - as correctly implemented in >> rte_eth_bond_pmd.c::bond_ethdev_tx_burst_balance. >> >> Invalid array dimension causes overflow when number of transmitted >> packets is >> greater than RTE_MAX_ETHPORTS. Some areas of memory end up overwritten >> (in my >> particular case, slave_nb_bufs array), which leads to SIGSEGV and crash. >> >> To work around the issue, ensure that number of packets transmitted in a >> single >> burst is no greater than RTE_MAX_ETHPORTS. >> >> To fix it, it should be sufficient to define bufs_slave_port_idxs as a >> variable-length array, as in bond_ethdev_tx_burst_balance: >> >> /* Mapping array generated by hash function to map mbufs to slaves *= / >> uint16_t bufs_slave_port_idxs[nb_bufs]; >> > > I have a series of fixes for this, and on the rx parts as well but did no= t > have time to properly check them. > Would you have some time to test it if I send it ? > > > -- > David Marchand >