From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 22BE130E for ; Tue, 1 Jul 2014 16:16:29 +0200 (CEST) Received: by mail-wi0-f177.google.com with SMTP id r20so7885257wiv.10 for ; Tue, 01 Jul 2014 07:16:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=BX7agQVnZSv2mugTmuvfOBd0XXzcawjrME9veWMFQ4k=; b=IQpCuiNgehSrDXebTBZIBqT+dNzX4kyRd4NW+OfLCr4lDVKan4jDWb53xbugqixPaJ LKwHODB43rtsWoV1U2R1tCWMmx7p/5Eh4kb1+qrha4Yz7PI0OsZfoqs7mZnWmvVIEOze 73ZgKphD2Ei+y07hQLPcIcdAcLjUUb+J+DY6a08RP4sRI75Teiqlng+ND0bHNEHDA7aX 9qd0+iNyd0Lhcdu5Hiu4DIMy8VVLJoT2Bd93TZg4Dojx4qWKqyIoYJDt8CCV64ornjrh 4Ly2tUZRsTCjNc+BS71xVkx9nFBdOSB85bwozaz/8FGlPUypOhuIbobvNvzzn8grVCTc gPjA== X-Gm-Message-State: ALoCoQmc26U67JMc5PrNrUoa7iBLVmf7p005pKhMS9pOODa8HVgrG/bpxQiZdATedR607oZS13SR X-Received: by 10.194.11.74 with SMTP id o10mr17507802wjb.82.1404224207788; Tue, 01 Jul 2014 07:16:47 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id w9sm19197889wif.12.2014.07.01.07.16.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 07:16:46 -0700 (PDT) From: Thomas Monjalon To: Declan Doherty Date: Tue, 01 Jul 2014 16:16:38 +0200 Message-ID: <3320876.itqhkFR1Bu@xps13> Organization: 6WIND User-Agent: KMail/4.13.1 (Linux/3.14.6-1-ARCH; KDE/4.13.1; x86_64; ; ) In-Reply-To: References: <1403864324-12022-1-git-send-email-declan.doherty@intel.com> <1404064161-26370-2-git-send-email-declan.doherty@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v11 1/5] bond: new link bonding library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 14:16:29 -0000 Hi Declan, Do you confirm we should merge the Robert's patch in rc3? 2014-06-30 18:29, Robert Sanford: > I see a potential problem with bond_ethdev_rx_burst( ). > We could receive more packets than the caller asked for, and overrun the > caller's rte_mbuf * array. > The fix could be something like this: > > --- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c > +++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c > @@ -73,13 +73,15 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf > **bufs, uint16_t nb_pkts) > case BONDING_MODE_ROUND_ROBIN: > case BONDING_MODE_BROADCAST: > case BONDING_MODE_BALANCE: > - for (i = 0; i < internals->active_slave_count; i++) { > + for (i = 0; i < internals->active_slave_count && nb_pkts; > i++) { > /* Offset of pointer to *bufs increases as packets > are received > * from other slaves */ > num_rx_slave = > rte_eth_rx_burst(internals->active_slaves[i], > bd_rx_q->queue_id, bufs + > num_rx_total, nb_pkts); > - if (num_rx_slave) > + if (num_rx_slave) { > num_rx_total += num_rx_slave; > + nb_pkts -= num_rx_slave; > + } > } > break; > case BONDING_MODE_ACTIVE_BACKUP: