From: Mark Kavanagh <mark.b.kavanagh@intel.com>
To: dev@dpdk.org, diproiettod@vmware.com
Cc: i.maximets@samsung.com
Subject: [dpdk-dev] [PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const.
Date: Fri, 5 Aug 2016 15:30:12 +0100 [thread overview]
Message-ID: <1470407413-157932-6-git-send-email-mark.b.kavanagh@intel.com> (raw)
In-Reply-To: <1470407413-157932-1-git-send-email-mark.b.kavanagh@intel.com>
From: Daniele Di Proietto <diproiettod@vmware.com>
Every provider silently drops the const attribute when converting the
parameter to the appropriate subclass. Might as well drop the const
attribute from the parameter, since this is a "set" function.
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
---
v2->v1: add missing 'Signed-off-by' field in commit message.
lib/netdev-dummy.c | 2 +-
lib/netdev-linux.c | 2 +-
lib/netdev-provider.h | 2 +-
lib/netdev.c | 2 +-
lib/netdev.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index c8f82b7..dec1a8e 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1150,7 +1150,7 @@ netdev_dummy_get_mtu(const struct netdev *netdev, int *mtup)
}
static int
-netdev_dummy_set_mtu(const struct netdev *netdev, int mtu)
+netdev_dummy_set_mtu(struct netdev *netdev, int mtu)
{
struct netdev_dummy *dev = netdev_dummy_cast(netdev);
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 1b5f7c1..20b5cc7 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1382,7 +1382,7 @@ netdev_linux_get_mtu(const struct netdev *netdev_, int *mtup)
* networking ioctl interface.
*/
static int
-netdev_linux_set_mtu(const struct netdev *netdev_, int mtu)
+netdev_linux_set_mtu(struct netdev *netdev_, int mtu)
{
struct netdev_linux *netdev = netdev_linux_cast(netdev_);
struct ifreq ifr;
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 5bcfeba..cd04ae9 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -389,7 +389,7 @@ struct netdev_class {
* If 'netdev' does not have an MTU (e.g. as some tunnels do not), then
* this function should return EOPNOTSUPP. This function may be set to
* null if it would always return EOPNOTSUPP. */
- int (*set_mtu)(const struct netdev *netdev, int mtu);
+ int (*set_mtu)(struct netdev *netdev, int mtu);
/* Returns the ifindex of 'netdev', if successful, as a positive number.
* On failure, returns a negative errno value.
diff --git a/lib/netdev.c b/lib/netdev.c
index 589d37c..5cf8bbb 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -869,7 +869,7 @@ netdev_get_mtu(const struct netdev *netdev, int *mtup)
* MTU (as e.g. some tunnels do not). On other failure, returns a positive
* errno value. */
int
-netdev_set_mtu(const struct netdev *netdev, int mtu)
+netdev_set_mtu(struct netdev *netdev, int mtu)
{
const struct netdev_class *class = netdev->netdev_class;
int error;
diff --git a/lib/netdev.h b/lib/netdev.h
index dc7ede8..d8ec627 100644
--- a/lib/netdev.h
+++ b/lib/netdev.h
@@ -132,7 +132,7 @@ const char *netdev_get_name(const struct netdev *);
const char *netdev_get_type(const struct netdev *);
const char *netdev_get_type_from_name(const char *);
int netdev_get_mtu(const struct netdev *, int *mtup);
-int netdev_set_mtu(const struct netdev *, int mtu);
+int netdev_set_mtu(struct netdev *, int mtu);
int netdev_get_ifindex(const struct netdev *);
int netdev_set_tx_multiq(struct netdev *, unsigned int n_txq);
--
1.9.3
next prev parent reply other threads:[~2016-08-05 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 14:30 [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 2/7] vswitchd: Introduce 'mtu_request' column in Interface Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 3/7] netdev: Pass 'netdev_class' to ->run() and ->wait() Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 4/7] netdev-dummy: Add dummy-internal class Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 5/7] tests: Add a new MTU test Mark Kavanagh
2016-08-05 14:30 ` Mark Kavanagh [this message]
2016-08-05 14:30 ` [dpdk-dev] [PATCH 7/7] netdev-dpdk: add support for Jumbo Frames Mark Kavanagh
2016-08-05 14:41 ` [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports Kavanagh, Mark B
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470407413-157932-6-git-send-email-mark.b.kavanagh@intel.com \
--to=mark.b.kavanagh@intel.com \
--cc=dev@dpdk.org \
--cc=diproiettod@vmware.com \
--cc=i.maximets@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).