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 5CA74A0552; Wed, 1 Jun 2022 03:53:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CB2140A84; Wed, 1 Jun 2022 03:53:01 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id B194440150; Wed, 1 Jun 2022 03:52:59 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LCXGR0FyvzDqcV; Wed, 1 Jun 2022 09:52:47 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 1 Jun 2022 09:52:57 +0800 Subject: Re: [PATCH] kni: fix compile error To: Andrew Rybchenko , CC: , Ferruh Yigit , Helin Zhang References: <20220521070642.35413-1-humin29@huawei.com> From: "Min Hu (Connor)" Message-ID: <242997ca-ba66-f923-892a-10f9e105cb20@huawei.com> Date: Wed, 1 Jun 2022 09:52:57 +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: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 Hi, Andrew , 在 2022/6/1 0:42, Andrew Rybchenko 写道: > On 5/21/22 10:06, Min Hu (Connor) wrote: >> When kernel version change into 5.18 from 5.17, 'netif_rx_ni' is discard. >> It is replaced by 'netif_rx' and this API is also supported in the >> version below 5.18. >> >> This patch fixed it. >> >> Fixes: d89a58dfe90b ("kni: support chained mbufs") >> Cc: stable@dpdk.org >> >> Signed-off-by: Min Hu (Connor) >> --- >>   kernel/linux/kni/kni_net.c | 4 ++-- >>   1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c >> index 29e5b9e21f..e19f03285e 100644 >> --- a/kernel/linux/kni/kni_net.c >> +++ b/kernel/linux/kni/kni_net.c >> @@ -441,7 +441,7 @@ kni_net_rx_normal(struct kni_dev *kni) >>           skb->ip_summed = CHECKSUM_UNNECESSARY; >>           /* Call netif interface */ >> -        netif_rx_ni(skb); >> +        netif_rx(skb); > > I think the approach in [1] is the right one. Any comments? > > [1] > https://patches.dpdk.org/project/dpdk/patch/20220525102641.20982-1-jslaby@suse.cz/ > > >>           /* Update statistics */ >>           dev->stats.rx_bytes += len; >> @@ -779,7 +779,7 @@ kni_net_set_mac(struct net_device *netdev, void *p) >>           return -EADDRNOTAVAIL; >>       memcpy(req.mac_addr, addr->sa_data, netdev->addr_len); >> -    memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); >> +    memcpy((void *)(netdev->dev_addr), addr->sa_data, netdev->addr_len); When compile, it will report a warning, because it claims that the parameter types must be the same. void *memcpy(void *destin, void *source, unsigned n); so this is what I am doing. > > I don't understand why the change is needed and the patch description > does not shed any light on it. > >>       ret = kni_net_process_request(netdev, &req); > > .