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 6A61BA0548; Wed, 1 Jun 2022 10:48:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C5AF40DDE; Wed, 1 Jun 2022 10:48:04 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 3BF2040689; Wed, 1 Jun 2022 10:48:03 +0200 (CEST) Received: from [192.168.1.38] (unknown [188.170.81.145]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 54B4BB0; Wed, 1 Jun 2022 11:48:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 54B4BB0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1654073281; bh=gITrSn+fGqhx9IN/IO+jcIkEDG6zvPgthiXkFzu9ox4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kgptvmU2vlabhic5+e5WcBARFTSWECtLEGpaQJEPe7bEg8QSm4D8M4M7Py8/7BmkJ 2JiQfxVHCiqUoff+cIZnB6v4GeAjUpVzK36Nkzmmi2lgx3P8Fn0yikifla2D3UTFLj l9ovc7+dRfGXAIObrXbCzRW71Qp7EBZvoHllfD48= Message-ID: Date: Wed, 1 Jun 2022 11:47:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] kni: fix compile error Content-Language: en-US To: "Min Hu (Connor)" , dev@dpdk.org Cc: stable@dpdk.org, Ferruh Yigit , Helin Zhang References: <20220521070642.35413-1-humin29@huawei.com> <242997ca-ba66-f923-892a-10f9e105cb20@huawei.com> From: Andrew Rybchenko In-Reply-To: <242997ca-ba66-f923-892a-10f9e105cb20@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 6/1/22 04:52, Min Hu (Connor) wrote: > 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 think it is a separate story vs netif_rx_ni(). So, it should not be in the same patch. IMHO, it is closer to [1] [1] https://patches.dpdk.org/project/dpdk/patch/20220601015925.35304-1-humin29@huawei.com/ Am I missing something? >> >> 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); >> >> .