From patchwork Wed Aug 5 13:48:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Balabanov X-Patchwork-Id: 6708 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 6B6B75A24; Wed, 5 Aug 2015 15:48:35 +0200 (CEST) Received: from mail.ecotelecom.ru (mail.ecotelecom.ru [193.105.59.24]) by dpdk.org (Postfix) with ESMTP id 697545960 for ; Wed, 5 Aug 2015 15:48:34 +0200 (CEST) Received: from stand.ecotelecom.ru (unknown [10.210.0.221]) by mail.ecotelecom.ru (Postfix) with ESMTP id 0BCB5D407BC; Wed, 5 Aug 2015 16:48:34 +0300 (MSK) From: Sergey Balabanov To: dev@dpdk.org Date: Wed, 5 Aug 2015 16:48:32 +0300 Message-Id: <1438782512-8364-1-git-send-email-balabanovsv@ecotelecom.ru> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] bonding: 8023ad: fix incorrect typecast of socket 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On slave activation in LACP (8023AD) SOCKET_ANY_ID (which is -1) is being casted to unsigned char and then to signed int. The result is that socket_id has value of 255, not -1. This results to memory allocation failure. Acked-by: Pablo de Lara --- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 97a828e..c0f0b99 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -849,7 +849,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) }; char mem_name[RTE_ETH_NAME_MAX_LEN]; - uint8_t socket_id; + int socket_id; unsigned element_size; /* Given slave mus not be in active list */