Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
fcoe_transport.c File Reference
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/errno.h>
#include <linux/crc32.h>
#include <scsi/libfcoe.h>
#include "libfcoe.h"

Go to the source code of this file.

Functions

 MODULE_AUTHOR ("Open-FCoE.org")
 
 MODULE_DESCRIPTION ("FIP discovery protocol and FCoE transport for FCoE HBAs")
 
 MODULE_LICENSE ("GPL v2")
 
 module_param_named (debug_logging, libfcoe_debug_logging, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug_logging,"a bit mask of logging levels")
 
 module_param_call (show, NULL, fcoe_transport_show, NULL, S_IRUSR)
 
 __MODULE_PARM_TYPE (show,"string")
 
 MODULE_PARM_DESC (show," Show attached FCoE transports")
 
 module_param_call (create, fcoe_transport_create, NULL,(void *) FIP_MODE_FABRIC, S_IWUSR)
 
 __MODULE_PARM_TYPE (create,"string")
 
 MODULE_PARM_DESC (create," Creates fcoe instance on a ethernet interface")
 
 module_param_call (create_vn2vn, fcoe_transport_create, NULL,(void *) FIP_MODE_VN2VN, S_IWUSR)
 
 __MODULE_PARM_TYPE (create_vn2vn,"string")
 
 MODULE_PARM_DESC (create_vn2vn," Creates a VN_node to VN_node FCoE instance ""on an Ethernet interface")
 
 module_param_call (destroy, fcoe_transport_destroy, NULL, NULL, S_IWUSR)
 
 __MODULE_PARM_TYPE (destroy,"string")
 
 MODULE_PARM_DESC (destroy," Destroys fcoe instance on a ethernet interface")
 
 module_param_call (enable, fcoe_transport_enable, NULL, NULL, S_IWUSR)
 
 __MODULE_PARM_TYPE (enable,"string")
 
 MODULE_PARM_DESC (enable," Enables fcoe on a ethernet interface.")
 
 module_param_call (disable, fcoe_transport_disable, NULL, NULL, S_IWUSR)
 
 __MODULE_PARM_TYPE (disable,"string")
 
 MODULE_PARM_DESC (disable," Disables fcoe on a ethernet interface.")
 
void __fcoe_get_lesb (struct fc_lport *lport, struct fc_els_lesb *fc_lesb, struct net_device *netdev)
 
 EXPORT_SYMBOL_GPL (__fcoe_get_lesb)
 
void fcoe_wwn_to_str (u64 wwn, char *buf, int len)
 
 EXPORT_SYMBOL_GPL (fcoe_wwn_to_str)
 
int fcoe_validate_vport_create (struct fc_vport *vport)
 
 EXPORT_SYMBOL_GPL (fcoe_validate_vport_create)
 
int fcoe_get_wwn (struct net_device *netdev, u64 *wwn, int type)
 
 EXPORT_SYMBOL_GPL (fcoe_get_wwn)
 
u32 fcoe_fc_crc (struct fc_frame *fp)
 
 EXPORT_SYMBOL_GPL (fcoe_fc_crc)
 
int fcoe_start_io (struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (fcoe_start_io)
 
void fcoe_clean_pending_queue (struct fc_lport *lport)
 
 EXPORT_SYMBOL_GPL (fcoe_clean_pending_queue)
 
void fcoe_check_wait_queue (struct fc_lport *lport, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (fcoe_check_wait_queue)
 
void fcoe_queue_timer (ulong lport)
 
 EXPORT_SYMBOL_GPL (fcoe_queue_timer)
 
int fcoe_get_paged_crc_eof (struct sk_buff *skb, int tlen, struct fcoe_percpu_s *fps)
 
 EXPORT_SYMBOL_GPL (fcoe_get_paged_crc_eof)
 
int fcoe_transport_attach (struct fcoe_transport *ft)
 
 EXPORT_SYMBOL (fcoe_transport_attach)
 
int fcoe_transport_detach (struct fcoe_transport *ft)
 
 EXPORT_SYMBOL (fcoe_transport_detach)
 
 module_init (libfcoe_init)
 
 module_exit (libfcoe_exit)
 

Variables

unsigned int libfcoe_debug_logging
 

Function Documentation

void __fcoe_get_lesb ( struct fc_lport lport,
struct fc_els_lesb fc_lesb,
struct net_device netdev 
)

Definition at line 86 of file fcoe_transport.c.

__MODULE_PARM_TYPE ( show  ,
"string"   
)
__MODULE_PARM_TYPE ( create  ,
"string"   
)
__MODULE_PARM_TYPE ( create_vn2vn  ,
"string"   
)
__MODULE_PARM_TYPE ( destroy  ,
"string"   
)
__MODULE_PARM_TYPE ( enable  ,
"string"   
)
__MODULE_PARM_TYPE ( disable  ,
"string"   
)
EXPORT_SYMBOL ( fcoe_transport_attach  )
EXPORT_SYMBOL ( fcoe_transport_detach  )
EXPORT_SYMBOL_GPL ( __fcoe_get_lesb  )
EXPORT_SYMBOL_GPL ( fcoe_wwn_to_str  )
EXPORT_SYMBOL_GPL ( fcoe_validate_vport_create  )
EXPORT_SYMBOL_GPL ( fcoe_get_wwn  )
EXPORT_SYMBOL_GPL ( fcoe_fc_crc  )
EXPORT_SYMBOL_GPL ( fcoe_start_io  )
EXPORT_SYMBOL_GPL ( fcoe_clean_pending_queue  )
EXPORT_SYMBOL_GPL ( fcoe_check_wait_queue  )
EXPORT_SYMBOL_GPL ( fcoe_queue_timer  )
EXPORT_SYMBOL_GPL ( fcoe_get_paged_crc_eof  )
void fcoe_check_wait_queue ( struct fc_lport lport,
struct sk_buff skb 
)

fcoe_check_wait_queue() - Attempt to clear the transmit backlog : The local port whose backlog is to be cleared

This empties the wait_queue, dequeues the head of the wait_queue queue and calls fcoe_start_io() for each packet. If all skb have been transmitted it returns the qlen. If an error occurs it restores wait_queue (to try again later) and returns -1.

The wait_queue is used when the skb transmit fails. The failed skb will go in the wait_queue which will be emptied by the timer function or by the next skb transmit.

Definition at line 282 of file fcoe_transport.c.

void fcoe_clean_pending_queue ( struct fc_lport lport)

fcoe_clean_pending_queue() - Dequeue a skb and free it : The local port to dequeue a skb on

Definition at line 254 of file fcoe_transport.c.

u32 fcoe_fc_crc ( struct fc_frame fp)

fcoe_fc_crc() - Calculates the CRC for a given frame : The frame to be checksumed

This uses crc32() routine to calculate the CRC for a frame

Return: The 32 bit CRC value

Definition at line 195 of file fcoe_transport.c.

int fcoe_get_paged_crc_eof ( struct sk_buff skb,
int  tlen,
struct fcoe_percpu_s fps 
)

fcoe_get_paged_crc_eof() - Allocate a page to be used for the trailer CRC : The packet to be transmitted : The total length of the trailer : The fcoe context

This routine allocates a page for frame trailers. The page is re-used if there is enough room left on it for the current trailer. If there isn't enough buffer left a new page is allocated for the trailer. Reference to the page from this function as well as the skbs using the page fragments ensure that the page is freed at the appropriate time.

Returns: 0 for success

Definition at line 353 of file fcoe_transport.c.

int fcoe_get_wwn ( struct net_device netdev,
u64 wwn,
int  type 
)

fcoe_get_wwn() - Get the world wide name from LLD if it supports it : the associated net device : the output WWN : the type of WWN (WWPN or WWNN)

Returns: 0 for success

Definition at line 177 of file fcoe_transport.c.

void fcoe_queue_timer ( ulong  lport)

fcoe_queue_timer() - The fcoe queue timer : The local port

Calls fcoe_check_wait_queue on timeout

Definition at line 333 of file fcoe_transport.c.

int fcoe_start_io ( struct sk_buff skb)

fcoe_start_io() - Start FCoE I/O : The packet to be transmitted

This routine is called from the net device to start transmitting FCoE packets.

Returns: 0 for success

Definition at line 233 of file fcoe_transport.c.

int fcoe_transport_attach ( struct fcoe_transport ft)

fcoe_transport_attach - Attaches an FCoE transport : The fcoe transport to be attached

Returns : 0 for success

Definition at line 411 of file fcoe_transport.c.

int fcoe_transport_detach ( struct fcoe_transport ft)

fcoe_transport_detach - Detaches an FCoE transport : The fcoe transport to be attached

Returns : 0 for success

Definition at line 444 of file fcoe_transport.c.

int fcoe_validate_vport_create ( struct fc_vport vport)

fcoe_validate_vport_create() - Validate a vport before creating it : NPIV port to be created

This routine is meant to add validation for a vport before creating it via fcoe_vport_create(). Current validations are:

  • WWPN supplied is unique for given lport

Definition at line 135 of file fcoe_transport.c.

void fcoe_wwn_to_str ( u64  wwn,
char buf,
int  len 
)

Definition at line 115 of file fcoe_transport.c.

MODULE_AUTHOR ( "Open-FCoE.org"  )
MODULE_DESCRIPTION ( "FIP discovery protocol and FCoE transport for FCoE HBAs"  )
module_exit ( libfcoe_exit  )
module_init ( libfcoe_init  )
MODULE_LICENSE ( "GPL v2 )
module_param_call ( show  ,
NULL  ,
fcoe_transport_show  ,
NULL  ,
S_IRUSR   
)
module_param_call ( create  ,
fcoe_transport_create  ,
NULL  ,
(void *)  FIP_MODE_FABRIC,
S_IWUSR   
)
module_param_call ( create_vn2vn  ,
fcoe_transport_create  ,
NULL  ,
(void *)  FIP_MODE_VN2VN,
S_IWUSR   
)
module_param_call ( destroy  ,
fcoe_transport_destroy  ,
NULL  ,
NULL  ,
S_IWUSR   
)
module_param_call ( enable  ,
fcoe_transport_enable  ,
NULL  ,
NULL  ,
S_IWUSR   
)
module_param_call ( disable  ,
fcoe_transport_disable  ,
NULL  ,
NULL  ,
S_IWUSR   
)
module_param_named ( debug_logging  ,
libfcoe_debug_logging  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug_logging  ,
"a bit mask of logging levels"   
)
MODULE_PARM_DESC ( show  ,
" Show attached FCoE transports"   
)
MODULE_PARM_DESC ( create  ,
" Creates fcoe instance on a ethernet interface  
)
MODULE_PARM_DESC ( create_vn2vn  ,
" Creates a VN_node to VN_node FCoE instance ""on an Ethernet interface  
)
MODULE_PARM_DESC ( destroy  ,
" Destroys fcoe instance on a ethernet interface  
)
MODULE_PARM_DESC ( enable  ,
" Enables fcoe on a ethernet interface."   
)
MODULE_PARM_DESC ( disable  ,
" Disables fcoe on a ethernet interface."   
)

Variable Documentation

unsigned int libfcoe_debug_logging

Definition at line 50 of file fcoe_transport.c.