All of lore.kernel.org
 help / color / mirror / Atom feed
From: sfeldma@gmail.com
To: netdev@vger.kernel.org
Cc: jiri@resnulli.us, ronen.arad@intel.com
Subject: [PATCH net-next 2/4] switchdev: sparse warning: pass ipv4 fib dst as network-byte order
Date: Tue, 12 May 2015 23:03:52 -0700	[thread overview]
Message-ID: <1431497034-22153-3-git-send-email-sfeldma@gmail.com> (raw)
In-Reply-To: <1431497034-22153-1-git-send-email-sfeldma@gmail.com>

From: Scott Feldman <sfeldma@gmail.com>

And let driver convert it to host-byte order as needed.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
 drivers/net/ethernet/rocker/rocker.c |    7 ++++---
 net/switchdev/switchdev.c            |    4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 1fc006b..ca53393 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4471,7 +4471,7 @@ static int rocker_port_obj_add(struct net_device *dev,
 	case SWITCHDEV_OBJ_IPV4_FIB:
 		fib4 = &obj->ipv4_fib;
 		err = rocker_port_fib_ipv4(rocker_port, obj->trans,
-					   fib4->dst, fib4->dst_len,
+					   htonl(fib4->dst), fib4->dst_len,
 					   fib4->fi, fib4->tb_id, 0);
 		break;
 	default:
@@ -4525,8 +4525,9 @@ static int rocker_port_obj_del(struct net_device *dev,
 	case SWITCHDEV_OBJ_IPV4_FIB:
 		fib4 = &obj->ipv4_fib;
 		err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE,
-					   fib4->dst, fib4->dst_len, fib4->fi,
-					   fib4->tb_id, ROCKER_OP_FLAG_REMOVE);
+					   htonl(fib4->dst), fib4->dst_len,
+					   fib4->fi, fib4->tb_id,
+					   ROCKER_OP_FLAG_REMOVE);
 		break;
 	default:
 		err = -EOPNOTSUPP;
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index a267f77..77f1b6e 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -645,7 +645,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
 	struct switchdev_obj fib_obj = {
 		.id = SWITCHDEV_OBJ_IPV4_FIB,
 		.ipv4_fib = {
-			.dst = htonl(dst),
+			.dst = dst,
 			.dst_len = dst_len,
 			.fi = fi,
 			.tos = tos,
@@ -699,7 +699,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
 	struct switchdev_obj fib_obj = {
 		.id = SWITCHDEV_OBJ_IPV4_FIB,
 		.ipv4_fib = {
-			.dst = htonl(dst),
+			.dst = dst,
 			.dst_len = dst_len,
 			.fi = fi,
 			.tos = tos,
-- 
1.7.10.4

  parent reply	other threads:[~2015-05-13  6:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  6:03 [PATCH net-next 0/4] switchdev: more (minor) cleanups sfeldma
2015-05-13  6:03 ` [PATCH net-next 1/4] switchdev: sparse warning: make __switchdev_port_obj_add static sfeldma
2015-05-13  6:03 ` sfeldma [this message]
2015-05-13  6:03 ` [PATCH net-next 3/4] switchdev: align comment with other comments in block sfeldma
2015-05-13  6:03 ` [PATCH net-next 4/4] switchdev: apply review comments on documentation sfeldma
2015-05-13 16:26 ` [PATCH net-next 0/4] switchdev: more (minor) cleanups David Miller

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=1431497034-22153-3-git-send-email-sfeldma@gmail.com \
    --to=sfeldma@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=ronen.arad@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.