Message ID | 1445946068-28183-1-git-send-email-kevin.traynor@intel.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id BE5025682; Tue, 27 Oct 2015 12:41:12 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3A9B5374E for <dev@dpdk.org>; Tue, 27 Oct 2015 12:41:11 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 27 Oct 2015 04:41:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,204,1444719600"; d="scan'208";a="672629774" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 27 Oct 2015 04:41:10 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t9RBf8GM030961 for <dev@dpdk.org>; Tue, 27 Oct 2015 11:41:09 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t9RBf8KP028221 for <dev@dpdk.org>; Tue, 27 Oct 2015 11:41:08 GMT Received: (from ktraynor@localhost) by sivswdev01.ir.intel.com with id t9RBf8L6028216 for dev@dpdk.org; Tue, 27 Oct 2015 11:41:08 GMT From: Kevin Traynor <kevin.traynor@intel.com> To: dev@dpdk.org Date: Tue, 27 Oct 2015 11:41:08 +0000 Message-Id: <1445946068-28183-1-git-send-email-kevin.traynor@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path selection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Traynor, Kevin
Oct. 27, 2015, 11:41 a.m. UTC
Simple and vector are different tx code paths. If vector
is selected, change logging from:
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
to:
PMD: ixgbe_set_tx_function(): Using vector tx code path
or, if simple selected:
PMD: ixgbe_set_tx_function(): Using simple tx code path
The dangling else in the #ifdef makes readability difficult,
so resolving in way that seems most readable.
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
---
drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
Comments
On Tue, Oct 27, 2015 at 11:41:08AM +0000, Kevin Traynor wrote: > Simple and vector are different tx code paths. If vector > is selected, change logging from: > PMD: ixgbe_set_tx_function(): Using simple tx code path > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > to: > PMD: ixgbe_set_tx_function(): Using vector tx code path > > or, if simple selected: > PMD: ixgbe_set_tx_function(): Using simple tx code path > > The dangling else in the #ifdef makes readability difficult, > so resolving in way that seems most readable. > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> > --- > drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > index a598a72..11d7feb 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) > && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { > - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > #ifdef RTE_IXGBE_INC_VECTOR > if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && > (rte_eal_process_type() != RTE_PROC_PRIMARY || > ixgbe_txq_vec_setup(txq) == 0)) { > - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); > + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); > dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; > } else > #endif > - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > + { > + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > + } > } else { > PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); > PMD_INIT_LOG(DEBUG, > -- > 1.7.4.1 > Hi Kevin, can I suggest a slight alternative here that might help make things easier. Instead of printing the message as we pick the code path, why not have a "logmsg" pointer variable that is assigned in the code, and then print out the log path at the end. This would have a number of advantages: 1. there are no issues with changing our mind, so we can assign one path type, and then later change it to something different without cluttering up the debug output with the history of our code's flow. 2. it means that you don't have a problem with smaller else legs as you can easily do multiple assignments in the one line using a comma as: dev->tx_pkt_burst = ixgbe_xmit_pkts_simple, logmsg = "Using simple ..."; Regards, /Bruce
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Tuesday, October 27, 2015 11:50 AM > To: Traynor, Kevin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path selection > > On Tue, Oct 27, 2015 at 11:41:08AM +0000, Kevin Traynor wrote: > > Simple and vector are different tx code paths. If vector > > is selected, change logging from: > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > > > to: > > PMD: ixgbe_set_tx_function(): Using vector tx code path > > > > or, if simple selected: > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > > The dangling else in the #ifdef makes readability difficult, > > so resolving in way that seems most readable. > > > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> > > --- > > drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++--- > > 1 files changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > > index a598a72..11d7feb 100644 > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) > > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > > if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) > > && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { > > - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > #ifdef RTE_IXGBE_INC_VECTOR > > if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && > > (rte_eal_process_type() != RTE_PROC_PRIMARY || > > ixgbe_txq_vec_setup(txq) == 0)) { > > - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); > > + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); > > dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; > > } else > > #endif > > - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > + { > > + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > + } > > } else { > > PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); > > PMD_INIT_LOG(DEBUG, > > -- > > 1.7.4.1 > > > Hi Kevin, > > can I suggest a slight alternative here that might help make things easier. > Instead of printing the message as we pick the code path, why not have a "logmsg" > pointer variable that is assigned in the code, and then print out the log path > at the end. > > This would have a number of advantages: > 1. there are no issues with changing our mind, so we can assign one path type, > and then later change it to something different without cluttering up the debug > output with the history of our code's flow. > 2. it means that you don't have a problem with smaller else legs as you can > easily do multiple assignments in the one line using a comma as: > dev->tx_pkt_burst = ixgbe_xmit_pkts_simple, logmsg = "Using simple ..."; While I like approach with logmsg, please avoid commas here. It will make this peace of code even more hard to read (at least for me). Konstantin > > Regards, > /Bruce
On Tue, Oct 27, 2015 at 12:12:39PM +0000, Ananyev, Konstantin wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > Sent: Tuesday, October 27, 2015 11:50 AM > > To: Traynor, Kevin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path selection > > > > On Tue, Oct 27, 2015 at 11:41:08AM +0000, Kevin Traynor wrote: > > > Simple and vector are different tx code paths. If vector > > > is selected, change logging from: > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > > > > > to: > > > PMD: ixgbe_set_tx_function(): Using vector tx code path > > > > > > or, if simple selected: > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > > > > The dangling else in the #ifdef makes readability difficult, > > > so resolving in way that seems most readable. > > > > > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> > > > --- > > > drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++--- > > > 1 files changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c > > > index a598a72..11d7feb 100644 > > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > > @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) > > > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > > > if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) > > > && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { > > > - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > #ifdef RTE_IXGBE_INC_VECTOR > > > if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && > > > (rte_eal_process_type() != RTE_PROC_PRIMARY || > > > ixgbe_txq_vec_setup(txq) == 0)) { > > > - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); > > > + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); > > > dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; > > > } else > > > #endif > > > - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > + { > > > + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > + } > > > } else { > > > PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); > > > PMD_INIT_LOG(DEBUG, > > > -- > > > 1.7.4.1 > > > > > Hi Kevin, > > > > can I suggest a slight alternative here that might help make things easier. > > Instead of printing the message as we pick the code path, why not have a "logmsg" > > pointer variable that is assigned in the code, and then print out the log path > > at the end. > > > > This would have a number of advantages: > > 1. there are no issues with changing our mind, so we can assign one path type, > > and then later change it to something different without cluttering up the debug > > output with the history of our code's flow. > > 2. it means that you don't have a problem with smaller else legs as you can > > easily do multiple assignments in the one line using a comma as: > > dev->tx_pkt_burst = ixgbe_xmit_pkts_simple, logmsg = "Using simple ..."; > > While I like approach with logmsg, please avoid commas here. > It will make this peace of code even more hard to read (at least for me). > Konstantin > Sure, it's a matter of taste. I'd much prefer a single line with commas to the awkwardness above trying to manage braces around an ifdef. I'll leave it to Kevin to see what he comes up with. :-) /Bruce
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kevin Traynor > Sent: Tuesday, October 27, 2015 11:41 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path > selection > > Simple and vector are different tx code paths. If vector is selected, > change logging from: > PMD: ixgbe_set_tx_function(): Using simple tx code path > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > to: > PMD: ixgbe_set_tx_function(): Using vector tx code path > > or, if simple selected: > PMD: ixgbe_set_tx_function(): Using simple tx code path > > The dangling else in the #ifdef makes readability difficult, so resolving > in way that seems most readable. > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
> -----Original Message----- > From: Ananyev, Konstantin > Sent: Tuesday, October 27, 2015 12:13 PM > To: Richardson, Bruce; Traynor, Kevin > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path > selection > > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > Sent: Tuesday, October 27, 2015 11:50 AM > > To: Traynor, Kevin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code > path selection > > > > On Tue, Oct 27, 2015 at 11:41:08AM +0000, Kevin Traynor wrote: > > > Simple and vector are different tx code paths. If vector > > > is selected, change logging from: > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > > > > > to: > > > PMD: ixgbe_set_tx_function(): Using vector tx code path > > > > > > or, if simple selected: > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > > > > The dangling else in the #ifdef makes readability difficult, > > > so resolving in way that seems most readable. > > > > > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> > > > --- > > > drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++--- > > > 1 files changed, 5 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c > b/drivers/net/ixgbe/ixgbe_rxtx.c > > > index a598a72..11d7feb 100644 > > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > > @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, > struct ixgbe_tx_queue *txq) > > > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > > > if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) > > > && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { > > > - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > #ifdef RTE_IXGBE_INC_VECTOR > > > if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && > > > (rte_eal_process_type() != RTE_PROC_PRIMARY || > > > ixgbe_txq_vec_setup(txq) == 0)) { > > > - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); > > > + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); > > > dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; > > > } else > > > #endif > > > - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > + { > > > + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > + } > > > } else { > > > PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); > > > PMD_INIT_LOG(DEBUG, > > > -- > > > 1.7.4.1 > > > > > Hi Kevin, > > > > can I suggest a slight alternative here that might help make things easier. > > Instead of printing the message as we pick the code path, why not have a > "logmsg" > > pointer variable that is assigned in the code, and then print out the log > path > > at the end. > > > > This would have a number of advantages: > > 1. there are no issues with changing our mind, so we can assign one path > type, > > and then later change it to something different without cluttering up the > debug > > output with the history of our code's flow. > > 2. it means that you don't have a problem with smaller else legs as you can > > easily do multiple assignments in the one line using a comma as: > > dev->tx_pkt_burst = ixgbe_xmit_pkts_simple, logmsg = "Using simple > ..."; > > While I like approach with logmsg, please avoid commas here. > It will make this peace of code even more hard to read (at least for me). > Konstantin yeah, sure. I agree with changing for 1. I also agree with Konstantin re commas. The code under the dangling else is aligned incorrectly/correctly depending on whether the #ifdef is true or not, so I think adding multiple statements with {} now will make it obvious for the next person who modifies. > > > > > Regards, > > /Bruce
On Tue, Oct 27, 2015 at 05:31:59PM +0000, Traynor, Kevin wrote: > > > -----Original Message----- > > From: Ananyev, Konstantin > > Sent: Tuesday, October 27, 2015 12:13 PM > > To: Richardson, Bruce; Traynor, Kevin > > Cc: dev@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code path > > selection > > > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > > Sent: Tuesday, October 27, 2015 11:50 AM > > > To: Traynor, Kevin > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] ixgbe: change logging for ixgbe tx code > > path selection > > > > > > On Tue, Oct 27, 2015 at 11:41:08AM +0000, Kevin Traynor wrote: > > > > Simple and vector are different tx code paths. If vector > > > > is selected, change logging from: > > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > > PMD: ixgbe_set_tx_function(): Vector tx enabled. > > > > > > > > to: > > > > PMD: ixgbe_set_tx_function(): Using vector tx code path > > > > > > > > or, if simple selected: > > > > PMD: ixgbe_set_tx_function(): Using simple tx code path > > > > > > > > The dangling else in the #ifdef makes readability difficult, > > > > so resolving in way that seems most readable. > > > > > > > > Signed-off-by: Kevin Traynor <kevin.traynor@intel.com> > > > > --- > > > > drivers/net/ixgbe/ixgbe_rxtx.c | 8 +++++--- > > > > 1 files changed, 5 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c > > b/drivers/net/ixgbe/ixgbe_rxtx.c > > > > index a598a72..11d7feb 100644 > > > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > > > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > > > > @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, > > struct ixgbe_tx_queue *txq) > > > > /* Use a simple Tx queue (no offloads, no multi segs) if possible */ > > > > if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) > > > > && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { > > > > - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > > #ifdef RTE_IXGBE_INC_VECTOR > > > > if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && > > > > (rte_eal_process_type() != RTE_PROC_PRIMARY || > > > > ixgbe_txq_vec_setup(txq) == 0)) { > > > > - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); > > > > + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); > > > > dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; > > > > } else > > > > #endif > > > > - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > > + { > > > > + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); > > > > + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; > > > > + } > > > > } else { > > > > PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); > > > > PMD_INIT_LOG(DEBUG, > > > > -- > > > > 1.7.4.1 > > > > > > > Hi Kevin, > > > > > > can I suggest a slight alternative here that might help make things easier. > > > Instead of printing the message as we pick the code path, why not have a > > "logmsg" > > > pointer variable that is assigned in the code, and then print out the log > > path > > > at the end. > > > > > > This would have a number of advantages: > > > 1. there are no issues with changing our mind, so we can assign one path > > type, > > > and then later change it to something different without cluttering up the > > debug > > > output with the history of our code's flow. > > > 2. it means that you don't have a problem with smaller else legs as you can > > > easily do multiple assignments in the one line using a comma as: > > > dev->tx_pkt_burst = ixgbe_xmit_pkts_simple, logmsg = "Using simple > > ..."; > > > > While I like approach with logmsg, please avoid commas here. > > It will make this peace of code even more hard to read (at least for me). > > Konstantin > > yeah, sure. I agree with changing for 1. I also agree with Konstantin re commas. > The code under the dangling else is aligned incorrectly/correctly depending on > whether the #ifdef is true or not, so I think adding multiple statements with {} > now will make it obvious for the next person who modifies. > Final alternative is to have a switch statement at the end of the block for printing based on what the final function selection is. That way there is only a single assignment needed and no awkward braces. :-)
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index a598a72..11d7feb 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -1963,16 +1963,18 @@ ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq) /* Use a simple Tx queue (no offloads, no multi segs) if possible */ if (((txq->txq_flags & IXGBE_SIMPLE_FLAGS) == IXGBE_SIMPLE_FLAGS) && (txq->tx_rs_thresh >= RTE_PMD_IXGBE_TX_MAX_BURST)) { - PMD_INIT_LOG(DEBUG, "Using simple tx code path"); #ifdef RTE_IXGBE_INC_VECTOR if (txq->tx_rs_thresh <= RTE_IXGBE_TX_MAX_FREE_BUF_SZ && (rte_eal_process_type() != RTE_PROC_PRIMARY || ixgbe_txq_vec_setup(txq) == 0)) { - PMD_INIT_LOG(DEBUG, "Vector tx enabled."); + PMD_INIT_LOG(DEBUG, "Using vector tx code path"); dev->tx_pkt_burst = ixgbe_xmit_pkts_vec; } else #endif - dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; + { + PMD_INIT_LOG(DEBUG, "Using simple tx code path"); + dev->tx_pkt_burst = ixgbe_xmit_pkts_simple; + } } else { PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); PMD_INIT_LOG(DEBUG,