Skip to content

Commit 15d23b4

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
i40e: comment that udp_port must be in host byte order
The firmware expects the port number passed when setting up the UDP tunnel configuration to be in Little Endian format. The i40e_aq_add_udp_tunnel command byte swaps the value from host order to Little Endian. Since commit fe0b0cd ("i40e: send correct port number to AdminQ when enabling UDP tunnels") we've correctly sent the value in host order. Let's also add a comment to the function explaining that it must be in host order, as the port numbers are commonly stored as Big Endian values. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 59e331e commit 15d23b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3614,11 +3614,15 @@ i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
36143614
/**
36153615
* i40e_aq_add_udp_tunnel
36163616
* @hw: pointer to the hw struct
3617-
* @udp_port: the UDP port to add
3617+
* @udp_port: the UDP port to add in Host byte order
36183618
* @header_len: length of the tunneling header length in DWords
36193619
* @protocol_index: protocol index type
36203620
* @filter_index: pointer to filter index
36213621
* @cmd_details: pointer to command details structure or NULL
3622+
*
3623+
* Note: Firmware expects the udp_port value to be in Little Endian format,
3624+
* and this function will call cpu_to_le16 to convert from Host byte order to
3625+
* Little Endian order.
36223626
**/
36233627
i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
36243628
u16 udp_port, u8 protocol_index,

0 commit comments

Comments
 (0)