Netdev List
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@mellanox.co.il>
To: openib-general@openib.org, netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
	Dror Goldenberg <gdror@mellanox.co.il>
Subject: RFC: struct netdevice changes for IPoIB UC support
Date: Wed, 21 Sep 2005 11:02:30 +0300	[thread overview]
Message-ID: <20050921080230.GE18449@mellanox.co.il> (raw)

Hi!
I am working on IP over InfiniBand net device support.
Existing code in mainline kernel only supports UD (unreliable datagram)
mode of operation, with max MTU of 2Kbyte.
I'm looking into support for UC (unreliable connected) mode of operation,
which can support MTU with theorectical limit up to 2Gbyte.

As was discussed on the openib list, one of the difficulties with
IP over IB support for UC mode, is the fact that the same device
has to support sending both UC (max MTU 2Gbyte) and UD (max MTU 2Kbyte)
packets, depending on packet link address.

I propose the following simple patch to let the netdevice override
the path MTU per dst entry. The patch was tested by modifying
existing IPoIB code to use MTU of 1K for some addresses, and 2K for
others.

Please comment on this approach: does it make sense to you guys?
Please Cc me directly, I'm not on the list.

Thanks a bunch,
MST

---

Make it possible for a network device to support more than one MTU value at a
time (depending on packet link address, or other criteria).

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>

Index: linux-2.6.12.5/include/linux/netdevice.h
===================================================================
--- linux-2.6.12.5.orig/include/linux/netdevice.h
+++ linux-2.6.12.5/include/linux/netdevice.h
@@ -454,6 +454,10 @@ struct net_device
 #define HAVE_CHANGE_MTU
 	int			(*change_mtu)(struct net_device *dev, int new_mtu);
 
+#define HAVE_GET_MTU
+	u32			(*get_mtu)(struct net_device *dev,
+					   struct neighbour *neigh,
+					   int path_mtu);
 #define HAVE_TX_TIMEOUT
 	void			(*tx_timeout) (struct net_device *dev);
 
Index: linux-2.6.12.5/include/net/dst.h
===================================================================
--- linux-2.6.12.5.orig/include/net/dst.h
+++ linux-2.6.12.5/include/net/dst.h
@@ -111,7 +111,12 @@ dst_metric(const struct dst_entry *dst, 
 
 static inline u32 dst_mtu(const struct dst_entry *dst)
 {
-	u32 mtu = dst_metric(dst, RTAX_MTU);
+	u32 mtu;
+	if (dst->dev && dst->dev->get_mtu)
+		mtu = dst->dev->get_mtu(dst->dev, dst->neighbour,
+					dst_metric(dst, RTAX_MTU));
+	else
+		mtu = dst_metric(dst, RTAX_MTU);
 	/*
 	 * Alexey put it here, so ask him about it :)
 	 */

-- 
MST

             reply	other threads:[~2005-09-21  8:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21  8:02 Michael S. Tsirkin [this message]
2005-09-21  8:15 ` RFC: struct netdevice changes for IPoIB UC support Herbert Xu

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=20050921080230.GE18449@mellanox.co.il \
    --to=mst@mellanox.co.il \
    --cc=davem@davemloft.net \
    --cc=gdror@mellanox.co.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=openib-general@openib.org \
    /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