Commit 66cf4710 authored by Thomas Falcon's avatar Thomas Falcon Committed by Jakub Kicinski

ibmveth: Convert multicast list size for little-endian system

The ibm,mac-address-filters property defines the maximum number of
addresses the hypervisor's multicast filter list can support. It is
encoded as a big-endian integer in the OF device tree, but the virtual
ethernet driver does not convert it for use by little-endian systems.
As a result, the driver is not behaving as it should on affected systems
when a large number of multicast addresses are assigned to the device.
Reported-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent 072f7940
...@@ -1605,7 +1605,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -1605,7 +1605,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
struct net_device *netdev; struct net_device *netdev;
struct ibmveth_adapter *adapter; struct ibmveth_adapter *adapter;
unsigned char *mac_addr_p; unsigned char *mac_addr_p;
unsigned int *mcastFilterSize_p; __be32 *mcastFilterSize_p;
long ret; long ret;
unsigned long ret_attr; unsigned long ret_attr;
...@@ -1627,8 +1627,9 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -1627,8 +1627,9 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
return -EINVAL; return -EINVAL;
} }
mcastFilterSize_p = (unsigned int *)vio_get_attribute(dev, mcastFilterSize_p = (__be32 *)vio_get_attribute(dev,
VETH_MCAST_FILTER_SIZE, NULL); VETH_MCAST_FILTER_SIZE,
NULL);
if (!mcastFilterSize_p) { if (!mcastFilterSize_p) {
dev_err(&dev->dev, "Can't find VETH_MCAST_FILTER_SIZE " dev_err(&dev->dev, "Can't find VETH_MCAST_FILTER_SIZE "
"attribute\n"); "attribute\n");
...@@ -1645,7 +1646,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -1645,7 +1646,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
adapter->vdev = dev; adapter->vdev = dev;
adapter->netdev = netdev; adapter->netdev = netdev;
adapter->mcastFilterSize = *mcastFilterSize_p; adapter->mcastFilterSize = be32_to_cpu(*mcastFilterSize_p);
adapter->pool_config = 0; adapter->pool_config = 0;
netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16); netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment