- Feb 16, 2016
-
-
Alessandro Rubini authored
Again, it returns 1 if it did some calculation. For profiling. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is a step towards profiling. The functions being polled return whether or not they did actually work. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The compiler is smart enough to turn this into a multiplication by 8: cf54: 3d c1 00 03 sli r1,r14,3 cf58: 59 a1 00 00 sw (r13+0),r1 and any real division by ll would be trapped by ./check-error.c . Still, I'd better simplify the code. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This solves http://www.ohwr.org/issues/1218 We used to have a "needIP" variable, but we need three states: if the address was set by bootp, we run bootp again when the link goes up, but if it was a static assignment we do not (and keep the static one). So I renamend needIP to a 3-valued ip_status. The rename ensured the compiler found all users. Also, the messages are now 3-headed, so the user know whether the address is static or it comes from bootp. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Feb 15, 2016
-
-
Alessandro Rubini authored
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This is needed for the syslog code to know about link up and down events, to report a link-up with the delay since last link-down. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We are going to have link up messages in syslog, we we'd better pass it over and not do network thiings in main. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I don't know why, but without this the next commit fails with a bad assert error in the compiler. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We need the string for IP and MAC in more places than stdout. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This costs 1K in binary size, and it currently only prints an alive message every 10 seconds. The time format is still wrong, so the syslog daemon adds its own timestamp. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
They are going to be used by the syslog code. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Jan 21, 2016
-
-
Alessandro Rubini authored
This pair of commits costs around 300 bytes overall, in network-using configurations. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
We are going to add more UDP services, so this commit adds the generic management of UDP sockets, with udp protocol and port matching. Thus, we now have two IPV4 sockets: one for ICMP and one for bootp; whose receive part relies on generic code for the match. We still miss the output helpers, so with this commit bootp still builds the whole frame by itself. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
I also change the prototype of the socket creation so the compile can warn me where the locally-allocated socket must be changed. The size saving is not huge, but this allows later creation of further sockets with a smaller overhead (e.g.: the syslog socket that sends only has no queue, and the snmp socket needs a very small buffer). Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
This has no effect, but greatly simplifies the later vlan-based operation. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The misbehavior can be reproduced with ping -s 422 192.168.16.200 now, the first frame is fully stored to the queue: copy_out: head 368 avail 512 len 2 copy_out: head 370 avail 510 len 14 copy_out: head 384 avail 496 len 24 copy_out: head 408 avail 472 len 450 but it is retrieved only partially: copy_in: tail 368 avail 22 len 2 copy_in: tail 370 avail 24 len 14 copy_in: tail 384 avail 38 len 24 copy_in: tail 408 avail 62 len 400 The tail of the frame remains in the queue, and is not correctly removed. So we have: update_rx_queues: queue for socket full; [avail 462 required 490] (because 50 bytes are lost there). And the next rx frame, the tail of the previous one is considered size, then truncated to the payload buffer size (here 400 for icmp), so we never realign: copy_out: head 346 avail 462 len 2 copy_out: head 348 avail 460 len 14 copy_out: head 362 avail 446 len 24 copy_out: head 386 avail 422 len 84 Q: Size 84 head 470 Smac 0:4:25:12:34:56 update_rx_queues: saved packet to queue [avail 338 n 1 size 124] copy_in: tail 296 avail 338 len 2 copy_in: tail 298 avail 340 len 14 copy_in: tail 312 avail 354 len 24 copy_in: tail 336 avail 378 len 400 So the available space in the 512-big queue explodes (and ping gets no replies): copy_in: tail 120 avail 1326 len 400 In the caller I got one reply and nothing more, not even the short pings: 68 bytes from 192.168.16.200: icmp_req=1 ttl=63 (truncated) 5 packets transmitted, 1 received, 80% packet loss, time 4009ms With this commit everything flows 68 bytes from 192.168.16.200: icmp_req=1 ttl=63 (truncated) 68 bytes from 192.168.16.200: icmp_req=2 ttl=63 (truncated) 68 bytes from 192.168.16.200: icmp_req=3 ttl=63 (truncated) 64 bytes from 192.168.16.200: icmp_req=1 ttl=63 time=2.02 ms 64 bytes from 192.168.16.200: icmp_req=2 ttl=63 time=1.61 ms Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Several advantages: - normal practice: you send a buffer pointer and its own len - rx values is already fixed, earlier the wrong result was wrongly used - this detaches us from the header length. Transparent vlan ahead... Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
- Jan 20, 2016
-
-
Alessandro Rubini authored
We removed the pool of sockets, to only keep a list of pointers. The caller provides the socket (and the buffer). This saves from 440 to 1570 bytes in the binary (more in the ones with no CONFIG_IP, beause sockets are not used. Now we can move to a caller-defined queue size, when I find the time and willingness. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
-
Alessandro Rubini authored
This changes the pfilter rule-set, to make it ready for vlan addition. Moreover, it removes the choice between three rule-sets and uses one that works for everyone (we'll add the vlan option later on). Moreover, we prepare for the option of peer-delay PTP and UDP-based PTP. As a side effect, one Kconfig option is removed. We know for sure that what goes to the "streamer" protocol is re-checked, so the streamer can get some "everything else", exactly like the 7S wr-nic (that sends to the host everything unused). This is the current rule set: - everything tagged is dropped - CPU: arp broadcast, not unicast (i.e. requests only). - CPU: PTP ethtype. Any mac address. - CPU: ICMP unicast, not broadcast. - CPU: UDP (uni/multicast), ports bootpc, ptp-event, ptp-general. - Etherbone (class 7): UDP (uni/multicast) and port 0xebd0 - Other fabric (class 6): anything not Etherbone (inverted class 7 bit) This counts up to 28 rules. We have 4 more rules available and we may add options, either at build time or run time to add udp ports or other ethertypes. Or not... 2 caveats: - frames for the CPU will have class bits 0x41 instead of 0x01, because everything not etherbone will receive bit 6. This is not a problem, as the CPU is not checking the class bits. - the wr-nic gateware, when using this new sw code base, must be changed to use classes 6 and 7 like everybody else, not classes 7 and 5. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-
Alessandro Rubini authored
The description of class management was not completely clear or correct, so it's now rewritten with some references to gateware files. Signed-off-by:
Alessandro Rubini <rubini@gnudd.com>
-