]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
IB/{hfi1, ipoib, rdma}: Broadcast ping sent packets which exceeded mtu size
authorGary Leshner <Gary.S.Leshner@intel.com>
Mon, 11 May 2020 16:06:55 +0000 (12:06 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 21 May 2020 14:23:57 +0000 (11:23 -0300)
When in connected mode ipoib sent broadcast pings which exceeded the mtu
size for broadcast addresses.

Add an mtu attribute to the rdma_netdev structure which ipoib sets to its
mcast mtu size.

The RDMA netdev uses this value to determine if the skb length is too long
for the mtu specified and if it is, drops the packet and logs an error
about the errant packet.

Link: https://lore.kernel.org/r/20200511160655.173205.14546.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Gary Leshner <Gary.S.Leshner@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/infiniband/ulp/ipoib/ipoib_vlan.c

index 22216f181b24b1b18d0778ff4fc6384d8dd0ea38..a6c4322b409b104267251ba5dbe06472dd687908 100644 (file)
@@ -1896,6 +1896,7 @@ static int ipoib_ndo_init(struct net_device *ndev)
 {
        struct ipoib_dev_priv *priv = ipoib_priv(ndev);
        int rc;
+       struct rdma_netdev *rn = netdev_priv(ndev);
 
        if (priv->parent) {
                ipoib_child_init(ndev);
@@ -1908,6 +1909,7 @@ static int ipoib_ndo_init(struct net_device *ndev)
        /* MTU will be reset when mcast join happens */
        ndev->mtu = IPOIB_UD_MTU(priv->max_ib_mtu);
        priv->mcast_mtu = priv->admin_mtu = ndev->mtu;
+       rn->mtu = priv->mcast_mtu;
        ndev->max_mtu = IPOIB_CM_MTU;
 
        ndev->neigh_priv_len = sizeof(struct ipoib_neigh);
index 7166ee9b7a257344b9c133ea20c6412dd3d0909f..3d5f6b848c9e8a1e11afed89fdd8813f06eca5f1 100644 (file)
@@ -246,6 +246,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
                if (priv->mcast_mtu == priv->admin_mtu)
                        priv->admin_mtu = IPOIB_UD_MTU(mtu);
                priv->mcast_mtu = IPOIB_UD_MTU(mtu);
+               rn->mtu = priv->mcast_mtu;
 
                priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);
                spin_unlock_irq(&priv->lock);
index 8ac8e18fbe0c3779bf4c4b384dfae1578df3f048..30865605e0980f5dd4b77958ac93da8a76c36119 100644 (file)
@@ -97,6 +97,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv,
 {
        struct net_device *ndev = priv->dev;
        int result;
+       struct rdma_netdev *rn = netdev_priv(ndev);
 
        ASSERT_RTNL();
 
@@ -117,6 +118,8 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv,
                goto out_early;
        }
 
+       rn->mtu = priv->mcast_mtu;
+
        priv->parent = ppriv->dev;
        priv->pkey = pkey;
        priv->child_type = type;