From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B95CA0548; Fri, 23 Apr 2021 11:34:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 002144067E; Fri, 23 Apr 2021 11:34:15 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 0BF874014F for ; Fri, 23 Apr 2021 11:34:14 +0200 (CEST) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FRTZW1N8gzvST8; Fri, 23 Apr 2021 17:31:47 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Fri, 23 Apr 2021 17:34:06 +0800 To: Stephen Hemminger CC: , , References: <1619090834-14643-1-git-send-email-humin29@huawei.com> <1619090834-14643-3-git-send-email-humin29@huawei.com> <20210422082045.35db7756@hermes.local> From: "Min Hu (Connor)" Message-ID: <312ff8cb-6f04-2dbc-be80-d13fd1979e8c@huawei.com> Date: Fri, 23 Apr 2021 17:34:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210422082045.35db7756@hermes.local> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 2/2] net/tap: fix tap interrupt vector array size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" ÔÚ 2021/4/22 23:20, Stephen Hemminger дµÀ: > On Thu, 22 Apr 2021 19:27:14 +0800 > "Min Hu (Connor)" wrote: > >> diff --git a/drivers/net/tap/tap_intr.c b/drivers/net/tap/tap_intr.c >> index 5cf4f17..1cacc15 100644 >> --- a/drivers/net/tap/tap_intr.c >> +++ b/drivers/net/tap/tap_intr.c >> @@ -59,7 +59,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev) >> >> if (!dev->data->dev_conf.intr_conf.rxq) >> return 0; >> - intr_handle->intr_vec = malloc(sizeof(intr_handle->intr_vec[rxqs_n])); >> + intr_handle->intr_vec = malloc(sizeof(int) * rxqs_n); > > Maybe calloc() here would be good idea? > Hi, Stephen, No need to use calloc, because members of 'intr_handle->intr_vec' array will be set new value. >