Q: sendmsg + raw ethernet + several frames I use linux 3.x and modern glibc(2.19).
I would like send several Ethernet frames without switch from kernel/user space forth and back.
I have MTU = 1500, and I want to send 800 KB.
I init receiver address like this:
struct sockaddr_ll socket_address;
socket_address.sll_ifindex = if_idx.ifr_ifindex;
socket_address.sll_halen = ETH_ALEN;
socket_address.sll_addr[0] = MY_DEST_MAC0;
//...

After that I can call sendto/sendmsg 800KB / 1500 ~= 500 times and all works fine, but this require user space <-> kernel negotiation ~ 500 * 25 times per second. I want avoid it.
I try to init struct msghdr::msg_iov with appropriate info,
but get error "message too long", looks like msghdr::msg_iov can not describe something with size > MTU.
So question is it possible to send many raw Ethernet frame on Linux from userspace at once?
PS
The data (800KB) I get from file, and read it to memory. So struct iovec good for me, I can create suitable amount of Ethernet header and have to iovec per 1500 packet, one point to data, one point to Ethernet header.

A: Whoa.
My last company made realtime hidef video encoding hardware. In the lab, we had to blast 200MB / second across a bonded link, so I have some experience with this.  What follows is based upon that.
Before you can tune, you must measure.  You don't want to do multiple syscalls, but can you prove with timing measurement that the overhead is significant?
I use a wrapper routine around clock_gettime that gives back time of day with nanosecond precision (e.g. (tv_sec * 100000000) + tv_nsec).  Call this [herein] "nanotime".
So, for any given syscall, you need a measurement:
tstart = nanotime();
syscall();
tdif = nanotime() - tstart;

For send/sendto/sendmsg/write, do this will small data so you're sure you're not blocking [or use O_NONBLOCK, if applicable].  This gives you the syscall overhead
Why are you going directly to ethernet frames?  TCP [or UDP] is usually fast enough and modern NIC cards can do the envelope wrap/strip in hardware.  I'd like to know if there is a specific situation that requires ethernet frames, or was it that you weren't getting the performance you wanted and came up with this as a solution.  Remember, you're doing 800KB/s (~1MB/s) and my project was doing 100x-200x more than that over TCP.
What about using two plain write calls to the socket?  One for header, one for data [all 800KB].  write can be used on a socket and doesn't have the EMSGSIZE error or restriction.
Further, why do you need your header to be in a separate buffer?  When you allocate your buffer, just do:
datamax = 800 * 1024;  // or whatever
buflen = sizeof(struct header) + datamax;
buf = malloc(buflen);

while (1) {
    datalen = read(fdfile,&buf[sizeof(struct header)],datamax);
    // fill in header ...
    write(fdsock,buf,sizeof(struct header) + datalen);
}

This works even for the ethernet frame case.
One of the things can also do is use a setsockopt to increase the size of the kernel buffer for your socket.  Otherwise, you can send data, but it will be dropped in the kernel before the receiver can drain it.  More on this below.
To measure the performance of the wire, add some fields to your header:
u64 send_departure_time;  // set by sender from nanotime
u64 recv_arrival_time;  // set by receiver when the packet arrives

So, sender sets departure time and does write [just do the header for this test].  Call this packet Xs.  receiver stamps this when it arrives.  receiver immediately sends back a message to sender [call it Xr] with a departure stamp that and the contents of Xs.  When sender gets this, it stamps it with an arrival time.
With the above we now have:
T1 -- time packet Xs departed sender
T2 -- time packet Xs arrived at receiver
T3 -- time packet Xr departed receiver
T4 -- time packet Xr arrived at sender

Assuming you do this on a relatively quiet connection with little to no other traffic and you know the link speed (e.g. 1 Gb/s), with T1/T2/T3/T4 you can calculate the overhead.
You can repeat the measurement for TCP/UDP vs ETH.  You may find that it doesn't buy you as much as you think.  Once again, can you prove it with precise measurement?
I "invented" this algorithm while working at the aforementioned company, only to find out that it was already part of a video standard for sending raw video across a 100Gb Ethernet NIC card and the NIC does the timestamping in hardware.
One of the other things you may have to do is add some throttle control.  This is similar to what bittorrent does or what the PCIe bus does.
When PCIe bus nodes first start up, they communicate how much free buffer space they have available for "blind write".  That is, the sender is free to blast up to this much, without any ACK message.  As the receiver drains its input buffer, it sends periodic ACK messages to the sender with the number of bytes it was able to drain.  sender can add this value back to the blind write limit and keep going.
For your purposes, the blind write limit is the size of the receiver's kernel socket buffer.
UPDATE
Based upon some of the additional information from your comments [the actual system configuration should go, in a more complete form, as an edit to your question at the bottom].
You do have a need for a raw socket and sending an ethernet frame.  You can reduce the overhead by setting a larger MTU via ifconfig or an ioctl call with SIOCSIFMTU.  I recommend the ioctl.  You may not need to set MTU to 800KB.  Your CPU's NIC card has a practical limit.  You can probably increase MTU from 1500 to 15000 easily enough.  This would reduce syscall overhead by 10x and that may be "good enough".
You probably will have to use sendto/sendmsg.  The two write calls were based on conversion to TCP/UDP.  But, I suspect sendmsg with msg_iov will have more overhead than sendto.  If you search, you'll find that most example code for what you want uses sendto.  sendmsg seems like less overhead for you, but it may cause more overhead for the kernel.  Here's an example that uses sendto: http://hacked10bits.blogspot.com/2011/12/sending-raw-ethernet-frames-in-6-easy.html
In addition to improving syscall overhead, larger MTU might improve the efficiency of the "wire", even though this doesn't seem like a problem in your use case.  I have experience with CPU + FPGA systems and communicating between them, but I am still puzzled by one of your comments about "not using a wire".  FPGA connected to ethernet pins of CPU I get--sort of.  More precisely, do you mean FPGA pins connected to ethernet pins of NIC card/chip of CPU"?
Are the CPU/NIC on the same PC board and the FPGA pins are connected via PC board traces?  Otherwise, I don't understand "not using a wire".

However, once again, I must say that you must be able to measure your performance before you blindly try to improve it.

Have you run the test case I suggested for determining the syscall overhead?  If it is small enough, trying to optimize for it may not be worth it and doing so may actually hurt performance more severely in other areas that you didn't realize when you started.
As an example, I once worked on a system that had a severe performance problem, such that, the system didn't work.  I suspected the serial port driver was slow, so I recoded from a high level language (e.g. like C) into assembler.
I increased the driver performance by 2x, but it contributed less than a 5% performance improvement to the system.  It turned out the real problem was that other code was accessing non-existent memory which just caused a bus timeout, slowing the system down measurably [it did not generate an interrupt that would have made it easy to find as on modern systems].
That's when I learned the importance of measurement.  I had done my optimization based on an educated guess, rather than hard data.  After that: lesson learned!
Nowadays, I never try large optimization until I can measure first.  In some cases, I add an optimization that I'm "sure" will make things better (e.g. inlining a function).  When I measure it [and because I can measure it], I find out that the new code is actually slower and I have to revert the change.  But, that's the point:  I can prove/disprove this with hard performance data.
What CPU are you using: x86, arm, mips, etc. At what clock frequency?  How much DRAM?  How many cores?
What FPGA are you using (e.g. Xilinx, Altera)?  What specific type/part number?  What is the maximum clock rate?  Is the FPGA devoted entirely to logic or do you also have a CPU inside it such as microblaze, nios, arm?  Does the FPGA have access to DRAM of it's own [and how much DRAM]?
If you increase the MTU, can the FPGA handle it, from either a buffer/space standpoint or a clock speed standpoint???  If you increase MTU, you may need to add an ack/sync protocol as I suggested in the original post.  
Currently, the CPU is doing a blind write of the data, hoping the FPGA can handle it.  This means you have an open race condition between CPU and FPGA.
This may be mitigated, purely as a side effect of sending small packets.  If you increase MTU too much, you might overwhelm the FPGA.  In other words, it is the very overhead you're trying to optimize away, that allows the FPGA to keep up with the data rate.
This is what I meant by unintended consequences of blind optimization.  It can have unintended and worse side effects.
What is the nature of the data being sent to the FPGA?  You're sending 800KB, but how often?
I am assuming that it is not the FPGA firmware itself for a few reasons.  You said the firmware was already almost full [and it is receiving the ethernet data].  Also, firmware is usually loaded via the I2C bus, a ROM, or an FPGA programmer.  So, am I correct?
You're sending the data to the FPGA from a file.  This implies that it is only being sent once, at the startup of your CPU's application.  Is that correct?  If so, optimization is not needed because it's an init/startup cost that has little impact on the running system.
So, I have to assume that the file gets loaded many times, possibly a different file each time.  Is that correct?  If so, you may need to consider the impact of the read syscall.  Not just from syscall overhead, but optimal read length.  For example, IIRC, the optimal transfer size for a disk-to-disk or file-to-file copy/transfer is 64KB, depending upon the filesystem or underlying disk characteristics.
So, if you're looking to reduce overhead, reading data from a file may have considerably more than having the application generate the data [if that's possible].
The kernel syscall interface is designed to be very low overhead.  Kernel programmers [I happen to be one] spend a great deal of time ensuring the overhead is low.
You say your system is utilizing the a lot of CPU time for other things.  Can you measure the other things?  How is your application structured?  How many processes?  How many threads?  How do they communicate?  What is the latency/througput?  You may be able to find [can quite probably find] the larger bottlenecks and recode those and you'll get an overall reduction in CPU usage that far exceeds the maximum benefit you'll get from the MTU tweak.
Trying to optimize the syscall overhead may be like my serial port optimization.  A lot of effort, and yet the overall results are/were disappointing.
When considering performance, it is important to consider it from an overall system standpoint.  In your case, this means CPU, FPGA, and anything else in it.
You say that the CPU is doing a lot of things.  Could/should some of those algorithms go into the FPGA?  Is the reason they're not because the FPGA is almost out of space, otherwise you would?  Is the FPGA firmware 100% done?  Or, is there more RTL to be written?  If you're at 90% space utilization in the FPGA, and you'll need more RTL, you may wish to consider going to an FPGA part that has more space for logic, possibly with a higher clock rate.
In my video company, we used FPGAs.  We used the largest/fastest state-of-the-art part the FPGA vendor had.  We also used virtually 100% of the space for logic and required the part's maximum clock rate.  We were told by the vendor that we were the largest consumer of FPGA resources of any of their client companies worldwide.  Because of this, we were straining the vendors development tools.  Place-and-route would frequently fail and have to be rerun to get correct placement and meet timing.
So, when an FPGA is almost full with logic, the place-and-route can be difficult to achieve.  It might be a reason to consider a larger part [if possible]
