Message ID | 20231023114449.2362147-3-srasheed@marvell.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Cleanup and optimizations to transmit code | expand |
Context | Check | Description |
---|---|---|
netdev/series_format | success | Posting correctly formatted |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 9 this patch: 9 |
netdev/cc_maintainers | success | CCed 7 of 7 maintainers |
netdev/build_clang | success | Errors and warnings before: 1388 this patch: 1388 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/deprecated_api | success | None detected |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 1388 this patch: 1388 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 47 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
> -----Original Message----- > From: Shinas Rasheed <srasheed@marvell.com> > Sent: Monday, October 23, 2023 1:45 PM > To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Cc: hgani@marvell.com; vimleshk@marvell.com; Gallen, Erwan <egallen@redhat.com>; mschmidt <mschmidt@redhat.com>; > pabeni@redhat.com; horms@kernel.org; kuba@kernel.org; davem@davemloft.net; Shinas Rasheed <srasheed@marvell.com>; > Veerasenareddy Burru <vburru@marvell.com>; Sathesh Edara <sedara@marvell.com>; Eric Dumazet <edumazet@google.com> > Subject: [PATCH net-next 2/3] octeon_ep: implement xmit_more in transmit > > Adds xmit_more handling in tx datapath for octeon_ep pf. Imperative mode is preferred :) Besides that: Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> > > Signed-off-by: Shinas Rasheed <srasheed@marvell.com> > --- > .../ethernet/marvell/octeon_ep/octep_config.h | 2 +- > .../ethernet/marvell/octeon_ep/octep_main.c | 19 +++++++++++++++---- > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_config.h b/drivers/net/ethernet/marvell/octeon_ep/octep_config.h > index 1622a6ebf036..ed8b1ace56b9 100644 > --- a/drivers/net/ethernet/marvell/octeon_ep/octep_config.h > +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_config.h > @@ -15,7 +15,7 @@ > /* Tx Queue: maximum descriptors per ring */ > #define OCTEP_IQ_MAX_DESCRIPTORS 1024 > /* Minimum input (Tx) requests to be enqueued to ring doorbell */ > -#define OCTEP_DB_MIN 1 > +#define OCTEP_DB_MIN 8 > /* Packet threshold for Tx queue interrupt */ > #define OCTEP_IQ_INTR_THRESHOLD 0x0 > > diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c > index bf1e376a4232..730443ba2f5b 100644 > --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c > +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c > @@ -818,6 +818,7 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb, > struct octep_iq *iq; > skb_frag_t *frag; > u16 nr_frags, si; > + int xmit_more; > u16 q_no, wi; > > q_no = skb_get_queue_mapping(skb); > @@ -892,18 +893,28 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb, > } > > netdev_tx_sent_queue(iq->netdev_q, skb->len); > + > + xmit_more = netdev_xmit_more(); > + > skb_tx_timestamp(skb); > atomic_inc(&iq->instr_pending); > + iq->fill_cnt++; > wi++; > if (wi == iq->max_count) > wi = 0; > iq->host_write_index = wi; > + if (xmit_more && > + (atomic_read(&iq->instr_pending) < > + (iq->max_count - OCTEP_WAKE_QUEUE_THRESHOLD)) && > + iq->fill_cnt < iq->fill_threshold) > + return NETDEV_TX_OK; > + > /* Flush the hw descriptor before writing to doorbell */ > wmb(); > - > - /* Ring Doorbell to notify the NIC there is a new packet */ > - writel(1, iq->doorbell_reg); > - iq->stats.instr_posted++; > + /* Ring Doorbell to notify the NIC of new packets */ > + writel(iq->fill_cnt, iq->doorbell_reg); > + iq->stats.instr_posted += iq->fill_cnt; > + iq->fill_cnt = 0; > return NETDEV_TX_OK; > > dma_map_sg_err: > -- > 2.25.1 >
Sure, will update it since the first patch changelog requires more explanation as well
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_config.h b/drivers/net/ethernet/marvell/octeon_ep/octep_config.h index 1622a6ebf036..ed8b1ace56b9 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_config.h +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_config.h @@ -15,7 +15,7 @@ /* Tx Queue: maximum descriptors per ring */ #define OCTEP_IQ_MAX_DESCRIPTORS 1024 /* Minimum input (Tx) requests to be enqueued to ring doorbell */ -#define OCTEP_DB_MIN 1 +#define OCTEP_DB_MIN 8 /* Packet threshold for Tx queue interrupt */ #define OCTEP_IQ_INTR_THRESHOLD 0x0 diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c index bf1e376a4232..730443ba2f5b 100644 --- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c @@ -818,6 +818,7 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb, struct octep_iq *iq; skb_frag_t *frag; u16 nr_frags, si; + int xmit_more; u16 q_no, wi; q_no = skb_get_queue_mapping(skb); @@ -892,18 +893,28 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb, } netdev_tx_sent_queue(iq->netdev_q, skb->len); + + xmit_more = netdev_xmit_more(); + skb_tx_timestamp(skb); atomic_inc(&iq->instr_pending); + iq->fill_cnt++; wi++; if (wi == iq->max_count) wi = 0; iq->host_write_index = wi; + if (xmit_more && + (atomic_read(&iq->instr_pending) < + (iq->max_count - OCTEP_WAKE_QUEUE_THRESHOLD)) && + iq->fill_cnt < iq->fill_threshold) + return NETDEV_TX_OK; + /* Flush the hw descriptor before writing to doorbell */ wmb(); - - /* Ring Doorbell to notify the NIC there is a new packet */ - writel(1, iq->doorbell_reg); - iq->stats.instr_posted++; + /* Ring Doorbell to notify the NIC of new packets */ + writel(iq->fill_cnt, iq->doorbell_reg); + iq->stats.instr_posted += iq->fill_cnt; + iq->fill_cnt = 0; return NETDEV_TX_OK; dma_map_sg_err:
Adds xmit_more handling in tx datapath for octeon_ep pf. Signed-off-by: Shinas Rasheed <srasheed@marvell.com> --- .../ethernet/marvell/octeon_ep/octep_config.h | 2 +- .../ethernet/marvell/octeon_ep/octep_main.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-)