From: Jakub Kicinski Date: Thu, 12 Jun 2025 17:08:24 +0000 (-0700) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d23ad54de795ec0054f90ecb03b41e8f2c410f3a;p=users%2Fhch%2Fmisc.git Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR (net-6.17-rc4). No conflicts. Adjacent changes: drivers/net/ethernet/intel/idpf/idpf_txrx.c 02614eee26fb ("idpf: do not linearize big TSO packets") 6c4e68480238 ("idpf: remove obsolete stashing code") Signed-off-by: Jakub Kicinski --- d23ad54de795ec0054f90ecb03b41e8f2c410f3a diff --cc drivers/net/ethernet/intel/idpf/idpf_txrx.c index b868761fad4d,eaad52a83b04..194f924d2bd6 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@@ -8,67 -8,12 +8,32 @@@ #include "idpf_ptp.h" #include "idpf_virtchnl.h" - struct idpf_tx_stash { - struct hlist_node hlist; - struct libeth_sqe buf; - }; - - #define idpf_tx_buf_compl_tag(buf) (*(u32 *)&(buf)->priv) + #define idpf_tx_buf_next(buf) (*(u32 *)&(buf)->priv) LIBETH_SQE_CHECK_PRIV(u32); -static bool idpf_chk_linearize(struct sk_buff *skb, unsigned int max_bufs, - unsigned int count); +/** + * idpf_chk_linearize - Check if skb exceeds max descriptors per packet + * @skb: send buffer + * @max_bufs: maximum scatter gather buffers for single packet + * @count: number of buffers this packet needs + * + * Make sure we don't exceed maximum scatter gather buffers for a single + * packet. + * TSO case has been handled earlier from idpf_features_check(). + */ +static bool idpf_chk_linearize(const struct sk_buff *skb, + unsigned int max_bufs, + unsigned int count) +{ + if (likely(count <= max_bufs)) + return false; + + if (skb_is_gso(skb)) + return false; + + return true; +} - /** - * idpf_buf_lifo_push - push a buffer pointer onto stack - * @stack: pointer to stack struct - * @buf: pointer to buf to push - * - * Returns 0 on success, negative on failure - **/ - static int idpf_buf_lifo_push(struct idpf_buf_lifo *stack, - struct idpf_tx_stash *buf) - { - if (unlikely(stack->top == stack->size)) - return -ENOSPC; - - stack->bufs[stack->top++] = buf; - - return 0; - } - - /** - * idpf_buf_lifo_pop - pop a buffer pointer from stack - * @stack: pointer to stack struct - **/ - static struct idpf_tx_stash *idpf_buf_lifo_pop(struct idpf_buf_lifo *stack) - { - if (unlikely(!stack->top)) - return NULL; - - return stack->bufs[--stack->top]; - } - /** * idpf_tx_timeout - Respond to a Tx Hang * @netdev: network interface device structure