diff for duplicates of <49CB8DFD.2050504@cosmosbay.com> diff --git a/a/1.txt b/N1/1.txt index 1f4e2ee..05c0472 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,57 +1,54 @@ -Joakim Tjernlund a =E9crit : +Joakim Tjernlund a écrit : > Also set NAPI weight to 64 as this is a common value. > This will make the system alot more responsive while > ping flooding the ucc_geth ethernet interaface. ->=20 +> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> > --- > drivers/net/ucc_geth.c | 32 ++++++++++++-------------------- > drivers/net/ucc_geth.h | 1 - > 2 files changed, 12 insertions(+), 21 deletions(-) ->=20 +> > diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c > index 097aed8..7fc91aa 100644 > --- a/drivers/net/ucc_geth.c > +++ b/drivers/net/ucc_geth.c -> @@ -3214,7 +3214,7 @@ static int ucc_geth_tx(struct net_device *dev, u8= - txQ) +> @@ -3214,7 +3214,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) > dev->stats.tx_packets++; -> =20 +> > /* Free the sk buffer associated with this TxBD */ > - dev_kfree_skb_irq(ugeth-> > + dev_kfree_skb(ugeth-> > tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]); -> ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] =3D NULL; -> ugeth->skb_dirtytx[txQ] =3D -> @@ -3248,9 +3248,16 @@ static int ucc_geth_poll(struct napi_struct *nap= -i, int budget) +> ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL; +> ugeth->skb_dirtytx[txQ] = +> @@ -3248,9 +3248,16 @@ static int ucc_geth_poll(struct napi_struct *napi, int budget) -> for (i =3D 0; i < ug_info->numQueuesRx; i++) -> howmany +=3D ucc_geth_rx(ugeth, i, budget - howmany); +> for (i = 0; i < ug_info->numQueuesRx; i++) +> howmany += ucc_geth_rx(ugeth, i, budget - howmany); Not related to your patch, but seeing above code, I can understand you might have a problem in flood situation : Only first queue(s) are -depleted, and last one cannot be because howmany >=3D budget. +depleted, and last one cannot be because howmany >= budget. This driver might have to remember last queue it handled at previous -call ucc_geth_poll(), so that all rxqueues have same probability to be sc= -anned. +call ucc_geth_poll(), so that all rxqueues have same probability to be scanned. -j =3D ug->lastslot; -for (i =3D 0; ug_info->numQueuesRx; i++) { - if (++j >=3D ug_info->numQueuesRx) - j =3D 0; - howmany +=3D ucc_geth_rx(ugeth, j, budget - howmany); - if (howmany >=3D budget) +j = ug->lastslot; +for (i = 0; ug_info->numQueuesRx; i++) { + if (++j >= ug_info->numQueuesRx) + j = 0; + howmany += ucc_geth_rx(ugeth, j, budget - howmany); + if (howmany >= budget) break; } -ug->lastslot =3D j; +ug->lastslot = j; -> =20 +> > + /* Tx event processing */ > + spin_lock(&ugeth->lock); -> + for (i =3D 0; i < ug_info->numQueuesTx; i++) { +> + for (i = 0; i < ug_info->numQueuesTx; i++) { > + ucc_geth_tx(ugeth->dev, i); > + } > + spin_unlock(&ugeth->lock); @@ -61,42 +58,40 @@ ug->lastslot =3D j; > - setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS); > + setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS | UCCE_TX_EVENTS); > } -> =20 +> > return howmany; -> @@ -3264,8 +3271,6 @@ static irqreturn_t ucc_geth_irq_handler(int irq, = -void *info) +> @@ -3264,8 +3271,6 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) > struct ucc_geth_info *ug_info; > register u32 ucce; > register u32 uccm; > - register u32 tx_mask; > - u8 i; -> =20 +> > ugeth_vdbg("%s: IN", __func__); -> =20 -> @@ -3279,27 +3284,14 @@ static irqreturn_t ucc_geth_irq_handler(int irq= -, void *info) +> +> @@ -3279,27 +3284,14 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) > out_be32(uccf->p_ucce, ucce); -> =20 +> > /* check for receive events that require processing */ > - if (ucce & UCCE_RX_EVENTS) { > + if (ucce & (UCCE_RX_EVENTS | UCCE_TX_EVENTS)) { > if (netif_rx_schedule_prep(&ugeth->napi)) { -> - uccm &=3D ~UCCE_RX_EVENTS; -> + uccm &=3D ~(UCCE_RX_EVENTS | UCCE_TX_EVENTS); +> - uccm &= ~UCCE_RX_EVENTS; +> + uccm &= ~(UCCE_RX_EVENTS | UCCE_TX_EVENTS); > out_be32(uccf->p_uccm, uccm); > __netif_rx_schedule(&ugeth->napi); > } > } -> =20 +> > - /* Tx event processing */ > - if (ucce & UCCE_TX_EVENTS) { > - spin_lock(&ugeth->lock); -> - tx_mask =3D UCC_GETH_UCCE_TXB0; -> - for (i =3D 0; i < ug_info->numQueuesTx; i++) { +> - tx_mask = UCC_GETH_UCCE_TXB0; +> - for (i = 0; i < ug_info->numQueuesTx; i++) { > - if (ucce & tx_mask) > - ucc_geth_tx(dev, i); -> - ucce &=3D ~tx_mask; -> - tx_mask <<=3D 1; +> - ucce &= ~tx_mask; +> - tx_mask <<= 1; > - } > - spin_unlock(&ugeth->lock); > - } @@ -104,18 +99,15 @@ void *info) > /* Errors and other events */ > if (ucce & UCCE_OTHER) { > if (ucce & UCC_GETH_UCCE_BSY) -> @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device* ofdev= -, const struct of_device_id *ma -> dev->netdev_ops =3D &ucc_geth_netdev_ops; -> dev->watchdog_timeo =3D TX_TIMEOUT; +> @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma +> dev->netdev_ops = &ucc_geth_netdev_ops; +> dev->watchdog_timeo = TX_TIMEOUT; > INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work); -> - netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT)= -; +> - netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT); > + netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64); -> dev->mtu =3D 1500; -> =20 -> ugeth->msg_enable =3D netif_msg_init(debug.msg_enable, UGETH_MSG_DEFA= -ULT); +> dev->mtu = 1500; +> +> ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT); > diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h > index 44218b8..50bad53 100644 > --- a/drivers/net/ucc_geth.h @@ -125,6 +117,6 @@ ULT); > #define TX_BD_RING_LEN 0x10 > #define RX_BD_RING_LEN 0x10 > -#define UCC_GETH_DEV_WEIGHT TX_BD_RING_LEN -> =20 +> > #define TX_RING_MOD_MASK(size) (size-1) > #define RX_RING_MOD_MASK(size) (size-1) diff --git a/a/content_digest b/N1/content_digest index ca1b582..ed00f35 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -8,60 +8,57 @@ " netdev@vger.kernel.org\0" "\00:1\0" "b\0" - "Joakim Tjernlund a =E9crit :\n" + "Joakim Tjernlund a \303\251crit :\n" "> Also set NAPI weight to 64 as this is a common value.\n" "> This will make the system alot more responsive while\n" "> ping flooding the ucc_geth ethernet interaface.\n" - ">=20\n" + "> \n" "> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>\n" "> ---\n" "> drivers/net/ucc_geth.c | 32 ++++++++++++--------------------\n" "> drivers/net/ucc_geth.h | 1 -\n" "> 2 files changed, 12 insertions(+), 21 deletions(-)\n" - ">=20\n" + "> \n" "> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c\n" "> index 097aed8..7fc91aa 100644\n" "> --- a/drivers/net/ucc_geth.c\n" "> +++ b/drivers/net/ucc_geth.c\n" - "> @@ -3214,7 +3214,7 @@ static int ucc_geth_tx(struct net_device *dev, u8=\n" - " txQ)\n" + "> @@ -3214,7 +3214,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)\n" "> \t\tdev->stats.tx_packets++;\n" - "> =20\n" + "> \n" "> \t\t/* Free the sk buffer associated with this TxBD */\n" "> -\t\tdev_kfree_skb_irq(ugeth->\n" "> +\t\tdev_kfree_skb(ugeth->\n" "> \t\t\t\t tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]);\n" - "> \t\tugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] =3D NULL;\n" - "> \t\tugeth->skb_dirtytx[txQ] =3D\n" - "> @@ -3248,9 +3248,16 @@ static int ucc_geth_poll(struct napi_struct *nap=\n" - "i, int budget)\n" + "> \t\tugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL;\n" + "> \t\tugeth->skb_dirtytx[txQ] =\n" + "> @@ -3248,9 +3248,16 @@ static int ucc_geth_poll(struct napi_struct *napi, int budget)\n" "\n" - "> \tfor (i =3D 0; i < ug_info->numQueuesRx; i++)\n" - "> \t\thowmany +=3D ucc_geth_rx(ugeth, i, budget - howmany);\n" + "> \tfor (i = 0; i < ug_info->numQueuesRx; i++)\n" + "> \t\thowmany += ucc_geth_rx(ugeth, i, budget - howmany);\n" "\n" "Not related to your patch, but seeing above code, I can understand\n" "you might have a problem in flood situation : Only first queue(s) are\n" - "depleted, and last one cannot be because howmany >=3D budget.\n" + "depleted, and last one cannot be because howmany >= budget.\n" "\n" "This driver might have to remember last queue it handled at previous\n" - "call ucc_geth_poll(), so that all rxqueues have same probability to be sc=\n" - "anned.\n" + "call ucc_geth_poll(), so that all rxqueues have same probability to be scanned.\n" "\n" - "j =3D ug->lastslot;\n" - "for (i =3D 0; ug_info->numQueuesRx; i++) {\n" - "\tif (++j >=3D ug_info->numQueuesRx)\n" - "\t\tj =3D 0;\n" - "\thowmany +=3D ucc_geth_rx(ugeth, j, budget - howmany);\n" - "\tif (howmany >=3D budget)\n" + "j = ug->lastslot;\n" + "for (i = 0; ug_info->numQueuesRx; i++) {\n" + "\tif (++j >= ug_info->numQueuesRx)\n" + "\t\tj = 0;\n" + "\thowmany += ucc_geth_rx(ugeth, j, budget - howmany);\n" + "\tif (howmany >= budget)\n" "\t\tbreak;\n" "}\n" - "ug->lastslot =3D j;\n" + "ug->lastslot = j;\n" "\n" "\n" - "> =20\n" + "> \n" "> +\t/* Tx event processing */\n" "> +\tspin_lock(&ugeth->lock);\n" - "> +\tfor (i =3D 0; i < ug_info->numQueuesTx; i++) {\n" + "> +\tfor (i = 0; i < ug_info->numQueuesTx; i++) {\n" "> +\t\tucc_geth_tx(ugeth->dev, i);\n" "> +\t}\n" "> +\tspin_unlock(&ugeth->lock);\n" @@ -71,42 +68,40 @@ "> -\t\tsetbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS);\n" "> +\t\tsetbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS | UCCE_TX_EVENTS);\n" "> \t}\n" - "> =20\n" + "> \n" "> \treturn howmany;\n" - "> @@ -3264,8 +3271,6 @@ static irqreturn_t ucc_geth_irq_handler(int irq, =\n" - "void *info)\n" + "> @@ -3264,8 +3271,6 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)\n" "> \tstruct ucc_geth_info *ug_info;\n" "> \tregister u32 ucce;\n" "> \tregister u32 uccm;\n" "> -\tregister u32 tx_mask;\n" "> -\tu8 i;\n" - "> =20\n" + "> \n" "> \tugeth_vdbg(\"%s: IN\", __func__);\n" - "> =20\n" - "> @@ -3279,27 +3284,14 @@ static irqreturn_t ucc_geth_irq_handler(int irq=\n" - ", void *info)\n" + "> \n" + "> @@ -3279,27 +3284,14 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)\n" "> \tout_be32(uccf->p_ucce, ucce);\n" - "> =20\n" + "> \n" "> \t/* check for receive events that require processing */\n" "> -\tif (ucce & UCCE_RX_EVENTS) {\n" "> +\tif (ucce & (UCCE_RX_EVENTS | UCCE_TX_EVENTS)) {\n" "> \t\tif (netif_rx_schedule_prep(&ugeth->napi)) {\n" - "> -\t\t\tuccm &=3D ~UCCE_RX_EVENTS;\n" - "> +\t\t\tuccm &=3D ~(UCCE_RX_EVENTS | UCCE_TX_EVENTS);\n" + "> -\t\t\tuccm &= ~UCCE_RX_EVENTS;\n" + "> +\t\t\tuccm &= ~(UCCE_RX_EVENTS | UCCE_TX_EVENTS);\n" "> \t\t\tout_be32(uccf->p_uccm, uccm);\n" "> \t\t\t__netif_rx_schedule(&ugeth->napi);\n" "> \t\t}\n" "> \t}\n" - "> =20\n" + "> \n" "> -\t/* Tx event processing */\n" "> -\tif (ucce & UCCE_TX_EVENTS) {\n" "> -\t\tspin_lock(&ugeth->lock);\n" - "> -\t\ttx_mask =3D UCC_GETH_UCCE_TXB0;\n" - "> -\t\tfor (i =3D 0; i < ug_info->numQueuesTx; i++) {\n" + "> -\t\ttx_mask = UCC_GETH_UCCE_TXB0;\n" + "> -\t\tfor (i = 0; i < ug_info->numQueuesTx; i++) {\n" "> -\t\t\tif (ucce & tx_mask)\n" "> -\t\t\t\tucc_geth_tx(dev, i);\n" - "> -\t\t\tucce &=3D ~tx_mask;\n" - "> -\t\t\ttx_mask <<=3D 1;\n" + "> -\t\t\tucce &= ~tx_mask;\n" + "> -\t\t\ttx_mask <<= 1;\n" "> -\t\t}\n" "> -\t\tspin_unlock(&ugeth->lock);\n" "> -\t}\n" @@ -114,18 +109,15 @@ "> \t/* Errors and other events */\n" "> \tif (ucce & UCCE_OTHER) {\n" "> \t\tif (ucce & UCC_GETH_UCCE_BSY)\n" - "> @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device* ofdev=\n" - ", const struct of_device_id *ma\n" - "> \tdev->netdev_ops =3D &ucc_geth_netdev_ops;\n" - "> \tdev->watchdog_timeo =3D TX_TIMEOUT;\n" + "> @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma\n" + "> \tdev->netdev_ops = &ucc_geth_netdev_ops;\n" + "> \tdev->watchdog_timeo = TX_TIMEOUT;\n" "> \tINIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);\n" - "> -\tnetif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT)=\n" - ";\n" + "> -\tnetif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);\n" "> +\tnetif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64);\n" - "> \tdev->mtu =3D 1500;\n" - "> =20\n" - "> \tugeth->msg_enable =3D netif_msg_init(debug.msg_enable, UGETH_MSG_DEFA=\n" - "ULT);\n" + "> \tdev->mtu = 1500;\n" + "> \n" + "> \tugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);\n" "> diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h\n" "> index 44218b8..50bad53 100644\n" "> --- a/drivers/net/ucc_geth.h\n" @@ -135,8 +127,8 @@ "> #define TX_BD_RING_LEN 0x10\n" "> #define RX_BD_RING_LEN 0x10\n" "> -#define UCC_GETH_DEV_WEIGHT TX_BD_RING_LEN\n" - "> =20\n" + "> \n" "> #define TX_RING_MOD_MASK(size) (size-1)\n" > #define RX_RING_MOD_MASK(size) (size-1) -e4be10ef18752bc7858fb6b099f22a9b56af792ca2cee8435119ddec09342f4d +4816070d98fe97976e1af6b687429da77bd255e8d89e2b00a50b14ba58be583e
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.