From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id BC0B03B5 for ; Tue, 16 Dec 2014 14:40:36 +0100 (CET) Received: by mail-wg0-f46.google.com with SMTP id x13so17405566wgg.19 for ; Tue, 16 Dec 2014 05:40:36 -0800 (PST) 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=wkSCuE1BlDszPXT+soN8rTBoYdigQmslFCuirZX1nac=; b=S8bZbxTa2rl/AYmq8d3WOMPBnyio4lzjBnRZOI4BuP66SNgBWiyVQLe0xuVwDmYLvk 8+9dUv4eXIbpVW3BAAA+/uZDAitcSU/XkTxOb0XPxmn4r6QMuNWtHvqpwgkYjPCmGEWc /r9xonRedHlETN2j+g/jQ80QTHpAQfxyhHSTcZ7Nofxbr119maRF1juXTPaARiy90Zpy ZMWahvft2dvuyLZlkSr3ez/WhMvWFEny5BfHOKRtDsarAJDj76shzVMcSsGghnUEHRdq 99BnSr6ELUAMw75J+J/FzX+HzVxoqWRBvncjkx5jOlf0qd+XIjWAyl7K3NWNuepT73uG ZYPw== X-Gm-Message-State: ALoCoQl6FkHMMSUWmugSTrVSp0S7oZdBmkbY9XHWdGxyXXx9ieYh3JXkeNmGvm9wJbqpO/WHegXM X-Received: by 10.180.103.229 with SMTP id fz5mr4973398wib.31.1418737236060; Tue, 16 Dec 2014 05:40:36 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id nj9sm2192649wic.10.2014.12.16.05.40.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 05:40:35 -0800 (PST) From: Thomas Monjalon To: Bruce Richardson Date: Tue, 16 Dec 2014 14:40:09 +0100 Message-ID: <2281526.Jgy67gTqhP@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <1418736437-30585-1-git-send-email-bruce.richardson@intel.com> References: <1418736437-30585-1-git-send-email-bruce.richardson@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] testpmd: limit port mask bits to RTE_MAX_ETHPORTS 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, 16 Dec 2014 13:40:36 -0000 2014-12-16 13:27, Bruce Richardson: > The port mask parsing in testpmd allowed up to 64 bits to be processed, > even if RTE_MAX_ETHPORTS is set to a max of 32. Fix this by only > processing up to min(RTE_MAX_ETHPORTS,64) bits of the mask. [...] > - for (i = 0; i < 64; i++) { > + for (i = 0; i < 64 && i < RTE_MAX_ETHPORTS; i++) { Why not use RTE_MIN? -- Thomas