From patchwork Thu Dec 18 14:21:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42454 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5BAC526C6B for ; Thu, 18 Dec 2014 14:22:14 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf829062lam.6 for ; Thu, 18 Dec 2014 06:22:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=NH93bXgpBLDHNsWnFwnX6FGep9/sdz9fEjZaAzG7BpI=; b=PX+BqfuZlIENc1OMDuRmcphNKP1JQUiJAjwpX9DypgyqkitTnxoGkw5tZOa8eoWCxd RUb0HDPcqY+BhL6hWCfa8owkTyrXWCPcLvrFTGw14EAs2z+H6a3viACT81J6OolhESfi gK4mbZVCKciW+WBzIHLhz6Y1aC/4dlAWVPlwLmFBGZbZICOcgdV7AqAhhm6tq4ZP+KIU vjQfGH1Mw/uzeMzWoUpF1Rlp1AS0onQK3bDoFqytQ8Y02kMVWUqaOCz5TDzREizISIE+ hNvNgygkc70l6CEQaUh4WApGM4KAm31Yzb8d3UZZUuIFYDBNSDY7uIWsGS8yhEbVdoTR bsAA== X-Gm-Message-State: ALoCoQl5d46diQiEBhJU7cweQGVk8XOYzxayOlP9sC1qtqlaTlR8mHqrCP49SQMdJO9C8YZc1r6V X-Received: by 10.152.6.202 with SMTP id d10mr13295laa.10.1418912533262; Thu, 18 Dec 2014 06:22:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.10 with SMTP id lc10ls1228663lac.22.gmail; Thu, 18 Dec 2014 06:22:13 -0800 (PST) X-Received: by 10.152.170.194 with SMTP id ao2mr2636349lac.12.1418912532918; Thu, 18 Dec 2014 06:22:12 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id am7si6994688lac.98.2014.12.18.06.22.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:22:12 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gm9so1063608lab.26 for ; Thu, 18 Dec 2014 06:22:12 -0800 (PST) X-Received: by 10.152.197.5 with SMTP id iq5mr2587999lac.6.1418912532795; Thu, 18 Dec 2014 06:22:12 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1722022lbb; Thu, 18 Dec 2014 06:22:11 -0800 (PST) X-Received: by 10.140.40.51 with SMTP id w48mr3862645qgw.34.1418912530775; Thu, 18 Dec 2014 06:22:10 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 15si8278026qgt.127.2014.12.18.06.22.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:22:10 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1bxv-0001uP-LG; Thu, 18 Dec 2014 14:22:07 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1bxp-0001uK-8e for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 14:22:01 +0000 Received: by mail-la0-f50.google.com with SMTP id pn19so1062535lab.23 for ; Thu, 18 Dec 2014 06:21:55 -0800 (PST) X-Received: by 10.152.6.41 with SMTP id x9mr2515727lax.86.1418912515028; Thu, 18 Dec 2014 06:21:55 -0800 (PST) Received: from localhost.localdomain (ppp91-76-163-205.pppoe.mtu-net.ru. [91.76.163.205]) by mx.google.com with ESMTPSA id d1sm303748laf.47.2014.12.18.06.21.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:21:54 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 18 Dec 2014 17:21:45 +0300 Message-Id: <1418912505-32072-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH] api: pktio: remove api for changing MTU size X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Not all hardware can change MTU size from ODP application. Remove this API 1.0 release. Signed-off-by: Maxim Uvarov --- example/packet/odp_pktio.c | 27 -------------- platform/linux-generic/include/api/odp_packet_io.h | 13 ------- platform/linux-generic/odp_packet_io.c | 42 ---------------------- 3 files changed, 82 deletions(-) diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index a323ec2..0a38ec2 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -70,7 +70,6 @@ typedef struct { char **if_names; /**< Array of pointers to interface names */ int mode; /**< Packet IO mode */ odp_buffer_pool_t pool; /**< Buffer pool for packet IO */ - int mtu; /**< Pktio dev MTU */ } appl_args_t; /** @@ -80,7 +79,6 @@ typedef struct { char *pktio_dev; /**< Interface name to use */ odp_buffer_pool_t pool; /**< Buffer pool for packet IO */ int mode; /**< Thread mode */ - int mtu; /**< Pktio dev MTU */ } thread_args_t; /** @@ -145,14 +143,6 @@ static void *pktio_queue_thread(void *arg) return NULL; } - /* Change mtu if requested */ - if (thr_args->mtu) { - ret = odp_pktio_set_mtu(pktio, thr_args->mtu); - if (ret != 0) - EXAMPLE_ERR("setting MTU to %d failed\n", - thr_args->mtu); - } - mtu = odp_pktio_mtu(pktio); if (mtu > 0) printf("PKTIO: %d, dev %s, MTU: %d\n", @@ -251,7 +241,6 @@ static void *pktio_ifburst_thread(void *arg) unsigned long err_cnt = 0; unsigned long tmp = 0; int mtu; - int ret; thr = odp_thread_id(); thr_args = arg; @@ -273,14 +262,6 @@ static void *pktio_ifburst_thread(void *arg) return NULL; } - /* Change mtu if requested */ - if (thr_args->mtu) { - ret = odp_pktio_set_mtu(pktio, thr_args->mtu); - if (ret != 0) - EXAMPLE_ERR("setting MTU to %d failed\n", - thr_args->mtu); - } - mtu = odp_pktio_mtu(pktio); if (mtu > 0) printf("PKTIO: %d, dev %s, MTU: %d\n", @@ -409,7 +390,6 @@ int main(int argc, char *argv[]) args->thread[i].pktio_dev = args->appl.if_names[if_idx]; args->thread[i].pool = pool; args->thread[i].mode = args->appl.mode; - args->thread[i].mtu = args->appl.mtu; if (args->appl.mode == APPL_MODE_PKT_BURST) thr_run_func = pktio_ifburst_thread; @@ -520,13 +500,11 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"count", required_argument, NULL, 'c'}, {"interface", required_argument, NULL, 'i'}, /* return 'i' */ {"mode", required_argument, NULL, 'm'}, /* return 'm' */ - {"mtu", required_argument, NULL, 't'}, /* return 't' */ {"help", no_argument, NULL, 'h'}, /* return 'h' */ {NULL, 0, NULL, 0} }; appl_args->mode = -1; /* Invalid, must be changed by parsing */ - appl_args->mtu = 0; while (1) { opt = getopt_long(argc, argv, "+c:i:m:t:h", @@ -589,10 +567,6 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) else appl_args->mode = APPL_MODE_PKT_QUEUE; break; - case 't': - appl_args->mtu = atoi(optarg); - break; - case 'h': usage(argv[0]); exit(EXIT_SUCCESS); @@ -666,7 +640,6 @@ static void usage(char *progname) "Optional OPTIONS\n" " -c, --count Core count.\n" " -h, --help Display help and exit.\n" - " -t, --mtu MTU\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" " ODP_PKTIO_DISABLE_SOCKET_BASIC\n" diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h index a1ad754..e4577c3 100644 --- a/platform/linux-generic/include/api/odp_packet_io.h +++ b/platform/linux-generic/include/api/odp_packet_io.h @@ -111,19 +111,6 @@ int odp_pktio_inq_remdef(odp_pktio_t id); odp_queue_t odp_pktio_outq_getdef(odp_pktio_t id); /** - * Configure the MTU for a packet IO interface. - * - * @param[in] id ODP packet IO handle. - * @param[in] mtu The value of MTU that the interface will be configured to - * use. - * - * @retval 0 on success. - * @retval -1 if specified mtu can not be handled. - * @retval -1 on any other error or illegal input parameters. - */ -int odp_pktio_set_mtu(odp_pktio_t id, int mtu); - -/** * Return the currently configured MTU value of a packet IO interface. * * @param[in] id ODP packet IO handle. diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a016b6f..9376b6f 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -538,48 +538,6 @@ static int sockfd_from_pktio_entry(pktio_entry_t *entry) } } -int odp_pktio_set_mtu(odp_pktio_t id, int mtu) -{ - pktio_entry_t *entry; - int sockfd; - struct ifreq ifr; - int ret; - - if (mtu <= 0) { - ODP_DBG("illegal MTU value %d\n", mtu); - return -1; - } - - entry = get_pktio_entry(id); - if (entry == NULL) { - ODP_DBG("pktio entry %d does not exist\n", id); - return -1; - } - - lock_entry(entry); - - if (odp_unlikely(is_free(entry))) { - unlock_entry(entry); - ODP_DBG("already freed pktio\n"); - return -1; - } - - sockfd = sockfd_from_pktio_entry(entry); - strncpy(ifr.ifr_name, entry->s.name, IFNAMSIZ - 1); - ifr.ifr_name[IFNAMSIZ - 1] = 0; - ifr.ifr_mtu = mtu; - - ret = ioctl(sockfd, SIOCSIFMTU, &ifr); - if (ret < 0) { - ODP_DBG("ioctl SIOCSIFMTU error\n"); - unlock_entry(entry); - return -1; - } - - unlock_entry(entry); - return 0; -} - int odp_pktio_mtu(odp_pktio_t id) { pktio_entry_t *entry;