Skip to content

Commit

Permalink
net: ethernet: ti: davinci_cpdma: revert "drop frame padding"
Browse files Browse the repository at this point in the history
This reverts commit 9ffc513 ("net: ethernet: ti: davinci_cpdma: drop
frame padding") which has depndency from not yet merged patch [1] and so
breaks cpsw_new driver.

[1] https://patchwork.kernel.org/project/netdevbpf/patch/20210805145511.12016-1-grygorii.strashko@ti.com/
Fixes: 9ffc513 ("net: ethernet: ti: davinci_cpdma: drop frame padding")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Link: https://lore.kernel.org/r/20210806142809.15069-1-grygorii.strashko@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Grygorii Strashko authored and Jakub Kicinski committed Aug 6, 2021
1 parent 06669e6 commit 35ba6ab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/cpsw_priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ int cpsw_init_common(struct cpsw_common *cpsw, void __iomem *ss_regs,

dma_params.num_chan = data->channels;
dma_params.has_soft_reset = true;
dma_params.min_packet_size = CPSW_MIN_PACKET_SIZE;
dma_params.desc_mem_size = data->bd_ram_size;
dma_params.desc_align = 16;
dma_params.has_ext_regs = true;
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/ti/davinci_cpdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ static int cpdma_chan_submit_si(struct submit_info *si)
return -ENOMEM;
}

if (len < ctlr->params.min_packet_size) {
len = ctlr->params.min_packet_size;
chan->stats.runt_transmit_buff++;
}

mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
cpdma_desc_to_port(chan, mode, si->directed);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/davinci_cpdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct cpdma_params {
void __iomem *rxthresh, *rxfree;
int num_chan;
bool has_soft_reset;
int min_packet_size;
dma_addr_t desc_mem_phys;
dma_addr_t desc_hw_addr;
int desc_mem_size;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
dma_params.txcp = priv->emac_base + 0x640;
dma_params.rxcp = priv->emac_base + 0x660;
dma_params.num_chan = EMAC_MAX_TXRX_CHANNELS;
dma_params.min_packet_size = EMAC_DEF_MIN_ETHPKTSIZE;
dma_params.desc_hw_addr = hw_ram_addr;
dma_params.desc_mem_size = pdata->ctrl_ram_size;
dma_params.desc_align = 16;
Expand Down

0 comments on commit 35ba6ab

Please sign in to comment.