Re: [PATCH net-next v2 1/8] net: stmmac: Initial support for TBS

From: Jakub Kicinski
Date: Mon Jan 13 2020 - 09:54:10 EST


On Mon, 13 Jan 2020 14:02:36 +0100, Jose Abreu wrote:
> Adds the initial hooks for TBS support. This needs a 32 byte descriptor
> in order for it to work with current HW. Adds all the logic for Enhanced
> Descriptors in main core but no HW related logic for now.
>
> Signed-off-by: Jose Abreu <Jose.Abreu@xxxxxxxxxxxx>

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index f98c5eefb382..dceaeb72a414 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -42,10 +42,13 @@ struct stmmac_tx_info {
> /* Frequently used values are kept adjacent for cache effect */
> struct stmmac_tx_queue {
> u32 tx_count_frames;
> + int tbs_avail;
> + int tbs_en;

These could be bool or a bitfield?

> struct timer_list txtimer;
> u32 queue_index;
> struct stmmac_priv *priv_data;
> struct dma_extended_desc *dma_etx ____cacheline_aligned_in_smp;
> + struct dma_edesc *dma_entx ____cacheline_aligned_in_smp;

Won't this create a cache line-sized hole? Is the structure member
supposed to be aligned or the data its pointing to?

> struct dma_desc *dma_tx;
> struct sk_buff **tx_skbuff;
> struct stmmac_tx_info *tx_skbuff_dma;

> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 0531afa9b21e..19190c609282 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -139,6 +139,7 @@ struct stmmac_txq_cfg {
> u32 low_credit;
> bool use_prio;
> u32 prio;
> + int tbs_en;

also bool?

> };
>
> struct plat_stmmacenet_data {