Looking for network link speed determination algorithm [closed] - networking

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for the best way to interpret the standard (well, standardish) Ethernet PHY registers, to determine the speed that an Ethernet link is actually running at. (e.g. 10/100/1000 and full/half-duplex)
I daresay that this is to be found in the source of things like Linux, and I'm just off to look there now, but if anyone has a good reference I'd be interested.
What I'm interested in is if it actually linked and what it linked at, rather than the vast sea of possibilities that each end has advertised at the outset.

Thanks for the answer. It's intended as a language and platform agnostic question, because pretty much all MII/GMII Ethernet PHYs have the same basic registers. I happen to be on an embedded platform.
But I found a sensible sequence which was good enough for my restricted application by looking at various bits of Linux driver source - it's basically:
Check for link-up in basic-status (0x1)
If the link's up then check for negotiation-complete in basic status (0x1)
If the negotiation's complete then check for 1G in the 1000M-status register (0xa)
If you've not got 1G, then you've got 100M. (That's not a general rule, but it applies in this application)
Maybe this was really a hardware question rather than a software one...

To help you looking at how the Linux kernel does it: While each driver can do its own thing, there is a generic version which is supposed to be used when the chip follows the standard closely enough: Generic Media Independent Interface device support.

Related

How to Convert OpenCL code from FP32 to FP16? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Is there a way to automatically convert a code that has been written to do FP32 calculations on a FP32 GPU, so it can do always FP16 calculations instead of FP32?
What I'm trying to achieve is to run a code for an old GPU(that doesn't support HALF Type), to run on a newer GPU that does... but without going through the code myself...
If not possible, show me some a light on what documentations should I read, to do it myself...
(new GPU is Radeon Vega Frontier, driver is ROCm 1.9.1, OS is Ubuntu 18.04)
(the code is extensive and composed by different modules... so I won't be posting it here, unless asked to)
No, there is no standard flag to say "treat float as half". You have to change "float" to "half". Also, your device must support fp16 calculations (many don't, just fp16 storage that converts to/from fp32 when you load/store). The cl_khr_fp16 extension adds support for half scalar and vector types as built-in types that can be used for arithmetic operations. You'll need a #prama in any kernels that use it.

Book suggestions for Low-level ethernet/networking (e.g. MII) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I had a colleague who is using Xilinx's LocalLink TEMAC
While I find the DS interesting, I would like to learn more about the basics of it. Does anyone have any recommendations for a good low-level intro to networking/ethernet book?
I don't need to know "how to be a good network administrator", but rather interfaces like the MII, GMII, and how they communicate with different PHYs that are on the market. My questions that I'd like to learn about are similar to:
What is ethernet?
How are packets structured?
What is a preamble and how is it used?
What is a frame?
I'd also be interested in online sites if it's really much easier to learn from in your opinion. If there is a book series, I would be open to that as well.
One of the best networking books I've found is "The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference" http://www.amazon.com/TCP-Guide-Comprehensive-Illustrated-Protocols/dp/159327047X/ref=sr_1_5?ie=UTF8&qid=1312296674&sr=8-5. The only thing this doesn't cover in great detail is the actual layer 1 stuff. Well even then it goes over some basic details, but the book is excellent for most anything you need to know regarding networks, packets, headers, etc....

What are some good resources for GNU Make? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have read about 1/3 of the GNU Make manual, do you guys know of any resources to really learn the Art of using Make.
Ideally, there might be some examples where two ways of doing something are possible, and the author explains which method he chose and why.
I am primarily using Make not to build C/C++ programs but to operate a processing pipeline for data analysis.
Managing Projects with GNU Make, by Robert Mecklenburg, is the best I've come across. Plus, it's an O'Reilly Open Book, so O'Reilly gives away free PDFs of it on their website. Read it linearly, and start from the beginning (even if you think you already know the basics of GNU Make).
John Graham-Cumming has written a book called GNU Make Unleashed which looks promising, although I have not read it yet. http://www.lulu.com/product/paperback/gnu-make-unleashed/2937580 and http://jgc.org/

Does an open-source poker-related math library exist? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I would like to develop a poker odds application that can give the probability of various game situations. Since the application will be mostly statistical analysis, I figured I would see if someone else had already written a library that implements the required mathematics.
I would prefer cross-platform open-source in C++, but that's not a requirement.
This is a subset of Dave's list, but I suggest you look at twodimes.net. It is a web app that uses the pokenum open source library. It is written in C. It does hand enumeration and stats for several poker varieties.
http://twodimes.net/poker/info/
Here's a list of poker-related software tools.
Complete source code for Texas hold'em poker game evaluator can be found here:
http://www.advancedmcode.org/poker-predictor.html
It is built for matlab, the GUI id m-coded but the computational engine is c++.
It allows for odds and probability calculation. It can deal, on my 2.4Ghz laptop, with a 100000 10 players game computation in 0,3 seconds.
An accurate real time computer:-)

Is there an alternative to MKS Yacc that supports "selection preference syntax" or something very similar? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
MKS Yacc supports a notation which their web site calls "selection preference syntax". It isn't illustrated, but it consists of a token in square brackets, optionally with a caret, and it indicates that a particular token is required to follow, or is required not to follow, the rest of the rules:
non_terminal: TOKEN1 non_terminal2 TOKEN2 [TOKEN3]
non_terminal: TOKEN1 non_terminal2 TOKEN2 [^TOKEN3]
(I'm not clear whether the bracketed item can be a non-terminal. The code I've seen using the notation always uses a token or a couple of space separated tokens, and never a non-terminal.)
Is anyone aware of an alternative Yacc-compatible system (preferably open source) that provides the same support (notation can differ - functionality can't), running on Unix or Linux machines, preferably available in source format?
(MKS Yacc also provides some flexibility in handling errors and adjusting the error behaviour. One way in which that can be used is to treat keywords as identifiers when they are encountered in a position that makes no sense when they are treated as keywords. I was able to retrofit that into byacc - Berkeley Yacc - but I haven't spent enough time working out how to handle 'selection preferences'.)
See also: Has anyone used the "selection preference" mechanism provided by MKS Yacc?
Just for completeness, since I linked this in the answer to your other version, there appears to be a product from Thinkage called YAY, which is yacc-like and supports the selector syntax. They're in Kitchner and apparently closely associated with MKS, but from the website they also appear to be responsible for MKS's documentation, so maybe if all else fails you can call them as ask what the hell they meant by these selection preferences. ;-)

Resources