The max segment size is currently limited to the ethernet frame length of the kernel which happens to be 1514 at this point in time. However the NCM specification limits it to 64K for sixtenn bit NTB's. For peer to peer connections, increasing the segment size gives better throughput. Add support to configure this value before configfs symlink is created. Also since the NTB Out/In buffer sizes are fixed at 16384 bytes, limit the segment size to an upper cap of 8000 to allow at least a minimum of 2 MTU sized datagrams to be aggregated. Set the default MTU size for the ncm interface during function bind before network interface is registered allowing MTU to be set in parity with wMaxSegmentSize. Update gadget documentation describing the new configfs property. Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> Link: https://lore.kernel.org/r/20231221153216.18657-1-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 lines
807 B
C
38 lines
807 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* u_ncm.h
|
|
*
|
|
* Utility definitions for the ncm function
|
|
*
|
|
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
|
|
* http://www.samsung.com
|
|
*
|
|
* Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
|
|
*/
|
|
|
|
#ifndef U_NCM_H
|
|
#define U_NCM_H
|
|
|
|
#include <linux/usb/composite.h>
|
|
|
|
struct f_ncm_opts {
|
|
struct usb_function_instance func_inst;
|
|
struct net_device *net;
|
|
bool bound;
|
|
|
|
struct config_group *ncm_interf_group;
|
|
struct usb_os_desc ncm_os_desc;
|
|
char ncm_ext_compat_id[16];
|
|
/*
|
|
* Read/write access to configfs attributes is handled by configfs.
|
|
*
|
|
* This is to protect the data from concurrent access by read/write
|
|
* and create symlink/remove symlink.
|
|
*/
|
|
struct mutex lock;
|
|
int refcnt;
|
|
|
|
u16 max_segment_size;
|
|
};
|
|
|
|
#endif /* U_NCM_H */
|