* Re: [PATCH net-next] tipc: cleanup function namespace
From: Neil Horman @ 2010-10-14 1:29 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: Stephen Hemminger, David Miller, netdev, allan.stephens
In-Reply-To: <4CB64D7C.1080004@windriver.com>
On Wed, Oct 13, 2010 at 08:23:24PM -0400, Paul Gortmaker wrote:
> On 10-10-13 07:20 PM, Stephen Hemminger wrote:
> > Do some cleanups of TIPC based on make namespacecheck
> > 1. Don't export unused symbols
> > 2. Eliminate dead code
> > 3. Make functions and variables local
> > 4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
> >
> > Compile tested only.
> > This make break out of tree kernel modules that depend on TIPC routines.
>
> Hi Stephen,
>
> When I first started looking at TIPC code, I too came to the
> same conclusion as you did and was about to do #1,2,3 -- but
> then I was told that the exported symbols were part of an API
> and might be in use by folks here and there as per this thread:
>
> http://www.mail-archive.com/netdev@vger.kernel.org/msg30208.html
>
I think its telling the the argument in the above thread for keeping the API
were that users of it were out there and 'likely to contribute' in the future.
That thread was 3 years ago. They might be using the API from outside the
kernel tree, but they're not planning on contributing. As Christoph noted,
they're freeloaders. The community really doesn't need or want to maintain an
API like that. If these users are your customers, and removing the API is
unacceptable, perhaps its time to move the entire TIPC module out of tree.
Neil
^ permalink raw reply
* [PATCH -next] net: move MII outside of NET_ETHERNET, fix kconfig warning
From: Randy Dunlap @ 2010-10-14 1:18 UTC (permalink / raw)
To: lkml, netdev; +Cc: akpm, Jeff Garzik, davem
From: Randy Dunlap <randy.dunlap@oracle.com>
We have USB, PCMCIA, and gigabit ethernet drivers that select
MII even though NET_ETHERNET is not enabled, so make MII not
be dependent on NET_ETHERNET. It is still dependent on NET
and NETDEVICES.
Fixes kconfig unmet dependency warning (shortened, was very long string):
warning: (ARM_AT91_ETHER && NETDEVICES && NET_ETHERNET && ARM && ARCH_AT91RM9200 || ARM_KS8695_ETHER && NETDEVICES && NET_ETHERNET && ARM && ARCH_KS8695 || ... || IP1000 && NETDEVICES && NETDEV_1000 && PCI && EXPERIMENTAL || HAMACHI && NETDEVICES && NETDEV_1000 && PCI || R8169 && NETDEVICES && NETDEV_1000 && PCI || SIS190 && NETDEVICES && NETDEV_1000 && PCI || VIA_VELOCITY && NETDEVICES && NETDEV_1000 && PCI || ATL1 && NETDEVICES && NETDEV_1000 && PCI || ATL1E && NETDEVICES && NETDEV_1000 && PCI && EXPERIMENTAL || ATL1C && NETDEVICES && NETDEV_1000 && PCI && EXPERIMENTAL || JME && NETDEVICES && NETDEV_1000 && PCI || STMMAC_ETH && NETDEV_1000 && NETDEVICES && HAS_IOMEM || USB_PEGASUS && NETDEVICES && USB && NET || USB_RTL8150 && NETDEVICES && USB && NET && EXPERIMENTAL || USB_USBNET && NETD
EVICES && USB && NET || PCMCIA_SMC91C92 && NETDEVICES && NET_PCMCIA && PCMCIA) selects MII which has unmet direct dependencies (NETDEVICES && NET_ETHERNET)
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jeff Garzik <jgarzik@pobox.com> [2006-NOV-30]
---
drivers/net/Kconfig | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- linux-next-20101013.orig/drivers/net/Kconfig
+++ linux-next-20101013/drivers/net/Kconfig
@@ -180,6 +180,13 @@ config NET_SB1000
source "drivers/net/arcnet/Kconfig"
+config MII
+ tristate "Generic Media Independent Interface device support"
+ help
+ Most ethernet controllers have MII transceiver either as an external
+ or internal device. It is safe to say Y or M here even if your
+ ethernet card lacks MII.
+
source "drivers/net/phy/Kconfig"
#
@@ -215,13 +222,6 @@ menuconfig NET_ETHERNET
if NET_ETHERNET
-config MII
- tristate "Generic Media Independent Interface device support"
- help
- Most ethernet controllers have MII transceiver either as an external
- or internal device. It is safe to say Y or M here even if your
- ethernet card lack MII.
-
config MACB
tristate "Atmel MACB support"
depends on HAVE_NET_MACB
^ permalink raw reply
* [PATCH -next] infiniband: fix mlx4 kconfig dependency warning
From: Randy Dunlap @ 2010-10-14 1:12 UTC (permalink / raw)
To: lkml, netdev, akpm; +Cc: linux-rdma, Roland Dreier, Sean Hefty, Hal Rosenstock
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix kconfig dependency warning to satisfy dependencies:
warning: (MLX4_EN && NETDEVICES && NETDEV_10000 && PCI && INET || MLX4_INFINIBAND && INFINIBAND) selects MLX4_CORE which has unmet direct dependencies (NETDEVICES && NETDEV_10000 && PCI)
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
drivers/infiniband/hw/mlx4/Kconfig | 1 +
1 file changed, 1 insertion(+)
--- linux-next-20101013.orig/drivers/infiniband/hw/mlx4/Kconfig
+++ linux-next-20101013/drivers/infiniband/hw/mlx4/Kconfig
@@ -1,5 +1,6 @@
config MLX4_INFINIBAND
tristate "Mellanox ConnectX HCA support"
+ depends on NETDEVICES && NETDEV_10000 && PCI
select MLX4_CORE
---help---
This driver provides low-level InfiniBand support for
^ permalink raw reply
* [PATCH 6/8 net-next] cnic: Add cnic_uio_dev struct
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-6-git-send-email-mchan@broadcom.com>
and put all uio related structures and ring buffers in it. This allows
uio operations to be done independent of the cnic device structures.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 195 ++++++++++++++++++++++++++++------------------------
drivers/net/cnic.h | 29 +++++---
2 files changed, 124 insertions(+), 100 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 739ffcb..e8f2836 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -89,22 +89,24 @@ static int cnic_cm_set_pg(struct cnic_sock *);
static int cnic_uio_open(struct uio_info *uinfo, struct inode *inode)
{
- struct cnic_dev *dev = uinfo->priv;
- struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = uinfo->priv;
+ struct cnic_dev *dev;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- if (cp->uio_dev != -1)
+ if (udev->uio_dev != -1)
return -EBUSY;
rtnl_lock();
+ dev = udev->dev;
+
if (!test_bit(CNIC_F_CNIC_UP, &dev->flags)) {
rtnl_unlock();
return -ENODEV;
}
- cp->uio_dev = iminor(inode);
+ udev->uio_dev = iminor(inode);
cnic_init_rings(dev);
rtnl_unlock();
@@ -114,12 +116,12 @@ static int cnic_uio_open(struct uio_info *uinfo, struct inode *inode)
static int cnic_uio_close(struct uio_info *uinfo, struct inode *inode)
{
- struct cnic_dev *dev = uinfo->priv;
- struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = uinfo->priv;
+ struct cnic_dev *dev = udev->dev;
cnic_shutdown_rings(dev);
- cp->uio_dev = -1;
+ udev->uio_dev = -1;
return 0;
}
@@ -276,8 +278,9 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
u16 len = 0;
u32 msg_type = ISCSI_KEVENT_IF_DOWN;
struct cnic_ulp_ops *ulp_ops;
+ struct cnic_uio_dev *udev = cp->udev;
- if (cp->uio_dev == -1)
+ if (!udev || udev->uio_dev == -1)
return -ENODEV;
if (csk) {
@@ -408,8 +411,7 @@ static void cnic_uio_stop(void)
list_for_each_entry(dev, &cnic_dev_list, list) {
struct cnic_local *cp = dev->cnic_priv;
- if (cp->cnic_uinfo)
- cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
+ cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
}
read_unlock(&cnic_dev_lock);
}
@@ -770,48 +772,44 @@ static void cnic_free_context(struct cnic_dev *dev)
}
}
-static void __cnic_free_uio(struct cnic_dev *dev)
+static void __cnic_free_uio(struct cnic_uio_dev *udev)
{
- struct cnic_local *cp = dev->cnic_priv;
-
- if (cp->cnic_uinfo)
- uio_unregister_device(cp->cnic_uinfo);
+ uio_unregister_device(&udev->cnic_uinfo);
- kfree(cp->cnic_uinfo);
- cp->cnic_uinfo = NULL;
-
- if (cp->l2_buf) {
- dma_free_coherent(&dev->pcidev->dev, cp->l2_buf_size,
- cp->l2_buf, cp->l2_buf_map);
- cp->l2_buf = NULL;
+ if (udev->l2_buf) {
+ dma_free_coherent(&udev->pdev->dev, udev->l2_buf_size,
+ udev->l2_buf, udev->l2_buf_map);
+ udev->l2_buf = NULL;
}
- if (cp->l2_ring) {
- dma_free_coherent(&dev->pcidev->dev, cp->l2_ring_size,
- cp->l2_ring, cp->l2_ring_map);
- cp->l2_ring = NULL;
+ if (udev->l2_ring) {
+ dma_free_coherent(&udev->pdev->dev, udev->l2_ring_size,
+ udev->l2_ring, udev->l2_ring_map);
+ udev->l2_ring = NULL;
}
}
-static void cnic_free_uio(struct cnic_dev *dev)
+static void cnic_free_uio(struct cnic_uio_dev *udev)
{
- if (!dev)
+ if (!udev)
return;
- __cnic_free_uio(dev);
+ __cnic_free_uio(udev);
}
static void cnic_free_resc(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = cp->udev;
int i = 0;
- if (cp->cnic_uinfo) {
- while (cp->uio_dev != -1 && i < 15) {
+ if (udev) {
+ while (udev->uio_dev != -1 && i < 15) {
msleep(100);
i++;
}
- cnic_free_uio(dev);
+ cnic_free_uio(udev);
+ cp->udev = NULL;
}
cnic_free_context(dev);
@@ -913,37 +911,53 @@ static int cnic_alloc_kcq(struct cnic_dev *dev, struct kcq_info *info)
return 0;
}
-static int cnic_alloc_l2_rings(struct cnic_dev *dev, int pages)
+static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
{
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev;
+
+ udev = kzalloc(sizeof(struct cnic_uio_dev), GFP_ATOMIC);
+ if (!udev)
+ return -ENOMEM;
+
+ udev->uio_dev = -1;
- cp->l2_ring_size = pages * BCM_PAGE_SIZE;
- cp->l2_ring = dma_alloc_coherent(&dev->pcidev->dev, cp->l2_ring_size,
- &cp->l2_ring_map,
- GFP_KERNEL | __GFP_COMP);
- if (!cp->l2_ring)
+ udev->dev = dev;
+ udev->pdev = dev->pcidev;
+ udev->l2_ring_size = pages * BCM_PAGE_SIZE;
+ udev->l2_ring = dma_alloc_coherent(&udev->pdev->dev, udev->l2_ring_size,
+ &udev->l2_ring_map,
+ GFP_KERNEL | __GFP_COMP);
+ if (!udev->l2_ring)
return -ENOMEM;
- cp->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size;
- cp->l2_buf_size = PAGE_ALIGN(cp->l2_buf_size);
- cp->l2_buf = dma_alloc_coherent(&dev->pcidev->dev, cp->l2_buf_size,
- &cp->l2_buf_map,
- GFP_KERNEL | __GFP_COMP);
- if (!cp->l2_buf)
+ udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size;
+ udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size);
+ udev->l2_buf = dma_alloc_coherent(&udev->pdev->dev, udev->l2_buf_size,
+ &udev->l2_buf_map,
+ GFP_KERNEL | __GFP_COMP);
+ if (!udev->l2_buf)
return -ENOMEM;
+ cp->udev = udev;
+
return 0;
}
-static int cnic_alloc_uio(struct cnic_dev *dev) {
+static int cnic_init_uio(struct cnic_dev *dev)
+{
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = cp->udev;
struct uio_info *uinfo;
- int ret;
+ int ret = 0;
- uinfo = kzalloc(sizeof(*uinfo), GFP_ATOMIC);
- if (!uinfo)
+ if (!udev)
return -ENOMEM;
+ udev->uio_dev = -1;
+
+ uinfo = &udev->cnic_uinfo;
+
uinfo->mem[0].addr = dev->netdev->base_addr;
uinfo->mem[0].internal_addr = dev->regview;
uinfo->mem[0].size = dev->netdev->mem_end - dev->netdev->mem_start;
@@ -951,7 +965,7 @@ static int cnic_alloc_uio(struct cnic_dev *dev) {
if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen &
- PAGE_MASK;
+ PAGE_MASK;
if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
uinfo->mem[1].size = BNX2_SBLK_MSIX_ALIGN_SIZE * 9;
else
@@ -968,12 +982,12 @@ static int cnic_alloc_uio(struct cnic_dev *dev) {
uinfo->mem[1].memtype = UIO_MEM_LOGICAL;
- uinfo->mem[2].addr = (unsigned long) cp->l2_ring;
- uinfo->mem[2].size = cp->l2_ring_size;
+ uinfo->mem[2].addr = (unsigned long) udev->l2_ring;
+ uinfo->mem[2].size = udev->l2_ring_size;
uinfo->mem[2].memtype = UIO_MEM_LOGICAL;
- uinfo->mem[3].addr = (unsigned long) cp->l2_buf;
- uinfo->mem[3].size = cp->l2_buf_size;
+ uinfo->mem[3].addr = (unsigned long) udev->l2_buf;
+ uinfo->mem[3].size = udev->l2_buf_size;
uinfo->mem[3].memtype = UIO_MEM_LOGICAL;
uinfo->version = CNIC_MODULE_VERSION;
@@ -982,16 +996,11 @@ static int cnic_alloc_uio(struct cnic_dev *dev) {
uinfo->open = cnic_uio_open;
uinfo->release = cnic_uio_close;
- uinfo->priv = dev;
+ uinfo->priv = udev;
- ret = uio_register_device(&dev->pcidev->dev, uinfo);
- if (ret) {
- kfree(uinfo);
- return ret;
- }
+ ret = uio_register_device(&udev->pdev->dev, uinfo);
- cp->cnic_uinfo = uinfo;
- return 0;
+ return ret;
}
static int cnic_alloc_bnx2_resc(struct cnic_dev *dev)
@@ -1012,11 +1021,11 @@ static int cnic_alloc_bnx2_resc(struct cnic_dev *dev)
if (ret)
goto error;
- ret = cnic_alloc_l2_rings(dev, 2);
+ ret = cnic_alloc_uio_rings(dev, 2);
if (ret)
goto error;
- ret = cnic_alloc_uio(dev);
+ ret = cnic_init_uio(dev);
if (ret)
goto error;
@@ -1150,11 +1159,11 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
cp->l2_rx_ring_size = 15;
- ret = cnic_alloc_l2_rings(dev, 4);
+ ret = cnic_alloc_uio_rings(dev, 4);
if (ret)
goto error;
- ret = cnic_alloc_uio(dev);
+ ret = cnic_init_uio(dev);
if (ret)
goto error;
@@ -2226,8 +2235,9 @@ static int cnic_get_kcqes(struct cnic_dev *dev, struct kcq_info *info)
static int cnic_l2_completion(struct cnic_local *cp)
{
u16 hw_cons, sw_cons;
+ struct cnic_uio_dev *udev = cp->udev;
union eth_rx_cqe *cqe, *cqe_ring = (union eth_rx_cqe *)
- (cp->l2_ring + (2 * BCM_PAGE_SIZE));
+ (udev->l2_ring + (2 * BCM_PAGE_SIZE));
u32 cmd;
int comp = 0;
@@ -2273,7 +2283,8 @@ static void cnic_chk_pkt_rings(struct cnic_local *cp)
cp->tx_cons = tx_cons;
cp->rx_cons = rx_cons;
- uio_event_notify(cp->cnic_uinfo);
+ if (cp->udev)
+ uio_event_notify(&cp->udev->cnic_uinfo);
}
if (comp)
clear_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags);
@@ -2435,8 +2446,7 @@ static void cnic_ulp_stop(struct cnic_dev *dev)
struct cnic_local *cp = dev->cnic_priv;
int if_type;
- if (cp->cnic_uinfo)
- cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
+ cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) {
struct cnic_ulp_ops *ulp_ops;
@@ -3658,11 +3668,12 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
struct cnic_eth_dev *ethdev = cp->ethdev;
+ struct cnic_uio_dev *udev = cp->udev;
u32 cid_addr, tx_cid, sb_id;
u32 val, offset0, offset1, offset2, offset3;
int i;
struct tx_bd *txbd;
- dma_addr_t buf_map;
+ dma_addr_t buf_map, ring_map = udev->l2_ring_map;
struct status_block *s_blk = cp->status_blk.gen;
sb_id = cp->status_blk_num;
@@ -3704,18 +3715,18 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)
val = BNX2_L2CTX_CMD_TYPE_TYPE_L2 | (8 << 16);
cnic_ctx_wr(dev, cid_addr, offset1, val);
- txbd = (struct tx_bd *) cp->l2_ring;
+ txbd = (struct tx_bd *) udev->l2_ring;
- buf_map = cp->l2_buf_map;
+ buf_map = udev->l2_buf_map;
for (i = 0; i < MAX_TX_DESC_CNT; i++, txbd++) {
txbd->tx_bd_haddr_hi = (u64) buf_map >> 32;
txbd->tx_bd_haddr_lo = (u64) buf_map & 0xffffffff;
}
- val = (u64) cp->l2_ring_map >> 32;
+ val = (u64) ring_map >> 32;
cnic_ctx_wr(dev, cid_addr, offset2, val);
txbd->tx_bd_haddr_hi = val;
- val = (u64) cp->l2_ring_map & 0xffffffff;
+ val = (u64) ring_map & 0xffffffff;
cnic_ctx_wr(dev, cid_addr, offset3, val);
txbd->tx_bd_haddr_lo = val;
}
@@ -3724,10 +3735,12 @@ static void cnic_init_bnx2_rx_ring(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
struct cnic_eth_dev *ethdev = cp->ethdev;
+ struct cnic_uio_dev *udev = cp->udev;
u32 cid_addr, sb_id, val, coal_reg, coal_val;
int i;
struct rx_bd *rxbd;
struct status_block *s_blk = cp->status_blk.gen;
+ dma_addr_t ring_map = udev->l2_ring_map;
sb_id = cp->status_blk_num;
cnic_init_context(dev, 2);
@@ -3761,22 +3774,22 @@ static void cnic_init_bnx2_rx_ring(struct cnic_dev *dev)
val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id);
cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val);
- rxbd = (struct rx_bd *) (cp->l2_ring + BCM_PAGE_SIZE);
+ rxbd = (struct rx_bd *) (udev->l2_ring + BCM_PAGE_SIZE);
for (i = 0; i < MAX_RX_DESC_CNT; i++, rxbd++) {
dma_addr_t buf_map;
int n = (i % cp->l2_rx_ring_size) + 1;
- buf_map = cp->l2_buf_map + (n * cp->l2_single_buf_size);
+ buf_map = udev->l2_buf_map + (n * cp->l2_single_buf_size);
rxbd->rx_bd_len = cp->l2_single_buf_size;
rxbd->rx_bd_flags = RX_BD_FLAGS_START | RX_BD_FLAGS_END;
rxbd->rx_bd_haddr_hi = (u64) buf_map >> 32;
rxbd->rx_bd_haddr_lo = (u64) buf_map & 0xffffffff;
}
- val = (u64) (cp->l2_ring_map + BCM_PAGE_SIZE) >> 32;
+ val = (u64) (ring_map + BCM_PAGE_SIZE) >> 32;
cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val);
rxbd->rx_bd_haddr_hi = val;
- val = (u64) (cp->l2_ring_map + BCM_PAGE_SIZE) & 0xffffffff;
+ val = (u64) (ring_map + BCM_PAGE_SIZE) & 0xffffffff;
cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_LO, val);
rxbd->rx_bd_haddr_lo = val;
@@ -4038,8 +4051,9 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev,
struct client_init_ramrod_data *data)
{
struct cnic_local *cp = dev->cnic_priv;
- union eth_tx_bd_types *txbd = (union eth_tx_bd_types *) cp->l2_ring;
- dma_addr_t buf_map, ring_map = cp->l2_ring_map;
+ struct cnic_uio_dev *udev = cp->udev;
+ union eth_tx_bd_types *txbd = (union eth_tx_bd_types *) udev->l2_ring;
+ dma_addr_t buf_map, ring_map = udev->l2_ring_map;
struct host_sp_status_block *sb = cp->bnx2x_def_status_blk;
int port = CNIC_PORT(cp);
int i;
@@ -4048,7 +4062,7 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev,
memset(txbd, 0, BCM_PAGE_SIZE);
- buf_map = cp->l2_buf_map;
+ buf_map = udev->l2_buf_map;
for (i = 0; i < MAX_TX_DESC_CNT; i += 3, txbd += 3) {
struct eth_tx_start_bd *start_bd = &txbd->start_bd;
struct eth_tx_bd *reg_bd = &((txbd + 2)->reg_bd);
@@ -4096,17 +4110,18 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev,
struct client_init_ramrod_data *data)
{
struct cnic_local *cp = dev->cnic_priv;
- struct eth_rx_bd *rxbd = (struct eth_rx_bd *) (cp->l2_ring +
+ struct cnic_uio_dev *udev = cp->udev;
+ struct eth_rx_bd *rxbd = (struct eth_rx_bd *) (udev->l2_ring +
BCM_PAGE_SIZE);
struct eth_rx_cqe_next_page *rxcqe = (struct eth_rx_cqe_next_page *)
- (cp->l2_ring + (2 * BCM_PAGE_SIZE));
+ (udev->l2_ring + (2 * BCM_PAGE_SIZE));
struct host_sp_status_block *sb = cp->bnx2x_def_status_blk;
int i;
int port = CNIC_PORT(cp);
int cli = BNX2X_ISCSI_CL_ID(CNIC_E1HVN(cp));
int cl_qzone_id = BNX2X_CL_QZONE_ID(cp, cli);
u32 val;
- dma_addr_t ring_map = cp->l2_ring_map;
+ dma_addr_t ring_map = udev->l2_ring_map;
/* General data */
data->general.client_id = cli;
@@ -4119,7 +4134,7 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev,
dma_addr_t buf_map;
int n = (i % cp->l2_rx_ring_size) + 1;
- buf_map = cp->l2_buf_map + (n * cp->l2_single_buf_size);
+ buf_map = udev->l2_buf_map + (n * cp->l2_single_buf_size);
rxbd->addr_hi = cpu_to_le32((u64) buf_map >> 32);
rxbd->addr_lo = cpu_to_le32(buf_map & 0xffffffff);
}
@@ -4320,6 +4335,7 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
static void cnic_init_rings(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_uio_dev *udev = cp->udev;
if (test_bit(CNIC_LCL_FL_RINGS_INITED, &cp->cnic_local_flags))
return;
@@ -4350,15 +4366,15 @@ static void cnic_init_rings(struct cnic_dev *dev)
set_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags);
- data = cp->l2_buf;
+ data = udev->l2_buf;
memset(data, 0, sizeof(*data));
cnic_init_bnx2x_tx_ring(dev, data);
cnic_init_bnx2x_rx_ring(dev, data);
- l5_data.phy_address.lo = cp->l2_buf_map & 0xffffffff;
- l5_data.phy_address.hi = (u64) cp->l2_buf_map >> 32;
+ l5_data.phy_address.lo = udev->l2_buf_map & 0xffffffff;
+ l5_data.phy_address.hi = (u64) udev->l2_buf_map >> 32;
type = (ETH_CONNECTION_TYPE << SPE_HDR_CONN_TYPE_SHIFT)
& SPE_HDR_CONN_TYPE;
@@ -4539,7 +4555,7 @@ static void cnic_stop_hw(struct cnic_dev *dev)
/* Need to wait for the ring shutdown event to complete
* before clearing the CNIC_UP flag.
*/
- while (cp->uio_dev != -1 && i < 15) {
+ while (cp->udev->uio_dev != -1 && i < 15) {
msleep(100);
i++;
}
@@ -4591,7 +4607,6 @@ static struct cnic_dev *cnic_alloc_dev(struct net_device *dev,
cp = cdev->cnic_priv;
cp->dev = cdev;
- cp->uio_dev = -1;
cp->l2_single_buf_size = 0x400;
cp->l2_rx_ring_size = 3;
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 47cd801..928af9e 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -195,6 +195,23 @@ struct iro {
u16 size;
};
+struct cnic_uio_dev {
+ struct uio_info cnic_uinfo;
+ u32 uio_dev;
+
+ int l2_ring_size;
+ void *l2_ring;
+ dma_addr_t l2_ring_map;
+
+ int l2_buf_size;
+ void *l2_buf;
+ dma_addr_t l2_buf_map;
+
+ struct cnic_dev *dev;
+ struct pci_dev *pdev;
+ struct list_head list;
+};
+
struct cnic_local {
spinlock_t cnic_ulp_lock;
@@ -214,14 +231,9 @@ struct cnic_local {
struct cnic_eth_dev *ethdev;
- void *l2_ring;
- dma_addr_t l2_ring_map;
- int l2_ring_size;
- int l2_rx_ring_size;
+ struct cnic_uio_dev *udev;
- void *l2_buf;
- dma_addr_t l2_buf_map;
- int l2_buf_size;
+ int l2_rx_ring_size;
int l2_single_buf_size;
u16 *rx_cons_ptr;
@@ -301,9 +313,6 @@ struct cnic_local {
u32 pfid;
u32 shmem_base;
- u32 uio_dev;
- struct uio_info *cnic_uinfo;
-
struct cnic_ops *cnic_ops;
int (*start_hw)(struct cnic_dev *);
void (*stop_hw)(struct cnic_dev *);
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 4/8 net-next] cnic: Defer iscsi connection cleanup
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-4-git-send-email-mchan@broadcom.com>
The bnx2x devices require a 2 second quiet time before sending the last
RAMROD command to destroy a connection. This sleep wait adds up to a
long delay when iscsid is serially destroying maultiple connections.
Create a workqueue to perform the final connection cleanup in the
background to speed up the process. This significantly speeds up the
process as the wait time can be done in parallel for multiple connections.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 110 +++++++++++++++++++++++++++-
drivers/net/cnic.h | 3 +
drivers/scsi/bnx2i/57xx_iscsi_constants.h | 2 +
3 files changed, 111 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index ee66c48..b12bba7 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -81,6 +81,8 @@ static struct cnic_ops cnic_bnx2x_ops = {
.cnic_ctl = cnic_ctl,
};
+static struct workqueue_struct *cnic_wq;
+
static void cnic_shutdown_rings(struct cnic_dev *);
static void cnic_init_rings(struct cnic_dev *);
static int cnic_cm_set_pg(struct cnic_sock *);
@@ -1629,10 +1631,11 @@ static int cnic_bnx2x_iscsi_ofld1(struct cnic_dev *dev, struct kwqe *wqes[],
struct iscsi_kwqe_conn_offload1 *req1;
struct iscsi_kwqe_conn_offload2 *req2;
struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_context *ctx;
struct iscsi_kcqe kcqe;
struct kcqe *cqes[1];
u32 l5_cid;
- int ret;
+ int ret = 0;
if (num < 2) {
*work = num;
@@ -1656,9 +1659,15 @@ static int cnic_bnx2x_iscsi_ofld1(struct cnic_dev *dev, struct kwqe *wqes[],
kcqe.iscsi_conn_id = l5_cid;
kcqe.completion_status = ISCSI_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE;
+ ctx = &cp->ctx_tbl[l5_cid];
+ if (test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags)) {
+ kcqe.completion_status =
+ ISCSI_KCQE_COMPLETION_STATUS_CID_BUSY;
+ goto done;
+ }
+
if (atomic_inc_return(&cp->iscsi_conn) > dev->max_iscsi_conn) {
atomic_dec(&cp->iscsi_conn);
- ret = 0;
goto done;
}
ret = cnic_alloc_bnx2x_conn_resc(dev, l5_cid);
@@ -1748,8 +1757,16 @@ static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
goto skip_cfc_delete;
- while (!time_after(jiffies, ctx->timestamp + (2 * HZ)))
- msleep(250);
+ if (!time_after(jiffies, ctx->timestamp + (2 * HZ))) {
+ unsigned long delta = ctx->timestamp + (2 * HZ) - jiffies;
+
+ if (delta > (2 * HZ))
+ delta = 0;
+
+ set_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags);
+ queue_delayed_work(cnic_wq, &cp->delete_task, delta);
+ goto destroy_reply;
+ }
ret = cnic_bnx2x_destroy_ramrod(dev, l5_cid);
@@ -1757,7 +1774,9 @@ skip_cfc_delete:
cnic_free_bnx2x_conn_resc(dev, l5_cid);
atomic_dec(&cp->iscsi_conn);
+ clear_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags);
+destroy_reply:
memset(&kcqe, 0, sizeof(kcqe));
kcqe.op_code = ISCSI_KCQE_OPCODE_DESTROY_CONN;
kcqe.iscsi_conn_id = l5_cid;
@@ -2748,6 +2767,13 @@ static int cnic_cm_create(struct cnic_dev *dev, int ulp_type, u32 cid,
if (l5_cid >= MAX_CM_SK_TBL_SZ)
return -EINVAL;
+ if (cp->ctx_tbl) {
+ struct cnic_context *ctx = &cp->ctx_tbl[l5_cid];
+
+ if (test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
+ return -EAGAIN;
+ }
+
csk1 = &cp->csk_tbl[l5_cid];
if (atomic_read(&csk1->ref_count))
return -EAGAIN;
@@ -3299,6 +3325,32 @@ static void cnic_close_bnx2x_conn(struct cnic_sock *csk, u32 opcode)
static void cnic_cm_stop_bnx2x_hw(struct cnic_dev *dev)
{
+ struct cnic_local *cp = dev->cnic_priv;
+ int i;
+
+ if (!cp->ctx_tbl)
+ return;
+
+ if (!netif_running(dev->netdev))
+ return;
+
+ for (i = 0; i < cp->max_cid_space; i++) {
+ struct cnic_context *ctx = &cp->ctx_tbl[i];
+
+ while (test_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags))
+ msleep(10);
+
+ if (test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
+ netdev_warn(dev->netdev, "CID %x not deleted\n",
+ ctx->cid);
+ }
+
+ cancel_delayed_work(&cp->delete_task);
+ flush_workqueue(cnic_wq);
+
+ if (atomic_read(&cp->iscsi_conn) != 0)
+ netdev_warn(dev->netdev, "%d iSCSI connections not destroyed\n",
+ atomic_read(&cp->iscsi_conn));
}
static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev)
@@ -3333,6 +3385,46 @@ static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev)
return 0;
}
+static void cnic_delete_task(struct work_struct *work)
+{
+ struct cnic_local *cp;
+ struct cnic_dev *dev;
+ u32 i;
+ int need_resched = 0;
+
+ cp = container_of(work, struct cnic_local, delete_task.work);
+ dev = cp->dev;
+
+ for (i = 0; i < cp->max_cid_space; i++) {
+ struct cnic_context *ctx = &cp->ctx_tbl[i];
+
+ if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags) ||
+ !test_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags))
+ continue;
+
+ if (!time_after(jiffies, ctx->timestamp + (2 * HZ))) {
+ need_resched = 1;
+ continue;
+ }
+
+ if (!test_and_clear_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags))
+ continue;
+
+ cnic_bnx2x_destroy_ramrod(dev, i);
+
+ cnic_free_bnx2x_conn_resc(dev, i);
+ if (ctx->ulp_proto_id == CNIC_ULP_ISCSI)
+ atomic_dec(&cp->iscsi_conn);
+
+ clear_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags);
+ }
+
+ if (need_resched)
+ queue_delayed_work(cnic_wq, &cp->delete_task,
+ msecs_to_jiffies(10));
+
+}
+
static int cnic_cm_open(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
@@ -3347,6 +3439,8 @@ static int cnic_cm_open(struct cnic_dev *dev)
if (err)
goto err_out;
+ INIT_DELAYED_WORK(&cp->delete_task, cnic_delete_task);
+
dev->cm_create = cnic_cm_create;
dev->cm_destroy = cnic_cm_destroy;
dev->cm_connect = cnic_cm_connect;
@@ -4735,6 +4829,13 @@ static int __init cnic_init(void)
return rc;
}
+ cnic_wq = create_singlethread_workqueue("cnic_wq");
+ if (!cnic_wq) {
+ cnic_release();
+ unregister_netdevice_notifier(&cnic_netdev_notifier);
+ return -ENOMEM;
+ }
+
return 0;
}
@@ -4742,6 +4843,7 @@ static void __exit cnic_exit(void)
{
unregister_netdevice_notifier(&cnic_netdev_notifier);
cnic_release();
+ destroy_workqueue(cnic_wq);
}
module_init(cnic_init);
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 9907cc2..47cd801 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -170,6 +170,7 @@ struct cnic_context {
unsigned long timestamp;
unsigned long ctx_flags;
#define CTX_FL_OFFLD_START 0
+#define CTX_FL_DELETE_WAIT 1
u8 ulp_proto_id;
union {
struct cnic_iscsi *iscsi;
@@ -287,6 +288,8 @@ struct cnic_local {
int hq_size;
int num_cqs;
+ struct delayed_work delete_task;
+
struct cnic_ctx *ctx_arr;
int ctx_blks;
int ctx_blk_size;
diff --git a/drivers/scsi/bnx2i/57xx_iscsi_constants.h b/drivers/scsi/bnx2i/57xx_iscsi_constants.h
index 2fceb19..1b6f86b 100644
--- a/drivers/scsi/bnx2i/57xx_iscsi_constants.h
+++ b/drivers/scsi/bnx2i/57xx_iscsi_constants.h
@@ -120,6 +120,8 @@
/* additional LOM specific iSCSI license not installed */
#define ISCSI_KCQE_COMPLETION_STATUS_LOM_ISCSI_NOT_ENABLED (0x51)
+#define ISCSI_KCQE_COMPLETION_STATUS_CID_BUSY (0x80)
+
/* SQ/RQ/CQ DB structure sizes */
#define ISCSI_SQ_DB_SIZE (16)
#define ISCSI_RQ_DB_SIZE (16)
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 8/8 net-next] cnic: Add support for 57712 device
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-8-git-send-email-mchan@broadcom.com>
Add new interrupt ack functions and other hardware interface logic to
support the new device.
Update version to 2.2.6.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 94 +++++++++++++++++++++++++++++++++++++++++--------
drivers/net/cnic.h | 22 +++++++++++
drivers/net/cnic_if.h | 4 +-
3 files changed, 103 insertions(+), 17 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 3f923a7..92bac19 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1077,7 +1077,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
cp->ctx_blks = blks;
cp->ctx_blk_size = ctx_blk_size;
- if (BNX2X_CHIP_IS_E1H(cp->chip_id))
+ if (!BNX2X_CHIP_IS_57710(cp->chip_id))
cp->ctx_align = 0;
else
cp->ctx_align = ctx_blk_size;
@@ -2406,6 +2406,22 @@ static inline void cnic_ack_bnx2x_int(struct cnic_dev *dev, u8 id, u8 storm,
CNIC_WR(dev, hc_addr, (*(u32 *)&igu_ack));
}
+static void cnic_ack_igu_sb(struct cnic_dev *dev, u8 igu_sb_id, u8 segment,
+ u16 index, u8 op, u8 update)
+{
+ struct igu_regular cmd_data;
+ u32 igu_addr = BAR_IGU_INTMEM + (IGU_CMD_INT_ACK_BASE + igu_sb_id) * 8;
+
+ cmd_data.sb_id_and_flags =
+ (index << IGU_REGULAR_SB_INDEX_SHIFT) |
+ (segment << IGU_REGULAR_SEGMENT_ACCESS_SHIFT) |
+ (update << IGU_REGULAR_BUPDATE_SHIFT) |
+ (op << IGU_REGULAR_ENABLE_INT_SHIFT);
+
+
+ CNIC_WR(dev, igu_addr, cmd_data.sb_id_and_flags);
+}
+
static void cnic_ack_bnx2x_msix(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
@@ -2414,6 +2430,14 @@ static void cnic_ack_bnx2x_msix(struct cnic_dev *dev)
IGU_INT_DISABLE, 0);
}
+static void cnic_ack_bnx2x_e2_msix(struct cnic_dev *dev)
+{
+ struct cnic_local *cp = dev->cnic_priv;
+
+ cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF, 0,
+ IGU_INT_DISABLE, 0);
+}
+
static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info)
{
u32 last_status = *info->status_idx_ptr;
@@ -2445,8 +2469,12 @@ static void cnic_service_bnx2x_bh(unsigned long data)
status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1);
CNIC_WR16(dev, cp->kcq1.io_addr, cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
- cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,
- status_idx, IGU_INT_ENABLE, 1);
+ if (BNX2X_CHIP_IS_E2(cp->chip_id))
+ cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF,
+ status_idx, IGU_INT_ENABLE, 1);
+ else
+ cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID,
+ status_idx, IGU_INT_ENABLE, 1);
}
static int cnic_service_bnx2x(void *data, void *status_blk)
@@ -4208,7 +4236,7 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev,
static void cnic_get_bnx2x_iscsi_info(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
- u32 base, addr, val;
+ u32 base, base2, addr, val;
int port = CNIC_PORT(cp);
dev->max_iscsi_conn = 0;
@@ -4216,6 +4244,8 @@ static void cnic_get_bnx2x_iscsi_info(struct cnic_dev *dev)
if (base == 0)
return;
+ base2 = CNIC_RD(dev, (CNIC_PATH(cp) ? MISC_REG_GENERIC_CR_1 :
+ MISC_REG_GENERIC_CR_0));
addr = BNX2X_SHMEM_ADDR(base,
dev_info.port_hw_config[port].iscsi_mac_upper);
@@ -4248,11 +4278,15 @@ static void cnic_get_bnx2x_iscsi_info(struct cnic_dev *dev)
val16 ^= 0x1e1e;
dev->max_iscsi_conn = val16;
}
- if (BNX2X_CHIP_IS_E1H(cp->chip_id)) {
+ if (BNX2X_CHIP_IS_E1H(cp->chip_id) || BNX2X_CHIP_IS_E2(cp->chip_id)) {
int func = CNIC_FUNC(cp);
u32 mf_cfg_addr;
- mf_cfg_addr = base + BNX2X_SHMEM_MF_BLK_OFFSET;
+ if (BNX2X_SHMEM2_HAS(base2, mf_cfg_addr))
+ mf_cfg_addr = CNIC_RD(dev, BNX2X_SHMEM2_ADDR(base2,
+ mf_cfg_addr));
+ else
+ mf_cfg_addr = base + BNX2X_SHMEM_MF_BLK_OFFSET;
addr = mf_cfg_addr +
offsetof(struct mf_cfg, func_mf_config[func].e1hov_tag);
@@ -4277,9 +4311,22 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
struct cnic_eth_dev *ethdev = cp->ethdev;
int func = CNIC_FUNC(cp), ret, i;
u32 pfid;
- struct host_hc_status_block_e1x *sb = cp->status_blk.gen;
- cp->pfid = func;
+ if (BNX2X_CHIP_IS_E2(cp->chip_id)) {
+ u32 val = CNIC_RD(dev, MISC_REG_PORT4MODE_EN_OVWR);
+
+ if (!(val & 1))
+ val = CNIC_RD(dev, MISC_REG_PORT4MODE_EN);
+ else
+ val = (val >> 1) & 1;
+
+ if (val)
+ cp->pfid = func >> 1;
+ else
+ cp->pfid = func & 0x6;
+ } else {
+ cp->pfid = func;
+ }
pfid = cp->pfid;
ret = cnic_init_id_tbl(&cp->cid_tbl, MAX_ISCSI_TBL_SZ,
@@ -4294,10 +4341,21 @@ static int cnic_start_bnx2x_hw(struct cnic_dev *dev)
CSTORM_ISCSI_EQ_PROD_OFFSET(pfid, 0);
cp->kcq1.sw_prod_idx = 0;
- cp->kcq1.hw_prod_idx_ptr =
- &sb->sb.index_values[HC_INDEX_ISCSI_EQ_CONS];
- cp->kcq1.status_idx_ptr =
- &sb->sb.running_index[SM_RX_ID];
+ if (BNX2X_CHIP_IS_E2(cp->chip_id)) {
+ struct host_hc_status_block_e2 *sb = cp->status_blk.gen;
+
+ cp->kcq1.hw_prod_idx_ptr =
+ &sb->sb.index_values[HC_INDEX_ISCSI_EQ_CONS];
+ cp->kcq1.status_idx_ptr =
+ &sb->sb.running_index[SM_RX_ID];
+ } else {
+ struct host_hc_status_block_e1x *sb = cp->status_blk.gen;
+
+ cp->kcq1.hw_prod_idx_ptr =
+ &sb->sb.index_values[HC_INDEX_ISCSI_EQ_CONS];
+ cp->kcq1.status_idx_ptr =
+ &sb->sb.running_index[SM_RX_ID];
+ }
cnic_get_bnx2x_iscsi_info(dev);
@@ -4380,7 +4438,9 @@ static void cnic_init_rings(struct cnic_dev *dev)
cl_qzone_id = BNX2X_CL_QZONE_ID(cp, cli);
off = BAR_USTRORM_INTMEM +
- USTORM_RX_PRODS_E1X_OFFSET(CNIC_PORT(cp), cli);
+ (BNX2X_CHIP_IS_E2(cp->chip_id) ?
+ USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) :
+ USTORM_RX_PRODS_E1X_OFFSET(CNIC_PORT(cp), cli));
for (i = 0; i < sizeof(struct ustorm_eth_rx_producers) / 4; i++)
CNIC_WR(dev, off + i * 4, ((u32 *) &rx_prods)[i]);
@@ -4506,7 +4566,6 @@ static int cnic_start_hw(struct cnic_dev *dev)
return -EALREADY;
dev->regview = ethdev->io_base;
- cp->chip_id = ethdev->chip_id;
pci_dev_get(dev->pcidev);
cp->func = PCI_FUNC(dev->pcidev->devfn);
cp->status_blk.gen = ethdev->irq_arr[0].status_blk;
@@ -4683,6 +4742,7 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev)
cp = cdev->cnic_priv;
cp->ethdev = ethdev;
cdev->pcidev = pdev;
+ cp->chip_id = ethdev->chip_id;
cp->cnic_ops = &cnic_bnx2_ops;
cp->start_hw = cnic_start_bnx2_hw;
@@ -4737,6 +4797,7 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
cp = cdev->cnic_priv;
cp->ethdev = ethdev;
cdev->pcidev = pdev;
+ cp->chip_id = ethdev->chip_id;
cp->cnic_ops = &cnic_bnx2x_ops;
cp->start_hw = cnic_start_bnx2x_hw;
@@ -4748,7 +4809,10 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
cp->stop_cm = cnic_cm_stop_bnx2x_hw;
cp->enable_int = cnic_enable_bnx2x_int;
cp->disable_int_sync = cnic_disable_bnx2x_int_sync;
- cp->ack_int = cnic_ack_bnx2x_msix;
+ if (BNX2X_CHIP_IS_E2(cp->chip_id))
+ cp->ack_int = cnic_ack_bnx2x_e2_msix;
+ else
+ cp->ack_int = cnic_ack_bnx2x_msix;
cp->close_conn = cnic_close_bnx2x_conn;
cp->next_idx = cnic_bnx2x_next_idx;
cp->hw_idx = cnic_bnx2x_hw_idx;
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 928af9e..6a4a0ae 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -372,15 +372,35 @@ struct bnx2x_bd_chain_next {
#define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
#define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
+#define BNX2X_CHIP_NUM_57710 0x164e
#define BNX2X_CHIP_NUM_57711 0x164f
#define BNX2X_CHIP_NUM_57711E 0x1650
+#define BNX2X_CHIP_NUM_57712 0x1662
+#define BNX2X_CHIP_NUM_57712E 0x1663
+#define BNX2X_CHIP_NUM_57713 0x1651
+#define BNX2X_CHIP_NUM_57713E 0x1652
+
#define BNX2X_CHIP_NUM(x) (x >> 16)
+#define BNX2X_CHIP_IS_57710(x) \
+ (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57710)
#define BNX2X_CHIP_IS_57711(x) \
(BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711)
#define BNX2X_CHIP_IS_57711E(x) \
(BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711E)
#define BNX2X_CHIP_IS_E1H(x) \
(BNX2X_CHIP_IS_57711(x) || BNX2X_CHIP_IS_57711E(x))
+#define BNX2X_CHIP_IS_57712(x) \
+ (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57712)
+#define BNX2X_CHIP_IS_57712E(x) \
+ (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57712E)
+#define BNX2X_CHIP_IS_57713(x) \
+ (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57713)
+#define BNX2X_CHIP_IS_57713E(x) \
+ (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57713E)
+#define BNX2X_CHIP_IS_E2(x) \
+ (BNX2X_CHIP_IS_57712(x) || BNX2X_CHIP_IS_57712E(x) || \
+ BNX2X_CHIP_IS_57713(x) || BNX2X_CHIP_IS_57713E(x))
+
#define IS_E1H_OFFSET BNX2X_CHIP_IS_E1H(cp->chip_id)
#define BNX2X_RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))
@@ -409,6 +429,8 @@ struct bnx2x_bd_chain_next {
#define CNIC_PORT(cp) ((cp)->pfid & 1)
#define CNIC_FUNC(cp) ((cp)->func)
+#define CNIC_PATH(cp) (!BNX2X_CHIP_IS_E2(cp->chip_id) ? 0 :\
+ (CNIC_FUNC(cp) & 1))
#define CNIC_E1HVN(cp) ((cp)->pfid >> 1)
#define BNX2X_HW_CID(cp, x) ((CNIC_PORT(cp) << 23) | \
diff --git a/drivers/net/cnic_if.h b/drivers/net/cnic_if.h
index 98ebac5..0dbeaec 100644
--- a/drivers/net/cnic_if.h
+++ b/drivers/net/cnic_if.h
@@ -12,8 +12,8 @@
#ifndef CNIC_IF_H
#define CNIC_IF_H
-#define CNIC_MODULE_VERSION "2.2.5"
-#define CNIC_MODULE_RELDATE "September 29, 2010"
+#define CNIC_MODULE_VERSION "2.2.6"
+#define CNIC_MODULE_RELDATE "Oct 12, 2010"
#define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 5/8 net-next] cnic: Add cnic_free_uio()
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-5-git-send-email-mchan@broadcom.com>
to free all UIO related structures.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index b12bba7..739ffcb 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -770,20 +770,15 @@ static void cnic_free_context(struct cnic_dev *dev)
}
}
-static void cnic_free_resc(struct cnic_dev *dev)
+static void __cnic_free_uio(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
- int i = 0;
- if (cp->cnic_uinfo) {
- while (cp->uio_dev != -1 && i < 15) {
- msleep(100);
- i++;
- }
+ if (cp->cnic_uinfo)
uio_unregister_device(cp->cnic_uinfo);
- kfree(cp->cnic_uinfo);
- cp->cnic_uinfo = NULL;
- }
+
+ kfree(cp->cnic_uinfo);
+ cp->cnic_uinfo = NULL;
if (cp->l2_buf) {
dma_free_coherent(&dev->pcidev->dev, cp->l2_buf_size,
@@ -796,6 +791,28 @@ static void cnic_free_resc(struct cnic_dev *dev)
cp->l2_ring, cp->l2_ring_map);
cp->l2_ring = NULL;
}
+}
+
+static void cnic_free_uio(struct cnic_dev *dev)
+{
+ if (!dev)
+ return;
+
+ __cnic_free_uio(dev);
+}
+
+static void cnic_free_resc(struct cnic_dev *dev)
+{
+ struct cnic_local *cp = dev->cnic_priv;
+ int i = 0;
+
+ if (cp->cnic_uinfo) {
+ while (cp->uio_dev != -1 && i < 15) {
+ msleep(100);
+ i++;
+ }
+ cnic_free_uio(dev);
+ }
cnic_free_context(dev);
kfree(cp->ctx_arr);
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 0/8 net-next] cnic: Bug fixes and 57712 support
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
David, please consider applying these patches to net-next.
Thanks.
^ permalink raw reply
* [PATCH 3/8 net-next] cnic: Add cnic_bnx2x_destroy_ramrod()
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-3-git-send-email-mchan@broadcom.com>
Refactoring code for the next patch to defer connection clean up.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 39 +++++++++++++++++++++++++--------------
1 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 311b2e6..ee66c48 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1708,25 +1708,14 @@ static int cnic_bnx2x_iscsi_update(struct cnic_dev *dev, struct kwqe *kwqe)
return ret;
}
-static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
+static int cnic_bnx2x_destroy_ramrod(struct cnic_dev *dev, u32 l5_cid)
{
struct cnic_local *cp = dev->cnic_priv;
- struct iscsi_kwqe_conn_destroy *req =
- (struct iscsi_kwqe_conn_destroy *) kwqe;
- union l5cm_specific_data l5_data;
- u32 l5_cid = req->reserved0;
struct cnic_context *ctx = &cp->ctx_tbl[l5_cid];
- int ret = 0;
- struct iscsi_kcqe kcqe;
- struct kcqe *cqes[1];
+ union l5cm_specific_data l5_data;
+ int ret;
u32 hw_cid, type;
- if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
- goto skip_cfc_delete;
-
- while (!time_after(jiffies, ctx->timestamp + (2 * HZ)))
- msleep(250);
-
init_waitqueue_head(&ctx->waitq);
ctx->wait_cond = 0;
memset(&l5_data, 0, sizeof(l5_data));
@@ -1742,6 +1731,28 @@ static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
if (ret == 0)
wait_event(ctx->waitq, ctx->wait_cond);
+ return ret;
+}
+
+static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
+{
+ struct cnic_local *cp = dev->cnic_priv;
+ struct iscsi_kwqe_conn_destroy *req =
+ (struct iscsi_kwqe_conn_destroy *) kwqe;
+ u32 l5_cid = req->reserved0;
+ struct cnic_context *ctx = &cp->ctx_tbl[l5_cid];
+ int ret = 0;
+ struct iscsi_kcqe kcqe;
+ struct kcqe *cqes[1];
+
+ if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
+ goto skip_cfc_delete;
+
+ while (!time_after(jiffies, ctx->timestamp + (2 * HZ)))
+ msleep(250);
+
+ ret = cnic_bnx2x_destroy_ramrod(dev, l5_cid);
+
skip_cfc_delete:
cnic_free_bnx2x_conn_resc(dev, l5_cid);
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 2/8 net-next] cnic: Convert ctx_flags to bit fields
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-2-git-send-email-mchan@broadcom.com>
so that we can additional bit definitions without requiring a spinlock.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 4 ++--
drivers/net/cnic.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0fab720..311b2e6 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1721,7 +1721,7 @@ static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
struct kcqe *cqes[1];
u32 hw_cid, type;
- if (!(ctx->ctx_flags & CTX_FL_OFFLD_START))
+ if (!test_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags))
goto skip_cfc_delete;
while (!time_after(jiffies, ctx->timestamp + (2 * HZ)))
@@ -1943,7 +1943,7 @@ static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
ret = cnic_submit_kwqe_16(dev, L5CM_RAMROD_CMD_ID_TCP_CONNECT,
kwqe1->cid, ISCSI_CONNECTION_TYPE, &l5_data);
if (!ret)
- ctx->ctx_flags |= CTX_FL_OFFLD_START;
+ set_bit(CTX_FL_OFFLD_START, &ctx->ctx_flags);
return ret;
}
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 676d008..9907cc2 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -168,8 +168,8 @@ struct cnic_context {
wait_queue_head_t waitq;
int wait_cond;
unsigned long timestamp;
- u32 ctx_flags;
-#define CTX_FL_OFFLD_START 0x00000001
+ unsigned long ctx_flags;
+#define CTX_FL_OFFLD_START 0
u8 ulp_proto_id;
union {
struct cnic_iscsi *iscsi;
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 7/8 net-next] cnic: Decouple uio close from cnic shutdown
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-7-git-send-email-mchan@broadcom.com>
During cnic shutdown, the original driver code requires userspace to
close the uio device within a few seconds. This doesn't always happen
as the userapp may be hung or otherwise take a long time to close. The
system may crash when this happens.
We fix the problem by decoupling the uio structures from the cnic
structures during cnic shutdown. We do not unregister the uio device
until the cnic driver is unloaded. This eliminates the unreliable wait
loop for uio to close.
All uio structures are kept in a linked list. If the device is shutdown
and later brought back up again, the uio strcture will be found in the
linked list and coupled back to the cnic structures.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 56 +++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index e8f2836..3f923a7 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -60,6 +60,7 @@ MODULE_LICENSE("GPL");
MODULE_VERSION(CNIC_MODULE_VERSION);
static LIST_HEAD(cnic_dev_list);
+static LIST_HEAD(cnic_udev_list);
static DEFINE_RWLOCK(cnic_dev_lock);
static DEFINE_MUTEX(cnic_lock);
@@ -101,13 +102,14 @@ static int cnic_uio_open(struct uio_info *uinfo, struct inode *inode)
rtnl_lock();
dev = udev->dev;
- if (!test_bit(CNIC_F_CNIC_UP, &dev->flags)) {
+ if (!dev || !test_bit(CNIC_F_CNIC_UP, &dev->flags)) {
rtnl_unlock();
return -ENODEV;
}
udev->uio_dev = iminor(inode);
+ cnic_shutdown_rings(dev);
cnic_init_rings(dev);
rtnl_unlock();
@@ -117,9 +119,6 @@ static int cnic_uio_open(struct uio_info *uinfo, struct inode *inode)
static int cnic_uio_close(struct uio_info *uinfo, struct inode *inode)
{
struct cnic_uio_dev *udev = uinfo->priv;
- struct cnic_dev *dev = udev->dev;
-
- cnic_shutdown_rings(dev);
udev->uio_dev = -1;
return 0;
@@ -787,6 +786,9 @@ static void __cnic_free_uio(struct cnic_uio_dev *udev)
udev->l2_ring, udev->l2_ring_map);
udev->l2_ring = NULL;
}
+
+ pci_dev_put(udev->pdev);
+ kfree(udev);
}
static void cnic_free_uio(struct cnic_uio_dev *udev)
@@ -794,6 +796,9 @@ static void cnic_free_uio(struct cnic_uio_dev *udev)
if (!udev)
return;
+ write_lock(&cnic_dev_lock);
+ list_del_init(&udev->list);
+ write_unlock(&cnic_dev_lock);
__cnic_free_uio(udev);
}
@@ -801,14 +806,9 @@ static void cnic_free_resc(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
struct cnic_uio_dev *udev = cp->udev;
- int i = 0;
if (udev) {
- while (udev->uio_dev != -1 && i < 15) {
- msleep(100);
- i++;
- }
- cnic_free_uio(udev);
+ udev->dev = NULL;
cp->udev = NULL;
}
@@ -916,6 +916,17 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
struct cnic_local *cp = dev->cnic_priv;
struct cnic_uio_dev *udev;
+ read_lock(&cnic_dev_lock);
+ list_for_each_entry(udev, &cnic_udev_list, list) {
+ if (udev->pdev == dev->pcidev) {
+ udev->dev = dev;
+ cp->udev = udev;
+ read_unlock(&cnic_dev_lock);
+ return 0;
+ }
+ }
+ read_unlock(&cnic_dev_lock);
+
udev = kzalloc(sizeof(struct cnic_uio_dev), GFP_ATOMIC);
if (!udev)
return -ENOMEM;
@@ -939,6 +950,12 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages)
if (!udev->l2_buf)
return -ENOMEM;
+ write_lock(&cnic_dev_lock);
+ list_add(&udev->list, &cnic_udev_list);
+ write_unlock(&cnic_dev_lock);
+
+ pci_dev_get(udev->pdev);
+
cp->udev = udev;
return 0;
@@ -954,8 +971,6 @@ static int cnic_init_uio(struct cnic_dev *dev)
if (!udev)
return -ENOMEM;
- udev->uio_dev = -1;
-
uinfo = &udev->cnic_uinfo;
uinfo->mem[0].addr = dev->netdev->base_addr;
@@ -996,9 +1011,15 @@ static int cnic_init_uio(struct cnic_dev *dev)
uinfo->open = cnic_uio_open;
uinfo->release = cnic_uio_close;
- uinfo->priv = udev;
+ if (udev->uio_dev == -1) {
+ if (!uinfo->priv) {
+ uinfo->priv = udev;
- ret = uio_register_device(&udev->pdev->dev, uinfo);
+ ret = uio_register_device(&udev->pdev->dev, uinfo);
+ }
+ } else {
+ cnic_init_rings(dev);
+ }
return ret;
}
@@ -4559,6 +4580,7 @@ static void cnic_stop_hw(struct cnic_dev *dev)
msleep(100);
i++;
}
+ cnic_shutdown_rings(dev);
clear_bit(CNIC_F_CNIC_UP, &dev->flags);
rcu_assign_pointer(cp->ulp_ops[CNIC_ULP_L4], NULL);
synchronize_rcu();
@@ -4834,6 +4856,7 @@ static struct notifier_block cnic_netdev_notifier = {
static void cnic_release(void)
{
struct cnic_dev *dev;
+ struct cnic_uio_dev *udev;
while (!list_empty(&cnic_dev_list)) {
dev = list_entry(cnic_dev_list.next, struct cnic_dev, list);
@@ -4847,6 +4870,11 @@ static void cnic_release(void)
list_del_init(&dev->list);
cnic_free_dev(dev);
}
+ while (!list_empty(&cnic_udev_list)) {
+ udev = list_entry(cnic_udev_list.next, struct cnic_uio_dev,
+ list);
+ cnic_free_uio(udev);
+ }
}
static int __init cnic_init(void)
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH 1/8 net-next] cnic: Add common cnic_request_irq()
From: Michael Chan @ 2010-10-14 0:06 UTC (permalink / raw)
To: davem; +Cc: netdev
In-Reply-To: <1287014811-10979-1-git-send-email-mchan@broadcom.com>
to reduce some duplicate code. Also, use tasklet_kill() in
cnic_free_irq() to wait for the cnic_irq_task to complete.
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/cnic.c | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 27449bf..0fab720 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3428,11 +3428,24 @@ static void cnic_free_irq(struct cnic_dev *dev)
if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) {
cp->disable_int_sync(dev);
- tasklet_disable(&cp->cnic_irq_task);
+ tasklet_kill(&cp->cnic_irq_task);
free_irq(ethdev->irq_arr[0].vector, dev);
}
}
+static int cnic_request_irq(struct cnic_dev *dev)
+{
+ struct cnic_local *cp = dev->cnic_priv;
+ struct cnic_eth_dev *ethdev = cp->ethdev;
+ int err;
+
+ err = request_irq(ethdev->irq_arr[0].vector, cnic_irq, 0, "cnic", dev);
+ if (err)
+ tasklet_disable(&cp->cnic_irq_task);
+
+ return err;
+}
+
static int cnic_init_bnx2_irq(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
@@ -3453,12 +3466,10 @@ static int cnic_init_bnx2_irq(struct cnic_dev *dev)
cp->last_status_idx = cp->status_blk.bnx2->status_idx;
tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2_msix,
(unsigned long) dev);
- err = request_irq(ethdev->irq_arr[0].vector, cnic_irq, 0,
- "cnic", dev);
- if (err) {
- tasklet_disable(&cp->cnic_irq_task);
+ err = cnic_request_irq(dev);
+ if (err)
return err;
- }
+
while (cp->status_blk.bnx2->status_completion_producer_index &&
i < 10) {
CNIC_WR(dev, BNX2_HC_COALESCE_NOW,
@@ -3860,12 +3871,9 @@ static int cnic_init_bnx2x_irq(struct cnic_dev *dev)
tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2x_bh,
(unsigned long) dev);
- if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) {
- err = request_irq(ethdev->irq_arr[0].vector, cnic_irq, 0,
- "cnic", dev);
- if (err)
- tasklet_disable(&cp->cnic_irq_task);
- }
+ if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
+ err = cnic_request_irq(dev);
+
return err;
}
--
1.6.4.GIT
^ permalink raw reply related
* [PATCH net-next 2/2] stmmac: make function tables const
From: Stephen Hemminger @ 2010-10-14 0:51 UTC (permalink / raw)
To: David Miller, Giuseppe Cavallaro, Deepak SIKRI; +Cc: netdev
In-Reply-To: <20101013175031.41c29349@nehalam>
These tables only contain function pointers.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/stmmac/common.h | 6 +++---
drivers/net/stmmac/dwmac100.h | 2 +-
drivers/net/stmmac/dwmac1000.h | 2 +-
drivers/net/stmmac/dwmac1000_core.c | 2 +-
drivers/net/stmmac/dwmac1000_dma.c | 2 +-
drivers/net/stmmac/dwmac100_core.c | 2 +-
drivers/net/stmmac/dwmac100_dma.c | 2 +-
drivers/net/stmmac/enh_desc.c | 2 +-
drivers/net/stmmac/norm_desc.c | 2 +-
drivers/net/stmmac/stmmac.h | 4 ++--
10 files changed, 13 insertions(+), 13 deletions(-)
--- a/drivers/net/stmmac/common.h 2010-10-13 17:42:30.599219840 -0700
+++ b/drivers/net/stmmac/common.h 2010-10-13 17:43:28.068306957 -0700
@@ -235,9 +235,9 @@ struct mii_regs {
};
struct mac_device_info {
- struct stmmac_ops *mac;
- struct stmmac_desc_ops *desc;
- struct stmmac_dma_ops *dma;
+ const struct stmmac_ops *mac;
+ const struct stmmac_desc_ops *desc;
+ const struct stmmac_dma_ops *dma;
struct mii_regs mii; /* MII register Addresses */
struct mac_link link;
};
--- a/drivers/net/stmmac/dwmac1000_core.c 2010-10-13 17:42:30.615217915 -0700
+++ b/drivers/net/stmmac/dwmac1000_core.c 2010-10-13 17:43:05.115068037 -0700
@@ -212,7 +212,7 @@ static void dwmac1000_irq_status(void __
}
}
-struct stmmac_ops dwmac1000_ops = {
+static const struct stmmac_ops dwmac1000_ops = {
.core_init = dwmac1000_core_init,
.rx_coe = dwmac1000_rx_coe_supported,
.dump_regs = dwmac1000_dump_regs,
--- a/drivers/net/stmmac/dwmac1000_dma.c 2010-10-13 17:44:34.880269557 -0700
+++ b/drivers/net/stmmac/dwmac1000_dma.c 2010-10-13 17:45:54.670669930 -0700
@@ -138,7 +138,7 @@ static void dwmac1000_dump_dma_regs(void
}
}
-struct stmmac_dma_ops dwmac1000_dma_ops = {
+const struct stmmac_dma_ops dwmac1000_dma_ops = {
.init = dwmac1000_dma_init,
.dump_regs = dwmac1000_dump_dma_regs,
.dma_mode = dwmac1000_dma_operation_mode,
--- a/drivers/net/stmmac/dwmac100_core.c 2010-10-13 17:42:30.631215991 -0700
+++ b/drivers/net/stmmac/dwmac100_core.c 2010-10-13 17:42:45.377442238 -0700
@@ -168,7 +168,7 @@ static void dwmac100_pmt(void __iomem *i
return;
}
-struct stmmac_ops dwmac100_ops = {
+static const struct stmmac_ops dwmac100_ops = {
.core_init = dwmac100_core_init,
.rx_coe = dwmac100_rx_coe_supported,
.dump_regs = dwmac100_dump_mac_regs,
--- a/drivers/net/stmmac/dwmac100_dma.c 2010-10-13 17:44:45.351009875 -0700
+++ b/drivers/net/stmmac/dwmac100_dma.c 2010-10-13 17:45:26.334079236 -0700
@@ -126,7 +126,7 @@ static void dwmac100_dma_diagnostic_fr(v
}
}
-struct stmmac_dma_ops dwmac100_dma_ops = {
+const struct stmmac_dma_ops dwmac100_dma_ops = {
.init = dwmac100_dma_init,
.dump_regs = dwmac100_dump_dma_regs,
.dma_mode = dwmac100_dma_operation_mode,
--- a/drivers/net/stmmac/enh_desc.c 2010-10-13 17:43:40.150853494 -0700
+++ b/drivers/net/stmmac/enh_desc.c 2010-10-13 17:46:25.390973687 -0700
@@ -318,7 +318,7 @@ static int enh_desc_get_rx_frame_len(str
return p->des01.erx.frame_length;
}
-struct stmmac_desc_ops enh_desc_ops = {
+const struct stmmac_desc_ops enh_desc_ops = {
.tx_status = enh_desc_get_tx_status,
.rx_status = enh_desc_get_rx_status,
.get_tx_len = enh_desc_get_tx_len,
--- a/drivers/net/stmmac/norm_desc.c 2010-10-13 17:44:05.363820440 -0700
+++ b/drivers/net/stmmac/norm_desc.c 2010-10-13 17:46:28.978542024 -0700
@@ -202,7 +202,7 @@ static int ndesc_get_rx_frame_len(struct
return p->des01.rx.frame_length;
}
-struct stmmac_desc_ops ndesc_ops = {
+const struct stmmac_desc_ops ndesc_ops = {
.tx_status = ndesc_get_tx_status,
.rx_status = ndesc_get_rx_status,
.get_tx_len = ndesc_get_tx_len,
--- a/drivers/net/stmmac/dwmac100.h 2010-10-13 17:47:08.289811886 -0700
+++ b/drivers/net/stmmac/dwmac100.h 2010-10-13 17:47:14.477067381 -0700
@@ -118,4 +118,4 @@ enum ttc_control {
#define DMA_MISSED_FRAME_OVE_M 0x00010000 /* Missed Frame Overflow */
#define DMA_MISSED_FRAME_M_CNTR 0x0000ffff /* Missed Frame Couinter */
-extern struct stmmac_dma_ops dwmac100_dma_ops;
+extern const struct stmmac_dma_ops dwmac100_dma_ops;
--- a/drivers/net/stmmac/dwmac1000.h 2010-10-13 17:46:53.607578558 -0700
+++ b/drivers/net/stmmac/dwmac1000.h 2010-10-13 17:46:59.630853799 -0700
@@ -205,4 +205,4 @@ enum rtc_control {
#define GMAC_MMC_TX_INTR 0x108
#define GMAC_MMC_RX_CSUM_OFFLOAD 0x208
-extern struct stmmac_dma_ops dwmac1000_dma_ops;
+extern const struct stmmac_dma_ops dwmac1000_dma_ops;
--- a/drivers/net/stmmac/stmmac.h 2010-10-13 17:47:30.415149545 -0700
+++ b/drivers/net/stmmac/stmmac.h 2010-10-13 17:47:40.497936258 -0700
@@ -121,5 +121,5 @@ static inline int stmmac_claim_resource(
extern int stmmac_mdio_unregister(struct net_device *ndev);
extern int stmmac_mdio_register(struct net_device *ndev);
extern void stmmac_set_ethtool_ops(struct net_device *netdev);
-extern struct stmmac_desc_ops enh_desc_ops;
-extern struct stmmac_desc_ops ndesc_ops;
+extern const struct stmmac_desc_ops enh_desc_ops;
+extern const struct stmmac_desc_ops ndesc_ops;
^ permalink raw reply
* [PATCH net-next 1/2]: stmmac: make ethtool functions local
From: Stephen Hemminger @ 2010-10-14 0:50 UTC (permalink / raw)
To: David Miller, Giuseppe Cavallaro, Deepak SIKRI; +Cc: netdev
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/stmmac/stmmac_ethtool.c 2010-10-13 17:39:03.228159654 -0700
+++ b/drivers/net/stmmac/stmmac_ethtool.c 2010-10-13 17:41:07.317236754 -0700
@@ -89,8 +89,8 @@ static const struct stmmac_stats stmmac
};
#define STMMAC_STATS_LEN ARRAY_SIZE(stmmac_gstrings_stats)
-void stmmac_ethtool_getdrvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
+static void stmmac_ethtool_getdrvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
{
struct stmmac_priv *priv = netdev_priv(dev);
@@ -104,7 +104,8 @@ void stmmac_ethtool_getdrvinfo(struct ne
info->n_stats = STMMAC_STATS_LEN;
}
-int stmmac_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int stmmac_ethtool_getsettings(struct net_device *dev,
+ struct ethtool_cmd *cmd)
{
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phy = priv->phydev;
@@ -126,7 +127,8 @@ int stmmac_ethtool_getsettings(struct ne
return rc;
}
-int stmmac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int stmmac_ethtool_setsettings(struct net_device *dev,
+ struct ethtool_cmd *cmd)
{
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phy = priv->phydev;
@@ -139,32 +141,32 @@ int stmmac_ethtool_setsettings(struct ne
return rc;
}
-u32 stmmac_ethtool_getmsglevel(struct net_device *dev)
+static u32 stmmac_ethtool_getmsglevel(struct net_device *dev)
{
struct stmmac_priv *priv = netdev_priv(dev);
return priv->msg_enable;
}
-void stmmac_ethtool_setmsglevel(struct net_device *dev, u32 level)
+static void stmmac_ethtool_setmsglevel(struct net_device *dev, u32 level)
{
struct stmmac_priv *priv = netdev_priv(dev);
priv->msg_enable = level;
}
-int stmmac_check_if_running(struct net_device *dev)
+static int stmmac_check_if_running(struct net_device *dev)
{
if (!netif_running(dev))
return -EBUSY;
return 0;
}
-int stmmac_ethtool_get_regs_len(struct net_device *dev)
+static int stmmac_ethtool_get_regs_len(struct net_device *dev)
{
return REG_SPACE_SIZE;
}
-void stmmac_ethtool_gregs(struct net_device *dev,
+static void stmmac_ethtool_gregs(struct net_device *dev,
struct ethtool_regs *regs, void *space)
{
int i;
@@ -195,7 +197,7 @@ void stmmac_ethtool_gregs(struct net_dev
}
}
-int stmmac_ethtool_set_tx_csum(struct net_device *netdev, u32 data)
+static int stmmac_ethtool_set_tx_csum(struct net_device *netdev, u32 data)
{
if (data)
netdev->features |= NETIF_F_HW_CSUM;
@@ -205,7 +207,7 @@ int stmmac_ethtool_set_tx_csum(struct ne
return 0;
}
-u32 stmmac_ethtool_get_rx_csum(struct net_device *dev)
+static u32 stmmac_ethtool_get_rx_csum(struct net_device *dev)
{
struct stmmac_priv *priv = netdev_priv(dev);
^ permalink raw reply
* Re: [PATCH net-next] tipc: cleanup function namespace
From: Stephen Hemminger @ 2010-10-14 0:32 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: David Miller, nhorman, netdev, allan.stephens
In-Reply-To: <4CB64D7C.1080004@windriver.com>
On Wed, 13 Oct 2010 20:23:24 -0400
Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> On 10-10-13 07:20 PM, Stephen Hemminger wrote:
> > Do some cleanups of TIPC based on make namespacecheck
> > 1. Don't export unused symbols
> > 2. Eliminate dead code
> > 3. Make functions and variables local
> > 4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
> >
> > Compile tested only.
> > This make break out of tree kernel modules that depend on TIPC routines.
>
> Hi Stephen,
>
> When I first started looking at TIPC code, I too came to the
> same conclusion as you did and was about to do #1,2,3 -- but
> then I was told that the exported symbols were part of an API
> and might be in use by folks here and there as per this thread:
>
> http://www.mail-archive.com/netdev@vger.kernel.org/msg30208.html
>
> I'm generally the 1st one to agree that the kernel should not
> be libc, and that exporting all sorts of functions without a
> clearly defined use case so that one can insert all sorts of
> brewed up modules is *not* the way to go -- and was asking if
> we could phase this API out if nobody was using it:
>
> http://sourceforge.net/mailarchive/message.php?msg_name=29C1DC0826876849BDD9F1C67ABA294308C1FEB6%40ala-mail09.corp.ad.wrs.com
>
> ...but apparently there are a couple of API users out there.
>
> I'd like to better understand their use case(es) and what parts
> of this API they use, but I haven't got that far yet, since
> there are a bunch of other TIPC bugfixes and changes queued on
> sourceforge which need cleaning and integration into mainline.
>
> I was thinking one idea would be to wrap them in a TIPC specific
> Kconfig (off by default) so that it would at least highlight
> this atypical use case for EXPORT_SYMBOL -- which might help
> bring these users to the surface so we can learn about their
> use cases. Having it as a Kconfig option would also help in
> giving us something to point our finger at for the feature
> removal file, if indeed we could find a better way for these
> users to get done whatever it is that they are doing.
>
> In any event, I think your #2 (dead code) and #3 (add static)
> are items considered dead or candidates for static because
> of #1, i.e. tossing the API exports out.
>
> I've already tossed out the explicitly dead code in #if 0
> blocks -- Dave just merged that today. But the #4 from your
> list seems to make sense, and we can do that as a standalone
> item of course.
>
> Thanks,
> Paul.
>
> >
> > Signed-off-by: Stephen Hemminger<shemminger@vyatta.com>
> >
The kernel is does not have or support API's just for out
of tree code. Any code that needs the API should be submitted for
inclusion or risks getting broken at any time!
^ permalink raw reply
* Re: [PATCH RFC] tun: dma engine support
From: Dan Williams @ 2010-10-14 0:27 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Linus Walleij, Anatolij Gustschin, Magnus Damm, Andrew Morton,
Tejun Heo, David S. Miller, Herbert Xu, Eric Dumazet, Joe Perches,
linux-kernel, netdev, kvm, Sosnowski, Maciej
In-Reply-To: <20101011205208.GA8527@redhat.com>
[ added Maciej ]
On Mon, Oct 11, 2010 at 1:52 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> Simple hack to use dma engine for tun RX.
> Only one skb in flight at the moment.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
> I am still looking at handling multiple skbs, but
> sending this out for early flames and improvement suggestions.
>
> Loopback testing seems to show only minor performance gains:
> this is not really suprising as data is hot in cache already.
> Where I would expect this to help more is with incoming
> traffic from an external NIC. This still needs to be tested.
Actually it is interesting that you did not see a performance loss
because the dma performs the transfer in memory so the destination
will be cache cold in the dma case compared to a cpu copy.
[..]
> +int tun_dma_copybreak = 0x10000;
> +module_param_named(dma_copybreak, tun_dma_copybreak, int, 0644);
What platform are you using for testing? If this proves beneficial we
may need to adjust this value to have a platform specific default,
similar to how ioatdma sets tcp_dma_copybreak depending on the
hardware version. You will notice that on Nehalem class hardware
(drivers/dma/ioat/dma_v3.c) the default is set to 256K effectively
disabling offload as the overhead of managing the dma engine
overshadows any offload advantage.
--
Dan
^ permalink raw reply
* Re: [PATCH net-next] tipc: cleanup function namespace
From: Paul Gortmaker @ 2010-10-14 0:23 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, nhorman, netdev, allan.stephens
In-Reply-To: <20101013162035.0c2e8123@nehalam>
On 10-10-13 07:20 PM, Stephen Hemminger wrote:
> Do some cleanups of TIPC based on make namespacecheck
> 1. Don't export unused symbols
> 2. Eliminate dead code
> 3. Make functions and variables local
> 4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
>
> Compile tested only.
> This make break out of tree kernel modules that depend on TIPC routines.
Hi Stephen,
When I first started looking at TIPC code, I too came to the
same conclusion as you did and was about to do #1,2,3 -- but
then I was told that the exported symbols were part of an API
and might be in use by folks here and there as per this thread:
http://www.mail-archive.com/netdev@vger.kernel.org/msg30208.html
I'm generally the 1st one to agree that the kernel should not
be libc, and that exporting all sorts of functions without a
clearly defined use case so that one can insert all sorts of
brewed up modules is *not* the way to go -- and was asking if
we could phase this API out if nobody was using it:
http://sourceforge.net/mailarchive/message.php?msg_name=29C1DC0826876849BDD9F1C67ABA294308C1FEB6%40ala-mail09.corp.ad.wrs.com
...but apparently there are a couple of API users out there.
I'd like to better understand their use case(es) and what parts
of this API they use, but I haven't got that far yet, since
there are a bunch of other TIPC bugfixes and changes queued on
sourceforge which need cleaning and integration into mainline.
I was thinking one idea would be to wrap them in a TIPC specific
Kconfig (off by default) so that it would at least highlight
this atypical use case for EXPORT_SYMBOL -- which might help
bring these users to the surface so we can learn about their
use cases. Having it as a Kconfig option would also help in
giving us something to point our finger at for the feature
removal file, if indeed we could find a better way for these
users to get done whatever it is that they are doing.
In any event, I think your #2 (dead code) and #3 (add static)
are items considered dead or candidates for static because
of #1, i.e. tossing the API exports out.
I've already tossed out the explicitly dead code in #if 0
blocks -- Dave just merged that today. But the #4 from your
list seems to make sense, and we can do that as a standalone
item of course.
Thanks,
Paul.
>
> Signed-off-by: Stephen Hemminger<shemminger@vyatta.com>
>
> ---
> include/net/tipc/tipc.h | 71 -------------
> include/net/tipc/tipc_port.h | 2
> net/tipc/addr.c | 5
> net/tipc/bcast.c | 10 +
> net/tipc/bcast.h | 3
> net/tipc/cluster.c | 21 ---
> net/tipc/cluster.h | 2
> net/tipc/config.c | 7 +
> net/tipc/config.h | 6 -
> net/tipc/core.c | 28 +----
> net/tipc/core.h | 9 -
> net/tipc/dbg.c | 13 +-
> net/tipc/dbg.h | 3
> net/tipc/discover.c | 16 --
> net/tipc/discover.h | 2
> net/tipc/link.c | 45 ++++----
> net/tipc/link.h | 4
> net/tipc/msg.c | 2
> net/tipc/name_distr.c | 2
> net/tipc/node.c | 19 ---
> net/tipc/node.h | 1
> net/tipc/port.c | 234 ++++---------------------------------------
> net/tipc/port.h | 2
> net/tipc/ref.c | 17 ---
> net/tipc/ref.h | 1
> net/tipc/subscr.c | 9 -
> net/tipc/zone.c | 11 --
> net/tipc/zone.h | 1
> 28 files changed, 84 insertions(+), 462 deletions(-)
>
> --- a/include/net/tipc/tipc.h 2010-10-13 15:43:50.025580173 -0700
> +++ b/include/net/tipc/tipc.h 2010-10-13 16:14:33.731207018 -0700
> @@ -50,8 +50,6 @@
> * TIPC operating mode routines
> */
>
> -u32 tipc_get_addr(void);
> -
> #define TIPC_NOT_RUNNING 0
> #define TIPC_NODE_MODE 1
> #define TIPC_NET_MODE 2
> @@ -62,8 +60,6 @@ int tipc_attach(unsigned int *userref, t
>
> void tipc_detach(unsigned int userref);
>
> -int tipc_get_mode(void);
> -
> /*
> * TIPC port manipulation routines
> */
> @@ -153,12 +149,6 @@ int tipc_disconnect(u32 portref);
>
> int tipc_shutdown(u32 ref);
>
> -int tipc_isconnected(u32 portref, int *isconnected);
> -
> -int tipc_peer(u32 portref, struct tipc_portid *peer);
> -
> -int tipc_ref_valid(u32 portref);
> -
> /*
> * TIPC messaging routines
> */
> @@ -170,38 +160,12 @@ int tipc_send(u32 portref,
> unsigned int num_sect,
> struct iovec const *msg_sect);
>
> -int tipc_send_buf(u32 portref,
> - struct sk_buff *buf,
> - unsigned int dsz);
> -
> int tipc_send2name(u32 portref,
> struct tipc_name const *name,
> u32 domain,
> unsigned int num_sect,
> struct iovec const *msg_sect);
>
> -int tipc_send_buf2name(u32 portref,
> - struct tipc_name const *name,
> - u32 domain,
> - struct sk_buff *buf,
> - unsigned int dsz);
> -
> -int tipc_forward2name(u32 portref,
> - struct tipc_name const *name,
> - u32 domain,
> - unsigned int section_count,
> - struct iovec const *msg_sect,
> - struct tipc_portid const *origin,
> - unsigned int importance);
> -
> -int tipc_forward_buf2name(u32 portref,
> - struct tipc_name const *name,
> - u32 domain,
> - struct sk_buff *buf,
> - unsigned int dsz,
> - struct tipc_portid const *orig,
> - unsigned int importance);
> -
> int tipc_send2port(u32 portref,
> struct tipc_portid const *dest,
> unsigned int num_sect,
> @@ -212,46 +176,11 @@ int tipc_send_buf2port(u32 portref,
> struct sk_buff *buf,
> unsigned int dsz);
>
> -int tipc_forward2port(u32 portref,
> - struct tipc_portid const *dest,
> - unsigned int num_sect,
> - struct iovec const *msg_sect,
> - struct tipc_portid const *origin,
> - unsigned int importance);
> -
> -int tipc_forward_buf2port(u32 portref,
> - struct tipc_portid const *dest,
> - struct sk_buff *buf,
> - unsigned int dsz,
> - struct tipc_portid const *orig,
> - unsigned int importance);
> -
> int tipc_multicast(u32 portref,
> struct tipc_name_seq const *seq,
> u32 domain, /* currently unused */
> unsigned int section_count,
> struct iovec const *msg);
> -
> -#if 0
> -int tipc_multicast_buf(u32 portref,
> - struct tipc_name_seq const *seq,
> - u32 domain,
> - void *buf,
> - unsigned int size);
> -#endif
> -
> -/*
> - * TIPC subscription routines
> - */
> -
> -int tipc_ispublished(struct tipc_name const *name);
> -
> -/*
> - * Get number of available nodes within specified domain (excluding own node)
> - */
> -
> -unsigned int tipc_available_nodes(const u32 domain);
> -
> #endif
>
> #endif
> --- a/net/tipc/bcast.c 2010-10-13 15:34:09.359325773 -0700
> +++ b/net/tipc/bcast.c 2010-10-13 15:58:43.362005611 -0700
> @@ -121,6 +121,9 @@ static DEFINE_SPINLOCK(bc_lock);
>
> const char tipc_bclink_name[] = "broadcast-link";
>
> +static void tipc_nmap_diff(struct tipc_node_map *nm_a,
> + struct tipc_node_map *nm_b,
> + struct tipc_node_map *nm_diff);
>
> static u32 buf_seqno(struct sk_buff *buf)
> {
> @@ -287,7 +290,7 @@ static void bclink_send_nack(struct tipc
> if (!less(n_ptr->bclink.gap_after, n_ptr->bclink.gap_to))
> return;
>
> - buf = buf_acquire(INT_H_SIZE);
> + buf = tipc_buf_acquire(INT_H_SIZE);
> if (buf) {
> msg = buf_msg(buf);
> tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG,
> @@ -871,8 +874,9 @@ void tipc_nmap_remove(struct tipc_node_m
> * @nm_diff: output node map A-B (i.e. nodes of A that are not in B)
> */
>
> -void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
> - struct tipc_node_map *nm_diff)
> +static void tipc_nmap_diff(struct tipc_node_map *nm_a,
> + struct tipc_node_map *nm_b,
> + struct tipc_node_map *nm_diff)
> {
> int stop = ARRAY_SIZE(nm_a->map);
> int w;
> --- a/net/tipc/bcast.h 2010-10-13 15:34:39.167747046 -0700
> +++ b/net/tipc/bcast.h 2010-10-13 15:42:10.321560582 -0700
> @@ -84,9 +84,6 @@ static inline int tipc_nmap_equal(struct
> return !memcmp(nm_a, nm_b, sizeof(*nm_a));
> }
>
> -void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
> - struct tipc_node_map *nm_diff);
> -
> void tipc_port_list_add(struct port_list *pl_ptr, u32 port);
> void tipc_port_list_free(struct port_list *pl_ptr);
>
> --- a/net/tipc/cluster.c 2010-10-13 15:44:43.583143953 -0700
> +++ b/net/tipc/cluster.c 2010-10-13 16:03:22.148331782 -0700
> @@ -113,25 +113,6 @@ void tipc_cltr_delete(struct cluster *c_
> kfree(c_ptr);
> }
>
> -u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
> -{
> - struct tipc_node *n_ptr;
> - u32 n_num = tipc_node(addr) + 1;
> -
> - if (!c_ptr)
> - return addr;
> - for (; n_num<= c_ptr->highest_node; n_num++) {
> - n_ptr = c_ptr->nodes[n_num];
> - if (n_ptr&& tipc_node_has_active_links(n_ptr))
> - return n_ptr->addr;
> - }
> - for (n_num = 1; n_num< tipc_node(addr); n_num++) {
> - n_ptr = c_ptr->nodes[n_num];
> - if (n_ptr&& tipc_node_has_active_links(n_ptr))
> - return n_ptr->addr;
> - }
> - return 0;
> -}
>
> void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
> {
> @@ -232,7 +213,7 @@ struct tipc_node *tipc_cltr_select_node(
> static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest)
> {
> u32 size = INT_H_SIZE + data_size;
> - struct sk_buff *buf = buf_acquire(size);
> + struct sk_buff *buf = tipc_buf_acquire(size);
> struct tipc_msg *msg;
>
> if (buf) {
> --- a/net/tipc/config.c 2010-10-13 15:35:16.359281659 -0700
> +++ b/net/tipc/config.c 2010-10-13 16:07:20.471544155 -0700
> @@ -95,7 +95,7 @@ int tipc_cfg_append_tlv(struct sk_buff *
> return 1;
> }
>
> -struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
> +static struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
> {
> struct sk_buff *buf;
> __be32 value_net;
> @@ -109,6 +109,11 @@ struct sk_buff *tipc_cfg_reply_unsigned_
> return buf;
> }
>
> +static struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
> +{
> + return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
> +}
> +
> struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
> {
> struct sk_buff *buf;
> --- a/net/tipc/config.h 2010-10-13 15:43:36.031261839 -0700
> +++ b/net/tipc/config.h 2010-10-13 15:49:35.868009966 -0700
> @@ -45,7 +45,6 @@
> struct sk_buff *tipc_cfg_reply_alloc(int payload_size);
> int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
> void *tlv_data, int tlv_data_size);
> -struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value);
> struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string);
>
> static inline struct sk_buff *tipc_cfg_reply_none(void)
> @@ -53,11 +52,6 @@ static inline struct sk_buff *tipc_cfg_r
> return tipc_cfg_reply_alloc(0);
> }
>
> -static inline struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
> -{
> - return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
> -}
> -
> static inline struct sk_buff *tipc_cfg_reply_error_string(char *string)
> {
> return tipc_cfg_reply_string_type(TIPC_TLV_ERROR_STRING, string);
> --- a/net/tipc/core.c 2010-10-13 15:32:35.750562985 -0700
> +++ b/net/tipc/core.c 2010-10-13 16:00:58.197719377 -0700
> @@ -96,13 +96,13 @@ int tipc_net_id;
> int tipc_remote_management;
>
>
> -int tipc_get_mode(void)
> +static int tipc_get_mode(void)
> {
> return tipc_mode;
> }
>
> /**
> - * buf_acquire - creates a TIPC message buffer
> + * tipc_buf_acquire - creates a TIPC message buffer
> * @size: message size (including TIPC header)
> *
> * Returns a new buffer with data pointers set to the specified size.
> @@ -111,7 +111,7 @@ int tipc_get_mode(void)
> * There may also be unrequested tailroom present at the buffer's end.
> */
>
> -struct sk_buff *buf_acquire(u32 size)
> +struct sk_buff *tipc_buf_acquire(u32 size)
> {
> struct sk_buff *skb;
> unsigned int buf_size = (BUF_HEADROOM + size + 3)& ~3u;
> @@ -129,7 +129,7 @@ struct sk_buff *buf_acquire(u32 size)
> * tipc_core_stop_net - shut down TIPC networking sub-systems
> */
>
> -void tipc_core_stop_net(void)
> +static void tipc_core_stop_net(void)
> {
> tipc_eth_media_stop();
> tipc_net_stop();
> @@ -154,7 +154,7 @@ int tipc_core_start_net(unsigned long ad
> * tipc_core_stop - switch TIPC from SINGLE NODE to NOT RUNNING mode
> */
>
> -void tipc_core_stop(void)
> +static void tipc_core_stop(void)
> {
> if (tipc_mode != TIPC_NODE_MODE)
> return;
> @@ -176,7 +176,7 @@ void tipc_core_stop(void)
> * tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode
> */
>
> -int tipc_core_start(void)
> +static int tipc_core_start(void)
> {
> int res;
>
> @@ -246,7 +246,6 @@ MODULE_VERSION(TIPC_MOD_VER);
>
> EXPORT_SYMBOL(tipc_attach);
> EXPORT_SYMBOL(tipc_detach);
> -EXPORT_SYMBOL(tipc_get_addr);
> EXPORT_SYMBOL(tipc_get_mode);
> EXPORT_SYMBOL(tipc_createport);
> EXPORT_SYMBOL(tipc_deleteport);
> @@ -262,23 +261,10 @@ EXPORT_SYMBOL(tipc_withdraw);
> EXPORT_SYMBOL(tipc_connect2port);
> EXPORT_SYMBOL(tipc_disconnect);
> EXPORT_SYMBOL(tipc_shutdown);
> -EXPORT_SYMBOL(tipc_isconnected);
> -EXPORT_SYMBOL(tipc_peer);
> -EXPORT_SYMBOL(tipc_ref_valid);
> EXPORT_SYMBOL(tipc_send);
> -EXPORT_SYMBOL(tipc_send_buf);
> EXPORT_SYMBOL(tipc_send2name);
> -EXPORT_SYMBOL(tipc_forward2name);
> -EXPORT_SYMBOL(tipc_send_buf2name);
> -EXPORT_SYMBOL(tipc_forward_buf2name);
> EXPORT_SYMBOL(tipc_send2port);
> -EXPORT_SYMBOL(tipc_forward2port);
> -EXPORT_SYMBOL(tipc_send_buf2port);
> -EXPORT_SYMBOL(tipc_forward_buf2port);
> EXPORT_SYMBOL(tipc_multicast);
> -/* EXPORT_SYMBOL(tipc_multicast_buf); not available yet */
> -EXPORT_SYMBOL(tipc_ispublished);
> -EXPORT_SYMBOL(tipc_available_nodes);
>
> /* TIPC API for external bearers (see tipc_bearer.h) */
>
> @@ -295,6 +281,4 @@ EXPORT_SYMBOL(tipc_createport_raw);
> EXPORT_SYMBOL(tipc_reject_msg);
> EXPORT_SYMBOL(tipc_send_buf_fast);
> EXPORT_SYMBOL(tipc_acknowledge);
> -EXPORT_SYMBOL(tipc_get_port);
> -EXPORT_SYMBOL(tipc_get_handle);
>
> --- a/net/tipc/core.h 2010-10-13 15:36:36.237690119 -0700
> +++ b/net/tipc/core.h 2010-10-13 16:07:56.727164658 -0700
> @@ -83,9 +83,7 @@
> * Note: TIPC_LOG is configured to echo its output to the system console;
> * user-defined buffers can be configured to do the same thing.
> */
> -
> extern struct print_buf *const TIPC_NULL;
> -extern struct print_buf *const TIPC_CONS;
> extern struct print_buf *const TIPC_LOG;
>
> void tipc_printf(struct print_buf *, const char *fmt, ...);
> @@ -204,10 +202,7 @@ extern atomic_t tipc_user_count;
> * Routines available to privileged subsystems
> */
>
> -extern int tipc_core_start(void);
> -extern void tipc_core_stop(void);
> -extern int tipc_core_start_net(unsigned long addr);
> -extern void tipc_core_stop_net(void);
> +extern int tipc_core_start_net(unsigned long);
> extern int tipc_handler_start(void);
> extern void tipc_handler_stop(void);
> extern int tipc_netlink_start(void);
> @@ -328,7 +323,7 @@ static inline struct tipc_msg *buf_msg(s
> return (struct tipc_msg *)skb->data;
> }
>
> -extern struct sk_buff *buf_acquire(u32 size);
> +extern struct sk_buff *tipc_buf_acquire(u32 size);
>
> /**
> * buf_discard - frees a TIPC message buffer
> --- a/net/tipc/dbg.c 2010-10-13 15:35:34.049157629 -0700
> +++ b/net/tipc/dbg.c 2010-10-13 15:58:43.362005611 -0700
> @@ -52,7 +52,7 @@ static struct print_buf null_buf = { NUL
> struct print_buf *const TIPC_NULL =&null_buf;
>
> static struct print_buf cons_buf = { NULL, 0, NULL, 1 };
> -struct print_buf *const TIPC_CONS =&cons_buf;
> +static struct print_buf *const TIPC_CONS =&cons_buf;
>
> static struct print_buf log_buf = { NULL, 0, NULL, 1 };
> struct print_buf *const TIPC_LOG =&log_buf;
> @@ -76,6 +76,10 @@ struct print_buf *const TIPC_LOG =&log_
> static char print_string[TIPC_PB_MAX_STR];
> static DEFINE_SPINLOCK(print_lock);
>
> +static void tipc_printbuf_reset(struct print_buf *pb);
> +static int tipc_printbuf_empty(struct print_buf *pb);
> +static void tipc_printbuf_move(struct print_buf *pb_to,
> + struct print_buf *pb_from);
>
> #define FORMAT(PTR,LEN,FMT) \
> {\
> @@ -116,7 +120,7 @@ void tipc_printbuf_init(struct print_buf
> * @pb: pointer to print buffer structure
> */
>
> -void tipc_printbuf_reset(struct print_buf *pb)
> +static void tipc_printbuf_reset(struct print_buf *pb)
> {
> if (pb->buf) {
> pb->crs = pb->buf;
> @@ -132,7 +136,7 @@ void tipc_printbuf_reset(struct print_bu
> * Returns non-zero if print buffer is empty.
> */
>
> -int tipc_printbuf_empty(struct print_buf *pb)
> +static int tipc_printbuf_empty(struct print_buf *pb)
> {
> return !pb->buf || (pb->crs == pb->buf);
> }
> @@ -181,7 +185,8 @@ int tipc_printbuf_validate(struct print_
> * Source print buffer becomes empty if a successful move occurs.
> */
>
> -void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
> +static void tipc_printbuf_move(struct print_buf *pb_to,
> + struct print_buf *pb_from)
> {
> int len;
>
> --- a/net/tipc/dbg.h 2010-10-13 15:37:37.134376966 -0700
> +++ b/net/tipc/dbg.h 2010-10-13 15:42:09.489660536 -0700
> @@ -56,10 +56,7 @@ struct print_buf {
> #define TIPC_PB_MAX_STR 512 /* max printable string (with trailing NUL) */
>
> void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 size);
> -void tipc_printbuf_reset(struct print_buf *pb);
> -int tipc_printbuf_empty(struct print_buf *pb);
> int tipc_printbuf_validate(struct print_buf *pb);
> -void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from);
>
> int tipc_log_resize(int log_size);
>
> --- a/net/tipc/discover.c 2010-10-13 15:38:16.357666201 -0700
> +++ b/net/tipc/discover.c 2010-10-13 15:52:14.740906596 -0700
> @@ -68,20 +68,6 @@ struct link_req {
> unsigned int timer_intv;
> };
>
> -
> -/*
> - * disc_lost_link(): A link has lost contact
> - */
> -
> -void tipc_disc_link_event(u32 addr, char *name, int up)
> -{
> - if (in_own_cluster(addr))
> - return;
> - /*
> - * Code for inter cluster link setup here
> - */
> -}
> -
> /**
> * tipc_disc_init_msg - initialize a link setup message
> * @type: message type (request or response)
> @@ -95,7 +81,7 @@ static struct sk_buff *tipc_disc_init_ms
> u32 dest_domain,
> struct bearer *b_ptr)
> {
> - struct sk_buff *buf = buf_acquire(DSC_H_SIZE);
> + struct sk_buff *buf = tipc_buf_acquire(DSC_H_SIZE);
> struct tipc_msg *msg;
>
> if (buf) {
> --- a/net/tipc/discover.h 2010-10-13 15:47:41.609746110 -0700
> +++ b/net/tipc/discover.h 2010-10-13 15:47:50.604664821 -0700
> @@ -50,6 +50,4 @@ void tipc_disc_stop_link_req(struct link
>
> void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr);
>
> -void tipc_disc_link_event(u32 addr, char *name, int up);
> -
> #endif
> --- a/net/tipc/link.c 2010-10-13 15:38:30.243998362 -0700
> +++ b/net/tipc/link.c 2010-10-13 15:53:47.961684397 -0700
> @@ -112,6 +112,9 @@ static void link_state_event(struct link
> static void link_reset_statistics(struct link *l_ptr);
> static void link_print(struct link *l_ptr, struct print_buf *buf,
> const char *str);
> +static void link_start(struct link *l_ptr);
> +static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
> +
>
> /*
> * Debugging code used by link routines only
> @@ -442,7 +445,7 @@ struct link *tipc_link_create(struct bea
>
> k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr);
> list_add_tail(&l_ptr->link_list,&b_ptr->links);
> - tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr);
> + tipc_k_signal((Handler)link_start, (unsigned long)l_ptr);
>
> dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n",
> l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit);
> @@ -482,9 +485,9 @@ void tipc_link_delete(struct link *l_ptr
> kfree(l_ptr);
> }
>
> -void tipc_link_start(struct link *l_ptr)
> +static void link_start(struct link *l_ptr)
> {
> - dbg("tipc_link_start %x\n", l_ptr);
> + dbg("link_start %x\n", l_ptr);
> link_state_event(l_ptr, STARTING_EVT);
> }
>
> @@ -1000,7 +1003,7 @@ int tipc_link_send_buf(struct link *l_pt
> /* Fragmentation needed ? */
>
> if (size> max_packet)
> - return tipc_link_send_long_buf(l_ptr, buf);
> + return link_send_long_buf(l_ptr, buf);
>
> /* Packet can be queued or sent: */
>
> @@ -1036,7 +1039,7 @@ int tipc_link_send_buf(struct link *l_pt
> /* Try creating a new bundle */
>
> if (size<= max_packet * 2 / 3) {
> - struct sk_buff *bundler = buf_acquire(max_packet);
> + struct sk_buff *bundler = tipc_buf_acquire(max_packet);
> struct tipc_msg bundler_hdr;
>
> if (bundler) {
> @@ -1312,7 +1315,7 @@ again:
>
> /* Prepare header of first fragment: */
>
> - buf_chain = buf = buf_acquire(max_pkt);
> + buf_chain = buf = tipc_buf_acquire(max_pkt);
> if (!buf)
> return -ENOMEM;
> buf->next = NULL;
> @@ -1369,7 +1372,7 @@ error:
> msg_set_size(&fragm_hdr, fragm_sz + INT_H_SIZE);
> msg_set_fragm_no(&fragm_hdr, ++fragm_no);
> prev = buf;
> - buf = buf_acquire(fragm_sz + INT_H_SIZE);
> + buf = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
> if (!buf)
> goto error;
>
> @@ -2145,7 +2148,7 @@ void tipc_link_send_proto_msg(struct lin
> if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) {
> if (!l_ptr->proto_msg_queue) {
> l_ptr->proto_msg_queue =
> - buf_acquire(sizeof(l_ptr->proto_msg));
> + tipc_buf_acquire(sizeof(l_ptr->proto_msg));
> }
> buf = l_ptr->proto_msg_queue;
> if (!buf)
> @@ -2159,7 +2162,7 @@ void tipc_link_send_proto_msg(struct lin
>
> msg_dbg(msg, ">>");
>
> - buf = buf_acquire(msg_size);
> + buf = tipc_buf_acquire(msg_size);
> if (!buf)
> return;
>
> @@ -2318,10 +2321,10 @@ exit:
> * tipc_link_tunnel(): Send one message via a link belonging to
> * another bearer. Owner node is locked.
> */
> -void tipc_link_tunnel(struct link *l_ptr,
> - struct tipc_msg *tunnel_hdr,
> - struct tipc_msg *msg,
> - u32 selector)
> +static void tipc_link_tunnel(struct link *l_ptr,
> + struct tipc_msg *tunnel_hdr,
> + struct tipc_msg *msg,
> + u32 selector)
> {
> struct link *tunnel;
> struct sk_buff *buf;
> @@ -2334,7 +2337,7 @@ void tipc_link_tunnel(struct link *l_ptr
> return;
> }
> msg_set_size(tunnel_hdr, length + INT_H_SIZE);
> - buf = buf_acquire(length + INT_H_SIZE);
> + buf = tipc_buf_acquire(length + INT_H_SIZE);
> if (!buf) {
> warn("Link changeover error, "
> "unable to send tunnel msg\n");
> @@ -2380,7 +2383,7 @@ void tipc_link_changeover(struct link *l
> if (!l_ptr->first_out) {
> struct sk_buff *buf;
>
> - buf = buf_acquire(INT_H_SIZE);
> + buf = tipc_buf_acquire(INT_H_SIZE);
> if (buf) {
> skb_copy_to_linear_data(buf,&tunnel_hdr, INT_H_SIZE);
> msg_set_size(&tunnel_hdr, INT_H_SIZE);
> @@ -2441,7 +2444,7 @@ void tipc_link_send_duplicate(struct lin
> msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); /* Update */
> msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
> msg_set_size(&tunnel_hdr, length + INT_H_SIZE);
> - outbuf = buf_acquire(length + INT_H_SIZE);
> + outbuf = tipc_buf_acquire(length + INT_H_SIZE);
> if (outbuf == NULL) {
> warn("Link changeover error, "
> "unable to send duplicate msg\n");
> @@ -2477,7 +2480,7 @@ static struct sk_buff *buf_extract(struc
> u32 size = msg_size(msg);
> struct sk_buff *eb;
>
> - eb = buf_acquire(size);
> + eb = tipc_buf_acquire(size);
> if (eb)
> skb_copy_to_linear_data(eb, msg, size);
> return eb;
> @@ -2605,11 +2608,11 @@ void tipc_link_recv_bundle(struct sk_buf
>
>
> /*
> - * tipc_link_send_long_buf: Entry for buffers needing fragmentation.
> + * link_send_long_buf: Entry for buffers needing fragmentation.
> * The buffer is complete, inclusive total message length.
> * Returns user data length.
> */
> -int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
> +static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
> {
> struct tipc_msg *inmsg = buf_msg(buf);
> struct tipc_msg fragm_hdr;
> @@ -2648,7 +2651,7 @@ int tipc_link_send_long_buf(struct link
> fragm_sz = rest;
> msg_set_type(&fragm_hdr, LAST_FRAGMENT);
> }
> - fragm = buf_acquire(fragm_sz + INT_H_SIZE);
> + fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
> if (fragm == NULL) {
> warn("Link unable to fragment message\n");
> dsz = -ENOMEM;
> @@ -2753,7 +2756,7 @@ int tipc_link_recv_fragment(struct sk_bu
> buf_discard(fbuf);
> return 0;
> }
> - pbuf = buf_acquire(msg_size(imsg));
> + pbuf = tipc_buf_acquire(msg_size(imsg));
> if (pbuf != NULL) {
> pbuf->next = *pending;
> *pending = pbuf;
> --- a/net/tipc/link.h 2010-10-13 15:51:49.403953468 -0700
> +++ b/net/tipc/link.h 2010-10-13 15:52:06.877852172 -0700
> @@ -225,7 +225,6 @@ void tipc_link_send_duplicate(struct lin
> void tipc_link_reset_fragments(struct link *l_ptr);
> int tipc_link_is_up(struct link *l_ptr);
> int tipc_link_is_active(struct link *l_ptr);
> -void tipc_link_start(struct link *l_ptr);
> u32 tipc_link_push_packet(struct link *l_ptr);
> void tipc_link_stop(struct link *l_ptr);
> struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd);
> @@ -239,9 +238,6 @@ int tipc_link_send_sections_fast(struct
> struct iovec const *msg_sect,
> const u32 num_sect,
> u32 destnode);
> -int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
> -void tipc_link_tunnel(struct link *l_ptr, struct tipc_msg *tnl_hdr,
> - struct tipc_msg *msg, u32 selector);
> void tipc_link_recv_bundle(struct sk_buff *buf);
> int tipc_link_recv_fragment(struct sk_buff **pending,
> struct sk_buff **fb,
> --- a/net/tipc/msg.c 2010-10-13 15:45:42.760031835 -0700
> +++ b/net/tipc/msg.c 2010-10-13 15:45:52.410871897 -0700
> @@ -112,7 +112,7 @@ int tipc_msg_build(struct tipc_msg *hdr,
> return dsz;
> }
>
> - *buf = buf_acquire(sz);
> + *buf = tipc_buf_acquire(sz);
> if (!(*buf))
> return -ENOMEM;
> skb_copy_to_linear_data(*buf, hdr, hsz);
> --- a/net/tipc/name_distr.c 2010-10-13 15:45:56.098428684 -0700
> +++ b/net/tipc/name_distr.c 2010-10-13 15:46:05.505298048 -0700
> @@ -98,7 +98,7 @@ static void publ_to_item(struct distr_it
>
> static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
> {
> - struct sk_buff *buf = buf_acquire(LONG_H_SIZE + size);
> + struct sk_buff *buf = tipc_buf_acquire(LONG_H_SIZE + size);
> struct tipc_msg *msg;
>
> if (buf != NULL) {
> --- a/net/tipc/node.c 2010-10-13 15:39:25.165401568 -0700
> +++ b/net/tipc/node.c 2010-10-13 16:03:21.564402314 -0700
> @@ -50,7 +50,8 @@ void node_print(struct print_buf *buf, s
> static void node_lost_contact(struct tipc_node *n_ptr);
> static void node_established_contact(struct tipc_node *n_ptr);
>
> -struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */
> +/* sorted list of nodes within cluster */
> +static struct tipc_node *tipc_nodes = NULL;
>
> static DEFINE_SPINLOCK(node_create_lock);
>
> @@ -587,22 +588,6 @@ void tipc_node_remove_router(struct tipc
> node_lost_contact(n_ptr);
> }
>
> -u32 tipc_available_nodes(const u32 domain)
> -{
> - struct tipc_node *n_ptr;
> - u32 cnt = 0;
> -
> - read_lock_bh(&tipc_net_lock);
> - for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
> - if (!tipc_in_scope(domain, n_ptr->addr))
> - continue;
> - if (tipc_node_is_up(n_ptr))
> - cnt++;
> - }
> - read_unlock_bh(&tipc_net_lock);
> - return cnt;
> -}
> -
> struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
> {
> u32 domain;
> --- a/net/tipc/node.h 2010-10-13 15:54:01.616035253 -0700
> +++ b/net/tipc/node.h 2010-10-13 15:54:11.830801530 -0700
> @@ -96,7 +96,6 @@ struct tipc_node {
> } bclink;
> };
>
> -extern struct tipc_node *tipc_nodes;
> extern u32 tipc_own_tag;
>
> struct tipc_node *tipc_node_create(u32 addr);
> --- a/net/tipc/port.c 2010-10-13 15:40:52.362926772 -0700
> +++ b/net/tipc/port.c 2010-10-13 16:16:41.435779874 -0700
> @@ -293,34 +293,6 @@ int tipc_deleteport(u32 ref)
> return 0;
> }
>
> -/**
> - * tipc_get_port() - return port associated with 'ref'
> - *
> - * Note: Port is not locked.
> - */
> -
> -struct tipc_port *tipc_get_port(const u32 ref)
> -{
> - return (struct tipc_port *)tipc_ref_deref(ref);
> -}
> -
> -/**
> - * tipc_get_handle - return user handle associated to port 'ref'
> - */
> -
> -void *tipc_get_handle(const u32 ref)
> -{
> - struct port *p_ptr;
> - void * handle;
> -
> - p_ptr = tipc_port_lock(ref);
> - if (!p_ptr)
> - return NULL;
> - handle = p_ptr->publ.usr_handle;
> - tipc_port_unlock(p_ptr);
> - return handle;
> -}
> -
> static int port_unreliable(struct port *p_ptr)
> {
> return msg_src_droppable(&p_ptr->publ.phdr);
> @@ -392,7 +364,7 @@ static struct sk_buff *port_build_proto_
> struct sk_buff *buf;
> struct tipc_msg *msg;
>
> - buf = buf_acquire(LONG_H_SIZE);
> + buf = tipc_buf_acquire(LONG_H_SIZE);
> if (buf) {
> msg = buf_msg(buf);
> tipc_msg_init(msg, usr, type, LONG_H_SIZE, destnode);
> @@ -433,7 +405,7 @@ int tipc_reject_msg(struct sk_buff *buf,
> hdr_sz = MCAST_H_SIZE;
> else
> hdr_sz = LONG_H_SIZE;
> - rbuf = buf_acquire(data_sz + hdr_sz);
> + rbuf = tipc_buf_acquire(data_sz + hdr_sz);
> if (rbuf == NULL) {
> buf_discard(buf);
> return data_sz;
> @@ -1242,50 +1214,13 @@ int tipc_shutdown(u32 ref)
> return tipc_disconnect(ref);
> }
>
> -int tipc_isconnected(u32 ref, int *isconnected)
> -{
> - struct port *p_ptr;
> -
> - p_ptr = tipc_port_lock(ref);
> - if (!p_ptr)
> - return -EINVAL;
> - *isconnected = p_ptr->publ.connected;
> - tipc_port_unlock(p_ptr);
> - return 0;
> -}
> -
> -int tipc_peer(u32 ref, struct tipc_portid *peer)
> -{
> - struct port *p_ptr;
> - int res;
> -
> - p_ptr = tipc_port_lock(ref);
> - if (!p_ptr)
> - return -EINVAL;
> - if (p_ptr->publ.connected) {
> - peer->ref = port_peerport(p_ptr);
> - peer->node = port_peernode(p_ptr);
> - res = 0;
> - } else
> - res = -ENOTCONN;
> - tipc_port_unlock(p_ptr);
> - return res;
> -}
> -
> -int tipc_ref_valid(u32 ref)
> -{
> - /* Works irrespective of type */
> - return !!tipc_ref_deref(ref);
> -}
> -
> -
> /*
> * tipc_port_recv_sections(): Concatenate and deliver sectioned
> * message for this node.
> */
>
> -int tipc_port_recv_sections(struct port *sender, unsigned int num_sect,
> - struct iovec const *msg_sect)
> +static int tipc_port_recv_sections(struct port *sender, unsigned int num_sect,
> + struct iovec const *msg_sect)
> {
> struct sk_buff *buf;
> int res;
> @@ -1336,65 +1271,16 @@ int tipc_send(u32 ref, unsigned int num_
> }
>
> /**
> - * tipc_send_buf - send message buffer on connection
> - */
> -
> -int tipc_send_buf(u32 ref, struct sk_buff *buf, unsigned int dsz)
> -{
> - struct port *p_ptr;
> - struct tipc_msg *msg;
> - u32 destnode;
> - u32 hsz;
> - u32 sz;
> - u32 res;
> -
> - p_ptr = tipc_port_deref(ref);
> - if (!p_ptr || !p_ptr->publ.connected)
> - return -EINVAL;
> -
> - msg =&p_ptr->publ.phdr;
> - hsz = msg_hdr_sz(msg);
> - sz = hsz + dsz;
> - msg_set_size(msg, sz);
> - if (skb_cow(buf, hsz))
> - return -ENOMEM;
> -
> - skb_push(buf, hsz);
> - skb_copy_to_linear_data(buf, msg, hsz);
> - destnode = msg_destnode(msg);
> - p_ptr->publ.congested = 1;
> - if (!tipc_port_congested(p_ptr)) {
> - if (likely(destnode != tipc_own_addr))
> - res = tipc_send_buf_fast(buf, destnode);
> - else {
> - tipc_port_recv_msg(buf);
> - res = sz;
> - }
> - if (likely(res != -ELINKCONG)) {
> - port_incr_out_seqno(p_ptr);
> - p_ptr->sent++;
> - p_ptr->publ.congested = 0;
> - return res;
> - }
> - }
> - if (port_unreliable(p_ptr)) {
> - p_ptr->publ.congested = 0;
> - return dsz;
> - }
> - return -ELINKCONG;
> -}
> -
> -/**
> * tipc_forward2name - forward message sections to port name
> */
>
> -int tipc_forward2name(u32 ref,
> - struct tipc_name const *name,
> - u32 domain,
> - u32 num_sect,
> - struct iovec const *msg_sect,
> - struct tipc_portid const *orig,
> - unsigned int importance)
> +static int tipc_forward2name(u32 ref,
> + struct tipc_name const *name,
> + u32 domain,
> + u32 num_sect,
> + struct iovec const *msg_sect,
> + struct tipc_portid const *orig,
> + unsigned int importance)
> {
> struct port *p_ptr;
> struct tipc_msg *msg;
> @@ -1457,89 +1343,15 @@ int tipc_send2name(u32 ref,
> }
>
> /**
> - * tipc_forward_buf2name - forward message buffer to port name
> - */
> -
> -int tipc_forward_buf2name(u32 ref,
> - struct tipc_name const *name,
> - u32 domain,
> - struct sk_buff *buf,
> - unsigned int dsz,
> - struct tipc_portid const *orig,
> - unsigned int importance)
> -{
> - struct port *p_ptr;
> - struct tipc_msg *msg;
> - u32 destnode = domain;
> - u32 destport;
> - int res;
> -
> - p_ptr = (struct port *)tipc_ref_deref(ref);
> - if (!p_ptr || p_ptr->publ.connected)
> - return -EINVAL;
> -
> - msg =&p_ptr->publ.phdr;
> - if (importance<= TIPC_CRITICAL_IMPORTANCE)
> - msg_set_importance(msg, importance);
> - msg_set_type(msg, TIPC_NAMED_MSG);
> - msg_set_orignode(msg, orig->node);
> - msg_set_origport(msg, orig->ref);
> - msg_set_nametype(msg, name->type);
> - msg_set_nameinst(msg, name->instance);
> - msg_set_lookup_scope(msg, tipc_addr_scope(domain));
> - msg_set_hdr_sz(msg, LONG_H_SIZE);
> - msg_set_size(msg, LONG_H_SIZE + dsz);
> - destport = tipc_nametbl_translate(name->type, name->instance,&destnode);
> - msg_set_destnode(msg, destnode);
> - msg_set_destport(msg, destport);
> - msg_dbg(msg, "forw2name ==> ");
> - if (skb_cow(buf, LONG_H_SIZE))
> - return -ENOMEM;
> - skb_push(buf, LONG_H_SIZE);
> - skb_copy_to_linear_data(buf, msg, LONG_H_SIZE);
> - msg_dbg(buf_msg(buf),"PREP:");
> - if (likely(destport)) {
> - p_ptr->sent++;
> - if (destnode == tipc_own_addr)
> - return tipc_port_recv_msg(buf);
> - res = tipc_send_buf_fast(buf, destnode);
> - if (likely(res != -ELINKCONG))
> - return res;
> - if (port_unreliable(p_ptr))
> - return dsz;
> - return -ELINKCONG;
> - }
> - return tipc_reject_msg(buf, TIPC_ERR_NO_NAME);
> -}
> -
> -/**
> - * tipc_send_buf2name - send message buffer to port name
> - */
> -
> -int tipc_send_buf2name(u32 ref,
> - struct tipc_name const *dest,
> - u32 domain,
> - struct sk_buff *buf,
> - unsigned int dsz)
> -{
> - struct tipc_portid orig;
> -
> - orig.ref = ref;
> - orig.node = tipc_own_addr;
> - return tipc_forward_buf2name(ref, dest, domain, buf, dsz,&orig,
> - TIPC_PORT_IMPORTANCE);
> -}
> -
> -/**
> * tipc_forward2port - forward message sections to port identity
> */
>
> -int tipc_forward2port(u32 ref,
> - struct tipc_portid const *dest,
> - unsigned int num_sect,
> - struct iovec const *msg_sect,
> - struct tipc_portid const *orig,
> - unsigned int importance)
> +static int tipc_forward2port(u32 ref,
> + struct tipc_portid const *dest,
> + unsigned int num_sect,
> + struct iovec const *msg_sect,
> + struct tipc_portid const *orig,
> + unsigned int importance)
> {
> struct port *p_ptr;
> struct tipc_msg *msg;
> @@ -1591,12 +1403,12 @@ int tipc_send2port(u32 ref,
> /**
> * tipc_forward_buf2port - forward message buffer to port identity
> */
> -int tipc_forward_buf2port(u32 ref,
> - struct tipc_portid const *dest,
> - struct sk_buff *buf,
> - unsigned int dsz,
> - struct tipc_portid const *orig,
> - unsigned int importance)
> +static int tipc_forward_buf2port(u32 ref,
> + struct tipc_portid const *dest,
> + struct sk_buff *buf,
> + unsigned int dsz,
> + struct tipc_portid const *orig,
> + unsigned int importance)
> {
> struct port *p_ptr;
> struct tipc_msg *msg;
> --- a/net/tipc/port.h 2010-10-13 15:48:09.502393058 -0700
> +++ b/net/tipc/port.h 2010-10-13 16:14:00.819182858 -0700
> @@ -109,8 +109,6 @@ struct port {
> extern spinlock_t tipc_port_list_lock;
> struct port_list;
>
> -int tipc_port_recv_sections(struct port *p_ptr, u32 num_sect,
> - struct iovec const *msg_sect);
> int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr,
> struct iovec const *msg_sect, u32 num_sect,
> int err);
> --- a/net/tipc/ref.c 2010-10-13 15:41:13.468391212 -0700
> +++ b/net/tipc/ref.c 2010-10-13 16:03:20.908481542 -0700
> @@ -282,23 +282,6 @@ void *tipc_ref_lock(u32 ref)
> return NULL;
> }
>
> -/**
> - * tipc_ref_unlock - unlock referenced object
> - */
> -
> -void tipc_ref_unlock(u32 ref)
> -{
> - if (likely(tipc_ref_table.entries)) {
> - struct reference *entry;
> -
> - entry =&tipc_ref_table.entries[ref&
> - tipc_ref_table.index_mask];
> - if (likely((entry->ref == ref)&& (entry->object)))
> - spin_unlock_bh(&entry->lock);
> - else
> - err("Attempt to unlock non-existent reference\n");
> - }
> -}
>
> /**
> * tipc_ref_deref - return pointer referenced object (without locking it)
> --- a/net/tipc/ref.h 2010-10-13 15:47:56.028012866 -0700
> +++ b/net/tipc/ref.h 2010-10-13 15:48:04.642977233 -0700
> @@ -44,7 +44,6 @@ u32 tipc_ref_acquire(void *object, spinl
> void tipc_ref_discard(u32 ref);
>
> void *tipc_ref_lock(u32 ref);
> -void tipc_ref_unlock(u32 ref);
> void *tipc_ref_deref(u32 ref);
>
> #endif
> --- a/net/tipc/zone.c 2010-10-13 15:41:49.324083397 -0700
> +++ b/net/tipc/zone.c 2010-10-13 15:54:26.329050453 -0700
> @@ -160,14 +160,3 @@ u32 tipc_zone_select_router(struct _zone
> }
> return 0;
> }
> -
> -
> -u32 tipc_zone_next_node(u32 addr)
> -{
> - struct cluster *c_ptr = tipc_cltr_find(addr);
> -
> - if (c_ptr)
> - return tipc_cltr_next_node(c_ptr, addr);
> - return 0;
> -}
> -
> --- a/net/tipc/zone.h 2010-10-13 15:48:24.460594837 -0700
> +++ b/net/tipc/zone.h 2010-10-13 15:48:33.715482229 -0700
> @@ -61,7 +61,6 @@ void tipc_zone_send_external_routes(stru
> struct _zone *tipc_zone_create(u32 addr);
> void tipc_zone_delete(struct _zone *z_ptr);
> void tipc_zone_attach_cluster(struct _zone *z_ptr, struct cluster *c_ptr);
> -u32 tipc_zone_next_node(u32 addr);
>
> static inline struct _zone *tipc_zone_find(u32 addr)
> {
> --- a/net/tipc/addr.c 2010-10-13 15:33:41.742641197 -0700
> +++ b/net/tipc/addr.c 2010-10-13 16:02:50.348172914 -0700
> @@ -41,11 +41,6 @@
> #include "cluster.h"
> #include "net.h"
>
> -u32 tipc_get_addr(void)
> -{
> - return tipc_own_addr;
> -}
> -
> /**
> * tipc_addr_domain_valid - validates a network domain address
> *
> --- a/net/tipc/cluster.h 2010-10-13 16:01:44.276153671 -0700
> +++ b/net/tipc/cluster.h 2010-10-13 16:01:56.218711152 -0700
> @@ -75,7 +75,7 @@ void tipc_cltr_attach_node(struct cluste
> void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest);
> void tipc_cltr_broadcast(struct sk_buff *buf);
> int tipc_cltr_init(void);
> -u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr);
> +
> void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
> void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest);
> void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
> --- a/net/tipc/subscr.c 2010-10-13 16:01:08.020532905 -0700
> +++ b/net/tipc/subscr.c 2010-10-13 16:03:03.330604772 -0700
> @@ -598,12 +598,3 @@ void tipc_subscr_stop(void)
> topsrv.user_ref = 0;
> }
> }
> -
> -
> -int tipc_ispublished(struct tipc_name const *name)
> -{
> - u32 domain = 0;
> -
> - return tipc_nametbl_translate(name->type, name->instance,&domain) != 0;
> -}
> -
> --- a/include/net/tipc/tipc_port.h 2010-10-13 16:05:35.080274751 -0700
> +++ b/include/net/tipc/tipc_port.h 2010-10-13 16:06:14.247543618 -0700
> @@ -88,8 +88,6 @@ void tipc_acknowledge(u32 port_ref,u32 a
>
> struct tipc_port *tipc_get_port(const u32 ref);
>
> -void *tipc_get_handle(const u32 ref);
> -
> /*
> * The following routines require that the port be locked on entry
> */
>
>
^ permalink raw reply
* Re: BUG ? ipip unregister_netdevice_many()
From: David Miller @ 2010-10-13 23:23 UTC (permalink / raw)
To: daniel.lezcano; +Cc: ebiederm, hans.schillstrom, netdev
In-Reply-To: <4CB62FAF.1030009@free.fr>
From: Daniel Lezcano <daniel.lezcano@free.fr>
Date: Thu, 14 Oct 2010 00:16:15 +0200
> do you mind to wait I test the patch before merging it ?
> I would like to stress a bit this routine with multiple containers.
Yes, it would be great if you could test this.
Please make sure you get the fix for the bug that
Jarek found ('list' needs to be initialized to NULL)
I've included the latest version below:
diff --git a/include/net/route.h b/include/net/route.h
index 7e5e73b..8d24761 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -106,7 +106,7 @@ extern int ip_rt_init(void);
extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
__be32 src, struct net_device *dev);
extern void rt_cache_flush(struct net *net, int how);
-extern void rt_cache_flush_batch(void);
+extern void rt_cache_flush_batch(struct net *net);
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 919f2ad..4039f56 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -999,7 +999,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
rt_cache_flush(dev_net(dev), 0);
break;
case NETDEV_UNREGISTER_BATCH:
- rt_cache_flush_batch();
+ rt_cache_flush_batch(dev_net(dev));
break;
}
return NOTIFY_DONE;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0755aa4..6ad730c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -712,13 +712,14 @@ static inline int rt_is_expired(struct rtable *rth)
* Can be called by a softirq or a process.
* In the later case, we want to be reschedule if necessary
*/
-static void rt_do_flush(int process_context)
+static void rt_do_flush(struct net *net, int process_context)
{
unsigned int i;
struct rtable *rth, *next;
- struct rtable * tail;
for (i = 0; i <= rt_hash_mask; i++) {
+ struct rtable *list = NULL, **pprev;
+
if (process_context && need_resched())
cond_resched();
rth = rt_hash_table[i].chain;
@@ -726,41 +727,27 @@ static void rt_do_flush(int process_context)
continue;
spin_lock_bh(rt_hash_lock_addr(i));
-#ifdef CONFIG_NET_NS
- {
- struct rtable ** prev, * p;
- rth = rt_hash_table[i].chain;
+ pprev = &rt_hash_table[i].chain;
+ rth = *pprev;
+ while (rth) {
+ next = rth->dst.rt_next;
+ if (dev_net(rth->dst.dev) == net) {
+ *pprev = next;
- /* defer releasing the head of the list after spin_unlock */
- for (tail = rth; tail; tail = tail->dst.rt_next)
- if (!rt_is_expired(tail))
- break;
- if (rth != tail)
- rt_hash_table[i].chain = tail;
-
- /* call rt_free on entries after the tail requiring flush */
- prev = &rt_hash_table[i].chain;
- for (p = *prev; p; p = next) {
- next = p->dst.rt_next;
- if (!rt_is_expired(p)) {
- prev = &p->dst.rt_next;
- } else {
- *prev = next;
- rt_free(p);
- }
- }
+ rth->dst.rt_next = list;
+ list = rth;
+ } else
+ pprev = &rth->dst.rt_next;
+
+ rth = next;
}
-#else
- rth = rt_hash_table[i].chain;
- rt_hash_table[i].chain = NULL;
- tail = NULL;
-#endif
+
spin_unlock_bh(rt_hash_lock_addr(i));
- for (; rth != tail; rth = next) {
- next = rth->dst.rt_next;
- rt_free(rth);
+ for (; list; list = next) {
+ next = list->dst.rt_next;
+ rt_free(list);
}
}
}
@@ -906,13 +893,13 @@ void rt_cache_flush(struct net *net, int delay)
{
rt_cache_invalidate(net);
if (delay >= 0)
- rt_do_flush(!in_softirq());
+ rt_do_flush(net, !in_softirq());
}
/* Flush previous cache invalidated entries from the cache */
-void rt_cache_flush_batch(void)
+void rt_cache_flush_batch(struct net *net)
{
- rt_do_flush(!in_softirq());
+ rt_do_flush(net, !in_softirq());
}
static void rt_emergency_hash_rebuild(struct net *net)
^ permalink raw reply related
* [PATCH net-next] tipc: cleanup function namespace
From: Stephen Hemminger @ 2010-10-13 23:20 UTC (permalink / raw)
To: David Miller, paul.gortmaker; +Cc: nhorman, netdev, allan.stephens
In-Reply-To: <20101013.142834.226768662.davem@davemloft.net>
Do some cleanups of TIPC based on make namespacecheck
1. Don't export unused symbols
2. Eliminate dead code
3. Make functions and variables local
4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
Compile tested only.
This make break out of tree kernel modules that depend on TIPC routines.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
include/net/tipc/tipc.h | 71 -------------
include/net/tipc/tipc_port.h | 2
net/tipc/addr.c | 5
net/tipc/bcast.c | 10 +
net/tipc/bcast.h | 3
net/tipc/cluster.c | 21 ---
net/tipc/cluster.h | 2
net/tipc/config.c | 7 +
net/tipc/config.h | 6 -
net/tipc/core.c | 28 +----
net/tipc/core.h | 9 -
net/tipc/dbg.c | 13 +-
net/tipc/dbg.h | 3
net/tipc/discover.c | 16 --
net/tipc/discover.h | 2
net/tipc/link.c | 45 ++++----
net/tipc/link.h | 4
net/tipc/msg.c | 2
net/tipc/name_distr.c | 2
net/tipc/node.c | 19 ---
net/tipc/node.h | 1
net/tipc/port.c | 234 ++++---------------------------------------
net/tipc/port.h | 2
net/tipc/ref.c | 17 ---
net/tipc/ref.h | 1
net/tipc/subscr.c | 9 -
net/tipc/zone.c | 11 --
net/tipc/zone.h | 1
28 files changed, 84 insertions(+), 462 deletions(-)
--- a/include/net/tipc/tipc.h 2010-10-13 15:43:50.025580173 -0700
+++ b/include/net/tipc/tipc.h 2010-10-13 16:14:33.731207018 -0700
@@ -50,8 +50,6 @@
* TIPC operating mode routines
*/
-u32 tipc_get_addr(void);
-
#define TIPC_NOT_RUNNING 0
#define TIPC_NODE_MODE 1
#define TIPC_NET_MODE 2
@@ -62,8 +60,6 @@ int tipc_attach(unsigned int *userref, t
void tipc_detach(unsigned int userref);
-int tipc_get_mode(void);
-
/*
* TIPC port manipulation routines
*/
@@ -153,12 +149,6 @@ int tipc_disconnect(u32 portref);
int tipc_shutdown(u32 ref);
-int tipc_isconnected(u32 portref, int *isconnected);
-
-int tipc_peer(u32 portref, struct tipc_portid *peer);
-
-int tipc_ref_valid(u32 portref);
-
/*
* TIPC messaging routines
*/
@@ -170,38 +160,12 @@ int tipc_send(u32 portref,
unsigned int num_sect,
struct iovec const *msg_sect);
-int tipc_send_buf(u32 portref,
- struct sk_buff *buf,
- unsigned int dsz);
-
int tipc_send2name(u32 portref,
struct tipc_name const *name,
u32 domain,
unsigned int num_sect,
struct iovec const *msg_sect);
-int tipc_send_buf2name(u32 portref,
- struct tipc_name const *name,
- u32 domain,
- struct sk_buff *buf,
- unsigned int dsz);
-
-int tipc_forward2name(u32 portref,
- struct tipc_name const *name,
- u32 domain,
- unsigned int section_count,
- struct iovec const *msg_sect,
- struct tipc_portid const *origin,
- unsigned int importance);
-
-int tipc_forward_buf2name(u32 portref,
- struct tipc_name const *name,
- u32 domain,
- struct sk_buff *buf,
- unsigned int dsz,
- struct tipc_portid const *orig,
- unsigned int importance);
-
int tipc_send2port(u32 portref,
struct tipc_portid const *dest,
unsigned int num_sect,
@@ -212,46 +176,11 @@ int tipc_send_buf2port(u32 portref,
struct sk_buff *buf,
unsigned int dsz);
-int tipc_forward2port(u32 portref,
- struct tipc_portid const *dest,
- unsigned int num_sect,
- struct iovec const *msg_sect,
- struct tipc_portid const *origin,
- unsigned int importance);
-
-int tipc_forward_buf2port(u32 portref,
- struct tipc_portid const *dest,
- struct sk_buff *buf,
- unsigned int dsz,
- struct tipc_portid const *orig,
- unsigned int importance);
-
int tipc_multicast(u32 portref,
struct tipc_name_seq const *seq,
u32 domain, /* currently unused */
unsigned int section_count,
struct iovec const *msg);
-
-#if 0
-int tipc_multicast_buf(u32 portref,
- struct tipc_name_seq const *seq,
- u32 domain,
- void *buf,
- unsigned int size);
-#endif
-
-/*
- * TIPC subscription routines
- */
-
-int tipc_ispublished(struct tipc_name const *name);
-
-/*
- * Get number of available nodes within specified domain (excluding own node)
- */
-
-unsigned int tipc_available_nodes(const u32 domain);
-
#endif
#endif
--- a/net/tipc/bcast.c 2010-10-13 15:34:09.359325773 -0700
+++ b/net/tipc/bcast.c 2010-10-13 15:58:43.362005611 -0700
@@ -121,6 +121,9 @@ static DEFINE_SPINLOCK(bc_lock);
const char tipc_bclink_name[] = "broadcast-link";
+static void tipc_nmap_diff(struct tipc_node_map *nm_a,
+ struct tipc_node_map *nm_b,
+ struct tipc_node_map *nm_diff);
static u32 buf_seqno(struct sk_buff *buf)
{
@@ -287,7 +290,7 @@ static void bclink_send_nack(struct tipc
if (!less(n_ptr->bclink.gap_after, n_ptr->bclink.gap_to))
return;
- buf = buf_acquire(INT_H_SIZE);
+ buf = tipc_buf_acquire(INT_H_SIZE);
if (buf) {
msg = buf_msg(buf);
tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG,
@@ -871,8 +874,9 @@ void tipc_nmap_remove(struct tipc_node_m
* @nm_diff: output node map A-B (i.e. nodes of A that are not in B)
*/
-void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
- struct tipc_node_map *nm_diff)
+static void tipc_nmap_diff(struct tipc_node_map *nm_a,
+ struct tipc_node_map *nm_b,
+ struct tipc_node_map *nm_diff)
{
int stop = ARRAY_SIZE(nm_a->map);
int w;
--- a/net/tipc/bcast.h 2010-10-13 15:34:39.167747046 -0700
+++ b/net/tipc/bcast.h 2010-10-13 15:42:10.321560582 -0700
@@ -84,9 +84,6 @@ static inline int tipc_nmap_equal(struct
return !memcmp(nm_a, nm_b, sizeof(*nm_a));
}
-void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
- struct tipc_node_map *nm_diff);
-
void tipc_port_list_add(struct port_list *pl_ptr, u32 port);
void tipc_port_list_free(struct port_list *pl_ptr);
--- a/net/tipc/cluster.c 2010-10-13 15:44:43.583143953 -0700
+++ b/net/tipc/cluster.c 2010-10-13 16:03:22.148331782 -0700
@@ -113,25 +113,6 @@ void tipc_cltr_delete(struct cluster *c_
kfree(c_ptr);
}
-u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
-{
- struct tipc_node *n_ptr;
- u32 n_num = tipc_node(addr) + 1;
-
- if (!c_ptr)
- return addr;
- for (; n_num <= c_ptr->highest_node; n_num++) {
- n_ptr = c_ptr->nodes[n_num];
- if (n_ptr && tipc_node_has_active_links(n_ptr))
- return n_ptr->addr;
- }
- for (n_num = 1; n_num < tipc_node(addr); n_num++) {
- n_ptr = c_ptr->nodes[n_num];
- if (n_ptr && tipc_node_has_active_links(n_ptr))
- return n_ptr->addr;
- }
- return 0;
-}
void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
{
@@ -232,7 +213,7 @@ struct tipc_node *tipc_cltr_select_node(
static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest)
{
u32 size = INT_H_SIZE + data_size;
- struct sk_buff *buf = buf_acquire(size);
+ struct sk_buff *buf = tipc_buf_acquire(size);
struct tipc_msg *msg;
if (buf) {
--- a/net/tipc/config.c 2010-10-13 15:35:16.359281659 -0700
+++ b/net/tipc/config.c 2010-10-13 16:07:20.471544155 -0700
@@ -95,7 +95,7 @@ int tipc_cfg_append_tlv(struct sk_buff *
return 1;
}
-struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
+static struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
{
struct sk_buff *buf;
__be32 value_net;
@@ -109,6 +109,11 @@ struct sk_buff *tipc_cfg_reply_unsigned_
return buf;
}
+static struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
+{
+ return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
+}
+
struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
{
struct sk_buff *buf;
--- a/net/tipc/config.h 2010-10-13 15:43:36.031261839 -0700
+++ b/net/tipc/config.h 2010-10-13 15:49:35.868009966 -0700
@@ -45,7 +45,6 @@
struct sk_buff *tipc_cfg_reply_alloc(int payload_size);
int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
void *tlv_data, int tlv_data_size);
-struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value);
struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string);
static inline struct sk_buff *tipc_cfg_reply_none(void)
@@ -53,11 +52,6 @@ static inline struct sk_buff *tipc_cfg_r
return tipc_cfg_reply_alloc(0);
}
-static inline struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
-{
- return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
-}
-
static inline struct sk_buff *tipc_cfg_reply_error_string(char *string)
{
return tipc_cfg_reply_string_type(TIPC_TLV_ERROR_STRING, string);
--- a/net/tipc/core.c 2010-10-13 15:32:35.750562985 -0700
+++ b/net/tipc/core.c 2010-10-13 16:00:58.197719377 -0700
@@ -96,13 +96,13 @@ int tipc_net_id;
int tipc_remote_management;
-int tipc_get_mode(void)
+static int tipc_get_mode(void)
{
return tipc_mode;
}
/**
- * buf_acquire - creates a TIPC message buffer
+ * tipc_buf_acquire - creates a TIPC message buffer
* @size: message size (including TIPC header)
*
* Returns a new buffer with data pointers set to the specified size.
@@ -111,7 +111,7 @@ int tipc_get_mode(void)
* There may also be unrequested tailroom present at the buffer's end.
*/
-struct sk_buff *buf_acquire(u32 size)
+struct sk_buff *tipc_buf_acquire(u32 size)
{
struct sk_buff *skb;
unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u;
@@ -129,7 +129,7 @@ struct sk_buff *buf_acquire(u32 size)
* tipc_core_stop_net - shut down TIPC networking sub-systems
*/
-void tipc_core_stop_net(void)
+static void tipc_core_stop_net(void)
{
tipc_eth_media_stop();
tipc_net_stop();
@@ -154,7 +154,7 @@ int tipc_core_start_net(unsigned long ad
* tipc_core_stop - switch TIPC from SINGLE NODE to NOT RUNNING mode
*/
-void tipc_core_stop(void)
+static void tipc_core_stop(void)
{
if (tipc_mode != TIPC_NODE_MODE)
return;
@@ -176,7 +176,7 @@ void tipc_core_stop(void)
* tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode
*/
-int tipc_core_start(void)
+static int tipc_core_start(void)
{
int res;
@@ -246,7 +246,6 @@ MODULE_VERSION(TIPC_MOD_VER);
EXPORT_SYMBOL(tipc_attach);
EXPORT_SYMBOL(tipc_detach);
-EXPORT_SYMBOL(tipc_get_addr);
EXPORT_SYMBOL(tipc_get_mode);
EXPORT_SYMBOL(tipc_createport);
EXPORT_SYMBOL(tipc_deleteport);
@@ -262,23 +261,10 @@ EXPORT_SYMBOL(tipc_withdraw);
EXPORT_SYMBOL(tipc_connect2port);
EXPORT_SYMBOL(tipc_disconnect);
EXPORT_SYMBOL(tipc_shutdown);
-EXPORT_SYMBOL(tipc_isconnected);
-EXPORT_SYMBOL(tipc_peer);
-EXPORT_SYMBOL(tipc_ref_valid);
EXPORT_SYMBOL(tipc_send);
-EXPORT_SYMBOL(tipc_send_buf);
EXPORT_SYMBOL(tipc_send2name);
-EXPORT_SYMBOL(tipc_forward2name);
-EXPORT_SYMBOL(tipc_send_buf2name);
-EXPORT_SYMBOL(tipc_forward_buf2name);
EXPORT_SYMBOL(tipc_send2port);
-EXPORT_SYMBOL(tipc_forward2port);
-EXPORT_SYMBOL(tipc_send_buf2port);
-EXPORT_SYMBOL(tipc_forward_buf2port);
EXPORT_SYMBOL(tipc_multicast);
-/* EXPORT_SYMBOL(tipc_multicast_buf); not available yet */
-EXPORT_SYMBOL(tipc_ispublished);
-EXPORT_SYMBOL(tipc_available_nodes);
/* TIPC API for external bearers (see tipc_bearer.h) */
@@ -295,6 +281,4 @@ EXPORT_SYMBOL(tipc_createport_raw);
EXPORT_SYMBOL(tipc_reject_msg);
EXPORT_SYMBOL(tipc_send_buf_fast);
EXPORT_SYMBOL(tipc_acknowledge);
-EXPORT_SYMBOL(tipc_get_port);
-EXPORT_SYMBOL(tipc_get_handle);
--- a/net/tipc/core.h 2010-10-13 15:36:36.237690119 -0700
+++ b/net/tipc/core.h 2010-10-13 16:07:56.727164658 -0700
@@ -83,9 +83,7 @@
* Note: TIPC_LOG is configured to echo its output to the system console;
* user-defined buffers can be configured to do the same thing.
*/
-
extern struct print_buf *const TIPC_NULL;
-extern struct print_buf *const TIPC_CONS;
extern struct print_buf *const TIPC_LOG;
void tipc_printf(struct print_buf *, const char *fmt, ...);
@@ -204,10 +202,7 @@ extern atomic_t tipc_user_count;
* Routines available to privileged subsystems
*/
-extern int tipc_core_start(void);
-extern void tipc_core_stop(void);
-extern int tipc_core_start_net(unsigned long addr);
-extern void tipc_core_stop_net(void);
+extern int tipc_core_start_net(unsigned long);
extern int tipc_handler_start(void);
extern void tipc_handler_stop(void);
extern int tipc_netlink_start(void);
@@ -328,7 +323,7 @@ static inline struct tipc_msg *buf_msg(s
return (struct tipc_msg *)skb->data;
}
-extern struct sk_buff *buf_acquire(u32 size);
+extern struct sk_buff *tipc_buf_acquire(u32 size);
/**
* buf_discard - frees a TIPC message buffer
--- a/net/tipc/dbg.c 2010-10-13 15:35:34.049157629 -0700
+++ b/net/tipc/dbg.c 2010-10-13 15:58:43.362005611 -0700
@@ -52,7 +52,7 @@ static struct print_buf null_buf = { NUL
struct print_buf *const TIPC_NULL = &null_buf;
static struct print_buf cons_buf = { NULL, 0, NULL, 1 };
-struct print_buf *const TIPC_CONS = &cons_buf;
+static struct print_buf *const TIPC_CONS = &cons_buf;
static struct print_buf log_buf = { NULL, 0, NULL, 1 };
struct print_buf *const TIPC_LOG = &log_buf;
@@ -76,6 +76,10 @@ struct print_buf *const TIPC_LOG = &log_
static char print_string[TIPC_PB_MAX_STR];
static DEFINE_SPINLOCK(print_lock);
+static void tipc_printbuf_reset(struct print_buf *pb);
+static int tipc_printbuf_empty(struct print_buf *pb);
+static void tipc_printbuf_move(struct print_buf *pb_to,
+ struct print_buf *pb_from);
#define FORMAT(PTR,LEN,FMT) \
{\
@@ -116,7 +120,7 @@ void tipc_printbuf_init(struct print_buf
* @pb: pointer to print buffer structure
*/
-void tipc_printbuf_reset(struct print_buf *pb)
+static void tipc_printbuf_reset(struct print_buf *pb)
{
if (pb->buf) {
pb->crs = pb->buf;
@@ -132,7 +136,7 @@ void tipc_printbuf_reset(struct print_bu
* Returns non-zero if print buffer is empty.
*/
-int tipc_printbuf_empty(struct print_buf *pb)
+static int tipc_printbuf_empty(struct print_buf *pb)
{
return !pb->buf || (pb->crs == pb->buf);
}
@@ -181,7 +185,8 @@ int tipc_printbuf_validate(struct print_
* Source print buffer becomes empty if a successful move occurs.
*/
-void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
+static void tipc_printbuf_move(struct print_buf *pb_to,
+ struct print_buf *pb_from)
{
int len;
--- a/net/tipc/dbg.h 2010-10-13 15:37:37.134376966 -0700
+++ b/net/tipc/dbg.h 2010-10-13 15:42:09.489660536 -0700
@@ -56,10 +56,7 @@ struct print_buf {
#define TIPC_PB_MAX_STR 512 /* max printable string (with trailing NUL) */
void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 size);
-void tipc_printbuf_reset(struct print_buf *pb);
-int tipc_printbuf_empty(struct print_buf *pb);
int tipc_printbuf_validate(struct print_buf *pb);
-void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from);
int tipc_log_resize(int log_size);
--- a/net/tipc/discover.c 2010-10-13 15:38:16.357666201 -0700
+++ b/net/tipc/discover.c 2010-10-13 15:52:14.740906596 -0700
@@ -68,20 +68,6 @@ struct link_req {
unsigned int timer_intv;
};
-
-/*
- * disc_lost_link(): A link has lost contact
- */
-
-void tipc_disc_link_event(u32 addr, char *name, int up)
-{
- if (in_own_cluster(addr))
- return;
- /*
- * Code for inter cluster link setup here
- */
-}
-
/**
* tipc_disc_init_msg - initialize a link setup message
* @type: message type (request or response)
@@ -95,7 +81,7 @@ static struct sk_buff *tipc_disc_init_ms
u32 dest_domain,
struct bearer *b_ptr)
{
- struct sk_buff *buf = buf_acquire(DSC_H_SIZE);
+ struct sk_buff *buf = tipc_buf_acquire(DSC_H_SIZE);
struct tipc_msg *msg;
if (buf) {
--- a/net/tipc/discover.h 2010-10-13 15:47:41.609746110 -0700
+++ b/net/tipc/discover.h 2010-10-13 15:47:50.604664821 -0700
@@ -50,6 +50,4 @@ void tipc_disc_stop_link_req(struct link
void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr);
-void tipc_disc_link_event(u32 addr, char *name, int up);
-
#endif
--- a/net/tipc/link.c 2010-10-13 15:38:30.243998362 -0700
+++ b/net/tipc/link.c 2010-10-13 15:53:47.961684397 -0700
@@ -112,6 +112,9 @@ static void link_state_event(struct link
static void link_reset_statistics(struct link *l_ptr);
static void link_print(struct link *l_ptr, struct print_buf *buf,
const char *str);
+static void link_start(struct link *l_ptr);
+static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
+
/*
* Debugging code used by link routines only
@@ -442,7 +445,7 @@ struct link *tipc_link_create(struct bea
k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr);
list_add_tail(&l_ptr->link_list, &b_ptr->links);
- tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr);
+ tipc_k_signal((Handler)link_start, (unsigned long)l_ptr);
dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n",
l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit);
@@ -482,9 +485,9 @@ void tipc_link_delete(struct link *l_ptr
kfree(l_ptr);
}
-void tipc_link_start(struct link *l_ptr)
+static void link_start(struct link *l_ptr)
{
- dbg("tipc_link_start %x\n", l_ptr);
+ dbg("link_start %x\n", l_ptr);
link_state_event(l_ptr, STARTING_EVT);
}
@@ -1000,7 +1003,7 @@ int tipc_link_send_buf(struct link *l_pt
/* Fragmentation needed ? */
if (size > max_packet)
- return tipc_link_send_long_buf(l_ptr, buf);
+ return link_send_long_buf(l_ptr, buf);
/* Packet can be queued or sent: */
@@ -1036,7 +1039,7 @@ int tipc_link_send_buf(struct link *l_pt
/* Try creating a new bundle */
if (size <= max_packet * 2 / 3) {
- struct sk_buff *bundler = buf_acquire(max_packet);
+ struct sk_buff *bundler = tipc_buf_acquire(max_packet);
struct tipc_msg bundler_hdr;
if (bundler) {
@@ -1312,7 +1315,7 @@ again:
/* Prepare header of first fragment: */
- buf_chain = buf = buf_acquire(max_pkt);
+ buf_chain = buf = tipc_buf_acquire(max_pkt);
if (!buf)
return -ENOMEM;
buf->next = NULL;
@@ -1369,7 +1372,7 @@ error:
msg_set_size(&fragm_hdr, fragm_sz + INT_H_SIZE);
msg_set_fragm_no(&fragm_hdr, ++fragm_no);
prev = buf;
- buf = buf_acquire(fragm_sz + INT_H_SIZE);
+ buf = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
if (!buf)
goto error;
@@ -2145,7 +2148,7 @@ void tipc_link_send_proto_msg(struct lin
if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) {
if (!l_ptr->proto_msg_queue) {
l_ptr->proto_msg_queue =
- buf_acquire(sizeof(l_ptr->proto_msg));
+ tipc_buf_acquire(sizeof(l_ptr->proto_msg));
}
buf = l_ptr->proto_msg_queue;
if (!buf)
@@ -2159,7 +2162,7 @@ void tipc_link_send_proto_msg(struct lin
msg_dbg(msg, ">>");
- buf = buf_acquire(msg_size);
+ buf = tipc_buf_acquire(msg_size);
if (!buf)
return;
@@ -2318,10 +2321,10 @@ exit:
* tipc_link_tunnel(): Send one message via a link belonging to
* another bearer. Owner node is locked.
*/
-void tipc_link_tunnel(struct link *l_ptr,
- struct tipc_msg *tunnel_hdr,
- struct tipc_msg *msg,
- u32 selector)
+static void tipc_link_tunnel(struct link *l_ptr,
+ struct tipc_msg *tunnel_hdr,
+ struct tipc_msg *msg,
+ u32 selector)
{
struct link *tunnel;
struct sk_buff *buf;
@@ -2334,7 +2337,7 @@ void tipc_link_tunnel(struct link *l_ptr
return;
}
msg_set_size(tunnel_hdr, length + INT_H_SIZE);
- buf = buf_acquire(length + INT_H_SIZE);
+ buf = tipc_buf_acquire(length + INT_H_SIZE);
if (!buf) {
warn("Link changeover error, "
"unable to send tunnel msg\n");
@@ -2380,7 +2383,7 @@ void tipc_link_changeover(struct link *l
if (!l_ptr->first_out) {
struct sk_buff *buf;
- buf = buf_acquire(INT_H_SIZE);
+ buf = tipc_buf_acquire(INT_H_SIZE);
if (buf) {
skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE);
msg_set_size(&tunnel_hdr, INT_H_SIZE);
@@ -2441,7 +2444,7 @@ void tipc_link_send_duplicate(struct lin
msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); /* Update */
msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
msg_set_size(&tunnel_hdr, length + INT_H_SIZE);
- outbuf = buf_acquire(length + INT_H_SIZE);
+ outbuf = tipc_buf_acquire(length + INT_H_SIZE);
if (outbuf == NULL) {
warn("Link changeover error, "
"unable to send duplicate msg\n");
@@ -2477,7 +2480,7 @@ static struct sk_buff *buf_extract(struc
u32 size = msg_size(msg);
struct sk_buff *eb;
- eb = buf_acquire(size);
+ eb = tipc_buf_acquire(size);
if (eb)
skb_copy_to_linear_data(eb, msg, size);
return eb;
@@ -2605,11 +2608,11 @@ void tipc_link_recv_bundle(struct sk_buf
/*
- * tipc_link_send_long_buf: Entry for buffers needing fragmentation.
+ * link_send_long_buf: Entry for buffers needing fragmentation.
* The buffer is complete, inclusive total message length.
* Returns user data length.
*/
-int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
+static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
{
struct tipc_msg *inmsg = buf_msg(buf);
struct tipc_msg fragm_hdr;
@@ -2648,7 +2651,7 @@ int tipc_link_send_long_buf(struct link
fragm_sz = rest;
msg_set_type(&fragm_hdr, LAST_FRAGMENT);
}
- fragm = buf_acquire(fragm_sz + INT_H_SIZE);
+ fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
if (fragm == NULL) {
warn("Link unable to fragment message\n");
dsz = -ENOMEM;
@@ -2753,7 +2756,7 @@ int tipc_link_recv_fragment(struct sk_bu
buf_discard(fbuf);
return 0;
}
- pbuf = buf_acquire(msg_size(imsg));
+ pbuf = tipc_buf_acquire(msg_size(imsg));
if (pbuf != NULL) {
pbuf->next = *pending;
*pending = pbuf;
--- a/net/tipc/link.h 2010-10-13 15:51:49.403953468 -0700
+++ b/net/tipc/link.h 2010-10-13 15:52:06.877852172 -0700
@@ -225,7 +225,6 @@ void tipc_link_send_duplicate(struct lin
void tipc_link_reset_fragments(struct link *l_ptr);
int tipc_link_is_up(struct link *l_ptr);
int tipc_link_is_active(struct link *l_ptr);
-void tipc_link_start(struct link *l_ptr);
u32 tipc_link_push_packet(struct link *l_ptr);
void tipc_link_stop(struct link *l_ptr);
struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd);
@@ -239,9 +238,6 @@ int tipc_link_send_sections_fast(struct
struct iovec const *msg_sect,
const u32 num_sect,
u32 destnode);
-int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
-void tipc_link_tunnel(struct link *l_ptr, struct tipc_msg *tnl_hdr,
- struct tipc_msg *msg, u32 selector);
void tipc_link_recv_bundle(struct sk_buff *buf);
int tipc_link_recv_fragment(struct sk_buff **pending,
struct sk_buff **fb,
--- a/net/tipc/msg.c 2010-10-13 15:45:42.760031835 -0700
+++ b/net/tipc/msg.c 2010-10-13 15:45:52.410871897 -0700
@@ -112,7 +112,7 @@ int tipc_msg_build(struct tipc_msg *hdr,
return dsz;
}
- *buf = buf_acquire(sz);
+ *buf = tipc_buf_acquire(sz);
if (!(*buf))
return -ENOMEM;
skb_copy_to_linear_data(*buf, hdr, hsz);
--- a/net/tipc/name_distr.c 2010-10-13 15:45:56.098428684 -0700
+++ b/net/tipc/name_distr.c 2010-10-13 15:46:05.505298048 -0700
@@ -98,7 +98,7 @@ static void publ_to_item(struct distr_it
static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
{
- struct sk_buff *buf = buf_acquire(LONG_H_SIZE + size);
+ struct sk_buff *buf = tipc_buf_acquire(LONG_H_SIZE + size);
struct tipc_msg *msg;
if (buf != NULL) {
--- a/net/tipc/node.c 2010-10-13 15:39:25.165401568 -0700
+++ b/net/tipc/node.c 2010-10-13 16:03:21.564402314 -0700
@@ -50,7 +50,8 @@ void node_print(struct print_buf *buf, s
static void node_lost_contact(struct tipc_node *n_ptr);
static void node_established_contact(struct tipc_node *n_ptr);
-struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */
+/* sorted list of nodes within cluster */
+static struct tipc_node *tipc_nodes = NULL;
static DEFINE_SPINLOCK(node_create_lock);
@@ -587,22 +588,6 @@ void tipc_node_remove_router(struct tipc
node_lost_contact(n_ptr);
}
-u32 tipc_available_nodes(const u32 domain)
-{
- struct tipc_node *n_ptr;
- u32 cnt = 0;
-
- read_lock_bh(&tipc_net_lock);
- for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
- if (!tipc_in_scope(domain, n_ptr->addr))
- continue;
- if (tipc_node_is_up(n_ptr))
- cnt++;
- }
- read_unlock_bh(&tipc_net_lock);
- return cnt;
-}
-
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
{
u32 domain;
--- a/net/tipc/node.h 2010-10-13 15:54:01.616035253 -0700
+++ b/net/tipc/node.h 2010-10-13 15:54:11.830801530 -0700
@@ -96,7 +96,6 @@ struct tipc_node {
} bclink;
};
-extern struct tipc_node *tipc_nodes;
extern u32 tipc_own_tag;
struct tipc_node *tipc_node_create(u32 addr);
--- a/net/tipc/port.c 2010-10-13 15:40:52.362926772 -0700
+++ b/net/tipc/port.c 2010-10-13 16:16:41.435779874 -0700
@@ -293,34 +293,6 @@ int tipc_deleteport(u32 ref)
return 0;
}
-/**
- * tipc_get_port() - return port associated with 'ref'
- *
- * Note: Port is not locked.
- */
-
-struct tipc_port *tipc_get_port(const u32 ref)
-{
- return (struct tipc_port *)tipc_ref_deref(ref);
-}
-
-/**
- * tipc_get_handle - return user handle associated to port 'ref'
- */
-
-void *tipc_get_handle(const u32 ref)
-{
- struct port *p_ptr;
- void * handle;
-
- p_ptr = tipc_port_lock(ref);
- if (!p_ptr)
- return NULL;
- handle = p_ptr->publ.usr_handle;
- tipc_port_unlock(p_ptr);
- return handle;
-}
-
static int port_unreliable(struct port *p_ptr)
{
return msg_src_droppable(&p_ptr->publ.phdr);
@@ -392,7 +364,7 @@ static struct sk_buff *port_build_proto_
struct sk_buff *buf;
struct tipc_msg *msg;
- buf = buf_acquire(LONG_H_SIZE);
+ buf = tipc_buf_acquire(LONG_H_SIZE);
if (buf) {
msg = buf_msg(buf);
tipc_msg_init(msg, usr, type, LONG_H_SIZE, destnode);
@@ -433,7 +405,7 @@ int tipc_reject_msg(struct sk_buff *buf,
hdr_sz = MCAST_H_SIZE;
else
hdr_sz = LONG_H_SIZE;
- rbuf = buf_acquire(data_sz + hdr_sz);
+ rbuf = tipc_buf_acquire(data_sz + hdr_sz);
if (rbuf == NULL) {
buf_discard(buf);
return data_sz;
@@ -1242,50 +1214,13 @@ int tipc_shutdown(u32 ref)
return tipc_disconnect(ref);
}
-int tipc_isconnected(u32 ref, int *isconnected)
-{
- struct port *p_ptr;
-
- p_ptr = tipc_port_lock(ref);
- if (!p_ptr)
- return -EINVAL;
- *isconnected = p_ptr->publ.connected;
- tipc_port_unlock(p_ptr);
- return 0;
-}
-
-int tipc_peer(u32 ref, struct tipc_portid *peer)
-{
- struct port *p_ptr;
- int res;
-
- p_ptr = tipc_port_lock(ref);
- if (!p_ptr)
- return -EINVAL;
- if (p_ptr->publ.connected) {
- peer->ref = port_peerport(p_ptr);
- peer->node = port_peernode(p_ptr);
- res = 0;
- } else
- res = -ENOTCONN;
- tipc_port_unlock(p_ptr);
- return res;
-}
-
-int tipc_ref_valid(u32 ref)
-{
- /* Works irrespective of type */
- return !!tipc_ref_deref(ref);
-}
-
-
/*
* tipc_port_recv_sections(): Concatenate and deliver sectioned
* message for this node.
*/
-int tipc_port_recv_sections(struct port *sender, unsigned int num_sect,
- struct iovec const *msg_sect)
+static int tipc_port_recv_sections(struct port *sender, unsigned int num_sect,
+ struct iovec const *msg_sect)
{
struct sk_buff *buf;
int res;
@@ -1336,65 +1271,16 @@ int tipc_send(u32 ref, unsigned int num_
}
/**
- * tipc_send_buf - send message buffer on connection
- */
-
-int tipc_send_buf(u32 ref, struct sk_buff *buf, unsigned int dsz)
-{
- struct port *p_ptr;
- struct tipc_msg *msg;
- u32 destnode;
- u32 hsz;
- u32 sz;
- u32 res;
-
- p_ptr = tipc_port_deref(ref);
- if (!p_ptr || !p_ptr->publ.connected)
- return -EINVAL;
-
- msg = &p_ptr->publ.phdr;
- hsz = msg_hdr_sz(msg);
- sz = hsz + dsz;
- msg_set_size(msg, sz);
- if (skb_cow(buf, hsz))
- return -ENOMEM;
-
- skb_push(buf, hsz);
- skb_copy_to_linear_data(buf, msg, hsz);
- destnode = msg_destnode(msg);
- p_ptr->publ.congested = 1;
- if (!tipc_port_congested(p_ptr)) {
- if (likely(destnode != tipc_own_addr))
- res = tipc_send_buf_fast(buf, destnode);
- else {
- tipc_port_recv_msg(buf);
- res = sz;
- }
- if (likely(res != -ELINKCONG)) {
- port_incr_out_seqno(p_ptr);
- p_ptr->sent++;
- p_ptr->publ.congested = 0;
- return res;
- }
- }
- if (port_unreliable(p_ptr)) {
- p_ptr->publ.congested = 0;
- return dsz;
- }
- return -ELINKCONG;
-}
-
-/**
* tipc_forward2name - forward message sections to port name
*/
-int tipc_forward2name(u32 ref,
- struct tipc_name const *name,
- u32 domain,
- u32 num_sect,
- struct iovec const *msg_sect,
- struct tipc_portid const *orig,
- unsigned int importance)
+static int tipc_forward2name(u32 ref,
+ struct tipc_name const *name,
+ u32 domain,
+ u32 num_sect,
+ struct iovec const *msg_sect,
+ struct tipc_portid const *orig,
+ unsigned int importance)
{
struct port *p_ptr;
struct tipc_msg *msg;
@@ -1457,89 +1343,15 @@ int tipc_send2name(u32 ref,
}
/**
- * tipc_forward_buf2name - forward message buffer to port name
- */
-
-int tipc_forward_buf2name(u32 ref,
- struct tipc_name const *name,
- u32 domain,
- struct sk_buff *buf,
- unsigned int dsz,
- struct tipc_portid const *orig,
- unsigned int importance)
-{
- struct port *p_ptr;
- struct tipc_msg *msg;
- u32 destnode = domain;
- u32 destport;
- int res;
-
- p_ptr = (struct port *)tipc_ref_deref(ref);
- if (!p_ptr || p_ptr->publ.connected)
- return -EINVAL;
-
- msg = &p_ptr->publ.phdr;
- if (importance <= TIPC_CRITICAL_IMPORTANCE)
- msg_set_importance(msg, importance);
- msg_set_type(msg, TIPC_NAMED_MSG);
- msg_set_orignode(msg, orig->node);
- msg_set_origport(msg, orig->ref);
- msg_set_nametype(msg, name->type);
- msg_set_nameinst(msg, name->instance);
- msg_set_lookup_scope(msg, tipc_addr_scope(domain));
- msg_set_hdr_sz(msg, LONG_H_SIZE);
- msg_set_size(msg, LONG_H_SIZE + dsz);
- destport = tipc_nametbl_translate(name->type, name->instance, &destnode);
- msg_set_destnode(msg, destnode);
- msg_set_destport(msg, destport);
- msg_dbg(msg, "forw2name ==> ");
- if (skb_cow(buf, LONG_H_SIZE))
- return -ENOMEM;
- skb_push(buf, LONG_H_SIZE);
- skb_copy_to_linear_data(buf, msg, LONG_H_SIZE);
- msg_dbg(buf_msg(buf),"PREP:");
- if (likely(destport)) {
- p_ptr->sent++;
- if (destnode == tipc_own_addr)
- return tipc_port_recv_msg(buf);
- res = tipc_send_buf_fast(buf, destnode);
- if (likely(res != -ELINKCONG))
- return res;
- if (port_unreliable(p_ptr))
- return dsz;
- return -ELINKCONG;
- }
- return tipc_reject_msg(buf, TIPC_ERR_NO_NAME);
-}
-
-/**
- * tipc_send_buf2name - send message buffer to port name
- */
-
-int tipc_send_buf2name(u32 ref,
- struct tipc_name const *dest,
- u32 domain,
- struct sk_buff *buf,
- unsigned int dsz)
-{
- struct tipc_portid orig;
-
- orig.ref = ref;
- orig.node = tipc_own_addr;
- return tipc_forward_buf2name(ref, dest, domain, buf, dsz, &orig,
- TIPC_PORT_IMPORTANCE);
-}
-
-/**
* tipc_forward2port - forward message sections to port identity
*/
-int tipc_forward2port(u32 ref,
- struct tipc_portid const *dest,
- unsigned int num_sect,
- struct iovec const *msg_sect,
- struct tipc_portid const *orig,
- unsigned int importance)
+static int tipc_forward2port(u32 ref,
+ struct tipc_portid const *dest,
+ unsigned int num_sect,
+ struct iovec const *msg_sect,
+ struct tipc_portid const *orig,
+ unsigned int importance)
{
struct port *p_ptr;
struct tipc_msg *msg;
@@ -1591,12 +1403,12 @@ int tipc_send2port(u32 ref,
/**
* tipc_forward_buf2port - forward message buffer to port identity
*/
-int tipc_forward_buf2port(u32 ref,
- struct tipc_portid const *dest,
- struct sk_buff *buf,
- unsigned int dsz,
- struct tipc_portid const *orig,
- unsigned int importance)
+static int tipc_forward_buf2port(u32 ref,
+ struct tipc_portid const *dest,
+ struct sk_buff *buf,
+ unsigned int dsz,
+ struct tipc_portid const *orig,
+ unsigned int importance)
{
struct port *p_ptr;
struct tipc_msg *msg;
--- a/net/tipc/port.h 2010-10-13 15:48:09.502393058 -0700
+++ b/net/tipc/port.h 2010-10-13 16:14:00.819182858 -0700
@@ -109,8 +109,6 @@ struct port {
extern spinlock_t tipc_port_list_lock;
struct port_list;
-int tipc_port_recv_sections(struct port *p_ptr, u32 num_sect,
- struct iovec const *msg_sect);
int tipc_port_reject_sections(struct port *p_ptr, struct tipc_msg *hdr,
struct iovec const *msg_sect, u32 num_sect,
int err);
--- a/net/tipc/ref.c 2010-10-13 15:41:13.468391212 -0700
+++ b/net/tipc/ref.c 2010-10-13 16:03:20.908481542 -0700
@@ -282,23 +282,6 @@ void *tipc_ref_lock(u32 ref)
return NULL;
}
-/**
- * tipc_ref_unlock - unlock referenced object
- */
-
-void tipc_ref_unlock(u32 ref)
-{
- if (likely(tipc_ref_table.entries)) {
- struct reference *entry;
-
- entry = &tipc_ref_table.entries[ref &
- tipc_ref_table.index_mask];
- if (likely((entry->ref == ref) && (entry->object)))
- spin_unlock_bh(&entry->lock);
- else
- err("Attempt to unlock non-existent reference\n");
- }
-}
/**
* tipc_ref_deref - return pointer referenced object (without locking it)
--- a/net/tipc/ref.h 2010-10-13 15:47:56.028012866 -0700
+++ b/net/tipc/ref.h 2010-10-13 15:48:04.642977233 -0700
@@ -44,7 +44,6 @@ u32 tipc_ref_acquire(void *object, spinl
void tipc_ref_discard(u32 ref);
void *tipc_ref_lock(u32 ref);
-void tipc_ref_unlock(u32 ref);
void *tipc_ref_deref(u32 ref);
#endif
--- a/net/tipc/zone.c 2010-10-13 15:41:49.324083397 -0700
+++ b/net/tipc/zone.c 2010-10-13 15:54:26.329050453 -0700
@@ -160,14 +160,3 @@ u32 tipc_zone_select_router(struct _zone
}
return 0;
}
-
-
-u32 tipc_zone_next_node(u32 addr)
-{
- struct cluster *c_ptr = tipc_cltr_find(addr);
-
- if (c_ptr)
- return tipc_cltr_next_node(c_ptr, addr);
- return 0;
-}
-
--- a/net/tipc/zone.h 2010-10-13 15:48:24.460594837 -0700
+++ b/net/tipc/zone.h 2010-10-13 15:48:33.715482229 -0700
@@ -61,7 +61,6 @@ void tipc_zone_send_external_routes(stru
struct _zone *tipc_zone_create(u32 addr);
void tipc_zone_delete(struct _zone *z_ptr);
void tipc_zone_attach_cluster(struct _zone *z_ptr, struct cluster *c_ptr);
-u32 tipc_zone_next_node(u32 addr);
static inline struct _zone *tipc_zone_find(u32 addr)
{
--- a/net/tipc/addr.c 2010-10-13 15:33:41.742641197 -0700
+++ b/net/tipc/addr.c 2010-10-13 16:02:50.348172914 -0700
@@ -41,11 +41,6 @@
#include "cluster.h"
#include "net.h"
-u32 tipc_get_addr(void)
-{
- return tipc_own_addr;
-}
-
/**
* tipc_addr_domain_valid - validates a network domain address
*
--- a/net/tipc/cluster.h 2010-10-13 16:01:44.276153671 -0700
+++ b/net/tipc/cluster.h 2010-10-13 16:01:56.218711152 -0700
@@ -75,7 +75,7 @@ void tipc_cltr_attach_node(struct cluste
void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest);
void tipc_cltr_broadcast(struct sk_buff *buf);
int tipc_cltr_init(void);
-u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr);
+
void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest);
void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
--- a/net/tipc/subscr.c 2010-10-13 16:01:08.020532905 -0700
+++ b/net/tipc/subscr.c 2010-10-13 16:03:03.330604772 -0700
@@ -598,12 +598,3 @@ void tipc_subscr_stop(void)
topsrv.user_ref = 0;
}
}
-
-
-int tipc_ispublished(struct tipc_name const *name)
-{
- u32 domain = 0;
-
- return tipc_nametbl_translate(name->type, name->instance, &domain) != 0;
-}
-
--- a/include/net/tipc/tipc_port.h 2010-10-13 16:05:35.080274751 -0700
+++ b/include/net/tipc/tipc_port.h 2010-10-13 16:06:14.247543618 -0700
@@ -88,8 +88,6 @@ void tipc_acknowledge(u32 port_ref,u32 a
struct tipc_port *tipc_get_port(const u32 ref);
-void *tipc_get_handle(const u32 ref);
-
/*
* The following routines require that the port be locked on entry
*/
^ permalink raw reply
* [GIT PATCH] ioat2: fix performance regression
From: Dan Williams @ 2010-10-13 23:03 UTC (permalink / raw)
To: akpm, torvalds
Cc: Dave Jiang, Linus Walleij, netdev, Maciej Sosnowski,
Jesse Brandeburg, linux-kernel, stable, Richard Scobie
Commit 0793448 "DMAENGINE: generic channel status v2" changed the interface for
how dma channel progress is retrieved. It inadvertently exported an internal
helper function ioat_tx_status() instead of ioat_dma_tx_status(). The latter
polls the hardware to get the latest completion state, while the helper just
evaluates the current state without touching hardware. The effect is that we
end up waiting for completion timeouts or descriptor allocation errors before
the completion state is updated.
iperf (before fix):
[SUM] 0.0-41.3 sec 364 MBytes 73.9 Mbits/sec
iperf (after fix):
[SUM] 0.0- 4.5 sec 499 MBytes 940 Mbits/sec
This is a regression starting with 2.6.35.
Cc: <stable@kernel.org>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Reported-by: Richard Scobie <richard@sauce.co.nz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Late breaking fix that can hopefully get into 2.6.36. I will queue a
cleanup to clarify this confusing naming convention for 2.6.37.
Also available via git:
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git fixes
Dan Williams (1):
ioat2: fix performance regression
drivers/dma/ioat/dma_v2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 216f9d3..effd140 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -879,7 +879,7 @@ int __devinit ioat2_dma_probe(struct ioatdma_device *device, int dca)
dma->device_issue_pending = ioat2_issue_pending;
dma->device_alloc_chan_resources = ioat2_alloc_chan_resources;
dma->device_free_chan_resources = ioat2_free_chan_resources;
- dma->device_tx_status = ioat_tx_status;
+ dma->device_tx_status = ioat_dma_tx_status;
err = ioat_probe(device);
if (err)
^ permalink raw reply related
* Re: [PATCH net-next] net: allocate skbs on local node
From: David Rientjes @ 2010-10-13 22:41 UTC (permalink / raw)
To: Christoph Lameter
Cc: Pekka Enberg, Andrew Morton, Eric Dumazet, David Miller, netdev,
Michael Chan, Eilon Greenstein, Christoph Hellwig, LKML,
Nick Piggin
In-Reply-To: <alpine.DEB.2.00.1010131642220.8351@router.home>
On Wed, 13 Oct 2010, Christoph Lameter wrote:
> > I was going to mention that as an idea, but I thought storing the metadata
> > for certain debugging features might differ from the two allocators so
> > substantially that it would be even more convoluted and difficult to
> > maintain?
>
> We could have some callbacks to store allocator specific metadata?
>
It depends on whether we could share the same base for both slab (unified
allocator) and slub, which you snipped from your reply, that would make
this cleaner.
^ permalink raw reply
* Re: [Bugme-new] [Bug 20292] New: unable to handle kernel NULL pointer dereference in skb_dequeue
From: gvs @ 2010-10-13 22:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, bugzilla-daemon, bugme-daemon, Michal Ostrowski
In-Reply-To: <20101013123332.72cf90f8.akpm@linux-foundation.org>
I had no problems getting it to work properly in 2.6.35.7. However, when
I booted back into rc7 I was unable to reproduce the problem. I believe
I was running multiple pppd's that failed to authenticate at the time
the bug occured.
I'll leave it running rc7 and see if everything stays stable.
gvs
On Wed, Oct 13, 2010 at 12:33:32PM -0700, Andrew Morton wrote:
>
> (switched to email. Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
>
> On Wed, 13 Oct 2010 19:24:53 GMT
> bugzilla-daemon@bugzilla.kernel.org wrote:
>
> > https://bugzilla.kernel.org/show_bug.cgi?id=20292
> >
> > Summary: unable to handle kernel NULL pointer dereference in
> > skb_dequeue
> > Product: Networking
> > Version: 2.5
> > Kernel Version: 2.6.36-rc7
>
> Thanks. Do you know if this is a regression? Did it work OK on 2.6.35?
>
> > Platform: All
> > OS/Version: Linux
> > Tree: Mainline
> > Status: NEW
> > Severity: blocking
> > Priority: P1
> > Component: Other
> > AssignedTo: acme@ghostprotocols.net
> > ReportedBy: gvs@zemos.net
> > Regression: No
> >
> >
> > Created an attachment (id=33512)
> > --> (https://bugzilla.kernel.org/attachment.cgi?id=33512)
> > Kernel config (gzipped)
> >
> > I was trying to get pppoe working (the 'pon' command seemed to hang) and then
> > this happened:
> >
> > Oct 13 20:57:07 bes kernel: BUG: unable to handle kernel NULL pointer
> > dereference at (null)
> > Oct 13 20:57:07 bes kernel: IP: [<c1241674>] skb_dequeue+0x24/0x40
> > Oct 13 20:57:07 bes kernel: *pde = 00000000
> > Oct 13 20:57:07 bes kernel: Oops: 0002 [#1]
> > Oct 13 20:57:07 bes kernel: last sysfs file:
> > /sys/devices/virtual/net/ppp0/uevent
> > Oct 13 20:57:07 bes kernel: Modules linked in: xt_TCPMSS xt_tcpmss xt_tcpudp
> > iptable_mangle pppoe pppox ppp_generic slhc cpufreq_conservative
> > cpufreq_userspace cpufreq_powersave fuse ipt_MASQUERADE iptable_nat nf_nat
> > nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables
> > x_tables loop sd_mod usb_storage usblp i2c_viapro uhci_hcd fan ehci_hcd button
> > i2c_core
> > Oct 13 20:57:07 bes kernel:
> > Oct 13 20:57:07 bes kernel: Pid: 5495, comm: pppd Not tainted 2.6.36-rc7 #12
> > VX800 /VX800
> > Oct 13 20:57:07 bes kernel: EIP: 0060:[<c1241674>] EFLAGS: 00010046 CPU: 0
> > Oct 13 20:57:07 bes kernel: EIP is at skb_dequeue+0x24/0x40
> > Oct 13 20:57:07 bes kernel: EAX: 00000000 EBX: 00000202 ECX: f6ba4cc0 EDX:
> > 00000000
> > Oct 13 20:57:07 bes kernel: ESI: f6c93bc0 EDI: f6adfee4 EBP: f6ade000 ESP:
> > f6adfe68
> > Oct 13 20:57:07 bes kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
> > Oct 13 20:57:07 bes kernel: Process pppd (pid: 5495, ti=f6ade000 task=f70f2200
> > task.ti=f6ade000)
> > Oct 13 20:57:07 bes kernel: Stack:
> > Oct 13 20:57:07 bes kernel: f68836c4 c1243a94 f68836c0 f866825b 00000000
> > f72e4a00 f72e4a00 f86761cb
> > Oct 13 20:57:07 bes kernel: <0> f72e4a00 f8683c97 c143ea14 ffffffea c12ba92d
> > 00000286 f68f7d7c f6adfee4
> > Oct 13 20:57:07 bes kernel: <0> f68f7bfc 00000286 00000000 00000000 00000000
> > f68f7b9c f6adff68 f6adff64
> > Oct 13 20:57:07 bes kernel: Call Trace:
> > Oct 13 20:57:07 bes kernel: [<c1243a94>] ? skb_queue_purge+0x14/0x30
> > Oct 13 20:57:07 bes kernel: [<f866825b>] ? ppp_destroy_channel+0x1b/0x50
> > [ppp_generic]
> > Oct 13 20:57:07 bes kernel: [<f86761cb>] ? pppox_unbind_sock+0x1b/0x24 [pppox]
> > Oct 13 20:57:07 bes kernel: [<f8683c97>] ? pppoe_connect+0x87/0x4b0 [pppoe]
> > Oct 13 20:57:07 bes kernel: [<c12ba92d>] ? schedule_timeout+0xfd/0x150
> > Oct 13 20:57:07 bes kernel: [<c123d4d4>] ? sys_connect+0x84/0xd0
> > Oct 13 20:57:07 bes kernel: [<c10ba730>] ? do_lock_file_wait+0x30/0xf0
> > Oct 13 20:57:07 bes kernel: [<c10ba9f9>] ? fcntl_setlk+0x59/0x1b0
> > Oct 13 20:57:07 bes kernel: [<c123e5a4>] ? sys_socketcall+0x294/0x2c0
> > Oct 13 20:57:07 bes kernel: [<c1002a10>] ? sysenter_do_call+0x12/0x26
> > Oct 13 20:57:07 bes kernel: Code: 81 a8 00 00 00 5b c3 53 9c 5b fa 8b 08 39 c8
> > 74 25 85 c9 74 1b 83 68 08 01 8b 11 8b 41 04 c7 01 00 00 00 00 c7 41 04 00 00
> > 00 00 <89> 10 89 42 04 53 9d 89 c8 5b c3 31 c9 eb f6 8d b6 00 00 00 00
> > Oct 13 20:57:07 bes kernel: EIP: [<c1241674>] skb_dequeue+0x24/0x40 SS:ESP
> > 0068:f6adfe68
> > Oct 13 20:57:07 bes kernel: CR2: 0000000000000000
> > Oct 13 20:57:07 bes kernel: ---[ end trace 4914adf67d1ace25 ]---
> >
> > Oct 13 20:57:30 bes kernel: BUG: unable to handle kernel NULL pointer
> > dereference at (null)
> > Oct 13 20:57:30 bes kernel: IP: [<c1241674>] skb_dequeue+0x24/0x40
> > Oct 13 20:57:30 bes kernel: *pde = 00000000
> > Oct 13 20:57:30 bes kernel: Oops: 0002 [#2]
> > Oct 13 20:57:30 bes kernel: last sysfs file:
> > /sys/devices/virtual/net/ppp0/uevent
> > Oct 13 20:57:30 bes kernel: Modules linked in: xt_TCPMSS xt_tcpmss xt_tcpudp
> > iptable_mangle pppoe pppox ppp_generic slhc cpufreq_conservative
> > cpufreq_userspace cpufreq_powersave fuse ipt_MASQUERADE iptable_nat nf_nat
> > nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables
> > x_tables loop sd_mod usb_storage usblp i2c_viapro uhci_hcd fan ehci_hcd button
> > i2c_core
> > Oct 13 20:57:30 bes kernel:
> > Oct 13 20:57:30 bes kernel: Pid: 5445, comm: pppd Tainted: G D
> > 2.6.36-rc7 #12 VX800 /VX800
> > Oct 13 20:57:30 bes kernel: EIP: 0060:[<c1241674>] EFLAGS: 00010046 CPU: 0
> > Oct 13 20:57:30 bes kernel: EIP is at skb_dequeue+0x24/0x40
> > Oct 13 20:57:30 bes kernel: EAX: 00000000 EBX: 00000202 ECX: f6ae7200 EDX:
> > 00000000
> > Oct 13 20:57:30 bes kernel: ESI: f6c99080 EDI: f7161ee4 EBP: f7160000 ESP:
> > f7161e68
> > Oct 13 20:57:30 bes kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
> > Oct 13 20:57:30 bes kernel: Process pppd (pid: 5445, ti=f7160000 task=f7107280
> > task.ti=f7160000)
> > Oct 13 20:57:30 bes kernel: Stack:
> > Oct 13 20:57:30 bes kernel: f6883344 c1243a94 f6883340 f866825b 00000000
> > f72e4c00 f72e4c00 f86761cb
> > Oct 13 20:57:30 bes kernel: <0> f72e4c00 f8683c97 c143ea14 ffffffea c12ba92d
> > 00000286 f68f73bc f7161ee4
> > Oct 13 20:57:30 bes kernel: <0> f68f753c 00000286 00000000 00000000 00000000
> > f68f759c f7161f68 f7161f64
> > Oct 13 20:57:30 bes kernel: [<c1243a94>] ? skb_queue_purge+0x14/0x30
> > Oct 13 20:57:30 bes kernel: [<f866825b>] ? ppp_destroy_channel+0x1b/0x50
> > [ppp_generic]
> > Oct 13 20:57:30 bes kernel: [<f86761cb>] ? pppox_unbind_sock+0x1b/0x24 [pppox]
> > Oct 13 20:57:30 bes kernel: [<f8683c97>] ? pppoe_connect+0x87/0x4b0 [pppoe]
> > Oct 13 20:57:30 bes kernel: [<c12ba92d>] ? schedule_timeout+0xfd/0x150
> > Oct 13 20:57:30 bes kernel: [<c123d4d4>] ? sys_connect+0x84/0xd0
> > Oct 13 20:57:30 bes kernel: [<c10ba730>] ? do_lock_file_wait+0x30/0xf0
> > Oct 13 20:57:30 bes kernel: [<c10ba9f9>] ? fcntl_setlk+0x59/0x1b0
> > Oct 13 20:57:30 bes kernel: [<c123e5a4>] ? sys_socketcall+0x294/0x2c0
> > Oct 13 20:57:30 bes kernel: [<c1002a10>] ? sysenter_do_call+0x12/0x26
> > Oct 13 20:57:30 bes kernel: Code: 81 a8 00 00 00 5b c3 53 9c 5b fa 8b 08 39 c8
> > 74 25 85 c9 74 1b 83 68 08 01 8b 11 8b 41 04 c7 01 00 00 00 00 c7 41 04 00 00
> > 00 00 <89> 10 89 42 04 53 9d 89 c8 5b c3 31 c9 eb f6 8d b6 00 00 00 00
> > Oct 13 20:57:30 bes kernel: EIP: [<c1241674>] skb_dequeue+0x24/0x40 SS:ESP
> > 0068:f7161e68
> > Oct 13 20:57:30 bes kernel: CR2: 0000000000000000
> > Oct 13 20:57:30 bes kernel: ---[ end trace 4914adf67d1ace26 ]---
> > Oct 13 20:57:30 bes kernel: ------------[ cut here ]------------
> > Oct 13 20:57:30 bes kernel: WARNING: at kernel/softirq.c:143
> > local_bh_enable+0x60/0x90()
> > Oct 13 20:57:30 bes kernel: Hardware name: VX800
> > Oct 13 20:57:30 bes kernel: Modules linked in: xt_TCPMSS xt_tcpmss xt_tcpudp
> > iptable_mangle pppoe pppox ppp_generic slhc cpufreq_conservative
> > cpufreq_userspace cpufreq_powersave fuse ipt_MASQUERADE iptable_nat nf_nat
> > nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables
> > x_tables loop sd_mod usb_storage usblp i2c_viapro uhci_hcd fan ehci_hcd button
> > i2c_core
> > Oct 13 20:57:30 bes kernel: Pid: 5445, comm: pppd Tainted: G D
> > 2.6.36-rc7 #12
> > Oct 13 20:57:30 bes kernel: Call Trace:
> > Oct 13 20:57:30 bes kernel: [<c1028640>] ? local_bh_enable+0x60/0x90
> > Oct 13 20:57:30 bes kernel: [<c1028640>] ? local_bh_enable+0x60/0x90
> > Oct 13 20:57:30 bes kernel: [<c1023a1e>] ? warn_slowpath_common+0x7e/0xc0
> > Oct 13 20:57:30 bes kernel: [<c1028640>] ? local_bh_enable+0x60/0x90
> > Oct 13 20:57:30 bes kernel: [<c1023a7b>] ? warn_slowpath_null+0x1b/0x20
> > Oct 13 20:57:30 bes kernel: [<c1028640>] ? local_bh_enable+0x60/0x90
> > Oct 13 20:57:30 bes kernel: [<c12a5bb5>] ? unix_release_sock+0x45/0x1f0
> > Oct 13 20:57:30 bes kernel: [<c123dc4a>] ? sock_release+0x1a/0x80
> > Oct 13 20:57:30 bes kernel: [<c123dcbf>] ? sock_close+0xf/0x30
> > Oct 13 20:57:30 bes kernel: [<c1089cd9>] ? fput+0xb9/0x200
> > Oct 13 20:57:30 bes kernel: [<c1086f7e>] ? filp_close+0x3e/0x70
> > Oct 13 20:57:30 bes kernel: [<c10254b2>] ? put_files_struct+0x62/0xb0
> > Oct 13 20:57:30 bes kernel: [<c1026c47>] ? do_exit+0x567/0x630
> > Oct 13 20:57:30 bes kernel: [<c12ba037>] ? printk+0x17/0x20
> > Oct 13 20:57:30 bes kernel: [<c1005477>] ? oops_end+0x87/0x90
> > Oct 13 20:57:30 bes kernel: [<c12ba037>] ? printk+0x17/0x20
> > Oct 13 20:57:30 bes kernel: [<c10194a2>] ? no_context+0xc2/0x160
> > Oct 13 20:57:30 bes kernel: [<c10195a5>] ? __bad_area_nosemaphore+0x65/0x180
> > Oct 13 20:57:30 bes kernel: [<c1249a3b>] ? dev_txq_stats_fold+0x8b/0xf0
> > Oct 13 20:57:30 bes kernel: [<c117dc80>] ? __nla_reserve+0x40/0x60
> > Oct 13 20:57:30 bes kernel: [<c1255c33>] ? rtnl_fill_ifinfo+0x413/0x8d0
> > Oct 13 20:57:30 bes kernel: [<c101971a>] ? bad_area+0x3a/0x50
> > Oct 13 20:57:30 bes kernel: [<c1019b8e>] ? do_page_fault+0x33e/0x390
> > Oct 13 20:57:30 bes kernel: [<c101e6ab>] ? wakeup_preempt_entity+0x3b/0xa0
> > Oct 13 20:57:30 bes kernel: [<c101e79a>] ? check_preempt_wakeup+0x8a/0xe0
> > Oct 13 20:57:30 bes kernel: [<c1097675>] ? pollwake+0x65/0x80
> > Oct 13 20:57:30 bes kernel: [<c1021170>] ? default_wake_function+0x0/0x10
> > Oct 13 20:57:30 bes kernel: [<c1019850>] ? do_page_fault+0x0/0x390
> > Oct 13 20:57:30 bes kernel: [<c12bbcf0>] ? error_code+0x58/0x60
> > Oct 13 20:57:30 bes kernel: [<c1019850>] ? do_page_fault+0x0/0x390
> > Oct 13 20:57:30 bes kernel: [<c1241674>] ? skb_dequeue+0x24/0x40
> > Oct 13 20:57:30 bes kernel: [<c1243a94>] ? skb_queue_purge+0x14/0x30
> > Oct 13 20:57:30 bes kernel: [<f866825b>] ? ppp_destroy_channel+0x1b/0x50
> > [ppp_generic]
> > Oct 13 20:57:30 bes kernel: [<f86761cb>] ? pppox_unbind_sock+0x1b/0x24 [pppox]
> > Oct 13 20:57:30 bes kernel: [<f8683c97>] ? pppoe_connect+0x87/0x4b0 [pppoe]
> > Oct 13 20:57:30 bes kernel: [<c12ba92d>] ? schedule_timeout+0xfd/0x150
> > Oct 13 20:57:30 bes kernel: [<c123d4d4>] ? sys_connect+0x84/0xd0
> > Oct 13 20:57:30 bes kernel: [<c10ba730>] ? do_lock_file_wait+0x30/0xf0
> > Oct 13 20:57:30 bes kernel: [<c10ba9f9>] ? fcntl_setlk+0x59/0x1b0
> > Oct 13 20:57:30 bes kernel: [<c123e5a4>] ? sys_socketcall+0x294/0x2c0
> > Oct 13 20:57:30 bes kernel: [<c1002a10>] ? sysenter_do_call+0x12/0x26
> > Oct 13 20:57:30 bes kernel: ---[ end trace 4914adf67d1ace27 ]---
> >
> > Some other information:
> > /proc/version:
> > Linux version 2.6.36-rc7 (root@bes) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #12
> > Sun Oct 10 21:12:58 CEST 2010
> >
> > ver_linux:
> > Linux bes 2.6.36-rc7 #12 Sun Oct 10 21:12:58 CEST 2010 i686 GNU/Linux
> >
> > Gnu C 4.4.5
> > Gnu make 3.81
> > binutils 2.20.1
> > util-linux 2.17.2
> > mount support
> > module-init-tools 3.12
> > e2fsprogs 1.41.12
> > PPP 2.4.5
> > Linux C Library 2.11.2
> > Dynamic linker (ldd) 2.11.2
> > Procps 3.2.8
> > Net-tools 1.60
> > Console-tools 0.2.3
> > Sh-utils 8.5
> > Modules Loaded cpufreq_conservative cpufreq_userspace cpufreq_powersave
> > fuse ppp_generic slhc ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4
> > nf_defrag_ipv4 xt_state nf_conntrack iptable_filter ip_tables x_tables loop
> > sd_mod usb_storage usblp i2c_viapro uhci_hcd fan i2c_core ehci_hcd button
> >
> > cpuinfo:
> > processor : 0
> > vendor_id : CentaurHauls
> > cpu family : 6
> > model : 13
> > model name : VIA Eden Processor 1600MHz
> > stepping : 0
> > cpu MHz : 800.000
> > cache size : 128 KB
> > fdiv_bug : no
> > hlt_bug : no
> > f00f_bug : no
> > coma_bug : no
> > fpu : yes
> > fpu_exception : yes
> > cpuid level : 1
> > wp : yes
> > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge cmov pat
> > clflush acpi mmx fxsr sse sse2 tm nx pni est tm2 xtpr rng rng_en ace ace_en
> > ace2 ace2_en phe phe_en pmm pmm_en
> > bogomips : 1599.76
> > clflush size : 64
> > cache_alignment : 64
> > address sizes : 36 bits physical, 32 bits virtual
> > power management:
> >
> > If anything else is needed I'd be happy to assist.
> >
>
^ permalink raw reply
* Re: [RFC PATCH net-next] drivers/net Documentation/networking: Create directory intel_wired_lan
From: Joe Perches @ 2010-10-13 22:28 UTC (permalink / raw)
To: Jeff Kirsher
Cc: Don, e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, netdev
In-Reply-To: <1286841648.26045.17.camel@Joe-Laptop>
On Mon, 2010-10-11 at 17:00 -0700, Joe Perches wrote:
> On Mon, 2010-10-11 at 16:52 -0700, Jeff Kirsher wrote:
> > On Sun, Oct 10, 2010 at 13:42, Joe Perches <joe@perches.com> wrote:
> > > Perhaps it's better to move drivers from the very populated
> > > drivers/net directory into vendor specific directories similar
> > > to the Atheros approach used for drivers/net/wireless/ath/
> > NAK
> > First, I think we need to keep the documentation in /Documentation/networking.
> > Second, the changes are extensive and would create a lot of regression testing.
> I don't see any actual changes here other than layout.
> What kind of regression testing do you think necessary?
Jeff?
What regression testing would actually be done?
Any new objects are trivially validated against existing
objects.
> > We have been looking at solutions like this for future
> > drivers/hardware and is on the list of items we are currently working
> > on, but feel it should not be made retroactively due to the regression
> > testing and massive changes that would need to be made.
>
> Might as well start somewhere.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* RE: [PATCH 2.6.35-rc6] net-next: Add multiqueue support to vmxnet3 driver
From: Shreyas Bhatewara @ 2010-10-13 22:26 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev@vger.kernel.org, pv-drivers@vmware.com,
linux-kernel@vger.kernel.org
In-Reply-To: <20101013145732.7d69d0f3@nehalam>
> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Wednesday, October 13, 2010 2:58 PM
> To: Shreyas Bhatewara
> Cc: netdev@vger.kernel.org; pv-drivers@vmware.com; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH 2.6.35-rc6] net-next: Add multiqueue support to
> vmxnet3 driver
>
> On Wed, 13 Oct 2010 14:47:05 -0700 (PDT)
> Shreyas Bhatewara <sbhatewara@vmware.com> wrote:
>
> > #ifdef VMXNET3_RSS
> > +static unsigned int num_rss_entries;
> > +#define VMXNET3_MAX_DEVICES 10
> > +
> > +static int rss_ind_table[VMXNET3_MAX_DEVICES *
> > + VMXNET3_RSS_IND_TABLE_SIZE + 1] = {
> > + [0 ... VMXNET3_MAX_DEVICES * VMXNET3_RSS_IND_TABLE_SIZE] = -1 };
> > +#endif
> > +static int num_tqs[VMXNET3_MAX_DEVICES + 1] = {
> > + [0 ... VMXNET3_MAX_DEVICES] = 1 };
> > +static int num_rqs[VMXNET3_MAX_DEVICES + 1] = {
> > + [0 ... VMXNET3_MAX_DEVICES] = 1 };
> > +static int share_tx_intr[VMXNET3_MAX_DEVICES + 1] = {
> > + [0 ... VMXNET3_MAX_DEVICES] = 0 };
> > +static int buddy_intr[VMXNET3_MAX_DEVICES + 1] = {
> > + [0 ... VMXNET3_MAX_DEVICES] = 1 };
> > +
> > +static unsigned int num_adapters;
> > +module_param_array(share_tx_intr, int, &num_adapters, 0400);
> > +MODULE_PARM_DESC(share_tx_intr, "Share one IRQ among all tx queue
> completions. "
> > + "Comma separated list of 1s and 0s - one for each NIC. "
> > + "1 to share, 0 to not, default is 0");
> > +module_param_array(buddy_intr, int, &num_adapters, 0400);
> > +MODULE_PARM_DESC(buddy_intr, "Share one IRQ among corresponding tx
> and rx "
> > + "queues. Comma separated list of 1s and 0s - one for each
> "
> > + "NIC. 1 to share, 0 to not, default is 1");
> > +module_param_array(num_tqs, int, &num_adapters, 0400);
> > +MODULE_PARM_DESC(num_tqs, "Number of transmit queues in each
> adapter. Comma "
> > + "separated list of integers. Setting this to 0 makes
> number"
> > + " of queues same as number of CPUs. Default is 1.");
> > +
> > +#ifdef VMXNET3_RSS
> > +module_param_array(rss_ind_table, int, &num_rss_entries, 0400);
> > +MODULE_PARM_DESC(rss_ind_table, "RSS Indirection table. Number of
> entries "
> > + "per NIC should be 32. Each integer in a comma separated
> list"
> > + " is an rx queue number starting with 0. Repeat the same
> for"
> > + " all NICs.");
> > +module_param_array(num_rqs, int, &num_adapters, 0400);
> > +MODULE_PARM_DESC(num_rqs, "Number of receive queues in each adapter.
> Comma "
> > + " separated list of integers. Setting this to 0 makes
> number"
> > + " of queues same as number of CPUs. Default is 1.");
>
> Module parameters are not right for this. They lead to different API
> for interacting with each driver vendor. Is there a another better API?
AFAIK, ethtool does not offer any API to program number of rx/tx queues. I saw a patch sent to netdev (http://www.mail-archive.com/netdev@vger.kernel.org/msg43923.html) to support multiqueue in ethtool but do not see it making into the mailine kernel.
> Does it have to be this tweakable in a production environment.
rss_ind_table, share_tx_intr, buddy_intr can probably be done away with. They offer flexibility to users to tune performance to their needs though. It would be better to have them and not be used than not have them and be needed. (They are ordered in increasing order of preference/usability according to me). Would you rather have them removed ?
Thanks.
->Shreyas
>
> --
^ permalink raw reply
* CMO ASIA WINNER
From: Dr R L Bhatia, CEO @ 2010-10-13 22:18 UTC (permalink / raw)
$1.1 MILLION USD 2010 AWARD NOTIFICATION
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox