mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-14 11:19:08 +10:00
um: vector: Reduce stack usage in vector_eth_configure()
[ Upstream commit 2d65fc13be
]
When compiling with clang (19.1.7), initializing *vp using a compound
literal may result in excessive stack usage. Fix it by initializing the
required fields of *vp individually.
Without this patch:
$ objdump -d arch/um/drivers/vector_kern.o | ./scripts/checkstack.pl x86_64 0
...
0x0000000000000540 vector_eth_configure [vector_kern.o]:1472
...
With this patch:
$ objdump -d arch/um/drivers/vector_kern.o | ./scripts/checkstack.pl x86_64 0
...
0x0000000000000540 vector_eth_configure [vector_kern.o]:208
...
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506221017.WtB7Usua-lkp@intel.com/
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20250623110829.314864-1-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
694e78d3a3
commit
8806629f79
@ -1600,35 +1600,19 @@ static void vector_eth_configure(
|
|||||||
|
|
||||||
device->dev = dev;
|
device->dev = dev;
|
||||||
|
|
||||||
*vp = ((struct vector_private)
|
INIT_LIST_HEAD(&vp->list);
|
||||||
{
|
vp->dev = dev;
|
||||||
.list = LIST_HEAD_INIT(vp->list),
|
vp->unit = n;
|
||||||
.dev = dev,
|
vp->options = get_transport_options(def);
|
||||||
.unit = n,
|
vp->parsed = def;
|
||||||
.options = get_transport_options(def),
|
vp->max_packet = get_mtu(def) + ETH_HEADER_OTHER;
|
||||||
.rx_irq = 0,
|
/*
|
||||||
.tx_irq = 0,
|
* TODO - we need to calculate headroom so that ip header
|
||||||
.parsed = def,
|
* is 16 byte aligned all the time
|
||||||
.max_packet = get_mtu(def) + ETH_HEADER_OTHER,
|
*/
|
||||||
/* TODO - we need to calculate headroom so that ip header
|
vp->headroom = get_headroom(def);
|
||||||
* is 16 byte aligned all the time
|
vp->coalesce = 2;
|
||||||
*/
|
vp->req_size = get_req_size(def);
|
||||||
.headroom = get_headroom(def),
|
|
||||||
.form_header = NULL,
|
|
||||||
.verify_header = NULL,
|
|
||||||
.header_rxbuffer = NULL,
|
|
||||||
.header_txbuffer = NULL,
|
|
||||||
.header_size = 0,
|
|
||||||
.rx_header_size = 0,
|
|
||||||
.rexmit_scheduled = false,
|
|
||||||
.opened = false,
|
|
||||||
.transport_data = NULL,
|
|
||||||
.in_write_poll = false,
|
|
||||||
.coalesce = 2,
|
|
||||||
.req_size = get_req_size(def),
|
|
||||||
.in_error = false,
|
|
||||||
.bpf = NULL
|
|
||||||
});
|
|
||||||
|
|
||||||
dev->features = dev->hw_features = (NETIF_F_SG | NETIF_F_FRAGLIST);
|
dev->features = dev->hw_features = (NETIF_F_SG | NETIF_F_FRAGLIST);
|
||||||
tasklet_init(&vp->tx_poll, vector_tx_poll, (unsigned long)vp);
|
tasklet_init(&vp->tx_poll, vector_tx_poll, (unsigned long)vp);
|
||||||
|
Loading…
Reference in New Issue
Block a user