Skip to content

drivers/ethernet: Adapt stellaris driver to new L2 behaviour #11869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

tbursztyka
Copy link
Collaborator

L2 is the one who requests the packet to be sent, and not via net_if API
anymore. Stellaris driver was merged right after this behaviour change
and was thus lacking the proper modification.

Signed-off-by: Tomasz Bursztyka [email protected]

L2 is the one who requests the packet to be sent, and not via net_if API
anymore. Stellaris driver was merged right after this behaviour change
and was thus lacking the proper modification.

Signed-off-by: Tomasz Bursztyka <[email protected]>
@tbursztyka tbursztyka requested a review from jukkar December 5, 2018 08:55
@tbursztyka tbursztyka requested a review from pfalcon as a code owner December 5, 2018 08:55
@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

cc: @bravegnu

Copy link
Collaborator

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's always tempting to ask if this was tested, but let's closing eyes and going forward is apparently the best approach here anyway.

@jukkar
Copy link
Member

jukkar commented Dec 5, 2018

It's always tempting to ask if this was tested, but let's closing eyes and going forward is apparently the best approach here anyway.

These kind of passive-aggressive comments do not really help anybody. If you need the info, just ask if / how this has been tested.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

If you need the info, just ask if / how this has been tested.

I asked in #10547 (comment) and got no reply. I asked yesterday (about testing in general) during the monthly meeting. @tbursztyka left by that time (I saw him leaving just as I spoke the question, to be exact). And you said that you don't remember details of a particular case to test, and in general, you don't do "stress testing". I expected another guy to talk about testing in general and testing of his TCP implementation in particular, and he just didn't show up. Oh, I wanted to ask if somebody uses the testsuite developed by that guy, but as everyone was apparently too keen to close that (last in the year, and thus summary-of-the-year) meeting early, I just didn't.

Passive-aggressive comments you say? Let my just shut up then.

@jukkar
Copy link
Member

jukkar commented Dec 5, 2018

I asked in #10547 (comment) and got no reply.

Hmm, this was submitted under 1 hour ago, how some other PR is related to this one.

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

Hmm, this was submitted under 1 hour ago, how some other PR is related to this one.

In pretty obvious way IMHO - there're too many questions about testing, and too few answers. Whereas in the ideal case, there wouldn't be even questions, but information on the testing. But surely, that can be just my skewed perception, sorry.

@tbursztyka
Copy link
Collaborator Author

tbursztyka commented Dec 5, 2018

Let my just shut up then.

You would have read the commit message, you would have known why this situation happened. It's not L2 rework PR that was the culprit, but really the Stellaris ethernet driver's PR that was not rebased/tested once mine got in.

@tbursztyka
Copy link
Collaborator Author

Actually, I noticed the original PR introducing this driver also add the ethernet stats. which is good, but it's doing it in the wrong place, I missed that. Up to L2 to update such stats and not each and every driver

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

It's not L2 rework PR that was the culprit, but really the Stellaris ethernet driver's PR that was not rebased/tested once mine got in.

Well, but the talk is not about this, but whether after this change, the stellaris ethernet driver was test to work (again). If that was done, that's high mark, and should be talked about, to encourage your other colleagues do the same with their changes (which is hard, we don't have enough hardware, time, etc.).

And if it's not, it would be fair to ask @bravegnu (the author of the driver) to test it, and give him some time for that.

So, my comments are very intent-based, and are not made to just stir up conflict.

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

Actually, I noticed the original PR introducing this driver also add the ethernet stats.

More routines for more ethernet stat events specifically (or what I see there). I actually waited for them to be merged for my #11680 too.

So, if there's something wrong with that part (maybe you mean something else), I'd be interested to be in loop.

@tbursztyka
Copy link
Collaborator Author

So, if there's something wrong with that part (maybe you mean something else), I'd be interested to be in loop.

What's wrong with it is the place where the stats are updated. It should be in subsys/net/l2/ethernet.c:ethernet_send(). I'll send a PR to fix this

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

I'll send a PR to fix this

Thanks!

And to say which might have fallen thru the cracks - thanks @tbursztyka for coming forward with updating this driver, and do it so promptly, instead of letting it start to bitrot - it's absolutely great!

@bravegnu
Copy link
Contributor

bravegnu commented Dec 5, 2018

Ran a basic ping test, on this change. My initial observation is that for ping packets the "Bytes sent" does not get incremented. While the count increments in the original version of the driver. But the "Bytes sent" gets incremented for TCP packets, in both the versions.

@bravegnu
Copy link
Contributor

bravegnu commented Dec 5, 2018

Actually, I noticed the original PR introducing this driver also add the ethernet stats. which is good, but it's doing it in the wrong place, I missed that. Up to L2 to update such stats and not each and every driver

https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/ethernet/eth_native_posix.c is also updating the stats. Thought it was a missing feature in other drivers.

@pfalcon
Copy link
Collaborator

pfalcon commented Dec 5, 2018

@bravegnu: Thanks for testing! Great to know that the packet passing works as expected. Stats hopefully will be revamped by @tbursztyka as he said.

eth_native_posix.c is also updating the stats. Thought it was a missing feature in other drivers.

I noticed the same, and figured my stance on that would be that it's useful to have Eth-level stats for testing drivers, like native_posix, stellaris, and I decided to also maintain them in my wip smsc9118 driver.

Anyway, if I understood @tbursztyka right, he plans to make Eth stats to work for any Eth driver automagically.

@codecov-io
Copy link

Codecov Report

Merging #11869 into master will decrease coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11869      +/-   ##
==========================================
- Coverage   51.43%    51.3%   -0.14%     
==========================================
  Files         231      231              
  Lines       28751    28752       +1     
  Branches     7152     7156       +4     
==========================================
- Hits        14789    14751      -38     
- Misses      11144    11188      +44     
+ Partials     2818     2813       -5
Impacted Files Coverage Δ
subsys/shell/shell_dummy.c 37.14% <0%> (-8.58%) ⬇️
subsys/shell/shell.c 31.36% <0%> (-3.76%) ⬇️
subsys/net/ip/udp.c 64.58% <0%> (-2.09%) ⬇️
subsys/net/ip/ipv4.c 62.19% <0%> (-1.91%) ⬇️
subsys/net/ip/connection.c 74.6% <0%> (-0.66%) ⬇️
subsys/net/ip/tcp.c 56.98% <0%> (-0.4%) ⬇️
subsys/net/ip/icmpv6.c 30.48% <0%> (-0.35%) ⬇️
kernel/mutex.c 97.05% <0%> (ø) ⬆️
subsys/net/ip/utils.c 79.37% <0%> (+1.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 459ad67...8ba8f7f. Read the comment docs.

@tbursztyka
Copy link
Collaborator Author

@bravegnu the original is not going to compile on master branch so I guess you mean the original in your former dev branch. I don't think that patch affects anything about stats (note that I use data_len instead of net_pkt_get_len(), but data_len isn't modified as far as I see)

@bravegnu
Copy link
Contributor

bravegnu commented Dec 5, 2018

@tbursztyka I agree that the issue was not introduced by this change. The stats issues needs to be fixed separately.

@jukkar jukkar merged commit 1a59e0a into zephyrproject-rtos:master Dec 5, 2018
@tbursztyka tbursztyka deleted the stellaris_eth_fix branch December 7, 2018 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants