From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66C17A10DA for ; Fri, 2 Aug 2019 13:09:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 435D81C24F; Fri, 2 Aug 2019 13:09:47 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 05FF01C1B9 for ; Fri, 2 Aug 2019 13:09:45 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id u124so51061888vsu.2 for ; Fri, 02 Aug 2019 04:09:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t/mhLSDCwhWtvmXKiY7tUHLRuMgVnGfowUty6A9k1lI=; b=kYdE0IRHau6DuJUYdZYJ7ID2RwodtuCH0cLOfvauzSRh23+WJ71e8cgD69SJGohEto dozT8cLJNWiF12lYXnPGeP90vIQUUNodLJqwfFCNux7L93AccfAzmBGb2ujPDkJRgxVI 6D55tphJV+05OIX4mA7HpiiFR8MOiQiwZ2N7f+S8NNYm9wL5qUEkzNFtt0V46PvrGxve 81uUHUPmjIWd55+XjtbCGQsz2o8KtD16LUTqcE2raI6m2mgDjx2Vu4WGJRxFicJQ8Lev Knj3+Pc69G/ON3d2NYnYFzzOTwF9PUe8fNaEuM79kTfsGcv6lXtKbRnI3fc9h0u8WPn4 DUGQ== X-Gm-Message-State: APjAAAU/Hgo8fVEXAV+wJ9hIJZ+ga0OhPAVbli8j150MJD/zCbQ67c53 ekfieAye5KW0IWuifivEKQNcm3Bf5vdJzCbdMkikhg== X-Google-Smtp-Source: APXvYqyg+lTi2eujJ0SlLjS42VwqZ2TNcqPC+Jaugy56FLWydiZ20vC4/lGO+dUew3AE5IqIbUgVmye2rlGIhAKf6Ro= X-Received: by 2002:a67:2ec8:: with SMTP id u191mr89336605vsu.39.1564744185179; Fri, 02 Aug 2019 04:09:45 -0700 (PDT) MIME-Version: 1.0 References: <20190726165054.24078-1-stephen@networkplumber.org> <20190802025826.1174-1-stephen@networkplumber.org> <20190802025826.1174-4-stephen@networkplumber.org> In-Reply-To: <20190802025826.1174-4-stephen@networkplumber.org> From: David Marchand Date: Fri, 2 Aug 2019 13:09:34 +0200 Message-ID: To: Stephen Hemminger Cc: dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 3/4] examples/multi_process/client_server_mp/mp_server: fix style X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Aug 2, 2019 at 4:59 AM Stephen Hemminger wrote: > > Lots of little style complaints from checkpatch. > > Signed-off-by: Stephen Hemminger > --- > .../client_server_mp/mp_server/args.c | 37 ++++----- > .../client_server_mp/mp_server/init.c | 79 +++++++++++-------- > .../client_server_mp/mp_server/main.c | 44 ++++++----- > 3 files changed, 88 insertions(+), 72 deletions(-) > > diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c > index fdc008b3d677..91c823856a72 100644 > --- a/examples/multi_process/client_server_mp/mp_server/args.c > +++ b/examples/multi_process/client_server_mp/mp_server/args.c > @@ -112,33 +112,34 @@ parse_app_args(int argc, char *argv[]) > progname = argv[0]; > > while ((opt = getopt_long(argc, argvopt, "n:p:", lgopts, > - &option_index)) != EOF){ > - switch (opt){ > - case 'p': > - if (parse_portmask(optarg) != 0) { > - usage(); > - return -1; > - } > - break; > - case 'n': > - if (parse_num_clients(optarg) != 0){ > - usage(); > - return -1; > - } > - break; > - default: > - printf("ERROR: Unknown option '%c'\n", opt); > + &option_index)) != EOF) { > + > + switch (opt) { > + case 'p': > + if (parse_portmask(optarg) != 0) { > + usage(); > + return -1; > + } > + break; > + case 'n': > + if (parse_num_clients(optarg) != 0) { > usage(); > return -1; > + } > + break; > + default: > + printf("ERROR: Unknown option '%c'\n", opt); > + usage(); > + return -1; > } > } > > - if (ports->num_ports == 0 || num_clients == 0){ > + if (ports->num_ports == 0 || num_clients == 0) { > usage(); > return -1; > } > > - if (ports->num_ports % 2 != 0){ > + if (ports->num_ports % 2 != 0) { > printf("ERROR: application requires an even number of ports to use\n"); > return -1; > } > diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c > index 1b0569937b51..96c35f220a7d 100644 > --- a/examples/multi_process/client_server_mp/mp_server/init.c > +++ b/examples/multi_process/client_server_mp/mp_server/init.c > @@ -49,7 +49,7 @@ > struct rte_mempool *pktmbuf_pool; > > /* array of info/queues for clients */ > -struct client *clients = NULL; > +struct client *clients; > > /* the port details */ > struct port_info *ports; > @@ -72,7 +72,8 @@ init_mbuf_pools(void) > num_mbufs_server + num_mbufs_client + num_mbufs_mp_cache; > > /* don't pass single-producer/single-consumer flags to mbuf create as it > - * seems faster to use a cache instead */ > + * seems faster to use a cache instead > + */ > printf("Creating mbuf pool '%s' [%u mbufs] ...\n", > PKTMBUF_POOL_NAME, num_mbufs); > pktmbuf_pool = rte_pktmbuf_pool_create(PKTMBUF_POOL_NAME, num_mbufs, > @@ -108,9 +109,11 @@ init_port(uint16_t port_num) > fflush(stdout); > > /* Standard DPDK port initialisation - config port, then set up > - * rx and tx rings */ > - if ((retval = rte_eth_dev_configure(port_num, rx_rings, tx_rings, > - &port_conf)) != 0) > + * rx and tx rings > + */ > + retval = rte_eth_dev_configure(port_num, rx_rings, tx_rings, > + &port_conf); > + if (retval != 0) > return retval; > > retval = rte_eth_dev_adjust_nb_rx_tx_desc(port_num, &rx_ring_size, > @@ -122,22 +125,25 @@ init_port(uint16_t port_num) > retval = rte_eth_rx_queue_setup(port_num, q, rx_ring_size, > rte_eth_dev_socket_id(port_num), > NULL, pktmbuf_pool); > - if (retval < 0) return retval; > + if (retval < 0) > + return retval; > } > > - for ( q = 0; q < tx_rings; q ++ ) { > + for (q = 0; q < tx_rings; q++) { > retval = rte_eth_tx_queue_setup(port_num, q, tx_ring_size, > rte_eth_dev_socket_id(port_num), > NULL); > - if (retval < 0) return retval; > + if (retval < 0) > + return retval; > } > > rte_eth_promiscuous_enable(port_num); > > retval = rte_eth_dev_start(port_num); > - if (retval < 0) return retval; > + if (retval < 0) > + return retval; > > - printf( "done: \n"); > + printf("done:\n"); > > return 0; > } > @@ -150,15 +156,15 @@ init_port(uint16_t port_num) > static int > init_shm_rings(void) > { > - unsigned i; > - unsigned socket_id; > - const char * q_name; > - const unsigned ringsize = CLIENT_QUEUE_RINGSIZE; > + unsigned int i, socket_id; > + const char *q_name; > + const unsigned int ringsize = CLIENT_QUEUE_RINGSIZE; > > clients = rte_malloc("client details", > sizeof(*clients) * num_clients, 0); > if (clients == NULL) > - rte_exit(EXIT_FAILURE, "Cannot allocate memory for client program details\n"); > + rte_exit(EXIT_FAILURE, > + "Cannot allocate memory for client program details\n"); > > for (i = 0; i < num_clients; i++) { > /* Create an RX queue for each client */ > @@ -166,13 +172,27 @@ init_shm_rings(void) > q_name = get_rx_queue_name(i); > clients[i].rx_q = rte_ring_create(q_name, > ringsize, socket_id, > - RING_F_SP_ENQ | RING_F_SC_DEQ ); /* single prod, single cons */ > + RING_F_SP_ENQ | RING_F_SC_DEQ); > if (clients[i].rx_q == NULL) > - rte_exit(EXIT_FAILURE, "Cannot create rx ring queue for client %u\n", i); > + rte_exit(EXIT_FAILURE, > + "Cannot create rx ring queue for client %u\n", > + i); > } > return 0; > } > > +static void > +print_link_status(uint16 id, const struct rte_eth_link *link) uint16_t See build error at http://mails.dpdk.org/archives/test-report/2019-August/092150.html -- David Marchand