Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2573beec authored by David S. Miller's avatar David S. Miller
Browse files
parents fd3137cd 531c94a9
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -78,6 +78,9 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i


	priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
	priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
			    GFP_KERNEL);
			    GFP_KERNEL);
	if (!priv)
		return -ENOMEM;

	ci = (struct com20020_pci_card_info *)id->driver_data;
	ci = (struct com20020_pci_card_info *)id->driver_data;
	priv->ci = ci;
	priv->ci = ci;


+2 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,8 @@ static int mv88e6131_setup_global(struct dsa_switch *ds)
		int nexthop;
		int nexthop;


		nexthop = 0x1f;
		nexthop = 0x1f;
		if (i != ds->index && i < ds->dst->pd->nr_chips)
		if (ds->pd->rtable &&
		    i != ds->index && i < ds->dst->pd->nr_chips)
			nexthop = ds->pd->rtable[i] & 0x1f;
			nexthop = ds->pd->rtable[i] & 0x1f;


		REG_WRITE(REG_GLOBAL2, 0x06, 0x8000 | (i << 8) | nexthop);
		REG_WRITE(REG_GLOBAL2, 0x06, 0x8000 | (i << 8) | nexthop);
+6 −5
Original line number Original line Diff line number Diff line
@@ -342,12 +342,13 @@ static irqreturn_t xgbe_isr(int irq, void *data)
		dma_ch_isr = XGMAC_DMA_IOREAD(channel, DMA_CH_SR);
		dma_ch_isr = XGMAC_DMA_IOREAD(channel, DMA_CH_SR);
		DBGPR("  DMA_CH%u_ISR = %08x\n", i, dma_ch_isr);
		DBGPR("  DMA_CH%u_ISR = %08x\n", i, dma_ch_isr);


		/* If we get a TI or RI interrupt that means per channel DMA
		/* The TI or RI interrupt bits may still be set even if using
		 * interrupts are not enabled, so we use the private data napi
		 * per channel DMA interrupts. Check to be sure those are not
		 * structure, not the per channel napi structure
		 * enabled before using the private data napi structure.
		 */
		 */
		if (XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, TI) ||
		if (!pdata->per_channel_irq &&
		    XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, RI)) {
		    (XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, TI) ||
		     XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, RI))) {
			if (napi_schedule_prep(&pdata->napi)) {
			if (napi_schedule_prep(&pdata->napi)) {
				/* Disable Tx and Rx interrupts */
				/* Disable Tx and Rx interrupts */
				xgbe_disable_rx_tx_ints(pdata);
				xgbe_disable_rx_tx_ints(pdata);
+43 −14
Original line number Original line Diff line number Diff line
@@ -364,6 +364,26 @@ static int sxgbe_init_rx_buffers(struct net_device *dev,


	return 0;
	return 0;
}
}

/**
 * sxgbe_free_rx_buffers - free what sxgbe_init_rx_buffers() allocated
 * @dev: net device structure
 * @rx_ring: ring to be freed
 * @rx_rsize: ring size
 * Description:  this function initializes the DMA RX descriptor
 */
static void sxgbe_free_rx_buffers(struct net_device *dev,
				  struct sxgbe_rx_norm_desc *p, int i,
				  unsigned int dma_buf_sz,
				  struct sxgbe_rx_queue *rx_ring)
{
	struct sxgbe_priv_data *priv = netdev_priv(dev);

	kfree_skb(rx_ring->rx_skbuff[i]);
	dma_unmap_single(priv->device, rx_ring->rx_skbuff_dma[i],
			 dma_buf_sz, DMA_FROM_DEVICE);
}

/**
/**
 * init_tx_ring - init the TX descriptor ring
 * init_tx_ring - init the TX descriptor ring
 * @dev: net device structure
 * @dev: net device structure
@@ -456,7 +476,7 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no,
	/* RX ring is not allcoated */
	/* RX ring is not allcoated */
	if (rx_ring == NULL) {
	if (rx_ring == NULL) {
		netdev_err(dev, "No memory for RX queue\n");
		netdev_err(dev, "No memory for RX queue\n");
		goto error;
		return -ENOMEM;
	}
	}


	/* assign queue number */
	/* assign queue number */
@@ -468,23 +488,21 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no,
					      &rx_ring->dma_rx_phy, GFP_KERNEL);
					      &rx_ring->dma_rx_phy, GFP_KERNEL);


	if (rx_ring->dma_rx == NULL)
	if (rx_ring->dma_rx == NULL)
		goto error;
		return -ENOMEM;


	/* allocate memory for RX skbuff array */
	/* allocate memory for RX skbuff array */
	rx_ring->rx_skbuff_dma = kmalloc_array(rx_rsize,
	rx_ring->rx_skbuff_dma = kmalloc_array(rx_rsize,
					       sizeof(dma_addr_t), GFP_KERNEL);
					       sizeof(dma_addr_t), GFP_KERNEL);
	if (!rx_ring->rx_skbuff_dma) {
	if (!rx_ring->rx_skbuff_dma) {
		dma_free_coherent(priv->device,
		ret = -ENOMEM;
				  rx_rsize * sizeof(struct sxgbe_rx_norm_desc),
		goto err_free_dma_rx;
				  rx_ring->dma_rx, rx_ring->dma_rx_phy);
		goto error;
	}
	}


	rx_ring->rx_skbuff = kmalloc_array(rx_rsize,
	rx_ring->rx_skbuff = kmalloc_array(rx_rsize,
					   sizeof(struct sk_buff *), GFP_KERNEL);
					   sizeof(struct sk_buff *), GFP_KERNEL);
	if (!rx_ring->rx_skbuff) {
	if (!rx_ring->rx_skbuff) {
		kfree(rx_ring->rx_skbuff_dma);
		ret = -ENOMEM;
		goto error;
		goto err_free_skbuff_dma;
	}
	}


	/* initialise the buffers */
	/* initialise the buffers */
@@ -494,7 +512,7 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no,
		ret = sxgbe_init_rx_buffers(dev, p, desc_index,
		ret = sxgbe_init_rx_buffers(dev, p, desc_index,
					    bfsize, rx_ring);
					    bfsize, rx_ring);
		if (ret)
		if (ret)
			goto err_init_rx_buffers;
			goto err_free_rx_buffers;
	}
	}


	/* initalise counters */
	/* initalise counters */
@@ -504,11 +522,22 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no,


	return 0;
	return 0;


err_init_rx_buffers:
err_free_rx_buffers:
	while (--desc_index >= 0)
	while (--desc_index >= 0) {
		free_rx_ring(priv->device, rx_ring, desc_index);
		struct sxgbe_rx_norm_desc *p;
error:

	return -ENOMEM;
		p = rx_ring->dma_rx + desc_index;
		sxgbe_free_rx_buffers(dev, p, desc_index, bfsize, rx_ring);
	}
	kfree(rx_ring->rx_skbuff);
err_free_skbuff_dma:
	kfree(rx_ring->rx_skbuff_dma);
err_free_dma_rx:
	dma_free_coherent(priv->device,
			  rx_rsize * sizeof(struct sxgbe_rx_norm_desc),
			  rx_ring->dma_rx, rx_ring->dma_rx_phy);

	return ret;
}
}
/**
/**
 * free_tx_ring - free the TX descriptor ring
 * free_tx_ring - free the TX descriptor ring
+1 −1
Original line number Original line Diff line number Diff line
@@ -1009,7 +1009,7 @@ static bool vxlan_snoop(struct net_device *dev,
		if (net_ratelimit())
		if (net_ratelimit())
			netdev_info(dev,
			netdev_info(dev,
				    "%pM migrated from %pIS to %pIS\n",
				    "%pM migrated from %pIS to %pIS\n",
				    src_mac, &rdst->remote_ip, &src_ip);
				    src_mac, &rdst->remote_ip.sa, &src_ip->sa);


		rdst->remote_ip = *src_ip;
		rdst->remote_ip = *src_ip;
		f->updated = jiffies;
		f->updated = jiffies;
Loading