From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id C6DEC1B252 for ; Thu, 19 Oct 2017 18:15:44 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id i124so17428283wmf.3 for ; Thu, 19 Oct 2017 09:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=qxQizwU5Yrtp4/OR8MHqEk6tLrbn9qvmki+4cMEI+Nw=; b=k382InmUUfhytKcDEgSvq1wvINyRMov6HsBUYhJLVR4PbRoguIHpB0zUIJNaO5JPWc fsCf9W4UCbP+3xTg/XzAyolUW+GuLJCD9isgNHlVQnY9sYvAx0YH6sPbRRcGrJomSsZ2 3zP2RAHHKpN1yUA8yfDQL0/sNCraT9jwYMsgfkC1I4kxEOgxiitNM/uPR1rSiB7sgIRY nJxn0qe2XlP1L8d6lPRspPu1zAnfog3wXN4CzfONlz/Y4pAXmUbQBzVM+ZlH/LxXhxOZ QBzKOVSomUmJlTz1koIRu50DEHBoq7JU1c6wvXtuO0BfJc4YWlUjavJ9lvhlJ2E/WBkR gD6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=qxQizwU5Yrtp4/OR8MHqEk6tLrbn9qvmki+4cMEI+Nw=; b=G4fMwyqo+NfcVb/KzehOWjUlsxxxmNNKZPHD2BQBfNX0JqQMQaA4k4O6LCwsu3r+gq aH5Wu/DWh4WQwp6BiJ7+1XiUAEHLV9cyO5XfcHKj2dcAVQ+aWV790ZbgaMNWKxYkNOS3 rcFJpwF2JVtPBGtkDRqTMB28l5KPCm/2DXqQ82+Ue3RVnLFoWf5cAbP4HnAULGqOC8QC mY86l/6jBQCuSMDx50eWHAwzV1JGOCv7WJcoSBeowe+XbGBRE/8+CHI4c7cWmD4TkWYV G273AW1ToVDLobV6VKp2NZhvlQQ69D4pOezk+kDW7qaqGr0GpYL6u5I0yR1mtQrdNLsB JoFw== X-Gm-Message-State: AMCzsaW3kSLExp+iuDwz0LJ2nbaWXlWp0LdtjF+Vn+amei1F2qK60cjF KxVnvGyLuEWVzWqI41CllNdAuA== X-Google-Smtp-Source: ABhQp+R7XPsqMj7cqoMnRQyAuW2Hb4EFOiwfvwqnDLG66H54EgPBMINGKIWBmIN74v1z3zskOYlYRw== X-Received: by 10.28.191.215 with SMTP id o84mr2301935wmi.153.1508429744391; Thu, 19 Oct 2017 09:15:44 -0700 (PDT) Received: from [10.0.38.219] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id s196sm1722488wmb.26.2017.10.19.09.15.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 09:15:43 -0700 (PDT) To: Radu Nicolau , dev@dpdk.org Cc: sergio.gonzalez.monroy@intel.com, pablo.de.lara.guarch@intel.com References: <1508426775-30986-1-git-send-email-radu.nicolau@intel.com> <1508428699-24363-1-git-send-email-radu.nicolau@intel.com> From: Aviad Yehezkel Message-ID: Date: Thu, 19 Oct 2017 19:15:42 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1508428699-24363-1-git-send-email-radu.nicolau@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v3] examples/ipsec_secgw: support jumbo frames 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: , X-List-Received-Date: Thu, 19 Oct 2017 16:15:45 -0000 On 10/19/2017 6:58 PM, Radu Nicolau wrote: > Added cmdline option for jumbo frames. > Switched port initialization to the new offload API. > > Signed-off-by: Radu Nicolau > --- > v2: updated commit message > v3: addressed feedback > > doc/guides/sample_app_ug/ipsec_secgw.rst | 6 +++++- > examples/ipsec-secgw/ipsec-secgw.c | 35 +++++++++++++++++++++++++------- > 2 files changed, 33 insertions(+), 8 deletions(-) > > diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst b/doc/guides/sample_app_ug/ipsec_secgw.rst > index b675cba..a292859 100644 > --- a/doc/guides/sample_app_ug/ipsec_secgw.rst > +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst > @@ -119,7 +119,7 @@ The application has a number of command line options:: > > > ./build/ipsec-secgw [EAL options] -- > - -p PORTMASK -P -u PORTMASK > + -p PORTMASK -P -u PORTMASK -j FRAMESIZE > --config (port,queue,lcore)[,(port,queue,lcore] > --single-sa SAIDX > -f CONFIG_FILE_PATH > @@ -135,6 +135,10 @@ Where: > > * ``-u PORTMASK``: hexadecimal bitmask of unprotected ports > > +* ``-j FRAMESIZE``: *optional*. Enables jumbo frames with the maximum size > + specified as FRAMESIZE. If an invalid value is provided as FRAMESIZE > + then the default value 9000 is used. > + > * ``--config (port,queue,lcore)[,(port,queue,lcore)]``: determines which queues > from which ports are mapped to which cores. > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c > index d451b3d..a6cb342 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -161,6 +161,7 @@ static int32_t numa_on = 1; /**< NUMA is enabled by default. */ > static uint32_t nb_lcores; > static uint32_t single_sa; > static uint32_t single_sa_idx; > +static uint32_t frame_size; > > struct lcore_rx_queue { > uint16_t port_id; > @@ -204,11 +205,9 @@ static struct rte_eth_conf port_conf = { > .mq_mode = ETH_MQ_RX_RSS, > .max_rx_pkt_len = ETHER_MAX_LEN, > .split_hdr_size = 0, > - .header_split = 0, /**< Header Split disabled */ > - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ > - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ > - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ > - .hw_strip_crc = 1, /**< CRC stripped by hardware */ > + .offloads = DEV_RX_OFFLOAD_CHECKSUM | > + DEV_RX_OFFLOAD_CRC_STRIP, > + .ignore_offload_bitfield = 1, > }, IMO change the port_conf struct should be a different patch. Thanks! > .rx_adv_conf = { > .rss_conf = { > @@ -845,6 +844,7 @@ print_usage(const char *prgname) > " -p PORTMASK: hexadecimal bitmask of ports to configure\n" > " -P : enable promiscuous mode\n" > " -u PORTMASK: hexadecimal bitmask of unprotected ports\n" > + " -j FRAMESIZE: jumbo frame maximum size\n" > " --"OPTION_CONFIG": (port,queue,lcore): " > "rx queues configuration\n" > " --single-sa SAIDX: use single SA index for outbound, " > @@ -983,7 +983,7 @@ parse_args(int32_t argc, char **argv) > > argvopt = argv; > > - while ((opt = getopt_long(argc, argvopt, "p:Pu:f:", > + while ((opt = getopt_long(argc, argvopt, "p:Pu:f:j:", > lgopts, &option_index)) != EOF) { > > switch (opt) { > @@ -1022,6 +1022,19 @@ parse_args(int32_t argc, char **argv) > } > f_present = 1; > break; > + case 'j': > + { > + int32_t size = parse_decimal(optarg); > + if (size <= 1518) { > + printf("Invalid jumbo frame size\n" > + "Using default value 9000\n"); > + frame_size = 9000; > + } else { > + frame_size = size; > + } > + } > + printf("Enabled jumbo frames size %u\n", frame_size); > + break; > case 0: > if (parse_args_long_options(lgopts, option_index)) { > print_usage(prgname); > @@ -1359,6 +1372,11 @@ port_init(uint16_t portid) > printf("Creating queues: nb_rx_queue=%d nb_tx_queue=%u...\n", > nb_rx_queue, nb_tx_queue); > > + if (frame_size) { > + port_conf.rxmode.max_rx_pkt_len = frame_size; > + port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; > + } > + > ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue, > &port_conf); > if (ret < 0) > @@ -1423,11 +1441,14 @@ static void > pool_init(struct socket_ctx *ctx, int32_t socket_id, uint32_t nb_mbuf) > { > char s[64]; > + uint32_t buff_size = frame_size ? (frame_size + RTE_PKTMBUF_HEADROOM) : > + RTE_MBUF_DEFAULT_BUF_SIZE; > + > > snprintf(s, sizeof(s), "mbuf_pool_%d", socket_id); > ctx->mbuf_pool = rte_pktmbuf_pool_create(s, nb_mbuf, > MEMPOOL_CACHE_SIZE, ipsec_metadata_size(), > - RTE_MBUF_DEFAULT_BUF_SIZE, > + buff_size, > socket_id); > if (ctx->mbuf_pool == NULL) > rte_exit(EXIT_FAILURE, "Cannot init mbuf pool on socket %d\n",