diff mbox series

Fix MRU mismatch issue which may lead to data connection lost

Message ID 20220114100731.4033-1-slark_xiao@163.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Fix MRU mismatch issue which may lead to data connection lost | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Slark Xiao Jan. 14, 2022, 10:07 a.m. UTC
In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info.
This value shall be used for whole mhi if it's given a value for a specific product.
But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU.
'mru_default' shall have higher priority than MHI_DEFAULT_MRU.
And after checking, this change could help fix a data connection lost issue.

Signed-off-by: Shujun Wang <wsj20369@163.com>
Signed-off-by: Slark Xiao <slark_xiao@163.com>
---
 drivers/net/wwan/mhi_wwan_mbim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Loic Poulain Jan. 14, 2022, 4:03 p.m. UTC | #1
On Fri, 14 Jan 2022 at 11:07, Slark Xiao <slark_xiao@163.com> wrote:
>
> In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info.
> This value shall be used for whole mhi if it's given a value for a specific product.
> But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU.
> 'mru_default' shall have higher priority than MHI_DEFAULT_MRU.
> And after checking, this change could help fix a data connection lost issue.

Interesting, not sure why it fixes data issues, since the device
should comply with any size.Can you add a Fixes tag then? and add the
correct [PATCH net] suffix in the subject:
https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html

With that:

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

Thanks,
Loic




>
> Signed-off-by: Shujun Wang <wsj20369@163.com>
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
> ---
>  drivers/net/wwan/mhi_wwan_mbim.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
> index 71bf9b4f769f..6872782e8dd8 100644
> --- a/drivers/net/wwan/mhi_wwan_mbim.c
> +++ b/drivers/net/wwan/mhi_wwan_mbim.c
> @@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work)
>         int err;
>
>         while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) {
> -               struct sk_buff *skb = alloc_skb(MHI_DEFAULT_MRU, GFP_KERNEL);
> +               struct sk_buff *skb = alloc_skb(mbim->mru, GFP_KERNEL);
>
>                 if (unlikely(!skb))
>                         break;
>
>                 err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb,
> -                                   MHI_DEFAULT_MRU, MHI_EOT);
> +                                   mbim->mru, MHI_EOT);
>                 if (unlikely(err)) {
>                         kfree_skb(skb);
>                         break;
> --
> 2.25.1
>
Slark Xiao Jan. 15, 2022, 2:10 a.m. UTC | #2
At 2022-01-14 23:51:53, "Loic Poulain" <loic.poulain@linaro.org> wrote:
>On Fri, 14 Jan 2022 at 11:07, Slark Xiao <slark_xiao@163.com> wrote:
>>
>> In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info.
>> This value shall be used for whole mhi if it's given a value for a specific product.
>> But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU.
>> 'mru_default' shall have higher priority than MHI_DEFAULT_MRU.
>> And after checking, this change could help fix a data connection lost issue.
>
>Interesting, not sure why it fixes data issues, since the device
>should comply with any size.Can you add a Fixes tag then? and add the
>correct [PATCH net] suffix in the subject:
>https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html
>
>With that:
>
>Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
>
>Thanks,
>Loic
>
Hi Loic,
   Actually, for our Foxconn device SDX55, it has been confirmed that MRU 3500 
would lead to a IPA stuck. IPA stuck would make the data connection lost. 
For other MRU value, like 4000, 4096,32768, we can't reproduce it. 
  We also have report this issue in https://bugzilla.kernel.org/show_bug.cgi?id=215433 .
  I will send a new patch later.

Thanks
Slark
>
>
>
>>
>> Signed-off-by: Shujun Wang <wsj20369@163.com>
>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>> ---
>>  drivers/net/wwan/mhi_wwan_mbim.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
>> index 71bf9b4f769f..6872782e8dd8 100644
>> --- a/drivers/net/wwan/mhi_wwan_mbim.c
>> +++ b/drivers/net/wwan/mhi_wwan_mbim.c
>> @@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work)
>>         int err;
>>
>>         while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) {
>> -               struct sk_buff *skb = alloc_skb(MHI_DEFAULT_MRU, GFP_KERNEL);
>> +               struct sk_buff *skb = alloc_skb(mbim->mru, GFP_KERNEL);
>>
>>                 if (unlikely(!skb))
>>                         break;
>>
>>                 err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb,
>> -                                   MHI_DEFAULT_MRU, MHI_EOT);
>> +                                   mbim->mru, MHI_EOT);
>>                 if (unlikely(err)) {
>>                         kfree_skb(skb);
>>                         break;
>> --
>> 2.25.1
>>
diff mbox series

Patch

diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c
index 71bf9b4f769f..6872782e8dd8 100644
--- a/drivers/net/wwan/mhi_wwan_mbim.c
+++ b/drivers/net/wwan/mhi_wwan_mbim.c
@@ -385,13 +385,13 @@  static void mhi_net_rx_refill_work(struct work_struct *work)
 	int err;
 
 	while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) {
-		struct sk_buff *skb = alloc_skb(MHI_DEFAULT_MRU, GFP_KERNEL);
+		struct sk_buff *skb = alloc_skb(mbim->mru, GFP_KERNEL);
 
 		if (unlikely(!skb))
 			break;
 
 		err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb,
-				    MHI_DEFAULT_MRU, MHI_EOT);
+				    mbim->mru, MHI_EOT);
 		if (unlikely(err)) {
 			kfree_skb(skb);
 			break;