Hi,
I am working on offload support for foce and would like to hear
feedbacks on the approach we are taking for supporting offload in fcoe.
It touches both current fcoe as well as netdev so I hope to get
feedbacks on this issue here first before posting to netdev.
We would like to add a pointer to the net_device structure as something
like,
struct net_device {
...
#if defined(CONFIG_LIBFC) && defined(CONFIG_FCOE)
struct fcoe_data *fcoe_data;
#endif
...
};
This is similar to existing member wireless_handler in the net_device
struct. The struct fcoe_data is the placeholder for any offload
capabilities LLD wants to provide for fcoe stack to use for offload.
This can be data related to offload, as well as offload functions that,
for instance, can match up to current exch_get or exch_put in
libfc_function_template, or it can have xmit/recv functions if LLD wants
to bypass the existing fcoe_xmit/fcoe_rcv completely.
If LLD has fcoe offload capabilities, it will set netdev->fcoe_ops to
its locally defined fcoe_ops, i.e., netdev->fcoe_ops = &lld_fcoe_ops.
Otherwise, this ptr will be NULL.
When fcoe is loaded, in fcoe_create_interface(), it will check LLD's
support of offload by checking if netdev->fcoe_ops is not NULL.
Currently, I have one data member to info the em that allows LLD needs
to do large receive offload:
struct fcoe_data {
u16 max_xid_read;
};
The max_xid_read is the max exchange id allowed for receive offload via
direct data placement in a read request where the data received in
response to read request is placed into scsi data buffer directly,
instead of doing copy from skb to scsi data buffer. This would also
require change of the current fc_exch_alloc() function to add the
flexibility to the exchange manager to allow allocation of exhchange id
based on the i/o request type, e.g., xid from 1-200 for large receive
offload. The LLD can then set it up properly by checking the xid upon
transmitting the SCSI READ cmd to the target. I am working on a patch to
have fc_exch_alloc() support this.
On the transmit side, a recent patch has enabled fc_fcp_send_data() to
send a frame as big as the burst length and let LLD do the segmentation.
We will need to fix the dev_queue_xmit() path for fcoe if we are to use
gso for fcoe as tcp/ip does.
For the offload feature flags, I have already submitted related feature
flags to netdev for CRC and GSO for fcoe; hopefully they will be
included later. Adding net_device awareness of foce offload is the next
step since the offload is built on top of netdev. For any future
multiple function device, it is anyway going to be outside netdev, so
it's not a problem.
I think now it's a good time to discuss what other things are preferred
to be in the fcoe_data struct or any other thoughts for offload.
Thanks.
Yi
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel