[v1,06/15] examples/l2fwd: fix lines exceeding 80 char limit
Checks
Commit Message
v1:
* Replaced 'unsigned' with 'unsigned int'
Fixes: e2366e74e029 ("examples: use buffered Tx")
Fixes: af75078fece3 ("first public release")
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
examples/l2fwd/main.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Comments
Hi Anoob,
> -----Original Message-----
> From: Anoob Joseph [mailto:anoob.joseph@caviumnetworks.com]
> Sent: Thursday, June 14, 2018 11:18 AM
> To: Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: Anoob Joseph <anoob.joseph@caviumnetworks.com>; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>; Narayana Prasad
> <narayanaprasad.athreya@caviumnetworks.com>; dev@dpdk.org
> Subject: [PATCH v1 06/15] examples/l2fwd: fix lines exceeding 80 char limit
>
> v1:
> * Replaced 'unsigned' with 'unsigned int'
>
> Fixes: e2366e74e029 ("examples: use buffered Tx")
> Fixes: af75078fece3 ("first public release")
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
I don't think it is needed to have this patch. Generally, new code should follow the 80 char limit,
But I think we don't need to have a patch fixing existing code (and definitely, this doesn't need backport).
@@ -147,11 +147,12 @@ l2fwd_main_loop(void)
struct rte_mbuf *m;
int sent;
unsigned lcore_id;
+ unsigned int master_core_id;
uint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc;
unsigned i, j, portid, nb_rx;
struct lcore_queue_conf *qconf;
- const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S *
- BURST_TX_DRAIN_US;
+ const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
+ / US_PER_S * BURST_TX_DRAIN_US;
struct rte_eth_dev_tx_buffer *buffer;
prev_tsc = 0;
@@ -175,6 +176,8 @@ l2fwd_main_loop(void)
}
+ master_core_id = rte_get_master_lcore();
+
while (!force_quit) {
cur_tsc = rte_rdtsc();
@@ -187,10 +190,12 @@ l2fwd_main_loop(void)
for (i = 0; i < qconf->n_rx_port; i++) {
- portid = l2fwd_dst_ports[qconf->rx_port_list[i]];
+ portid =
+ l2fwd_dst_ports[qconf->rx_port_list[i]];
buffer = tx_buffer[portid];
- sent = rte_eth_tx_buffer_flush(portid, 0, buffer);
+ sent = rte_eth_tx_buffer_flush(portid, 0,
+ buffer);
if (sent)
port_statistics[portid].tx += sent;
@@ -206,7 +211,7 @@ l2fwd_main_loop(void)
if (unlikely(timer_tsc >= timer_period)) {
/* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == master_core_id) {
print_stats();
/* reset the timer */
timer_tsc = 0;