All of lore.kernel.org
 help / color / mirror / Atom feed
From: Enrico Mioso <mrkiko.rs@gmail.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: Midge Shaojun Tan <ShaojunMidge.Tan@audiocodes.com>,
	Kevin Zhu <Mingying.Zhu@audiocodes.com>,
	Eli Britstein <Eli.Britstein@audiocodes.com>,
	Alex Strizhevsky <alexxst@gmail.com>,
	"youtux@gmail.com" <youtux@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Is this 32-bit NCM?y
Date: Thu, 4 Dec 2014 13:17:17 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.03.1412041302260.9926@gmail.com> (raw)
In-Reply-To: <877fy7myfb.fsf@nemi.mork.no>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3995 bytes --]




On Thu, 4 Dec 2014, Bjørn Mork wrote:

> "Midge Shaojun  Tan" <ShaojunMidge.Tan@audiocodes.com> writes:
>
>> Hi all,
>>
>> I test OK with kervel 3.16.4
>> Need disable other Ethernet network, just like eth1. (Then the DNS and route is OK)
>> And also need disable arp, (ifconfig wwan0 -arp up), because China UNICOM don't respond the ARP message.
>
> The ARP functionality is independent of operator.  It is handled
> internally by the modem firmware.  There are no MAC addresses or
> ethernet headers transmitted over the radio link.  That's all faked by
> the modem.  All MAC addresses and ethernet headers are local to the
> modem<->host USB link.
>
>> With new mode switch string: /etc/usb_modeswitch.d/12d1:14fe
>> Please see the patch and check whether it is correct?
>
> I see that you have two changes there:
>
> 1) the ETH_HLEN adjustment of ctx->tx_remainder is dropped
> 2) the NDP is placed after the first frame.
>
> I haven't verified the effect of the tx_remainder change, but I assume
> it fixes an alignment problem for this device.  I'd like to look more at
> the effect of this for different values of wNdpOutPayloadRemainder and
> wNdpOutDivisor.
>
> We can choose to put the NDP at the end of the NTB if we find that this
> fixes some problem, but doing so by default for every NCM and MBIM
> device is a bit risky. If we accept that some devices are so buggy that
> the NDP cannot be placed anywhere (as required by the spec), then we
> have to assume that this goes both ways.  Which means that moving the
> NDP to the end of the NTB might break some other device.  We just don't
> know that since we haven't ever tried it.

Guys - this is a little hard moment for my life, so sorry if I sound negative 
too, really. No humor here.

Bjorn, I am starting to think that we might need to (sadly) differentiate how
we threat "standard" NCM devices in respect to Huawei ones, a little bit more.
As you said - changing the handling in any way would be too risky - and
definitely, I am starting to think that different firmware versions have
different bugs in this regard (might be not in NCM handling itself, but in
respect to other areas, like ARP handling / faking ).
At the end we might come out with a good enough solution - but we would start 
to complicate things more and more, and definitely we might end up complicating
more and more the driver itself. At some point, we might also end up finding 
out that we need a different workarounds for different firmwares, not even 
compatible one another.
so - my idea, that is hypotetical:
1 - Factorize out cdc_ncm more
2 - Creating new {tx,rx}_fixup routines applying different workarounds.

then, when the need to apply different workarounds for difference device (or 
firmware versions) arise, we might also think of a way to communicate to the 
driver the firmware version, allowing it to select some quirks to apply.
What do you all think about it?

> And your fix doesn't really move it to the end either.  It just places
> the NDP after the first ethernet packet.  Which happens to be the end if
> there is only one packet in the NTB. But if we aggregate more packets
> into this NTB then the result will look like this:
>
> NTH
> eth packet 1
> NDP
> eth packet 2
> ..
> eth packet N
>
> I'm not convinced this modem will handle that if it cannot handle the
> NDP being before the first packet...  This needs to be tested.  Try
> increasing /sys/class/net/wwan0/cdc_ncm/tx_timer_usecs to force the
> driver to aggregate packets and see if everything still works.
> Preferably while looking at the resulting NTB to verify that it does
> contain more than one ethernet packet.
>
> I realize I sound a bit negative now.  This is absolutely not my
> intention. This is great work, providing some real progress wrt figuring
> out what goes on here.  Thanks a lot!  I am sure we can sort out the
> remaining issues, which are really minor compared to what you have found
> so far.
>
>
>
> Bjørn
>
>
I'll test this now.

  reply	other threads:[~2014-12-04 12:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 10:10 Is this 32-bit NCM?y Midge Shaojun  Tan
     [not found] ` <AMSPR06MB6011E001029C251790CB923EE780-MyG0ARRHH/drF+2gGhmTpL9PrO6axcR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-12-04 10:24   ` Enrico Mioso
2014-12-04 10:33 ` Enrico Mioso
2014-12-04 11:44 ` Bjørn Mork
2014-12-04 12:17   ` Enrico Mioso [this message]
     [not found]   ` <877fy7myfb.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2014-12-04 12:28     ` Enrico Mioso
     [not found]       ` <alpine.LNX.2.03.1412041326160.9926-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-05  2:20         ` Kevin Zhu
     [not found]           ` <54811670.5030703-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>
2014-12-05  9:42             ` Bjørn Mork
     [not found]               ` <8761dqjuuh.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2014-12-05  9:59                 ` Enrico Mioso
2014-12-28 14:53               ` refactoring cdc_ncm Enrico Mioso
2015-01-19 16:51               ` [discuss] [cdc_ncm] Refactoring cdc_ncm Enrico Mioso
  -- strict thread matches above, loose matches on Subject: below --
2014-11-26 21:51 Is this 32-bit NCM? Enrico Mioso
2014-11-27 18:34 ` Enrico Mioso
2014-11-28  9:29   ` Bjørn Mork
2014-12-01 21:11     ` Enrico Mioso
2014-12-01 22:02       ` Eli Britstein
2014-12-02  3:53         ` Kevin Zhu
2014-12-02  6:32           ` Enrico Mioso
2014-12-02  6:43             ` Kevin Zhu
2014-12-02  6:49               ` Enrico Mioso
2014-12-02  7:44                 ` Kevin Zhu
2014-12-02  7:45                   ` Eli Britstein
2014-12-02  8:03                     ` Kevin Zhu
2014-12-02 10:32                       ` Enrico Mioso
2014-12-02 11:21                         ` Bjørn Mork
2014-12-02 13:11                           ` Enrico Mioso
2014-12-02 13:37                             ` Bjørn Mork
2014-12-02 13:53                               ` Enrico Mioso
2014-12-02 15:04                                 ` Kevin Zhu
2014-12-02 15:28                                   ` Enrico Mioso
2014-12-03  5:38                                     ` Kevin Zhu
2014-12-03  6:00                                       ` Enrico Mioso
2014-12-03  6:05                                         ` Kevin Zhu
2014-12-04  6:31                                           ` Is this 32-bit NCM?y Enrico Mioso
2014-12-04  8:52                                             ` Kevin Zhu
2014-12-04  8:56                                               ` Enrico Mioso
     [not found]                                                 ` <alpine.LNX.2.03.1412040955140.3516-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-04  9:01                                                   ` Kevin Zhu
2014-12-04  9:19                                               ` Bjørn Mork
2014-12-04  9:26                                                 ` Kevin Zhu
     [not found]                                                   ` <548028A0.5000909-6C2+4RG2qWF0ubjbjo6WXg@public.gmane.org>
2014-12-04  9:28                                                     ` Enrico Mioso
2014-12-04  9:55                                                   ` Bjørn Mork
2014-12-04  9:53                                                 ` Enrico Mioso
2014-12-04 10:02                                                   ` Bjørn Mork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.03.1412041302260.9926@gmail.com \
    --to=mrkiko.rs@gmail.com \
    --cc=Eli.Britstein@audiocodes.com \
    --cc=Mingying.Zhu@audiocodes.com \
    --cc=ShaojunMidge.Tan@audiocodes.com \
    --cc=alexxst@gmail.com \
    --cc=bjorn@mork.no \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=youtux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.