From patchwork Tue Mar 6 09:37:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar X-Patchwork-Id: 35681 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA8202BF7; Tue, 6 Mar 2018 10:37:15 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 90CDE2BF2 for ; Tue, 6 Mar 2018 10:37:14 +0100 (CET) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w269Z4Bq027438 for ; Tue, 6 Mar 2018 04:37:13 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ghnr9pk2h-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 06 Mar 2018 04:37:13 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Mar 2018 09:37:09 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 6 Mar 2018 09:37:06 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w269b6Zf66781408; Tue, 6 Mar 2018 09:37:06 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3798E11C052; Tue, 6 Mar 2018 09:29:53 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56DC011C04A; Tue, 6 Mar 2018 09:29:52 +0000 (GMT) Received: from chozha.in.ibm.com (unknown [9.109.215.15]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 6 Mar 2018 09:29:52 +0000 (GMT) From: Gowrishankar To: dev@dpdk.org Cc: Declan Doherty , stable@dpdk.org, Gowrishankar Muthukrishnan Date: Tue, 6 Mar 2018 15:07:04 +0530 X-Mailer: git-send-email 1.9.1 X-TM-AS-GCONF: 00 x-cbid: 18030609-0020-0000-0000-000003FF3F5B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030609-0021-0000-0000-000042937C09 Message-Id: <46c04d58a3b4aec442f615a4ee3dc9fc130e5fc9.1520328421.git.gowrishankar.m@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-06_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803060111 Subject: [dpdk-dev] [PATCH] net/bonding: avoid wrong casting on primary_slave_port_id from input param 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" From: Gowrishankar Muthukrishnan primary_slave_port_id is uint16_t which needs to be correctly stored with the same data type of input parameter in bond_ethdev_configure. Fixes: f8244c6399 ("ethdev: increase port id range") Cc: stable@dpdk.org Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Ferruh Yigit --- In powerpc, creating bond pmd results in below error due to wrong cast on input param. This is reproducible, only when using shared libraries. sudo -E LD_LIBRARY_PATH=$PWD/$RTE_TARGET/lib $RTE_TARGET/app/testpmd \ -l 0,8 --socket-mem=1024,1024 \ --vdev 'net_tap0,iface=dpdktap0' --vdev 'net_tap1,iface=dpdktap1' \ --vdev 'net_bonding0,mode=1,slave=0,slave=1,primary=0,socket_id=1' \ -d $RTE_TARGET/lib/librte_pmd_tap.so \ -d $RTE_TARGET/lib/librte_mempool_ring.so -- --forward-mode=rxonly Configuring Port 0 (socket 0) PMD: net_tap0: 0x70a854070280: TX configured queues number: 1 PMD: net_tap0: 0x70a854070280: RX configured queues number: 1 Port 0: 86:EA:6D:52:3E:DB Configuring Port 1 (socket 0) PMD: net_tap1: 0x70a854074300: TX configured queues number: 1 PMD: net_tap1: 0x70a854074300: RX configured queues number: 1 Port 1: 42:9A:B8:49:B6:00 Configuring Port 2 (socket 1) EAL: Failed to set primary slave port 7424 on bonded device net_bonding0 Fail to configure port 2 EAL: Error - exiting with code: 1 Cause: Start ports failed drivers/net/bonding/rte_eth_bond_args.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 27d3101..e99681e 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -244,7 +244,7 @@ if (primary_slave_port_id < 0) return -1; - *(uint8_t *)extra_args = (uint8_t)primary_slave_port_id; + *(uint16_t *)extra_args = (uint16_t)primary_slave_port_id; return 0; }