Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rxrpc: Only set DF=1 on initial DATA transmission

Change how the DF flag is managed on DATA transmissions. Set it on initial
transmission and don't set it on retransmissions. Then remove the handling
for EMSGSIZE in rxrpc_send_data_packet() and just pretend it didn't happen,
leaving it to the retransmission path to retry.

The path-MTU discovery using PING ACKs is then used to probe for the
maximum DATA size - though notification by ICMP will be used if one is
received.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241204074710.990092-16-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

David Howells and committed by
Jakub Kicinski
81e7761b cd69a07b

+20 -18
+1
net/rxrpc/ar-internal.h
··· 98 98 atomic_t stat_tx_data_send; 99 99 atomic_t stat_tx_data_send_frag; 100 100 atomic_t stat_tx_data_send_fail; 101 + atomic_t stat_tx_data_send_msgsize; 101 102 atomic_t stat_tx_data_underflow; 102 103 atomic_t stat_tx_data_cwnd_reset; 103 104 atomic_t stat_rx_data;
+16 -16
net/rxrpc/output.c
··· 552 552 msg.msg_controllen = 0; 553 553 msg.msg_flags = MSG_SPLICE_PAGES; 554 554 555 - /* Track what we've attempted to transmit at least once so that the 556 - * retransmission algorithm doesn't try to resend what we haven't sent 557 - * yet. 555 + /* Send the packet with the don't fragment bit set unless we think it's 556 + * too big or if this is a retransmission. 558 557 */ 559 - if (txb->seq == call->tx_transmitted + 1) 560 - call->tx_transmitted = txb->seq + n - 1; 561 - 562 - /* send the packet with the don't fragment bit set if we currently 563 - * think it's small enough */ 564 - if (len >= sizeof(struct rxrpc_wire_header) + call->peer->max_data) { 558 + if (txb->seq == call->tx_transmitted + 1 && 559 + len >= sizeof(struct rxrpc_wire_header) + call->peer->max_data) { 565 560 rxrpc_local_dont_fragment(conn->local, false); 566 561 frag = rxrpc_tx_point_call_data_frag; 567 562 } else { 568 563 rxrpc_local_dont_fragment(conn->local, true); 569 564 frag = rxrpc_tx_point_call_data_nofrag; 570 565 } 566 + 567 + /* Track what we've attempted to transmit at least once so that the 568 + * retransmission algorithm doesn't try to resend what we haven't sent 569 + * yet. 570 + */ 571 + if (txb->seq == call->tx_transmitted + 1) 572 + call->tx_transmitted = txb->seq + n - 1; 571 573 572 574 if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) { 573 575 static int lose; ··· 582 580 } 583 581 } 584 582 585 - retry: 586 583 /* send the packet by UDP 587 584 * - returns -EMSGSIZE if UDP would have to fragment the packet 588 585 * to go out of the interface ··· 592 591 ret = do_udp_sendmsg(conn->local->socket, &msg, len); 593 592 conn->peer->last_tx_at = ktime_get_seconds(); 594 593 595 - if (ret < 0) { 594 + if (ret == -EMSGSIZE) { 595 + rxrpc_inc_stat(call->rxnet, stat_tx_data_send_msgsize); 596 + trace_rxrpc_tx_packet(call->debug_id, call->local->kvec[0].iov_base, frag); 597 + ret = 0; 598 + } else if (ret < 0) { 596 599 rxrpc_inc_stat(call->rxnet, stat_tx_data_send_fail); 597 600 trace_rxrpc_tx_fail(call->debug_id, txb->serial, ret, frag); 598 601 } else { ··· 604 599 } 605 600 606 601 rxrpc_tx_backoff(call, ret); 607 - if (ret == -EMSGSIZE && frag == rxrpc_tx_point_call_data_nofrag) { 608 - rxrpc_local_dont_fragment(conn->local, false); 609 - frag = rxrpc_tx_point_call_data_frag; 610 - goto retry; 611 - } 612 602 613 603 done: 614 604 if (ret >= 0) {
+3 -2
net/rxrpc/proc.c
··· 473 473 struct rxrpc_net *rxnet = rxrpc_net(seq_file_single_net(seq)); 474 474 475 475 seq_printf(seq, 476 - "Data : send=%u sendf=%u fail=%u\n", 476 + "Data : send=%u sendf=%u fail=%u emsz=%u\n", 477 477 atomic_read(&rxnet->stat_tx_data_send), 478 478 atomic_read(&rxnet->stat_tx_data_send_frag), 479 - atomic_read(&rxnet->stat_tx_data_send_fail)); 479 + atomic_read(&rxnet->stat_tx_data_send_fail), 480 + atomic_read(&rxnet->stat_tx_data_send_msgsize)); 480 481 seq_printf(seq, 481 482 "Data-Tx : nr=%u retrans=%u uf=%u cwr=%u\n", 482 483 atomic_read(&rxnet->stat_tx_data),