Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 384f9d91 authored by Chris Lew's avatar Chris Lew
Browse files

diag: diagfwd_socket: Increase socket receive buf



Diag expects heavy traffic when maximum logging is enabled. The maximum
amount of packets QRTR will deliver before flow control kicks in is
16k * 10. Use setsockopt to increase the rcvbuf for the diag sockets
to avoid dropping any packets from the remote.

Change-Id: I782997c00e1f4ccefb8cee635b65ae2edb733396
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 5cd75ce7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -52,6 +52,10 @@
#define INST_ID_DCI_CMD		3
#define INST_ID_DCI		4

#define MAX_BUF_SIZE 		0x4400
#define MAX_NO_PACKETS		10
#define DIAG_SO_RCVBUF_SIZE	(MAX_BUF_SIZE * MAX_NO_PACKETS)

struct qmi_handle *cntl_qmi;
static uint64_t bootup_req[NUM_SOCKET_SUBSYSTEMS];

@@ -438,6 +442,7 @@ static void socket_open_server(struct diag_socket_info *info)
	struct kvec iv = { &pkt, sizeof(pkt) };
	int ret;
	int sl = sizeof(sq);
	unsigned int size = DIAG_SO_RCVBUF_SIZE;

	if (!info || info->port_type != PORT_TYPE_SERVER)
		return;
@@ -456,6 +461,9 @@ static void socket_open_server(struct diag_socket_info *info)
		return;
	}

	kernel_setsockopt(info->hdl, SOL_SOCKET, SO_RCVBUF,
			  (char *)&size, sizeof(size));

	write_lock_bh(&info->hdl->sk->sk_callback_lock);
	info->hdl->sk->sk_user_data = (void *)(info);
	info->hdl->sk->sk_data_ready = socket_data_ready;