From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id AB9DC1B233 for ; Fri, 6 Oct 2017 14:32:51 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id m72so7362637wmc.1 for ; Fri, 06 Oct 2017 05:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=T3PUUtnGSNeuwqyhpr9tJnAzsDPCvAoQgE2jYBTE17M=; b=aYZhdekR5/aIjcatJU7E6kMNX80mXKv6DJsfqPF0d00khccMqoR6tiSqXCVyqQZZao U4tAuw6VIsapRWMqNXEOR8IYq/kkXtEliEIAsdDvPD93AH6hpTazc5abGcHjg3DCItR0 L+sMXdqmOYkhDeV6KmqPEIXvAldvfo/1ixCnmVz2PNuTWeCK5YF7t08xpbuSbgdAJtZx n/NE4/ximh0CxEPMG1+CYf3DKZFxn8wlUccyg1/sFShdWRnlMLmdFudChuu3qL9ETrbU 86Usfm49SbRaeFc23qSuhWCWii3W97pK1P6p8wteeFeEXZB2pDy1aEmlS1KoXPGhKFtf K8og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=T3PUUtnGSNeuwqyhpr9tJnAzsDPCvAoQgE2jYBTE17M=; b=V2me8pr1ecjItBviFRV0mepN4pgrxUEpFZSCspOQ8hclcQZGlPaP+kC5u9MtbSyVKY UmApm2iFIS4dRqSzq3eL7HVrgMSA4V63q5lQZX6u9xaYqjjH//vIW/s9IpgIRodiRfk4 MLMiyRfB4PjTEZ2y8QL2mbIFGISTDYRchPSaqQOu6rtE+hhTdkY5yxrQ1Ltjrc3YDGq1 UTqsUdL8fVT9xNpUEOmF3e2EZeflaj9K7ya3V2VmQBmMDRSkQZeKaeZ1qPJMpW7euEsh DLzSXWv6AW+m0E9u26cG2EvKE4fptJ4yMJw2pThMEGaE7YyrwgR+O0/w6FoOwrLFQY2y PSVA== X-Gm-Message-State: AMCzsaXr+kU9768VSeOUvA8uQ5kiFVY/WJxOcl/F117mpFG9du2zPkKj gtxmXzmocSZR+7wn6jrmkzqLgLY/ X-Google-Smtp-Source: AOwi7QCOx/AJdTeAC0YuNtOnQDDHZkITphm+h3bOQDa8WUaIH2HD2kj8TvloaY5FBMfRMhY5XlXzFQ== X-Received: by 10.80.186.110 with SMTP id 43mr3003293eds.18.1507293171107; Fri, 06 Oct 2017 05:32:51 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id f20sm1073152edm.46.2017.10.06.05.32.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 05:32:50 -0700 (PDT) Date: Fri, 6 Oct 2017 14:32:33 +0200 From: Adrien Mazarguil To: Ferruh Yigit , Zhiyong Yang Cc: dev@dpdk.org Message-ID: <20171006123233.GC3871@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [dpdk-dev] [PATCH] ethdev: fix port ID type in flow API 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: Fri, 06 Oct 2017 12:32:51 -0000 As for the testpmd flow command which uses uint16_t since the beginning by chance, switch to portid_t for consistency. Fixes: 14ab03825b1d ("ethdev: increase port id range") Cc: Zhiyong Yang Signed-off-by: Adrien Mazarguil --- app/test-pmd/cmdline_flow.c | 6 +++--- lib/librte_ether/rte_flow.c | 12 ++++++------ lib/librte_ether/rte_flow.h | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 26c3e4f..b5d394d 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -230,7 +230,7 @@ struct context { int args_num; /**< Number of entries in args[]. */ uint32_t eol:1; /**< EOL has been detected. */ uint32_t last:1; /**< No more arguments. */ - uint16_t port; /**< Current port ID (for completions). */ + portid_t port; /**< Current port ID (for completions). */ uint32_t objdata; /**< Object-specific data. */ void *object; /**< Address of current object for relative offsets. */ void *objmask; /**< Object a full mask must be written to. */ @@ -350,7 +350,7 @@ struct token { /** Parser output buffer layout expected by cmd_flow_parsed(). */ struct buffer { enum index command; /**< Flow command. */ - uint16_t port; /**< Affected port ID. */ + portid_t port; /**< Affected port ID. */ union { struct { struct rte_flow_attr attr; @@ -2618,7 +2618,7 @@ comp_rule_id(struct context *ctx, const struct token *token, (void)token; if (port_id_is_invalid(ctx->port, DISABLED_WARN) || - ctx->port == (uint16_t)RTE_PORT_ALL) + ctx->port == (portid_t)RTE_PORT_ALL) return -1; port = &ports[ctx->port]; for (pf = port->flow_list; pf != NULL; pf = pf->next) { diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index 95d9ee0..e276fb2 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -132,7 +132,7 @@ rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) /* Check whether a flow rule can be created on a given port. */ int -rte_flow_validate(uint8_t port_id, +rte_flow_validate(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], @@ -152,7 +152,7 @@ rte_flow_validate(uint8_t port_id, /* Create a flow rule on a given port. */ struct rte_flow * -rte_flow_create(uint8_t port_id, +rte_flow_create(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], @@ -172,7 +172,7 @@ rte_flow_create(uint8_t port_id, /* Destroy a flow rule on a given port. */ int -rte_flow_destroy(uint8_t port_id, +rte_flow_destroy(uint16_t port_id, struct rte_flow *flow, struct rte_flow_error *error) { @@ -190,7 +190,7 @@ rte_flow_destroy(uint8_t port_id, /* Destroy all flow rules associated with a port. */ int -rte_flow_flush(uint8_t port_id, +rte_flow_flush(uint16_t port_id, struct rte_flow_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -207,7 +207,7 @@ rte_flow_flush(uint8_t port_id, /* Query an existing flow rule. */ int -rte_flow_query(uint8_t port_id, +rte_flow_query(uint16_t port_id, struct rte_flow *flow, enum rte_flow_action_type action, void *data, @@ -227,7 +227,7 @@ rte_flow_query(uint8_t port_id, /* Restrict ingress traffic to the defined flow rules. */ int -rte_flow_isolate(uint8_t port_id, +rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error) { diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index b1a1b97..d37b0ad 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -1168,7 +1168,7 @@ struct rte_flow_error { * state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()). */ int -rte_flow_validate(uint8_t port_id, +rte_flow_validate(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], @@ -1195,7 +1195,7 @@ rte_flow_validate(uint8_t port_id, * rte_flow_validate(). */ struct rte_flow * -rte_flow_create(uint8_t port_id, +rte_flow_create(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], @@ -1222,7 +1222,7 @@ rte_flow_create(uint8_t port_id, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -rte_flow_destroy(uint8_t port_id, +rte_flow_destroy(uint16_t port_id, struct rte_flow *flow, struct rte_flow_error *error); @@ -1243,7 +1243,7 @@ rte_flow_destroy(uint8_t port_id, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -rte_flow_flush(uint8_t port_id, +rte_flow_flush(uint16_t port_id, struct rte_flow_error *error); /** @@ -1271,7 +1271,7 @@ rte_flow_flush(uint8_t port_id, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -rte_flow_query(uint8_t port_id, +rte_flow_query(uint16_t port_id, struct rte_flow *flow, enum rte_flow_action_type action, void *data, @@ -1319,7 +1319,7 @@ rte_flow_query(uint8_t port_id, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -rte_flow_isolate(uint8_t port_id, int set, struct rte_flow_error *error); +rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error); /** * Generic flow representation. -- 2.1.4