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
Merge 'net' into 'net-next' to get the AF_PACKET bug fix that
Daniel's direct transmit changes depend upon.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Dec 10, 2013
2 parents 95dc192 + 66e56cd commit 34f9f43
Show file tree
Hide file tree
Showing 37 changed files with 314 additions and 208 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/net/davinci_emac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides information, what the device node
for the davinci_emac interface contains.

Required properties:
- compatible: "ti,davinci-dm6467-emac";
- compatible: "ti,davinci-dm6467-emac" or "ti,am3517-emac"
- reg: Offset and length of the register set for the device
- ti,davinci-ctrl-reg-offset: offset to control register
- ti,davinci-ctrl-mod-reg-offset: offset to control module register
Expand Down
10 changes: 10 additions & 0 deletions Documentation/networking/packet_mmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ Transmission process is similar to capture as shown below.
[shutdown] close() --------> destruction of the transmission socket and
deallocation of all associated resources.

Socket creation and destruction is also straight forward, and is done
the same way as in capturing described in the previous paragraph:

int fd = socket(PF_PACKET, mode, 0);

The protocol can optionally be 0 in case we only want to transmit
via this socket, which avoids an expensive call to packet_rcv().
In this case, you also need to bind(2) the TX_RING with sll_protocol = 0
set. Otherwise, htons(ETH_P_ALL) or any other protocol, for example.

Binding the socket to your network interface is mandatory (with zero copy) to
know the header size of frames used in the circular buffer.

Expand Down
2 changes: 0 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4450,10 +4450,8 @@ M: Bruce Allan <bruce.w.allan@intel.com>
M: Carolyn Wyborny <carolyn.wyborny@intel.com>
M: Don Skidmore <donald.c.skidmore@intel.com>
M: Greg Rose <gregory.v.rose@intel.com>
M: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
M: Alex Duyck <alexander.h.duyck@intel.com>
M: John Ronciak <john.ronciak@intel.com>
M: Tushar Dave <tushar.n.dave@intel.com>
L: e1000-devel@lists.sourceforge.net
W: http://www.intel.com/support/feedback.htm
W: http://e1000.sourceforge.net/
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4199,9 +4199,9 @@ static int bond_check_params(struct bond_params *params)
(arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) {
/* not complete check, but should be good enough to
catch mistakes */
__be32 ip = in_aton(arp_ip_target[i]);
if (!isdigit(arp_ip_target[i][0]) || ip == 0 ||
ip == htonl(INADDR_BROADCAST)) {
__be32 ip;
if (!in4_pton(arp_ip_target[i], -1, (u8 *)&ip, -1, NULL) ||
IS_IP_TARGET_UNUSABLE_ADDRESS(ip)) {
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
arp_ip_target[i]);
arp_interval = 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,12 +1634,12 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
char *buf)
{
struct bonding *bond = to_bond(d);
int packets_per_slave = bond->params.packets_per_slave;
unsigned int packets_per_slave = bond->params.packets_per_slave;

if (packets_per_slave > 1)
packets_per_slave = reciprocal_value(packets_per_slave);

return sprintf(buf, "%d\n", packets_per_slave);
return sprintf(buf, "%u\n", packets_per_slave);
}

static ssize_t bonding_store_packets_per_slave(struct device *d,
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,6 +3114,11 @@ int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs_param)
{
struct bnx2x *bp = netdev_priv(pci_get_drvdata(dev));

if (!IS_SRIOV(bp)) {
BNX2X_ERR("failed to configure SR-IOV since vfdb was not allocated. Check dmesg for errors in probe stage\n");
return -EINVAL;
}

DP(BNX2X_MSG_IOV, "bnx2x_sriov_configure called with %d, BNX2X_NR_VIRTFN(bp) was %d\n",
num_vfs_param, BNX2X_NR_VIRTFN(bp));

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/emulex/benet/be_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
#define SLIPORT_ERROR_NO_RESOURCE1 0x2
#define SLIPORT_ERROR_NO_RESOURCE2 0x9

#define SLIPORT_ERROR_FW_RESET1 0x2
#define SLIPORT_ERROR_FW_RESET2 0x0

/********* Memory BAR register ************/
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
Expand Down
41 changes: 29 additions & 12 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,8 +2464,16 @@ void be_detect_error(struct be_adapter *adapter)
*/
if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
adapter->hw_error = true;
dev_err(&adapter->pdev->dev,
"Error detected in the card\n");
/* Do not log error messages if its a FW reset */
if (sliport_err1 == SLIPORT_ERROR_FW_RESET1 &&
sliport_err2 == SLIPORT_ERROR_FW_RESET2) {
dev_info(&adapter->pdev->dev,
"Firmware update in progress\n");
return;
} else {
dev_err(&adapter->pdev->dev,
"Error detected in the card\n");
}
}

if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
Expand Down Expand Up @@ -2932,28 +2940,35 @@ static void be_cancel_worker(struct be_adapter *adapter)
}
}

static int be_clear(struct be_adapter *adapter)
static void be_mac_clear(struct be_adapter *adapter)
{
int i;

if (adapter->pmac_id) {
for (i = 0; i < (adapter->uc_macs + 1); i++)
be_cmd_pmac_del(adapter, adapter->if_handle,
adapter->pmac_id[i], 0);
adapter->uc_macs = 0;

kfree(adapter->pmac_id);
adapter->pmac_id = NULL;
}
}

static int be_clear(struct be_adapter *adapter)
{
be_cancel_worker(adapter);

if (sriov_enabled(adapter))
be_vf_clear(adapter);

/* delete the primary mac along with the uc-mac list */
for (i = 0; i < (adapter->uc_macs + 1); i++)
be_cmd_pmac_del(adapter, adapter->if_handle,
adapter->pmac_id[i], 0);
adapter->uc_macs = 0;
be_mac_clear(adapter);

be_cmd_if_destroy(adapter, adapter->if_handle, 0);

be_clear_queues(adapter);

kfree(adapter->pmac_id);
adapter->pmac_id = NULL;

be_msix_disable(adapter);
return 0;
}
Expand Down Expand Up @@ -3812,6 +3827,8 @@ static int lancer_fw_download(struct be_adapter *adapter,
}

if (change_status == LANCER_FW_RESET_NEEDED) {
dev_info(&adapter->pdev->dev,
"Resetting adapter to activate new FW\n");
status = lancer_physdev_ctrl(adapter,
PHYSDEV_CONTROL_FW_RESET_MASK);
if (status) {
Expand Down Expand Up @@ -4363,13 +4380,13 @@ static int lancer_recover_func(struct be_adapter *adapter)
goto err;
}

dev_err(dev, "Error recovery successful\n");
dev_err(dev, "Adapter recovery successful\n");
return 0;
err:
if (status == -EAGAIN)
dev_err(dev, "Waiting for resource provisioning\n");
else
dev_err(dev, "Error recovery failed\n");
dev_err(dev, "Adapter recovery failed\n");

return status;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ static void mvneta_rxq_drop_pkts(struct mvneta_port *pp,

dev_kfree_skb_any(skb);
dma_unmap_single(pp->dev->dev.parent, rx_desc->buf_phys_addr,
rx_desc->data_size, DMA_FROM_DEVICE);
MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE);
}

if (rx_done)
Expand Down Expand Up @@ -1424,7 +1424,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo,
}

dma_unmap_single(pp->dev->dev.parent, rx_desc->buf_phys_addr,
rx_desc->data_size, DMA_FROM_DEVICE);
MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE);

rx_bytes = rx_desc->data_size -
(ETH_FCS_LEN + MVNETA_MH_SIZE);
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/ethernet/nvidia/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -5149,8 +5149,10 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
{
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
int result;
memset(buffer, 0, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(u64));
int result, count;

count = nv_get_sset_count(dev, ETH_SS_TEST);
memset(buffer, 0, count * sizeof(u64));

if (!nv_link_test(dev)) {
test->flags |= ETH_TEST_FL_FAILED;
Expand Down Expand Up @@ -5194,7 +5196,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
return;
}

if (!nv_loopback_test(dev)) {
if (count > NV_TEST_COUNT_BASE && !nv_loopback_test(dev)) {
test->flags |= ETH_TEST_FL_FAILED;
buffer[3] = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qlge/qlge.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
#define DRV_NAME "qlge"
#define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver "
#define DRV_VERSION "1.00.00.33"
#define DRV_VERSION "1.00.00.34"

#define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */

Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ static const char ql_gstrings_test[][ETH_GSTRING_LEN] = {
};
#define QLGE_TEST_LEN (sizeof(ql_gstrings_test) / ETH_GSTRING_LEN)
#define QLGE_STATS_LEN ARRAY_SIZE(ql_gstrings_stats)
#define QLGE_RCV_MAC_ERR_STATS 7

static int ql_update_ring_coalescing(struct ql_adapter *qdev)
{
Expand Down Expand Up @@ -280,6 +281,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
iter++;
}

/* Update receive mac error statistics */
iter += QLGE_RCV_MAC_ERR_STATS;

/*
* Get Per-priority TX pause frame counter statistics.
*/
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/ethernet/qlogic/qlge/qlge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2376,14 +2376,6 @@ static netdev_features_t qlge_fix_features(struct net_device *ndev,
netdev_features_t features)
{
int err;
/*
* Since there is no support for separate rx/tx vlan accel
* enable/disable make sure tx flag is always in same state as rx.
*/
if (features & NETIF_F_HW_VLAN_CTAG_RX)
features |= NETIF_F_HW_VLAN_CTAG_TX;
else
features &= ~NETIF_F_HW_VLAN_CTAG_TX;

/* Update the behavior of vlan accel in the adapter */
err = qlge_update_hw_vlan_features(ndev, features);
Expand Down
26 changes: 25 additions & 1 deletion drivers/net/ethernet/ti/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include <linux/davinci_emac.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_net.h>

Expand Down Expand Up @@ -1752,10 +1753,14 @@ static const struct net_device_ops emac_netdev_ops = {
#endif
};

static const struct of_device_id davinci_emac_of_match[];

static struct emac_platform_data *
davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
{
struct device_node *np;
const struct of_device_id *match;
const struct emac_platform_data *auxdata;
struct emac_platform_data *pdata = NULL;
const u8 *mac_addr;

Expand Down Expand Up @@ -1793,7 +1798,20 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)

priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
if (!priv->phy_node)
pdata->phy_id = "";
pdata->phy_id = NULL;

auxdata = pdev->dev.platform_data;
if (auxdata) {
pdata->interrupt_enable = auxdata->interrupt_enable;
pdata->interrupt_disable = auxdata->interrupt_disable;
}

match = of_match_device(davinci_emac_of_match, &pdev->dev);
if (match && match->data) {
auxdata = match->data;
pdata->version = auxdata->version;
pdata->hw_ram_addr = auxdata->hw_ram_addr;
}

pdev->dev.platform_data = pdata;

Expand Down Expand Up @@ -2020,8 +2038,14 @@ static const struct dev_pm_ops davinci_emac_pm_ops = {
};

#if IS_ENABLED(CONFIG_OF)
static const struct emac_platform_data am3517_emac_data = {
.version = EMAC_VERSION_2,
.hw_ram_addr = 0x01e20000,
};

static const struct of_device_id davinci_emac_of_match[] = {
{.compatible = "ti,davinci-dm6467-emac", },
{.compatible = "ti,am3517-emac", .data = &am3517_emac_data, },
{},
};
MODULE_DEVICE_TABLE(of, davinci_emac_of_match);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,8 @@ static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv,

ret = macvtap_do_read(q, iv, len, file->f_flags & O_NONBLOCK);
ret = min_t(ssize_t, ret, len); /* XXX copied from tun.c. Why? */
if (ret > 0)
iocb->ki_pos = ret;
out:
return ret;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,
ret = tun_do_read(tun, tfile, iv, len,
file->f_flags & O_NONBLOCK);
ret = min_t(ssize_t, ret, len);
if (ret > 0)
iocb->ki_pos = ret;
out:
tun_put(tun);
return ret;
Expand Down
17 changes: 11 additions & 6 deletions drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) {
pr_debug("%s: short packet %i\n", dev->name, len);
dev->stats.rx_length_errors++;
if (vi->big_packets)
give_pages(rq, buf);
else if (vi->mergeable_rx_bufs)
if (vi->mergeable_rx_bufs)
put_page(virt_to_head_page(buf));
else if (vi->big_packets)
give_pages(rq, buf);
else
dev_kfree_skb(buf);
return;
Expand Down Expand Up @@ -1366,6 +1366,11 @@ static void virtnet_config_changed(struct virtio_device *vdev)

static void virtnet_free_queues(struct virtnet_info *vi)
{
int i;

for (i = 0; i < vi->max_queue_pairs; i++)
netif_napi_del(&vi->rq[i].napi);

kfree(vi->rq);
kfree(vi->sq);
}
Expand Down Expand Up @@ -1395,10 +1400,10 @@ static void free_unused_bufs(struct virtnet_info *vi)
struct virtqueue *vq = vi->rq[i].vq;

while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) {
if (vi->big_packets)
give_pages(&vi->rq[i], buf);
else if (vi->mergeable_rx_bufs)
if (vi->mergeable_rx_bufs)
put_page(virt_to_head_page(buf));
else if (vi->big_packets)
give_pages(&vi->rq[i], buf);
else
dev_kfree_skb(buf);
--vi->rq[i].num;
Expand Down
Loading

0 comments on commit 34f9f43

Please sign in to comment.