Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Conflicts:
	drivers/net/Makefile
	net/ipv6/sysctl_net_ipv6.c

Two ipv6_table_template[] additions overlap, so the index
of the ipv6_table[x] assignments needed to be adjusted.

In the drivers/net/Makefile case, we've gotten rid of the
garbage whereby we had to list every single USB networking
driver in the top-level Makefile, there is just one
"USB_NETWORKING" that guards everything.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 6, 2014
2 parents 30f0084 + 4d8fdc9 commit d247b6a
Show file tree
Hide file tree
Showing 27 changed files with 132 additions and 121 deletions.
4 changes: 2 additions & 2 deletions drivers/net/bonding/bond_sysfs_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int bond_sysfs_slave_add(struct slave *slave)
for (a = slave_attrs; *a; ++a) {
err = sysfs_create_file(&slave->kobj, &((*a)->attr));
if (err) {
kobject_del(&slave->kobj);
kobject_put(&slave->kobj);
return err;
}
}
Expand All @@ -140,5 +140,5 @@ void bond_sysfs_slave_del(struct slave *slave)
for (a = slave_attrs; *a; ++a)
sysfs_remove_file(&slave->kobj, &((*a)->attr));

kobject_del(&slave->kobj);
kobject_put(&slave->kobj);
}
6 changes: 4 additions & 2 deletions drivers/net/ethernet/allwinner/sun4i-emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,10 @@ static void emac_rx(struct net_device *dev)
}

/* Move data from EMAC */
skb = dev_alloc_skb(rxlen + 4);
if (good_packet && skb) {
if (good_packet) {
skb = netdev_alloc_skb(dev, rxlen + 4);
if (!skb)
continue;
skb_reserve(skb, 2);
rdptr = (u8 *) skb_put(skb, rxlen - 4);

Expand Down
22 changes: 12 additions & 10 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -7830,31 +7830,33 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,

static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);

/* Use GSO to workaround a rare TSO bug that may be triggered when the
* TSO header is greater than 80 bytes.
/* Use GSO to workaround all TSO packets that meet HW bug conditions
* indicated in tg3_tx_frag_set()
*/
static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb)
static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
struct netdev_queue *txq, struct sk_buff *skb)
{
struct sk_buff *segs, *nskb;
u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3;

/* Estimate the number of fragments in the worst case */
if (unlikely(tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)) {
netif_stop_queue(tp->dev);
if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {
netif_tx_stop_queue(txq);

/* netif_tx_stop_queue() must be done before checking
* checking tx index in tg3_tx_avail() below, because in
* tg3_tx(), we update tx index before checking for
* netif_tx_queue_stopped().
*/
smp_mb();
if (tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)
if (tg3_tx_avail(tnapi) <= frag_cnt_est)
return NETDEV_TX_BUSY;

netif_wake_queue(tp->dev);
netif_tx_wake_queue(txq);
}

segs = skb_gso_segment(skb, tp->dev->features & ~(NETIF_F_TSO | NETIF_F_TSO6));
segs = skb_gso_segment(skb, tp->dev->features &
~(NETIF_F_TSO | NETIF_F_TSO6));
if (IS_ERR(segs) || !segs)
goto tg3_tso_bug_end;

Expand Down Expand Up @@ -7930,7 +7932,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (!skb_is_gso_v6(skb)) {
if (unlikely((ETH_HLEN + hdr_len) > 80) &&
tg3_flag(tp, TSO_BUG))
return tg3_tso_bug(tp, skb);
return tg3_tso_bug(tp, tnapi, txq, skb);

ip_csum = iph->check;
ip_tot_len = iph->tot_len;
Expand Down Expand Up @@ -8061,7 +8063,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
iph->tot_len = ip_tot_len;
}
tcph->check = tcp_csum;
return tg3_tso_bug(tp, skb);
return tg3_tso_bug(tp, tnapi, txq, skb);
}

/* If the workaround fails due to memory/mapping
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/brocade/bna/bnad.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,9 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget)
prefetch(bnad->netdev);

cq = ccb->sw_q;
cmpl = &cq[ccb->producer_index];

while (packets < budget) {
cmpl = &cq[ccb->producer_index];
if (!cmpl->valid)
break;
/* The 'valid' field is set by the adapter, only after writing
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/ethernet/brocade/bna/bnad_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,8 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
unsigned long flags = 0;
int ret = 0;

/* Check if the flash read request is valid */
if (eeprom->magic != (bnad->pcidev->vendor |
(bnad->pcidev->device << 16)))
return -EFAULT;
/* Fill the magic value */
eeprom->magic = bnad->pcidev->vendor | (bnad->pcidev->device << 16);

/* Query the flash partition based on the offset */
flash_part = bnad_get_flash_partition_by_offset(bnad,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
rsp = qlcnic_poll_rsp(adapter);

if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) {
dev_err(&pdev->dev, "card response timeout.\n");
dev_err(&pdev->dev, "command timeout, response = 0x%x\n", rsp);
cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT;
} else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1), &err);
Expand Down
18 changes: 13 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,17 +1290,25 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)

void qlcnic_update_stats(struct qlcnic_adapter *adapter)
{
struct qlcnic_tx_queue_stats tx_stats;
struct qlcnic_host_tx_ring *tx_ring;
int ring;

memset(&tx_stats, 0, sizeof(tx_stats));
for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
tx_ring = &adapter->tx_ring[ring];
adapter->stats.xmit_on += tx_ring->tx_stats.xmit_on;
adapter->stats.xmit_off += tx_ring->tx_stats.xmit_off;
adapter->stats.xmitcalled += tx_ring->tx_stats.xmit_called;
adapter->stats.xmitfinished += tx_ring->tx_stats.xmit_finished;
adapter->stats.txbytes += tx_ring->tx_stats.tx_bytes;
tx_stats.xmit_on += tx_ring->tx_stats.xmit_on;
tx_stats.xmit_off += tx_ring->tx_stats.xmit_off;
tx_stats.xmit_called += tx_ring->tx_stats.xmit_called;
tx_stats.xmit_finished += tx_ring->tx_stats.xmit_finished;
tx_stats.tx_bytes += tx_ring->tx_stats.tx_bytes;
}

adapter->stats.xmit_on = tx_stats.xmit_on;
adapter->stats.xmit_off = tx_stats.xmit_off;
adapter->stats.xmitcalled = tx_stats.xmit_called;
adapter->stats.xmitfinished = tx_stats.xmit_finished;
adapter->stats.txbytes = tx_stats.tx_bytes;
}

static u64 *qlcnic_fill_tx_queue_stats(u64 *data, void *stats)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2324,14 +2324,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
if (err)
return err;

qlcnic_dcb_init_dcbnl_ops(adapter->dcb);

err = register_netdev(netdev);
if (err) {
dev_err(&pdev->dev, "failed to register net device\n");
return err;
}

qlcnic_dcb_init_dcbnl_ops(adapter->dcb);

return 0;
}

Expand Down Expand Up @@ -2624,13 +2624,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto err_out_disable_mbx_intr;

if (adapter->portnum == 0)
qlcnic_set_drv_version(adapter);

err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac);
if (err)
goto err_out_disable_mbx_intr;

if (adapter->portnum == 0)
qlcnic_set_drv_version(adapter);

pci_set_drvdata(pdev, adapter);

if (qlcnic_82xx_check(adapter))
Expand Down
1 change: 1 addition & 0 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ static int macvlan_init(struct net_device *dev)
(lowerdev->state & MACVLAN_STATE_MASK);
dev->features = lowerdev->features & MACVLAN_FEATURES;
dev->features |= ALWAYS_ON_FEATURES;
dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES;
dev->gso_max_size = lowerdev->gso_max_size;
dev->iflink = lowerdev->ifindex;
dev->hard_header_len = lowerdev->hard_header_len;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ int mdiobus_register(struct mii_bus *bus)

bus->dev.parent = bus->parent;
bus->dev.class = &mdio_bus_class;
bus->dev.driver = bus->parent->driver;
bus->dev.groups = NULL;
dev_set_name(&bus->dev, "%s", bus->id);

Expand Down
27 changes: 26 additions & 1 deletion drivers/net/usb/cdc_subset.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,28 @@ static int always_connected (struct usbnet *dev)
*
*-------------------------------------------------------------------------*/

static void m5632_recover(struct usbnet *dev)
{
struct usb_device *udev = dev->udev;
struct usb_interface *intf = dev->intf;
int r;

r = usb_lock_device_for_reset(udev, intf);
if (r < 0)
return;

usb_reset_device(udev);
usb_unlock_device(udev);
}

static const struct driver_info ali_m5632_info = {
.description = "ALi M5632",
.flags = FLAG_POINTTOPOINT,
.recover = m5632_recover,
};

#endif


#ifdef CONFIG_USB_AN2720
#define HAVE_HARDWARE

Expand Down Expand Up @@ -326,12 +340,23 @@ static const struct usb_device_id products [] = {
MODULE_DEVICE_TABLE(usb, products);

/*-------------------------------------------------------------------------*/
static int dummy_prereset(struct usb_interface *intf)
{
return 0;
}

static int dummy_postreset(struct usb_interface *intf)
{
return 0;
}

static struct usb_driver cdc_subset_driver = {
.name = "cdc_subset",
.probe = usbnet_probe,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.pre_reset = dummy_prereset,
.post_reset = dummy_postreset,
.disconnect = usbnet_disconnect,
.id_table = products,
.disable_hub_initiated_lpm = 1,
Expand Down
8 changes: 6 additions & 2 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,12 @@ void usbnet_tx_timeout (struct net_device *net)

unlink_urbs (dev, &dev->txq);
tasklet_schedule (&dev->bh);

// FIXME: device recovery -- reset?
/* this needs to be handled individually because the generic layer
* doesn't know what is sufficient and could not restore private
* information if a remedy of an unconditional reset were used.
*/
if (dev->driver_info->recover)
(dev->driver_info->recover)(dev);
}
EXPORT_SYMBOL_GPL(usbnet_tx_timeout);

Expand Down
74 changes: 10 additions & 64 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,22 +1196,6 @@ static void xennet_release_rx_bufs(struct netfront_queue *queue)
spin_unlock_bh(&queue->rx_lock);
}

static void xennet_uninit(struct net_device *dev)
{
struct netfront_info *np = netdev_priv(dev);
unsigned int num_queues = dev->real_num_tx_queues;
struct netfront_queue *queue;
unsigned int i;

for (i = 0; i < num_queues; ++i) {
queue = &np->queues[i];
xennet_release_tx_bufs(queue);
xennet_release_rx_bufs(queue);
gnttab_free_grant_references(queue->gref_tx_head);
gnttab_free_grant_references(queue->gref_rx_head);
}
}

static netdev_features_t xennet_fix_features(struct net_device *dev,
netdev_features_t features)
{
Expand Down Expand Up @@ -1313,7 +1297,6 @@ static void xennet_poll_controller(struct net_device *dev)

static const struct net_device_ops xennet_netdev_ops = {
.ndo_open = xennet_open,
.ndo_uninit = xennet_uninit,
.ndo_stop = xennet_close,
.ndo_start_xmit = xennet_start_xmit,
.ndo_change_mtu = xennet_change_mtu,
Expand Down Expand Up @@ -1455,6 +1438,11 @@ static void xennet_disconnect_backend(struct netfront_info *info)

napi_synchronize(&queue->napi);

xennet_release_tx_bufs(queue);
xennet_release_rx_bufs(queue);
gnttab_free_grant_references(queue->gref_tx_head);
gnttab_free_grant_references(queue->gref_rx_head);

/* End access and free the pages */
xennet_end_access(queue->tx_ring_ref, queue->tx.sring);
xennet_end_access(queue->rx_ring_ref, queue->rx.sring);
Expand Down Expand Up @@ -1827,8 +1815,8 @@ static int xennet_create_queues(struct netfront_info *info,

ret = xennet_init_queue(queue);
if (ret < 0) {
dev_warn(&info->netdev->dev, "only created %d queues\n",
num_queues);
dev_warn(&info->netdev->dev,
"only created %d queues\n", i);
num_queues = i;
break;
}
Expand Down Expand Up @@ -2001,7 +1989,7 @@ static int talk_to_netback(struct xenbus_device *dev,
info->queues = NULL;
rtnl_lock();
netif_set_real_num_tx_queues(info->netdev, 0);
rtnl_lock();
rtnl_unlock();
out:
return err;
}
Expand All @@ -2010,10 +1998,7 @@ static int xennet_connect(struct net_device *dev)
{
struct netfront_info *np = netdev_priv(dev);
unsigned int num_queues = 0;
int i, requeue_idx, err;
struct sk_buff *skb;
grant_ref_t ref;
struct xen_netif_rx_request *req;
int err;
unsigned int feature_rx_copy;
unsigned int j = 0;
struct netfront_queue *queue = NULL;
Expand All @@ -2040,47 +2025,8 @@ static int xennet_connect(struct net_device *dev)
netdev_update_features(dev);
rtnl_unlock();

/* By now, the queue structures have been set up */
for (j = 0; j < num_queues; ++j) {
queue = &np->queues[j];

/* Step 1: Discard all pending TX packet fragments. */
spin_lock_irq(&queue->tx_lock);
xennet_release_tx_bufs(queue);
spin_unlock_irq(&queue->tx_lock);

/* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
spin_lock_bh(&queue->rx_lock);

for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) {
skb_frag_t *frag;
const struct page *page;
if (!queue->rx_skbs[i])
continue;

skb = queue->rx_skbs[requeue_idx] = xennet_get_rx_skb(queue, i);
ref = queue->grant_rx_ref[requeue_idx] = xennet_get_rx_ref(queue, i);
req = RING_GET_REQUEST(&queue->rx, requeue_idx);

frag = &skb_shinfo(skb)->frags[0];
page = skb_frag_page(frag);
gnttab_grant_foreign_access_ref(
ref, queue->info->xbdev->otherend_id,
pfn_to_mfn(page_to_pfn(page)),
0);
req->gref = ref;
req->id = requeue_idx;

requeue_idx++;
}

queue->rx.req_prod_pvt = requeue_idx;

spin_unlock_bh(&queue->rx_lock);
}

/*
* Step 3: All public and private state should now be sane. Get
* All public and private state should now be sane. Get
* ready to start sending and receiving packets and give the driver
* domain a kick because we've probably just requeued some
* packets.
Expand Down
Loading

0 comments on commit d247b6a

Please sign in to comment.