[PATCH] iavh: fix a typo

2018-09-23 Thread Rami Rosen
This trivial patch fixes a typo in iavf.h.

Signed-off-by: Rami Rosen 
---
 drivers/net/ethernet/intel/iavf/iavf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf.h 
b/drivers/net/ethernet/intel/iavf/iavf.h
index a512f7521841..272d76b733aa 100644
--- a/drivers/net/ethernet/intel/iavf/iavf.h
+++ b/drivers/net/ethernet/intel/iavf/iavf.h
@@ -342,7 +342,7 @@ struct iavf_adapter {
struct iavf_channel_config ch_config;
u8 num_tc;
struct list_head cloud_filter_list;
-   /* lock to protest access to the cloud filter list */
+   /* lock to protect access to the cloud filter list */
spinlock_t cloud_filter_list_lock;
u16 num_cloud_filters;
 };
-- 
2.17.1



[PATCH net-next] net: fix two typos in net_device_ops documentation.

2017-08-31 Thread Rami Rosen
This patch fixes two trivial typos in net_device_ops documentation,
related to ndo_xdp_flush callback.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 include/linux/netdevice.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 29bf06f..35de831 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1124,8 +1124,8 @@ struct xfrmdev_ops {
  * This function is used to submit a XDP packet for transmit on a
  * netdevice.
  * void (*ndo_xdp_flush)(struct net_device *dev);
- * This function is used to inform the driver to flush a paticular
- * xpd tx queue. Must be called on same CPU as xdp_xmit.
+ * This function is used to inform the driver to flush a particular
+ * xdp tx queue. Must be called on same CPU as xdp_xmit.
  */
 struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
-- 
1.9.1



[PATCH net-next] i40e: fix a typo in i40e_pf documentation.

2017-08-18 Thread Rami Rosen
This patch fixes a typo in i40e_pf object documentation; num_req_vfs 
refers to the number of VFs requested for the PF.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h 
b/drivers/net/ethernet/intel/i40e/i40e.h
index d616f69..cadbbec 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -348,7 +348,7 @@ struct i40e_pf {
u16 num_vmdq_vsis; /* num vmdq vsis this PF has set up */
u16 num_vmdq_qps;  /* num queue pairs per vmdq pool */
u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
-   u16 num_req_vfs;   /* num VFs requested for this VF */
+   u16 num_req_vfs;   /* num VFs requested for this PF */
u16 num_vf_qps;/* num queue pairs per VF */
u16 num_lan_qps;   /* num lan queues this PF has set up */
u16 num_lan_msix;  /* num queue vectors for the base PF vsi */
-- 
1.9.1



[PATCH net-next] net/packet: remove unused PGV_FROM_VMALLOC definition.

2017-07-18 Thread Rami Rosen
This patch removes the definition of PGV_FROM_VMALLOC from af_packet.c.
The PGV_FROM_VMALLOC definition was already removed by 
commit 441c793a5650 ("net: cleanup unused macros in net directory"),
and its usage was removed even before by commit c56b4d90123b 
("af_packet: remove pgv.flags"); but it was added back by mistake later on,
in commit f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation").

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 net/packet/af_packet.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e3beb28203eb..ee035cbe5621 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -177,8 +177,6 @@ static int packet_set_ring(struct sock *sk, union 
tpacket_req_u *req_u,
 #define BLK_PLUS_PRIV(sz_of_priv) \
(BLK_HDR_LEN + ALIGN((sz_of_priv), V3_ALIGNMENT))
 
-#define PGV_FROM_VMALLOC 1
-
 #define BLOCK_STATUS(x)((x)->hdr.bh1.block_status)
 #define BLOCK_NUM_PKTS(x)  ((x)->hdr.bh1.num_pkts)
 #define BLOCK_O2FP(x)  ((x)->hdr.bh1.offset_to_first_pkt)
-- 
2.7.4



[PATCH net-next] net/packet: remove unneeded declaraion of tpacket_snd().

2017-06-10 Thread Rami Rosen
This patch removes unneeded forward declaration of tpacket_snd()
in net/packet/af_packet.c.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 net/packet/af_packet.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 82ca49fba336..f9349a495caf 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -188,7 +188,6 @@ static int packet_set_ring(struct sock *sk, union 
tpacket_req_u *req_u,
 #define BLOCK_PRIV(x)  ((void *)((char *)(x) + BLOCK_O2PRIV(x)))
 
 struct packet_sock;
-static int tpacket_snd(struct packet_sock *po, struct msghdr *msg);
 static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
   struct packet_type *pt, struct net_device *orig_dev);
 
-- 
2.4.11



[PATCH v2 net-next] genetlink: remove ops_list from genetlink header.

2017-06-04 Thread Rami Rosen
commit d91824c08fbc ("genetlink: register family ops as array") removed the 
ops_list member from both genl_family and genl_ops; while the 
documentation of genl_family was updated accordingly by this patch, 
ops_list remained in the documentation of the genl_ops object. 
This patch fixes it by removing ops_list from genl_ops documentation. 

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 include/net/genetlink.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 68b8819..c59a098 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -128,7 +128,6 @@ static inline int genl_err_attr(struct genl_info *info, int 
err,
  * @start: start callback for dumps
  * @dumpit: callback for dumpers
  * @done: completion callback for dumps
- * @ops_list: operations list
  */
 struct genl_ops {
const struct nla_policy *policy;
-- 
2.4.11



[PATCH net-next] genetlink: remove ops_list from genetlink header.

2017-06-04 Thread Rami Rosen
commit d91824 ("genetlink: register family ops as array") removed the 
ops_list member from both genl_family and genl_ops; while the 
documentation of genl_family was updated accordingly by this patch, 
ops_list remained in the documentation of the genl_ops object. 
This patch fixes it by removing ops_list from genl_ops documentation. 

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 include/net/genetlink.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 68b8819..c59a098 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -128,7 +128,6 @@ static inline int genl_err_attr(struct genl_info *info, int 
err,
  * @start: start callback for dumps
  * @dumpit: callback for dumpers
  * @done: completion callback for dumps
- * @ops_list: operations list
  */
 struct genl_ops {
const struct nla_policy *policy;
-- 
2.4.11



[PATCH net-next] net/packet: remove unused parameter in prb_curr_blk_in_use().

2017-05-24 Thread Rami Rosen
This patch removes unused parameter from prb_curr_blk_in_use() method
in net/packet/af_packet.c.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 net/packet/af_packet.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e3eeed1..82ca49f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -196,8 +196,7 @@ static void *packet_previous_frame(struct packet_sock *po,
struct packet_ring_buffer *rb,
int status);
 static void packet_increment_head(struct packet_ring_buffer *buff);
-static int prb_curr_blk_in_use(struct tpacket_kbdq_core *,
-   struct tpacket_block_desc *);
+static int prb_curr_blk_in_use(struct tpacket_block_desc *);
 static void *prb_dispatch_next_block(struct tpacket_kbdq_core *,
struct packet_sock *);
 static void prb_retire_current_block(struct tpacket_kbdq_core *,
@@ -721,7 +720,7 @@ static void prb_retire_rx_blk_timer_expired(unsigned long 
data)
/* Case 1. Queue was frozen because user-space was
 * lagging behind.
 */
-   if (prb_curr_blk_in_use(pkc, pbd)) {
+   if (prb_curr_blk_in_use(pbd)) {
/*
 * Ok, user-space is still behind.
 * So just refresh the timer.
@@ -972,8 +971,7 @@ static void prb_retire_current_block(struct 
tpacket_kbdq_core *pkc,
}
 }
 
-static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc,
- struct tpacket_block_desc *pbd)
+static int prb_curr_blk_in_use(struct tpacket_block_desc *pbd)
 {
return TP_STATUS_USER & BLOCK_STATUS(pbd);
 }
@@ -1064,7 +1062,7 @@ static void *__packet_lookup_frame_in_block(struct 
packet_sock *po,
 * Check if that last block which caused the queue to freeze,
 * is still in_use by user-space.
 */
-   if (prb_curr_blk_in_use(pkc, pbd)) {
+   if (prb_curr_blk_in_use(pbd)) {
/* Can't record this packet */
return NULL;
} else {
-- 
2.7.4



[PATCH net-next] net: socket: fix a typo in sockfd_lookup().

2017-05-21 Thread Rami Rosen
This patch fixes a typo in sockfd_lookup() in net/socket.c.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 net/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/socket.c b/net/socket.c
index cb355a7..8f9dab3 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -461,7 +461,7 @@ EXPORT_SYMBOL(sock_from_file);
  * @err: pointer to an error code return
  *
  * The file handle passed in is locked and the socket it is bound
- * too is returned. If an error occurs the err pointer is overwritten
+ * to is returned. If an error occurs the err pointer is overwritten
  * with a negative errno code and NULL is returned. The function checks
  * for both invalid handles and passing a handle which is not a socket.
  *
-- 
2.7.4



Re: [PATCH 0/9] net: thunderx: Adds XDP support

2017-05-03 Thread Rami Rosen
Thanks, Sunil.

>with network stack: 0.32 Mpps
>with XDP (XDP_TX): 3 Mpps
>and XDP_DROP: 3.8 Mpps

Interesting; May I ask - which packet size did you use ?

Regards,
Rami Rosen


Re: SO_BINDTODEVICE in VRFs not working?

2017-03-18 Thread Rami Rosen
Hi,

>Bind to the VRF device not an interface enslaved to it. I want to add
>the option for enslaved interfaces but have not gotten around to it.

Maybe this should be added as a note/TBD to the VRF documentation
(which does mention setsockopt with SO_BINDTODEVICE):
http://lxr.free-electrons.com/source/Documentation/networking/vrf.txt#L97

Regards,
Rami Rosen


Re: [PATCH v4 net-next 4/6] drivers: net: xgene-v2: Add base driver

2017-03-07 Thread Rami Rosen
Hi,
One minor comment:

The return type of xge_init_hw() should be changed to be void, as
the method xge_port_reset() always returns 0;  and also the return type
of xge_port_reset() should be changed to be void, it never fails; see
in [PATCH v4 net-next 3/6] drivers: net: xgene-v2: Add ethernet
hardware configuration.


+static int xge_init_hw(struct net_device *ndev)
+{
+   struct xge_pdata *pdata = netdev_priv(ndev);
+   int ret;
+
+   ret = xge_port_reset(ndev);
+   if (ret)
+   return ret;
+
+   xge_port_init(ndev);
+   pdata->nbufs = NUM_BUFS;
+
+   return 0;
+}

Regards,
Rami Rosen


Re: [PATCH v7 11/13] net: ethernet: aquantia: Ethtool support

2017-01-20 Thread Rami Rosen
+1
Many times this information is needed, and "ethtool -i"  is a
convenient way to get it.

Rami Rosen


Re: [PATCH v5 05/13] net: ethernet: aquantia: Support for NIC-specific code

2017-01-14 Thread Rami Rosen
Hi, Florian,

> +}
> +
> +static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
> +{
> + struct aq_nic_s *aq_nic = (struct aq_nic_s *)netdev_priv(ndev);
> + int err = 0;
> +
> + if (new_mtu == ndev->mtu) {
> + err = 0;
> + goto err_exit;
> + }
> + if (new_mtu < 68) {
> + err = -EINVAL;
> + goto err_exit;
> + }

> What's so special about 68 here?

I think that the check that the passed MTU is at least 68 bytes is
justified and correct.
This convention is followed by a large number of Ethernet drivers; for example,
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/i40e/i40e_main.c#L2246
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c#L6049

The size of 68 bytes is originated from RFC 791:
https://tools.ietf.org/html/rfc791
...
Every internet module must be able to forward a datagram of 68 octets
without further fragmentation.
This is because an internet header may be up to 60 octets, and the
minimum fragment is 8 octets.
...

Regards,
Rami Rosen


Re: [PATCH v2 01/13] net: ethernet: aquantia: Make and configuration files.

2017-01-11 Thread Rami Rosen
Hi,


> +++ b/drivers/net/ethernet/aquantia/Makefile
> @@ -0,0 +1,44 @@
...
...
> > +obj-$(CONFIG_AQTION) += atlantic.o
> +
> +atlantic-objs := aq_main.o \
> +   aq_nic.o \
> +   aq_pci_func.o \

Why twice aq_nic.o ? it appears two lines earlier:

> +   aq_nic.o \
> +   aq_vec.o \
> +   aq_ring.o \
...
...

Regards,
Rami Rosen


Re: [PATCH v2 03/12] net: ethernet: aquantia: Add ring support code

2017-01-08 Thread Rami Rosen
> +  DMA_TO_DEVICE);
> +   }
> +
> +   if (unlikely(buff->is_eop))
> +   dev_kfree_skb_any(buff->skb);
> +   }
> +
> +   return 0;
> +}
> +
> +int aq_ring_rx_drop(struct aq_ring_s *self)
> +{
> +   for (; self->sw_head != self->sw_tail;
> +   self->sw_head = aq_ring_next_dx(self, self->sw_head)) {
> +   struct aq_ring_buff_s *buff = >buff_ring[self->sw_head];
> +
> +   dma_unmap_page(aq_nic_get_dev(self->aq_nic), buff->pa,
> +  AQ_CFG_RX_FRAME_MAX, DMA_FROM_DEVICE);
> +
> +   __free_pages(buff->page, 0);
> +   }
> +
> +   return 0;
> +}
> +
> diff --git a/drivers/net/ethernet/aquantia/aq_ring.h 
> b/drivers/net/ethernet/aquantia/aq_ring.h
> new file mode 100644
> index 000..8f7e16e
> --- /dev/null
> +++ b/drivers/net/ethernet/aquantia/aq_ring.h
> @@ -0,0 +1,147 @@
> +/*
> + * aQuantia Corporation Network Driver
> + * Copyright (C) 2014-2016 aQuantia Corporation. All rights reserved
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +

File name should be aq_ring.h:

> +/* File aq_pci_ring.h: Declaration of functions for Rx/Tx rings. */
> +
> +#ifndef AQ_RING_H
> +#define AQ_RING_H
> +
> +#include "aq_common.h"
> +
> +struct page;
> +
> +/*   TxC   SOPDX EOP
> + * +--+--+--+---
> + *   8bytes|len l3,l4 | pa   | pa   | pa
> + * +--+--+--+---
> + * 4/8bytes|len pkt   |len pkt   |  | skb
> + * +--+--+--+---
> + * 4/8bytes|is_txc|len,flags |len   |len,is_eop
> + * +--+--+--+---
> + *
> + *  This aq_ring_buff_s doesn't have endianness dependency.

Typo: chache->cache
> + *  It is __packed for chache line optimisations.

Regards,
Rami Rosen


Re: [PATCH 05/12] Support for NIC-specific code

2016-12-27 Thread Rami Rosen
Hi, David,

Several nitpicks and comments, from a brief overview:

The commented label //err_exit:  should be removed
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> @@ -0,0 +1,993 @@
> +//err_exit:
> +//err_exit:

Shouldn't aq_nic_rss_init() be static? isn't it called only from
aq_nic_cfg_init_defaults()?
and it always returns 0, shouldn't it be void as well ? (+ remove
checking the return code when invoking it in
aq_nic_cfg_init_defaults())

> +int aq_nic_rss_init(struct aq_nic_s *self, unsigned int num_rss_queues)
> +{
> +   struct aq_nic_cfg_s *cfg = >aq_nic_cfg;
> +   struct aq_receive_scale_parameters *rss_params = >aq_rss;
> +   int i = 0;
> +
...
> +   return 0;
> +}


Shouldn't aq_nic_ndev_alloc() be static ? Isn't it invoked only from
aq_nic_alloc_cold()?

> +struct net_device *aq_nic_ndev_alloc(void)
> +{
...
> +}



> +
> +static unsigned int aq_nic_map_skb_lso(struct aq_nic_s *self,
> +  struct sk_buff *skb,
> +  struct aq_ring_buff_s *dx)
> +{
> +   unsigned int ret = 0U;
> +
> +   dx->flags = 0U;
> +   dx->len_pkt = skb->len;
> +   dx->len_l2 = ETH_HLEN;
> +   dx->len_l3 = ip_hdrlen(skb);
> +   dx->len_l4 = tcp_hdrlen(skb);
> +   dx->mss = skb_shinfo(skb)->gso_size;
> +   dx->is_txc = 1U;
> +   ret = 1U;
> +
Why not remove this "ret" variable, and simply return 1 ? the method
always returns 1:

> +   return ret;
> +}
> +

> +int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)
> +{
> +   struct aq_ring_s *ring = NULL;
> +   unsigned int frags = 0U;
> +   unsigned int vec = skb->queue_mapping % self->aq_nic_cfg.vecs;
> +   unsigned int tc = 0U;
> +   int err = 0;
> +   bool is_nic_in_bad_state;
> +   bool is_locked = false;
> +   bool is_busy = false;
> +   struct aq_ring_buff_s buffers[AQ_CFG_SKB_FRAGS_MAX];
> +
> +   frags = skb_shinfo(skb)->nr_frags + 1;
> +
> +   ring = self->aq_ring_tx[AQ_NIC_TCVEC2RING(self, tc, vec)];
> +
> +   atomic_inc(>busy_count);
> +   is_busy = true;
> +
> +   if (frags > AQ_CFG_SKB_FRAGS_MAX) {
> +   dev_kfree_skb_any(skb);
> +   goto err_exit;
> +   }
> +
> +   is_nic_in_bad_state = AQ_OBJ_TST(self, AQ_NIC_FLAGS_IS_NOT_TX_READY) 
> ||
> +   (aq_ring_avail_dx(ring) < 
> AQ_CFG_SKB_FRAGS_MAX);
> +
> +   if (is_nic_in_bad_state) {
> +   aq_nic_ndev_queue_stop(self, ring->idx);
> +   err = NETDEV_TX_BUSY;
> +   goto err_exit;
> +   }
> +

Usage of this internal block is not common (unless it is under #ifdef,
and also not very common also in that case). I suggest move "unsigned
int trys" to the variables definitions in the beginning of the method
and remove the opening and closing brackets of the following block:
> +   {
> +   unsigned int trys = AQ_CFG_LOCK_TRYS;
> +
> +   frags = aq_nic_map_skb(self, skb, [0]);
> +
> +   do {
> +   is_locked = spin_trylock(>lock);
> +   } while (--trys && !is_locked);
> +   if (!(is_locked)) {
> +   err = NETDEV_TX_BUSY;
> +   goto err_exit;
> +   }
> +

Usually you don't let the mtu be less than 68, for example:
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/i40e/i40e_main.c#L2246
See also RFV 791:
https://tools.ietf.org/html/rfc791


> +int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu)
> +{
> +   int err = 0;
> +
> +   if (new_mtu > self->aq_hw_caps.mtu) {
> +   err = 0;
> +   goto err_exit;
> +   }
> +   self->aq_nic_cfg.mtu = new_mtu;
> +
> +err_exit:
> +   return err;
> +}

> +

> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h 
> b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
> new file mode 100644
> index 000..89958e7
> --- /dev/null
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
> @@ -0,0 +1,111 @@
> +/*
> + * Aquantia Corporation Network Driver
> + * Copyright (C) 2014-2016 Aquantia Corporation. All rights reserved
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +/*

Should be, of course, aq_nic.h:

> + * File aq_nic.c: Declaration of common code for NIC.
> + */
> +

Regards,
Rami Rosen


Re: [PATCH 01/12] Make and configuration files.

2016-12-27 Thread Rami Rosen
Hi, David,

For the Makefile, you should follow the pattern which is common in
Linux Kernel Ethernet drivers, for example,
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/i40e/Makefile or
http://lxr.free-electrons.com/source/drivers/net/ethernet/mellanox/mlx5/core/Makefile


Don't think that I ever saw usage of "-j" in a kernel module Makefile;
apart from it, "-j4" is specific to one platform with a given number
of cores, and of course there can be platforms with many more cores,
for which it is less suitable. You can pass the "-j" when running
"make" from the command line, there is no justification to put it in a
Makefile:

>+all:
>+   $(MAKE) -j4 CC=$(CC) -C $(BUILD_DIR) M=$(PWD) modules
>+
>+dox:   .doxygen
>+   @doxygen $<
>+
>+clean:
>+   $(MAKE) -j4 -C $(BUILD_DIR) M=$(PWD) clean

Don't think I ever encountered load/unload targets in Linux Kernel
Makefiles (not talking about out of tree  projects):

>+load:
>+   insmod ./$(TARGET).ko
>+
>+unload:
>+   rmmod ./$(TARGET).ko


Regards,
Rami Rosen


Re: [PATCH iproute2 v2 1/3] ifstat: Add extended statistics to ifstat

2016-12-16 Thread Rami Rosen
Hi,

>Thanks, I'll fix it.
Another minor nit, on this occasion:

bool is_extanded should be: bool is_extended

Regards,
Rami Rosen


Re: iproute2 public git outdated?

2016-12-01 Thread Rami Rosen
Hi Phil,
I suggest that you will try again now, it seems that the iproute2 git
repo was updated in the last 2-4 hours, and "git log" in master shows
now a patch from 30 of November (actually it is your "Add notes about
dropped IPv4 route cache" patch)

Regards,
Rami Rosen


On 1 December 2016 at 14:18, Phil Sutter <p...@nwl.cc> wrote:
> Hi,
>
> I am using iproute2's public git repo at this URL:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
>
> To my surprise, neither master nor net-next branches have received new
> commits since end of October. Did the repo location change or was it
> just not updated for a while?
>
> Thanks, Phil


Re: [PATCH net-next] cgroup, bpf: remove unnecessary #include

2016-11-26 Thread Rami Rosen
Acked-by: Rami Rosen <roszenr...@gmail.com>

On 26 November 2016 at 09:23, Alexei Starovoitov <a...@fb.com> wrote:
> this #include is unnecessary and brings whole set of
> other headers into cgroup-defs.h. Remove it.
>
> Fixes: 3007098494be ("cgroup: add support for eBPF programs")
> Signed-off-by: Alexei Starovoitov <a...@kernel.org>
> ---
>  include/linux/bpf-cgroup.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
> index ec80d0c0953e..0cf1adfadd2d 100644
> --- a/include/linux/bpf-cgroup.h
> +++ b/include/linux/bpf-cgroup.h
> @@ -1,7 +1,6 @@
>  #ifndef _BPF_CGROUP_H
>  #define _BPF_CGROUP_H
>
> -#include 
>  #include 
>  #include 
>
> --
> 2.8.0
>


Re: [PATCH v3 net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver

2016-11-26 Thread Rami Rosen
Hi, Lino,

...

> @@ -0,0 +1,28 @@
> +config NET_VENDOR_ALACRITECH
> +bool "Alacritech devices"
> +default y
> +---help---
> +  If you have a network (Ethernet) card belonging to this class, say 
> Y.
> +
> +  Note that the answer to this question doesn't directly affect the
> +  kernel: saying N will just cause the configurator to skip all

Shouldn't it be "Alacritech devices" here, as appears earlier ?

> +  the questions about Renesas devices. If you say Y, you will be 
> asked
> +  for your specific device in the following questions.
> +

...
...
...
> +struct slic_device {
> +   struct pci_dev *pdev;
...
> +   bool promisc;

Seems that the autoneg boolean is not used anywhere, apart from
setting it once to true in
the slic_set_link_autoneg() method. Apart from this member it is not
accessed anywhere, so it seems it should be removed.

> +   bool autoneg;
> +   int speed;
...
...

> +static int slic_load_rcvseq_firmware(struct slic_device *sdev)
> +{
> +   const struct firmware *fw;
> +   const char *file;
> +   u32 codelen;
> +   int idx = 0;
> +   u32 instr;
> +   u32 addr;
> +   int err;
> +
...
> +   /* Do an initial sanity check concerning firmware size now. A further
> +* check follows below.
> +*/
> +   if (fw->size < SLIC_FIRMWARE_MIN_SIZE) {
> +   dev_err(>pdev->dev,
> +   "invalid firmware size %zu (min %u expected)\n",
> +   fw->size, SLIC_FIRMWARE_MIN_SIZE);
> +   err = -EINVAL;

in the release label, always 0 is returned:

> +   goto release;
> +   }
> +
> +   codelen = slic_read_dword_from_firmware(fw, );
> +
> +   /* do another sanity check against firmware size */
> +   if ((codelen + 4) > fw->size) {
> +   dev_err(>pdev->dev,
> +   "invalid rcv-sequencer firmware size %zu\n", 
> fw->size);
> +   err = -EINVAL;

Again, in the release label, always 0 is returned:

> +   goto release;
> +   }
> +
>
> +release:
> +   release_firmware(fw);
> +
> +   return 0;
> +}
> +

Regards,
Rami Rosen


Re: [PATCH v9 2/6] cgroup: add support for eBPF programs

2016-11-23 Thread Rami Rosen
Hi Daniel,

A minor comment:

> +/**
> + * __cgroup_bpf_update() - Update the pinned program of a cgroup, and
> + * propagate the change to descendants
> + * @cgrp: The cgroup which descendants to traverse
> + * @parent: The parent of @cgrp, or %NULL if @cgrp is the root
> + * @prog: A new program to pin
> + * @type: Type of pinning operation (ingress/egress)
> + *
> + * Each cgroup has a set of two pointers for bpf programs; one for eBPF
> + * programs it owns, and which is effective for execution.
> + *
You have in the following section twice identical checks, for If @prog
is %NULL".
Shouldn't it be here (in the first case only) "If @prog is not %NULL"
instead "If @prog is %NULL"?

> + * If @prog is %NULL, this function attaches a new program to the cgroup and
> + * releases the one that is currently attached, if any. @prog is then made
> + * the effective program of type @type in that cgroup.
> + *
> + * If @prog is %NULL, the currently attached program of type @type is 
> released,
> + * and the effective program of the parent cgroup (if any) is inherited to
> + * @cgrp.
> + *


Regard,
Rami Rosen


Re: [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers

2016-11-23 Thread Rami Rosen
Acked-by: Rami Rosen <roszenr...@gmail.com>


Re: [PATCH] cpsw: ethtool: add support for getting/setting EEE registers

2016-11-23 Thread Rami Rosen
Hi, Yegor,

Minor comment: these methods should be static.

+int cpsw_get_eee(struct net_device *ndev, struct ethtool_eee *edata)
+{
...
...
+int cpsw_set_eee(struct net_device *ndev, struct ethtool_eee *edata)
...

Regards,
Rami Rosen


Re: [PATCH] iproute2: Nr. of packets and octets for macsec tx stats were swapped.

2016-11-22 Thread Rami Rosen
Hi, Daniel
Acked-by: Rami Rosen <roszenr...@gmail.com>

Agreed about Sabrina comments about adding iproute2 and about the newlines.

Regards,
R


Re: ip -s macsec show: Statistics for OutOctets... and OutPkts... switched

2016-11-21 Thread Rami Rosen
+1
Rami Rosen


Re: [PATCH] netns: fix get_net_ns_by_fd(int pid) typo

2016-11-18 Thread Rami Rosen
On 18 November 2016 at 11:41, Stefan Hajnoczi <stefa...@redhat.com> wrote:
> The argument to get_net_ns_by_fd() is a /proc/$PID/ns/net file
> descriptor not a pid.  Fix the typo.
>

Acked-by: Rami Rosen <roszenr...@gmail.com>


Re: [PATCH v4 01/10] ethernet: add sun8i-emac driver

2016-10-23 Thread Rami Rosen
Hi Corentin,


Trivial comment: rx_saf_fai and rx_daf_fail are not used. This implies that also
rx_saf_error and rx_daf_error should be removed:

> +static const char const estats_str[][ETH_GSTRING_LEN] = {
...
> +   "rx_header_error",
> +   "rx_overflow_error",
> +   "rx_saf_error",
> +   "rx_daf_error",
> +   "rx_buf_error",
...

> +
> +struct sun8i_emac_stats {
> +   u64 rx_payload_error;
...
> +   u64 rx_overflow_error;
> +   u64 rx_saf_fail;
> +   u64 rx_daf_fail;

> +   u64 tx_used_desc;
> +   u64 napi_schedule;
> +   u64 napi_underflow;
> +};
> +

Trivial: typo, should be: can transfer

> +/* The datasheet said that each descriptor can transfers up to 4096bytes
> + * But latter, a register documentation reduce that value to 2048

Regards,
Rami Rosen


Re: [PATCH net] xfrm: Fix memory leak of aead algorithm name

2016-09-18 Thread Rami Rosen
Acked-by: Rami Rosen <roszenr...@gmail.com>

On 18 September 2016 at 10:42, Ilan Tayari <il...@mellanox.com> wrote:
> commit 1a6509d99122 ("[IPSEC]: Add support for combined mode algorithms")
> introduced aead. The function attach_aead kmemdup()s the algorithm
> name during xfrm_state_construct().
> However this memory is never freed.
> Implementation has since been slightly modified in
> commit ee5c23176fcc ("xfrm: Clone states properly on migration")
> without resolving this leak.
> This patch adds a kfree() call for the aead algorithm name.
>
> Fixes: 1a6509d99122 ("[IPSEC]: Add support for combined mode algorithms")
> Signed-off-by: Ilan Tayari <il...@mellanox.com>
> ---
>  net/xfrm/xfrm_state.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 9895a8c..a30f898d 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -332,6 +332,7 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
>  {
> tasklet_hrtimer_cancel(>mtimer);
> del_timer_sync(>rtimer);
> +   kfree(x->aead);
> kfree(x->aalg);
> kfree(x->ealg);
> kfree(x->calg);
> --
> 1.8.3.1
>


Re: [PATCH v4 2/6] cgroup: add support for eBPF programs

2016-09-06 Thread Rami Rosen
Hi,


+ * __cgroup_bpf_update() - Update the pinned program of a cgroup, and
+ * propagate the change to descendants
+ * @cgrp: The cgroup which descendants to traverse

Missing here is @parent

+ * @prog: A new program to pin
+ * @type: Type of pinning operation (ingress/egress)

...

> +void __cgroup_bpf_update(struct cgroup *cgrp,
> +struct cgroup *parent,
> +struct bpf_prog *prog,
> +enum bpf_attach_type type)
> +{

Regards,
Rami Rosen


Re: [PATCH net-next] rtnetlink: fdb dump: optimize by saving last interface markers

2016-09-02 Thread Rami Rosen
Hi Eric,

Nice catch!
This warning does not occur under certain gcc versions.
For example, gcc 4.8.4 (ubuntu 14.04);  it does occur, for example,
under gcc 5.3.1 for example (Fedora 24).

I just sent a patch to fix this.

Regards,
Rami Rosen


[PATCH net-next] switchdev: Fix return value of switchdev_port_fdb_dump().

2016-09-02 Thread Rami Rosen
This patch fixes the retun value of switchdev_port_fdb_dump() when
CONFIG_NET_SWITCHDEV is not set. This avoids getting "warning: return makes
integer from pointer without a cast [-Wint-conversion]" when building
when CONFIG_NET_SWITCHDEV is not set under several compiler versions.
This warning is due to commit d297653dd6f07afbe7e6c702a4bcd7615680002e
("rtnetlink: fdb dump: optimize by saving last interface markers").

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 include/net/switchdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 6279f2f..729fe15 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -344,7 +344,7 @@ static inline int switchdev_port_fdb_dump(struct sk_buff 
*skb,
  struct net_device *filter_dev,
  int *idx)
 {
-   return idx;
+   return *idx;
 }
 
 static inline bool switchdev_port_same_parent_id(struct net_device *a,
-- 
2.5.5



Re: [PATCH] [v9] net: emac: emac gigabit ethernet controller driver

2016-08-27 Thread Rami Rosen
Hi,

Shouldn't it be obj-$(CONFIG_QCOM_EMAC) instead obj-y? QCOM_EMAC is defined as
tristate in the drivers/net/ethernet/qualcomm/Kconfig by this patch,
so it should be possible to build it as a *.ko module also.

> diff --git a/drivers/net/ethernet/qualcomm/emac/Makefile 
> b/drivers/net/ethernet/qualcomm/emac/Makefile
> new file mode 100644
> index 000..700ee6e
> --- /dev/null
> +++ b/drivers/net/ethernet/qualcomm/emac/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Makefile for the Qualcomm Technologies, Inc. EMAC Gigabit Ethernet driver
> +#
> +
> +obj-y += qcom-emac.o
> +


The return type of the method emac_tx_tpd_create()  should be void, as
it always returns true.

> +/* Produce new transmit descriptor */
> +static bool emac_tx_tpd_create(struct emac_adapter *adpt,
> +  struct emac_tx_queue *tx_q, struct emac_tpd 
> *tpd)
> +{
> +   u32 *hw_tpd;
> +
> +   tx_q->tpd.last_produce_idx = tx_q->tpd.produce_idx;
> +   hw_tpd = EMAC_TPD(tx_q, adpt->tpd_size, tx_q->tpd.produce_idx);
> +
> +   if (++tx_q->tpd.produce_idx == tx_q->tpd.count)
> +   tx_q->tpd.produce_idx = 0;
> +
> +   *(hw_tpd++) = tpd->word[0];
> +   *(hw_tpd++) = tpd->word[1];
> +   *(hw_tpd++) = tpd->word[2];
> +   *hw_tpd = tpd->word[3];
> +
> +   return true;
> +}

...
...
...

Seems that there are several unused members in the emac_stats struct:

> +struct emac_stats {
...
...
Both rx_bcast_byte_cnt and rx_mcast_byte_cnt are not used anywhere/
> +   u64 rx_bcast_byte_cnt;  /* broadcast packets byte count (without FCS) 
> */
> +   u64 rx_mcast_byte_cnt;  /* multicast packets byte count (without FCS) 
> */
...
rx_err_addr is not used
> +   u64 rx_err_addr;/* packets dropped due to address filtering */

Typo: it is jabbers and not jubbers; greppping for "jubber" under
drivers/net/ethernet gives
0 results, whereas:
/net-next/drivers/net/ethernet$ grep -R jabber | wc -l
gives 241 results.

> +   u64 rx_jubbers; /* jubbers */


...
..
tx_rd_eop and tx_len_err are not used
> +   u64 tx_rd_eop;  /* count of reads beyond EOP */
> +   u64 tx_len_err; /* packets with length mismatch */

Both tx_bcast_byte and tx_mcast_byte are not used.
> +   u64 tx_bcast_byte;  /* broadcast packets byte count (without FCS) 
> */
> +   u64 tx_mcast_byte;  /* multicast packets byte count (without FCS) 
> */

Thanks for your good work, it seems that the driver is almost done!


Regards,
Rami Rosen


Re: [PATCH v3 0/6] Add eBPF hooks for cgroups

2016-08-27 Thread Rami Rosen
Hi Daniel,
I don't see the cgroups mailing list address in the cc list. Since
this patch is related also to the cgroups subsystem, I would suggest
that going forward you will cc also cgro...@vger.kernel.org to future
patches related to cgroups. (I hope this won't cause exceeding the max
cc list length for patches).

Regards,
Rami Rosen

On 26 August 2016 at 22:58, Daniel Mack <dan...@zonque.org> wrote:
> This is v3 of the patch set to allow eBPF programs for network
> filtering and accounting to be attached to cgroups, so that they apply
> to all sockets of all tasks placed in that cgroup. The logic also
> allows to be extendeded for other cgroup based eBPF logic.
>
> I am posting this now with only very few changes from v2 because
> I'll be travelling for a couple of days and won't have access to my
> mails.
>
>
> Changes from v2:
>
> * Fixed the RCU locking details Tejun pointed out.
>
> * Assert bpf_attr.flags == 0 in BPF_PROG_DETACH syscall handler.
>
>
> Changes from v1:
>
> * Moved all bpf specific cgroup code into its own file, and stub
>   out related functions for !CONFIG_CGROUP_BPF as static inline nops.
>   This way, the call sites are not cluttered with #ifdef guards while
>   the feature remains compile-time configurable.
>
> * Implemented the new scheme proposed by Tejun. Per cgroup, store one
>   set of pointers that are pinned to the cgroup, and one for the
>   programs that are effective. When a program is attached or detached,
>   the change is propagated to all the cgroup's descendants. If a
>   subcgroup has its own pinned program, skip the whole subbranch in
>   order to allow delegation models.
>
> * The hookup for egress packets is now done from __dev_queue_xmit().
>
> * A static key is now used in both the ingress and egress fast paths
>   to keep performance penalties close to zero if the feature is
>   not in use.
>
> * Overall cleanup to make the accessors use the program arrays.
>   This should make it much easier to add new program types, which
>   will then automatically follow the pinned vs. effective logic.
>
> * Fixed locking issues, as pointed out by Eric Dumazet and Alexei
>   Starovoitov. Changes to the program array are now done with
>   xchg() and are protected by cgroup_mutex.
>
> * eBPF programs are now expected to return 1 to let the packet pass,
>   not >= 0. Pointed out by Alexei.
>
> * Operation is now limited to INET sockets, so local AF_UNIX sockets
>   are not affected. The enum members are renamed accordingly. In case
>   other socket families should be supported, this can be extended in
>   the future.
>
> * The sample program learned to support both ingress and egress, and
>   can now optionally make the eBPF program drop packets by making it
>   return 0.
>
>
> As always, feedback is much appreciated.
>
> Thanks,
> Daniel
>
> Daniel Mack (6):
>   bpf: add new prog type for cgroup socket filtering
>   cgroup: add support for eBPF programs
>   bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands
>   net: filter: run cgroup eBPF ingress programs
>   net: core: run cgroup eBPF egress programs
>   samples: bpf: add userspace example for attaching eBPF programs to
> cgroups
>
>  include/linux/bpf-cgroup.h  |  70 +
>  include/linux/cgroup-defs.h |   4 +
>  include/uapi/linux/bpf.h|  16 
>  init/Kconfig|  12 +++
>  kernel/bpf/Makefile |   1 +
>  kernel/bpf/cgroup.c | 165 
> 
>  kernel/bpf/syscall.c|  83 
>  kernel/bpf/verifier.c   |   1 +
>  kernel/cgroup.c |  18 +
>  net/core/dev.c  |   6 ++
>  net/core/filter.c   |  11 +++
>  samples/bpf/Makefile|   2 +
>  samples/bpf/libbpf.c|  23 ++
>  samples/bpf/libbpf.h|   3 +
>  samples/bpf/test_cgrp2_attach.c | 147 +++
>  15 files changed, 562 insertions(+)
>  create mode 100644 include/linux/bpf-cgroup.h
>  create mode 100644 kernel/bpf/cgroup.c
>  create mode 100644 samples/bpf/test_cgrp2_attach.c
>
> --
> 2.5.5
>


[PATCH] net: ena: change the return type of ena_set_push_mode() to be void.

2016-08-23 Thread Rami Rosen
This patch changes the return type of ena_set_push_mode() to be void,
as it always returns 0.

Signed-off-by: Rami Rosen <ramir...@gmail.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c 
b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 5c536b8..bfeaec5 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2681,8 +2681,8 @@ static int ena_calc_io_queue_num(struct pci_dev *pdev,
return io_queue_num;
 }
 
-static int ena_set_push_mode(struct pci_dev *pdev, struct ena_com_dev *ena_dev,
-struct ena_com_dev_get_features_ctx *get_feat_ctx)
+static void ena_set_push_mode(struct pci_dev *pdev, struct ena_com_dev 
*ena_dev,
+ struct ena_com_dev_get_features_ctx *get_feat_ctx)
 {
bool has_mem_bar;
 
@@ -2693,8 +2693,6 @@ static int ena_set_push_mode(struct pci_dev *pdev, struct 
ena_com_dev *ena_dev,
ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_DEV;
else
ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
-
-   return 0;
 }
 
 static void ena_set_dev_offloads(struct ena_com_dev_get_features_ctx *feat,
@@ -2913,11 +2911,7 @@ static int ena_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
goto err_free_region;
}
 
-   rc = ena_set_push_mode(pdev, ena_dev, _feat_ctx);
-   if (rc) {
-   dev_err(>dev, "Invalid module param(push_mode)\n");
-   goto err_device_destroy;
-   }
+   ena_set_push_mode(pdev, ena_dev, _feat_ctx);
 
if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) {
ena_dev->mem_bar = ioremap_wc(pci_resource_start(pdev, 
ENA_MEM_BAR),
-- 
2.7.4



Re: [ethtool PATCH v1 2/2] ethtool:QSFP Plus/QSFP28 Diagnostics Information Support

2016-06-26 Thread Rami Rosen
Hi Vidya,
Thanks a lot for your your work!

Here are my 2 cents:

> +   /* SFP voltage in 0.1mV units */
> +   __u16 sfp_voltage;
> +   /* SFP Temp in 16-bit signed 1/256 Celcius */
> +   __s16 sfp_temp;
> +   /* [4] tables are low/high warn, low/high alarm */

You already had just 5 lines earlier: /* SFP voltage in 0.1mV units */
Shouldn't it be: /* SFP threshold voltage in 0.1mV units */ ?

> +   /* SFP voltage in 0.1mV units */
> +   __u16 thresh_sfp_voltage[4];


pagging should be: paging,
support_alarms should be:supports_alarms
> +* If pagging support exists, then support_alarms is marked as 1
> +*/
> +
+   if (eeprom_len == ETH_MODULE_SFF_8636_MAX_LEN) {
+   if (!(id[SFF8636_STATUS_2_OFFSET] &
+   SFF8636_STATUS_PAGE_3_PRESENT)) {
+   sd.supports_alarms = 1;
+   }
+   }


Shouldn't it be power/ TX bias current fields?  ("current" only once)
> +   /*
> +* SFF-8636/8436 spec is not clear whether RX power/ TX bias current
> +* current fields are supported or not. A valid temperature reading
> +* is used as existence for TX/RX power.

Should it be: SFF-8472/8079   (without "$")?
> + *
> + * Common utilities across SFF-8436/8636 and SFF-8472/8079$
> + * are defined in this file
> + *


Regards,
Rami Rosen


Re: [PATCH iproute2 net-next v4 0/5] bridge: json support for fdb and vlan show

2016-06-25 Thread Rami Rosen
Hi all,

>Also, for external automation and orchestration tools (to whom this
>patch-set is addressed),
>there is no reason for them to write and maintain their own tools
>using netlink when they
>can use iproute2 directly to create a link or query its properties.

+1 for this, seems very reasonable,

Just want to remind us all, in recent netdev 1.1 conference in Seville
(Feb 2016), Damascene Joachimpillai (DJ) from Verizon gave a talk
("Linux Networking and Data Center Operations Challenges"); IIRC, he
mentioned that he misses a REST API to the Linux Kernel networking
stack control plane. And it seems that Rest API and JSON (and maybe
other APIs, like python based APIs) are natural candidates for such an
interface nowadays.


Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen


[PATCH net-next] i40e: remove broken link.

2016-02-20 Thread Rami Rosen
This patch removes a broken link from Documentation/networking/i40e.txt.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 Documentation/networking/i40e.txt | 9 -
 1 file changed, 9 deletions(-)

diff --git a/Documentation/networking/i40e.txt 
b/Documentation/networking/i40e.txt
index a251bf4..09f8f3b 100644
--- a/Documentation/networking/i40e.txt
+++ b/Documentation/networking/i40e.txt
@@ -88,15 +88,6 @@ Additional Configurations
 
   Where n=the VF that attempted to do the spoofing.
 
-
-Performance Tuning
-==
-
-An excellent article on performance tuning can be found at:
-
-http://www.redhat.com/promo/summit/2008/downloads/pdf/Thursday/Mark_Wagner.pdf
-
-
 Known Issues
 
 
-- 
1.9.3



[PATCH net-next] core: remove unneded headers for net cgroup controllers.

2016-02-14 Thread Rami Rosen
commit 3ed80a6 (cgroup: drop module support) made including 
module.h redundant in the net cgroup controllers, 
netclassid_cgroup.c and netprio_cgroup.c. This patch 
removes them.

Signed-off-by: Rami Rosen <rami.ro...@intel.com>
---
 net/core/netclassid_cgroup.c | 1 -
 net/core/netprio_cgroup.c| 1 -
 2 files changed, 2 deletions(-)

diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c
index 0260c84..11fce17 100644
--- a/net/core/netclassid_cgroup.c
+++ b/net/core/netclassid_cgroup.c
@@ -9,7 +9,6 @@
  * Authors:Thomas Graf <tg...@suug.ch>
  */
 
-#include 
 #include 
 #include 
 #include 
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index f1efbc3..2ec86fc 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -11,7 +11,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include 
 #include 
 #include 
 #include 
-- 
1.9.3



[PATCH net-next v2] bridge: Fix setting a flag in br_fill_ifvlaninfo_range().

2015-07-21 Thread Rami Rosen
This patch fixes setting of vinfo.flags in the br_fill_ifvlaninfo_range() 
method. The
assignment of vinfo.flags = ~BRIDGE_VLAN_INFO_RANGE_BEGIN has no effect and is
unneeded, as vinfo.flags value is overriden by the  immediately following 
vinfo.flags = flags | BRIDGE_VLAN_INFO_RANGE_END assignement.

Signed-off-by: Rami Rosen rami.ro...@intel.com
---
 net/bridge/br_netlink.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 364bdc9..793d247 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -164,8 +164,6 @@ static int br_fill_ifvlaninfo_range(struct sk_buff *skb, 
u16 vid_start,
sizeof(vinfo), vinfo))
goto nla_put_failure;
 
-   vinfo.flags = ~BRIDGE_VLAN_INFO_RANGE_BEGIN;
-
vinfo.vid = vid_end;
vinfo.flags = flags | BRIDGE_VLAN_INFO_RANGE_END;
if (nla_put(skb, IFLA_BRIDGE_VLAN_INFO,
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6] NET: Add ezchip ethernet driver

2015-06-22 Thread Rami Rosen
Hi, Noam,

Just a typo and a nitpick:

+/**
+ * nps_enet_open - Open the network device.
+ * @ndev:   Pointer to the network device.
+ *
+ * returns: 0, on success or non-zero error value on failure.
+ *

Maybe better:  This function enables IRQs

+ * This function enables an IRQs for the ENET device and starts the Tx queue.



+static s32 nps_enet_probe(struct platform_device *pdev)
+{
+   struct device *dev = pdev-dev;
+   struct net_device *ndev;
+   struct nps_enet_priv *priv;
+   s32 err = 0;
+   const char *mac_addr;
+   struct resource *res_regs;
+
+   if (!dev-of_node)
+   return -ENODEV;
+
+   ndev = alloc_etherdev(sizeof(struct nps_enet_priv));
+   if (!ndev)
+   return -ENOMEM;
+
+   platform_set_drvdata(pdev, ndev);
+   SET_NETDEV_DEV(ndev, dev);
+   priv = netdev_priv(ndev);
+
+   /* The EZ NET specific entries in the device structure. */
+   ndev-netdev_ops = nps_netdev_ops;
+   ndev-watchdog_timeo = (400 * HZ / 1000);
+   /* FIXME :: no multicast support yet */
+   ndev-flags = ~IFF_MULTICAST;
+
+   res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   priv-regs_base = devm_ioremap_resource(dev, res_regs);
+   if (IS_ERR(priv-regs_base)) {
+   err = PTR_ERR(priv-regs_base);
+   goto out_netdev;
+   }
+   dev_dbg(dev, Registers base address is 0x%p\n, priv-regs_base);
+
+   /* set kernel MAC address to dev */
+   mac_addr = of_get_mac_address(dev-of_node);
+   if (mac_addr)
+   ether_addr_copy(ndev-dev_addr, mac_addr);
+   else
+   eth_hw_addr_random(ndev);
+
+   /* Get IRQ number */
+   priv-irq = platform_get_irq(pdev, 0);
+   if (!priv-irq) {
+   dev_err(dev, failed to retrieve irq Rx-Tx value
from device tree\n);
+   err = -ENODEV;
+   goto out_netdev;
+   }
+
+   netif_napi_add(ndev, priv-napi, nps_enet_poll,
+  NPS_ENET_NAPI_POLL_WEIGHT);

+
+   /* Register the driver. Should be the last thing in probe */
+   err = register_netdev(ndev);
+   if (err) {
+   dev_err(dev, Failed to register ndev for %s, err = 0x%08x\n,
+   ndev-name, (s32)err);

Wouldn't it be better not to assign any value at this point to err, so
that the returned err will reflect the true return value of
register_netdev(), which can have various error values ?

+   err = -ENODEV;
+   goto out_netif_api;
+   }
+
+   dev_info(dev, (rx/tx=%d)\n, priv-irq);
+   return 0;
+
+out_netif_api:
+   netif_napi_del(priv-napi);
+out_netdev:
+   if (err)
+   free_netdev(ndev);
+
+   return err;
+}


Regards,
Rami Rosen
--
To unsubscribe from this list: send the line unsubscribe netdev in


Re: [PATCH net-next] bridge: del external_learned fdbs from device on flush or ageout

2015-06-15 Thread Rami Rosen
Hi,
I will try to find time, will notify you if starting work on it ;)

Regards,
Rami Rosen
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] bridge: del external_learned fdbs from device on flush or ageout

2015-06-14 Thread Rami Rosen
Hi,

You mention bridge doing ageing vs. device doing
ageing. AFAIK, there is no way to prevent a bridge from doing aging by
a sysfs entry. Do you think that preventing bridge aging via sysfs is
needed?

Regards,
Rami Rosen
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [NETLABEL] Minor cleanup: remove unused method definition

2008-02-19 Thread Rami Rosen
Hi,

This patch removes definition of netlbl_cfg_cipsov4_del() method in
netlabel/netlabel_kapi.c and in include/net/netlabel.h as it is not used.


Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 0ca67d7..911d8c6 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -350,7 +350,6 @@ int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def,
 int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def,
   const char *domain,
   struct netlbl_audit *audit_info);
-int netlbl_cfg_cipsov4_del(u32 doi, struct netlbl_audit *audit_info);
 
 /*
  * LSM security attribute operations
@@ -408,11 +407,6 @@ static inline int netlbl_cfg_cipsov4_add_map(struct 
cipso_v4_doi *doi_def,
 {
return -ENOSYS;
 }
-static inline int netlbl_cfg_cipsov4_del(u32 doi,
-struct netlbl_audit *audit_info)
-{
-   return -ENOSYS;
-}
 static inline int netlbl_secattr_catmap_walk(
  struct netlbl_lsm_secattr_catmap *catmap,
  u32 offset)
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 39793a1..02b268d 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -203,21 +203,6 @@ cfg_cipsov4_add_map_failure:
return ret_val;
 }
 
-/**
- * netlbl_cfg_cipsov4_del - Removean existing CIPSOv4 DOI definition
- * @doi: the CIPSO DOI value
- * @audit_info: NetLabel audit information
- *
- * Description:
- * Removes an existing CIPSOv4 DOI definition from the NetLabel subsystem.
- * Returns zero on success, negative values on failure.
- *
- */
-int netlbl_cfg_cipsov4_del(u32 doi, struct netlbl_audit *audit_info)
-{
-   return cipso_v4_doi_remove(doi, audit_info, netlbl_cipsov4_doi_free);
-}
-
 /*
  * Security Attribute Functions
  */


[PATCH] [IPV6] Minor cleanup: remove unused method declaration (net/ndisc.h).

2008-02-10 Thread Rami Rosen
Hi,

This patch removes unused declaration of dflt_rt_lookup() method in
include/net/ndisc.h


Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6684f7e..59b7062 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -103,7 +103,6 @@ extern void ndisc_send_redirect(struct 
sk_buff *skb,
 extern int ndisc_mc_map(struct in6_addr *addr, char *buf, 
struct net_device *dev, int dir);
 
 
-struct rt6_info *  dflt_rt_lookup(void);
 
 /*
  * IGMP


[PATCH] [IPV6] Replace using the magic constant 1024 with IP6_RT_PRIO_USER for fc_metric.

2008-02-08 Thread Rami Rosen
Hi,
  This patch replaces the explicit usage of the magic constant 1024
with IP6_RT_PRIO_USER in the IPV6 tree.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 513f72e..6e7b56e 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1620,7 +1620,7 @@ static struct rt6_info *rt6_add_route_info(struct 
in6_addr *prefix, int prefixle
 {
struct fib6_config cfg = {
.fc_table   = RT6_TABLE_INFO,
-   .fc_metric  = 1024,
+   .fc_metric  = IP6_RT_PRIO_USER,
.fc_ifindex = ifindex,
.fc_dst_len = prefixlen,
.fc_flags   = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO |
@@ -1670,7 +1670,7 @@ struct rt6_info *rt6_add_dflt_router(struct in6_addr 
*gwaddr,
 {
struct fib6_config cfg = {
.fc_table   = RT6_TABLE_DFLT,
-   .fc_metric  = 1024,
+   .fc_metric  = IP6_RT_PRIO_USER,
.fc_ifindex = dev-ifindex,
.fc_flags   = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT |
  RTF_UP | RTF_EXPIRES | RTF_PREF(pref),


[PATCH] [NETNS] Remove unused member (dst_net) of dst_ops.

2008-02-08 Thread Rami Rosen
Hi,
  This patches removes dst_net member (a pointer to struct net)
  of dst_ops (/include/net/dst.h).

  Current network namespace implementation does not use it at all.

Denis - any comments ?


Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/dst.h b/include/net/dst.h
index e3ac7d0..ad06622 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -102,7 +102,6 @@ struct dst_ops
 
atomic_tentries;
struct kmem_cache   *kmem_cachep;
-   struct net  *dst_net;
 };
 
 #ifdef __KERNEL__


[PATCH] [IPV6] Minor cleanup: remove unused definitions in net/ip6_fib.h

2008-02-07 Thread Rami Rosen
Hi,

This patch removes some unused definitions and one method typedef
declaration (f_pnode)
in include/net/ip6_fib.h, as they are not used in the kernel.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index d8d85b1..953d604 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -150,19 +150,6 @@ struct rt6_statistics {
  *
  */
 
-#define RTPRI_FIREWALL 8   /* Firewall control information */
-#define RTPRI_FLOW 16  /* Flow based forwarding rules  */
-#define RTPRI_KERN_CTL 32  /* Kernel control routes*/
-
-#define RTPRI_USER_MIN 256 /* Mimimum user priority*/
-#define RTPRI_USER_MAX 1024/* Maximum user priority*/
-
-#define RTPRI_KERN_DFLT4096/* Kernel default routes
*/
-
-#defineMAX_FLOW_BACKTRACE  32
-
-
-typedef void   (*f_pnode)(struct fib6_node *fn, void *);
 
 struct fib6_table {
struct hlist_node   tb6_hlist;


[PATCH] [IPV6] Minor clenup: remove two unused definitions in net/ip6_route.h

2008-02-07 Thread Rami Rosen
Hi,
Remove IP6_RT_PRIO_FW and IP6_RT_FLOW_MASK definitions in
include/net/ip6_route.h, as they are not used in the kernel.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index faac0ee..f99e4f0 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,11 +1,9 @@
 #ifndef _NET_IP6_ROUTE_H
 #define _NET_IP6_ROUTE_H
 
-#define IP6_RT_PRIO_FW 16
 #define IP6_RT_PRIO_USER   1024
 #define IP6_RT_PRIO_ADDRCONF   256
 #define IP6_RT_PRIO_KERN   512
-#define IP6_RT_FLOW_MASK   0x00ff
 
 struct route_info {
__u8type;


[PATCH] [PPPOL2TP] Label unused warning when CONFIG_PROC_FS is not set.

2008-02-05 Thread Rami Rosen
Hi,

When CONFIG_PROC_FS is not set and CONFIG_PPPOL2TP is set,
we have the following warning in build:
  drivers/net/pppol2tp.c: In function 'pppol2tp_init':
  drivers/net/pppol2tp.c:2472: warning: label
'out_unregister_pppox_proto' defined but not used

This patches fixes this warning by adding appropriate #ifdef.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 1b51bb6..5aa0a80 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -2468,9 +2468,10 @@ static int __init pppol2tp_init(void)
 
 out:
return err;
-
+#ifdef CONFIG_PROC_FS
 out_unregister_pppox_proto:
unregister_pppox_proto(PX_PROTO_OL2TP);
+#endif
 out_unregister_pppol2tp_proto:
proto_unregister(pppol2tp_sk_proto);
goto out;


Re: 2.6.24-mm1 - Build failure at net/sched/cls_flow.c:598

2008-02-04 Thread Rami Rosen
Hello,
  I had sent a patch recently (which is currently pending) which
solves this problem.

see:
http://www.spinics.net/lists/netdev/msg54455.html


Regards,
Rami Rosen


On Feb 5, 2008 1:25 AM, Andrew Morton [EMAIL PROTECTED] wrote:
 On Mon, 04 Feb 2008 23:32:49 +0100
 Tilman Schmidt [EMAIL PROTECTED] wrote:

  My attempt to build this failed with:
 
 CC [M]  net/sched/cls_flow.o
  net/sched/cls_flow.c: In function ___flow_dump___:
  net/sched/cls_flow.c:598: error: ___struct tcf_ematch_tree___ has no member 
  named ___hdr___
 
  Config attached.

 Thanks.  hm.

 #else /* CONFIG_NET_EMATCH */

 struct tcf_ematch_tree
 {
 };

 methinks Patrick has a CONFIG_NET_EMATCH=n problem?
 --
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fwd: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)

2008-02-03 Thread Rami Rosen
-- Forwarded message --
From: Rami Rosen [EMAIL PROTECTED]
Date: Feb 3, 2008 10:51 AM
Subject: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in
net/sched/cls_flow.c (latest git broken build)
To: David Miller [EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED], [EMAIL PROTECTED]


Hi,
The 2.6 latest git build was broken when using the following
configuration options:
CONFIG_NET_EMATCH=n
CONFIG_NET_CLS_FLOW=y

with the following error:
net/sched/cls_flow.c: In function 'flow_dump':
net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
member named 'hdr'
make[2]: *** [net/sched/cls_flow.o] Error 1
make[1]: *** [net/sched] Error 2
make: *** [net] Error 2


see the recent post by Li Zefan:
  http://www.spinics.net/lists/netdev/msg54434.html

The reason for this crash is that struct tcf_ematch_tree (net/pkt_cls.h) is
empty when CONFIG_NET_EMATCH is not defined.

When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure indeed holds
a struct tcf_ematch_tree_hdr (hdr) as flow_dump() expects.

This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.

The patch was build against latest 2.6 git net tree.


Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 5a7f6a3..8d76986 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -594,11 +594,11 @@ static int flow_dump(struct tcf_proto *tp, unsigned long 
fh,
 
if (tcf_exts_dump(skb, f-exts, flow_ext_map)  0)
goto nla_put_failure;
-
+#ifdef CONFIG_NET_EMATCH
if (f-ematches.hdr.nmatches 
tcf_em_tree_dump(skb, f-ematches, TCA_FLOW_EMATCHES)  0)
goto nla_put_failure;
-
+#endif
nla_nest_end(skb, nest);
 
if (tcf_exts_dump_stats(skb, f-exts, flow_ext_map)  0)


[PATCH net-2.6.25] [NETNS] change net/Kconfig to avoid a broken build when building with network namesapce support.

2008-01-29 Thread Rami Rosen
Hi,

The build is broken with the following kernel configuration:

- net-2.6.25
- Support for network namespaces enabled (CONFIG_NET_NS=y)
- CONFIG_RCU_TRACE=y
CONFIG_RCU_TRACE can be set by:
 make menuconfig -Processor type and features-Enable tracing for RCU.

- The error in build is :
  fs/built-in.o: In function `debugfs_init':
 /work/src/netGit2.6.25/2.6.25/fs/debugfs/inode.c:435: undefined
 reference to `kernel_kobj'
 make: *** [.tmp_vmlinux1] Error 1

The reason is : RCU_TRACE selects DEBUG_FS,
 but CONFIG_NET_NS depends on EXPERIMENTAL  !SYSFS;
 debugfs can't be built without sysfs.

 There is currently a bit of mess with SYSFS and in fact it seems that
maybe selecting DEBUG_FS
should depend on SYSFS; to avoid this problem in the build,
 this patch adds !DEBUG_FS to CONFIG_NET_NS dependencies in net/Kconfig.
 This way, if CONFIG_RCU_TRACE is set, ( or other configuration items which
selects DEBUG_FS), we cannot set CONFIG_NET_NS.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/Kconfig b/net/Kconfig
index b6a5d45..82337e2 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -30,7 +30,7 @@ menu Networking options
 config NET_NS
bool Network namespace support
default n
-   depends on EXPERIMENTAL  !SYSFS
+   depends on EXPERIMENTAL  !SYSFS  !DEBUG_FS
help
  Allow user space to create what appear to be multiple instances
  of the network stack.


[PATCH net-2.6.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.

2008-01-29 Thread Rami Rosen
Hi,
  In drivers/net/macvlan.c, when rtnl_link_register() fails
in macvlan_init_module(), there is no point to set it (second time in this
method) to macvlan_handle_frame; macvlan_init_module() will return a negative
number, so instead this patch sets macvlan_handle_frame_hook to NULL.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6ef6b8b..f651a81 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -508,7 +508,7 @@ static int __init macvlan_init_module(void)
goto err1;
return 0;
 err1:
-   macvlan_handle_frame_hook = macvlan_handle_frame;
+   macvlan_handle_frame_hook = NULL;
unregister_netdevice_notifier(macvlan_notifier_block);
return err;
 }


[PATCH net-2.6.25] [PKTGEN] Remove an unused definition in pktgen.c.

2008-01-23 Thread Rami Rosen
Hi,
- Remove an unused definition (LAT_BUCKETS_MAX) in net/core/pktgen.c.
- Remove the corresponding comment.
- The LAT_BUCKETS_MAX seems to have to do with a patch from a long
time ago which was not applied (Ben Greear), which dealt with latency
counters.

See, for example : http://oss.sgi.com/archives/netdev/2002-09/msg00184.html

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index eebccdb..b7f2de1 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -170,8 +170,6 @@
 
 #define VERSION  pktgen v2.69: Packet Generator for packet performance 
testing.\n
 
-/* The buckets are exponential in 'width' */
-#define LAT_BUCKETS_MAX 32
 #define IP_NAME_SZ 32
 #define MAX_MPLS_LABELS 16 /* This is the max label stack depth */
 #define MPLS_STACK_BOTTOM htonl(0x0100)


[PATCH net-2.6.25] [XFRM] Remove unneeded export of xfrm_output_resume() and remove its declaration from net/xfrm.h.

2008-01-19 Thread Rami Rosen
Hi,

The method xfrm_output_resume() is used only in net/xfrm/xfrm_output.c.

This patch removes using unneeded EXPORT_SYMBOL_GPL to export it in
net/xfrm/xfrm_output.c and also removes its declaration in net/xfrm.h.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5ebb9ba..40ae133 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1242,7 +1242,6 @@ extern int xfrm_prepare_input(struct xfrm_state *x, 
struct sk_buff *skb);
 extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi,
  int encap_type);
 extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
-extern int xfrm_output_resume(struct sk_buff *skb, int err);
 extern int xfrm_output(struct sk_buff *skb);
 extern int xfrm4_extract_header(struct sk_buff *skb);
 extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index f4a1047..9a6e92e 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -136,7 +136,6 @@ int xfrm_output_resume(struct sk_buff *skb, int err)
 out:
return err;
 }
-EXPORT_SYMBOL_GPL(xfrm_output_resume);
 
 static int xfrm_output2(struct sk_buff *skb)
 {


[PATCH net-2.6.25] [BRIDGE] Remove unused include of a header file in ebtables.c

2008-01-18 Thread Rami Rosen
Hi,

In net/bridge/netfilter/ebtables.c,
- remove unused include of a header file (linux/tty.h) and remove the
  corresponding comment above it.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 817169e..32afff8 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -15,8 +15,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-/* used for print_string */
-#include linux/tty.h
 
 #include linux/kmod.h
 #include linux/module.h


[PATCH net-2.6.25] [XFRM] Remove unused definition XFRM_POLICY_LOCALOK in linux/xfrm.h + typos in net/xfrm.h

2008-01-15 Thread Rami Rosen
Hi,
- XFRM_POLICY_LOCALOK in linux/xfrm.h is unused definition.
- correct 4 typos in net/xfrm.h

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9b5b00c..f5cfb75 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -363,7 +363,6 @@ struct xfrm_userpolicy_info {
 #define XFRM_POLICY_ALLOW  0
 #define XFRM_POLICY_BLOCK  1
__u8flags;
-#define XFRM_POLICY_LOCALOK1   /* Allow user to override global policy 
*/
/* Automatically expand selector to include matching ICMP payloads. */
 #define XFRM_POLICY_ICMP   2
__u8share;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5ebb9ba..09b9bda 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -73,7 +73,7 @@ extern struct mutex xfrm_cfg_mutex;
Lookup is plain linear search until the first match with selector.
 
If action is block, then we prohibit the flow, otherwise:
-   if xfrms_nr is zero, the flow passes untransformed. Otherwise,
+   if xfrm_nr is zero, the flow passes untransformed. Otherwise,
policy entry has list of up to XFRM_MAX_DEPTH transformations,
described by templates xfrm_tmpl. Each template is resolved
to a complete xfrm_state (see below) and we pack bundle of transformations
@@ -84,10 +84,10 @@ extern struct mutex xfrm_cfg_mutex;
  |---. child .- dst -. xfrm .- xfrm_state #3
   |---. child .- NULL
 
-   Bundles are cached at xrfm_policy struct (field -bundles).
+   Bundles are cached at xfrm_policy struct (field -bundles).
 
 
-   Resolution of xrfm_tmpl
+   Resolution of xfrm_tmpl
---
Template contains:
1. -mode   Mode: transport or tunnel
@@ -133,7 +133,7 @@ struct xfrm_state
 
u32 genid;
 
-   /* Key manger bits */
+   /* Key manager bits */
struct {
u8  state;
u8  dying;


[PATCH net-2.6.25] [XFRM] Remove unused XFRM_STATE_VOID and typos (net/xfrm.h)

2008-01-12 Thread Rami Rosen
Hi,

In net/xfrm.h:
- remove XFRM_STATE_VOID (not in use)
- correct 3 typos

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 860fe4a..432c5c8 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -84,10 +84,10 @@ extern struct mutex xfrm_cfg_mutex;
  |---. child .- dst -. xfrm .- xfrm_state #3
   |---. child .- NULL
 
-   Bundles are cached at xrfm_policy struct (field -bundles).
+   Bundles are cached at xfrm_policy struct (field -bundles).
 
 
-   Resolution of xrfm_tmpl
+   Resolution of xfrm_tmpl
---
Template contains:
1. -mode   Mode: transport or tunnel
@@ -133,7 +133,7 @@ struct xfrm_state
 
u32 genid;
 
-   /* Key manger bits */
+   /* Key manager bits */
struct {
u8  state;
u8  dying;
@@ -217,7 +217,6 @@ struct xfrm_state
 #define XFRM_TIME_DEFER1
 
 enum {
-   XFRM_STATE_VOID,
XFRM_STATE_ACQ,
XFRM_STATE_VALID,
XFRM_STATE_ERROR,


[PATCH net-2.6.25] [IPVS] Added include for ip_vs.h for ctl_path (build was broken)

2008-01-09 Thread Rami Rosen
Hi,
   The build was broken with this error:

  In file included from net/ipv4/ipvs/ip_vs_rr.c:27:
  include/net/ip_vs.h:857: error: array type has incomplete element type
  make[3]: *** [net/ipv4/ipvs/ip_vs_rr.o] Error 1

This was due to missing include to the header file for ctl_path.

This patch added #include linux/sysctl.h to ip_vs_.h to avoid it

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 02ab7ca..56f3c94 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -9,6 +9,8 @@
 #include asm/types.h /* For __uXX types */
 #include linux/types.h   /* For __beXX types in userland */
 
+#include linux/sysctl.h  /* For ctl_path */
+
 #define IP_VS_VERSION_CODE 0x010201
 #define NVERSION(version)  \
(version  16)  0xFF, \


[PATCH net-2.6.25] [BRIDGE] Remove unused macros from ebt_vlan.c

2008-01-08 Thread Rami Rosen
Hi,

 Remove two unused macros, INV_FLAG and SET_BITMASK
 from net/bridge/netfilter/ebt_vlan.c.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c
index a43c697..0ddf749 100644
--- a/net/bridge/netfilter/ebt_vlan.c
+++ b/net/bridge/netfilter/ebt_vlan.c
@@ -37,9 +37,7 @@ MODULE_LICENSE(GPL);
 
 
 #define DEBUG_MSG(args...) if (debug) printk (KERN_DEBUG ebt_vlan:  args)
-#define INV_FLAG(_inv_flag_) (info-invflags  _inv_flag_) ? ! : 
 #define GET_BITMASK(_BIT_MASK_) info-bitmask  _BIT_MASK_
-#define SET_BITMASK(_BIT_MASK_) info-bitmask |= _BIT_MASK_
 #define EXIT_ON_MISMATCH(_MATCH_,_MASK_) {if (!((info-_MATCH_ == 
_MATCH_)^!!(info-invflags  _MASK_))) return EBT_NOMATCH;}
 
 static int


[PATCH net-2.6.25] [IPV4] Remove unused member of dst_entry

2008-01-06 Thread Rami Rosen
Hi,

  The info placeholder member of dst_entry seems to be unused in the
network stack.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/dst.h b/include/net/dst.h
index 31468c9..e03ea0c 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -80,7 +80,6 @@ struct dst_entry
struct rt6_info   *rt6_next;
struct dn_route  *dn_next;
};
-   charinfo[0];
 };
 
 


[PATCH net-2.6.25] [IPV4] Remove unsupported DNAT (RTCF_NAT and RTCF_NAT) in IPV4

2008-01-02 Thread Rami Rosen
Hi,

- The DNAT (Destination NAT) is not implemented in IPV4.

- This patch remove the code which checks these flags
in net/ipv4/arp.c and net/ipv4/route.c.

The RTCF_NAT and RTCF_NAT should stay in the header (linux/in_route.h)
because they are used in DECnet.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 1416bc9..2b72ba6 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -835,9 +835,8 @@ static int arp_process(struct sk_buff *skb)
}
goto out;
} else if (IN_DEV_FORWARD(in_dev)) {
-   if ((rt-rt_flagsRTCF_DNAT) ||
-   (addr_type == RTN_UNICAST   rt-u.dst.dev != dev 

-(arp_fwd_proxy(in_dev, rt) || 
pneigh_lookup(arp_tbl, init_net, tip, dev, 0 {
+   if (addr_type == RTN_UNICAST   rt-u.dst.dev != 
dev 
+(arp_fwd_proxy(in_dev, rt) || 
pneigh_lookup(arp_tbl, init_net, tip, dev, 0))) {
n = neigh_event_ns(arp_tbl, sha, sip, dev);
if (n)
neigh_release(n);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 10915bb..ee9c93c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1768,7 +1768,7 @@ static inline int __mkroute_input(struct sk_buff *skb,
if (err)
flags |= RTCF_DIRECTSRC;
 
-   if (out_dev == in_dev  err  !(flags  (RTCF_NAT | RTCF_MASQ)) 
+   if (out_dev == in_dev  err  !(flags  RTCF_MASQ) 
(IN_DEV_SHARED_MEDIA(out_dev) ||
 inet_addr_onlink(out_dev, saddr, FIB_RES_GW(*res
flags |= RTCF_DOREDIRECT;
@@ -1777,7 +1777,7 @@ static inline int __mkroute_input(struct sk_buff *skb,
/* Not IP (i.e. ARP). Do not create route, if it is
 * invalid for proxy arp. DNAT routes are always valid.
 */
-   if (out_dev == in_dev  !(flags  RTCF_DNAT)) {
+   if (out_dev == in_dev) {
err = -EINVAL;
goto cleanup;
}


[PATCH net-2.6.25] [IPV4] Remove three declarations of unimplemented methods and correct a typo in include/net/ip.h

2008-01-01 Thread Rami Rosen
Hi,
These three declarations in include/net/ip.h are not implemented
anywhere:
ip_mc_dropsocket(), ip_mc_dropdevice() and ip_net_unreachable().

Also, correct a comment to be Functions provided by ip_fragment.c
(instead of by ip_fragment.o) in consistency with the other comments in this
header.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/include/net/ip.h b/include/net/ip.h
index 5fab3a1..8be48c8 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -82,8 +82,6 @@ struct packet_type;
 struct rtable;
 struct sockaddr;
 
-extern voidip_mc_dropsocket(struct sock *);
-extern voidip_mc_dropdevice(struct net_device *dev);
 extern int igmp_mc_proc_init(void);
 
 /*
@@ -319,7 +317,7 @@ static __inline__ void inet_reset_saddr(struct sock *sk)
 extern int ip_call_ra_chain(struct sk_buff *skb);
 
 /*
- * Functions provided by ip_fragment.o
+ * Functions provided by ip_fragment.c
  */
 
 enum ip_defrag_users
@@ -342,7 +340,6 @@ int ip_frag_nqueues(void);
  */
  
 extern int ip_forward(struct sk_buff *skb);
-extern int ip_net_unreachable(struct sk_buff *skb);
  
 /*
  * Functions provided by ip_options.c


[PATCH net-2.6.25] [BRIDGE] Remove useless code in net/bridge/br_netfilter.c

2008-01-01 Thread Rami Rosen
Hi,

These following two commands in br_nf_forward_arp() achieve nothing and
should be removed; the d variable is not used later in this method:

...
struct net_device **d = (struct net_device **)(skb-cb);
...
*d = (struct net_device *)in;
...

Regards,
Rami Rosen


Signed-off-by: Rami Rosen [EMAIL PROTECTED]
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 32ac035..288e102 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -664,8 +664,6 @@ static unsigned int br_nf_forward_arp(unsigned int hook, 
struct sk_buff *skb,
  const struct net_device *out,
  int (*okfn)(struct sk_buff *))
 {
-   struct net_device **d = (struct net_device **)(skb-cb);
-
 #ifdef CONFIG_SYSCTL
if (!brnf_call_arptables)
return NF_ACCEPT;
@@ -682,7 +680,6 @@ static unsigned int br_nf_forward_arp(unsigned int hook, 
struct sk_buff *skb,
nf_bridge_push_encap_header(skb);
return NF_ACCEPT;
}
-   *d = (struct net_device *)in;
NF_HOOK(NF_ARP, NF_ARP_FORWARD, skb, (struct net_device *)in,
(struct net_device *)out, br_nf_forward_finish);
 


Re: [PATCH net-2.6.25] [BRIDGE] Remove useless code in net/bridge/br_netfilter.c

2008-01-01 Thread Rami Rosen
Hi,
 It's a pointer dereference assignment,
Sorry, I was wrong here !

 What automated tool showed this as useless to you?
 Please correct it's logic so it doesn't mark real side effects like
 this as superfluous.

I am not using any automated tool, only my eyes. And I
missed the intention here. It could be implemnted differently
but since it not marked as superfluous anywhere I suggest
to leave it as it is.

Sorry,

Regards,
Rami Rosen





On Jan 2, 2008 7:20 AM, David Miller [EMAIL PROTECTED] wrote:
 From: Rami Rosen [EMAIL PROTECTED]
 Date: Tue, 1 Jan 2008 12:48:14 +0200

  These following two commands in br_nf_forward_arp() achieve nothing and
  should be removed; the d variable is not used later in this method:
 
...
struct net_device **d = (struct net_device **)(skb-cb);
...
*d = (struct net_device *)in;
...
 
  Signed-off-by: Rami Rosen [EMAIL PROTECTED]

 It's a pointer dereference assignment, this last line has a
 side effect, therefore you can't remove it.

 The code is equivalent to:

 struct skb_bridge_info {
 struct net_device *dev;
 };

 struct skb_bridge_info *d;

 d = (struct skb_bridge_info *) skb-cb;

 d-dev = in;

 What automated tool showed this as useless to you?

 Please correct it's logic so it doesn't mark real side effects like
 this as superfluous.

 Thanks.

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [IPv4] Reply net unreachable ICMP message

2007-12-06 Thread Rami Rosen
Hello, Jarek,

I am sorry, but I think I am nor sure I underatand exactly what you mean when
you say:
It overrides err codes from fib_lookup, where such decisions should be made.

What is incorrect here ?

There are two lines added in this patch;

IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES);
and err = -ENETUNREACH;

The first one is, regardless to say, not relevant to err codes.

The second, err = -ENETUNREACH, is from: ip_route_input_slow().
(net/ipv4/route.c).

Assigning values to err is done more than once in this method;
for example,
e_hostunreach:
err = -EHOSTUNREACH;

e_inval:
err = -EINVAL;

e_nobufs:
err = -ENOBUFS;

So I don't think anything is incorrect here.


Regards,
Rami Rosen




On Dec 6, 2007 9:49 AM, Jarek Poplawski [EMAIL PROTECTED] wrote:

 On 06-12-2007 07:31, Mitsuru Chinen wrote:
  IPv4 stack doesn't reply any ICMP destination unreachable message
  with net unreachable code when IP detagrams are being discarded
  because of no route could be found in the forwarding path.
  Incidentally, IPv6 stack replies such ICMPv6 message in the similar
  situation.
 
  Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED]
  ---
   net/ipv4/route.c |2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
 
  diff --git a/net/ipv4/route.c b/net/ipv4/route.c
  index 6714bbc..ba85ec9 100644
  --- a/net/ipv4/route.c
  +++ b/net/ipv4/route.c
  @@ -1375,6 +1375,7 @@ static int ip_error(struct sk_buff *skb)
break;
case ENETUNREACH:
code = ICMP_NET_UNREACH;
  + IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES);
break;
case EACCES:
code = ICMP_PKT_FILTERED;
  @@ -2004,6 +2005,7 @@ no_route:
RT_CACHE_STAT_INC(in_no_route);
spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE);
res.type = RTN_UNREACHABLE;
  + err = -ENETUNREACH;
goto local_input;
 
/*

 This patch seems to be wrong. It overrides err codes from
 fib_lookup, where such decisions should be made.

 Regards,
 Jarek P.

 --
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Get the IP address of an interface with a given name

2007-11-20 Thread Rami Rosen
Giacomo,

  Consider using the dev_get_by_name/() kernel method; this is a
simplified example which works with device named eth0 :

  struct net_device* device;
  struct in_device* in_dev;
  struct in_ifaddr* if_info;

  device = dev_get_by_name(eth0);
  in_dev = (struct in_device *)device-ip_ptr;
  if_info = in_dev-ifa_list;
for (;if_info;if_info=if_info-ifa_next)
{
if (!(strcmp(if_info-ifa_label,eth0)))
{

printk(if_info-ifa_address=%x\n,if_info-ifa_address);   
break;
}
}


Yous should of course add check for NULL, etc.

Regards,
Rami Rosen


On Nov 20, 2007 10:09 AM, Giacomo [EMAIL PROTECTED] wrote:
 Good morning.

  I have written a kernel function which needs to get the IP address of
 an active network interface
  given its name.

  The actual implementation i have done is like this
  but i suspect this does not always work.
  Is there any API already provided by the kernel to do the same?

  Thanks a lot

  Giacomo

  -- actual implementation: ---

  /* returns in *addr the internet address having the name ifname */
  int get_ifaddr_by_name(const char *ifname, __u32 * addr)
  {
 struct net_device *pnet_device;
 struct in_device *pin_device;
 struct in_ifaddr* inet_ifaddr;

 read_lock_bh(dev_base_lock);
  #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,22)
 pnet_device = dev_base;
  #else
 pnet_device = first_net_device();
  #endif
 while (pnet_device != NULL)
 {
 if ((netif_running(pnet_device))
  (pnet_device-ip_ptr != NULL)
  (strcmp(pnet_device-name, ifname) == 0))
 {
 pin_device =
 (struct in_device *) pnet_device-ip_ptr;
 inet_ifaddr = pin_device-ifa_list;
 if(inet_ifaddr == NULL)
 {
 printk(ifa_list is null!\n);
 break;
 }
 /* ifa_local: ifa_address is the remote point in ppp 
 */
 *addr = (inet_ifaddr-ifa_local);
   read_unlock_bh(dev_base_lock);
 return 1;
 }
  #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,22)
 pnet_device = pnet_device-next;
  #else
 pnet_device = next_net_device(pnet_device);
  #endif

 }

 read_unlock_bh(dev_base_lock);
 return -1;  /* address not found! */
  }

 --
 Giacomo S.
 http://www.giacomos.it

 - - - - - - - - - - - - - - - - - - - - - -

 IPFIREwall (http://www.giacomos.it/ipfire) viene presentato
 all'Universita` degli Studi di Udine, il 28 ottobre, in occasione del
 Linux Day 2006:
 http://iglu.cc.uniud.it/linuxday

 - - - - - - - - - - - - - - - - - - - - - -

  . ''  `.
 :   :':
  `.  ` '
 `- Debian GNU/Linux -- The power of freedom
 http://www.debian.org
 -
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: IPSec on Linux Kernel

2007-09-27 Thread Rami Rosen
Hi,Fabio,

  - Assuming that you intend to deal with IPV4, I suggest that you will
start by looking at the ah4.ko module sources, which are in net/ipv4/ah.c,
especially at the ah_output() and the ah_input() methods.

(for ipv6 there are the ah6.c in net/ipv6).

- May I ask: are you aware that the Authentication Header protocol deals
only with authentication and not with encryption? and as a result, the ESP
protocol, which supports authentication and also, when needed, encryption, is
much more widely used?

Regards,
  Rosen Rami
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC][PATCH] Removal of FASTROUTE definition include/linux/if_packet.h

2007-08-02 Thread Rami Rosen
Hi,
  It seems that PACKET_FASTROUTE definition should be removed due to that
fastroute is no longer supported.

Regards,
Rami Rosen
--


Signed-off-by: Rami Rosen [EMAIL PROTECTED]


--- linux-2.6.23-rc1-clean/include/linux/if_packet.h2007-05-03
12:07:59.0 +0300
+++ linux-2.6.23-rc1/include/linux/if_packet.h  2007-08-02
11:37:16.0 +0300
@@ -30,7 +30,6 @@ struct sockaddr_ll
 #define PACKET_OUTGOING4   /* Outgoing of any type 
*/
 /* These ones are invisible by user level */
 #define PACKET_LOOPBACK5   /* MC/BRD frame looped 
back */
-#define PACKET_FASTROUTE   6   /* Fastrouted frame */

 /* Packet socket options */
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [linux-usb-devel] [PATCH RFC] ZyDAS ZD1211 USB-WLAN driver

2006-06-04 Thread Rami Rosen

Hi,

  While I did not yet review fully the code , I saw some definitions
which are not in use. (more than 150 such definitions, in one file)  I
think it may be better to remove this #define statements to make the
code more readable. In case there will be a need in the future, the needed
#define statements can be returned.
The definitions which are not in use are from zd_chip.h.

It is mentioned there that these definitions are taken from the ZYDAS
driver and  not all of them are relevant for the rewrite driver;
however, it seems to me that
removing them may be thought of.


Anyhow you did a great job and I hope I will find time to really delve
into the code.

The definitions I am talking about are: (see zd_chip.h)

CR_RF_IF_CLK
CR_RF_IF_DATA
CR_PE1_PE2
CR_PE2_DLY
CR_LE1
CR_LE2
CR_RADIO_PD
CR_RF2948_PD
CR_ENABLE_PS_MANUAL_AGC
CR_SA2400_SER_AP
CR_I2C_WRITE
CR_SA2400_SER_RP
CR_RADIO_PE
CR_RST_BUS_MASTER
CR_HSTSCHG
CR_PHY_ON
CR_RX_DELAY
CR_GPIO_1
CR_GPIO_2
CR_EncryBufMux
CR_MAC_PS_STATE
INT_TX_COMPLETE 
INT_RX_COMPLETE
INT_RETRY_FAIL
INT_WAKEUP
INT_DTIM_NOTIFY
INT_CFG_NEXT_BCN
INT_BUS_ABORT
INT_TX_FIFO_READY
INT_UART
INT_TX_COMPLETE_EN  
INT_RX_COMPLETE_EN
INT_RETRY_FAIL_EN
INT_WAKEUP_EN
INT_DTIM_NOTIFY_EN
INT_CFG_NEXT_BCN_EN
INT_BUS_ABORT_EN
INT_TX_FIFO_READY_EN
INT_UART_EN
CR_TSF_LOW_PART
CR_TSF_HIGH_PART
CR_UART_RBR_THR_DLL
CR_UART_DLM_IER
CR_UART_IIR_FCR
CR_UART_LCR
CR_UART_MCR
CR_UART_LSR 
CR_UART_MSR 
CR_UART_ECR 
CR_UART_STATUS  
CR_PCI_TX_ADDR_P1   
CR_PCI_TX_AddR_P2   
CR_PCI_RX_AddR_P1   
CR_PCI_RX_AddR_P2   
CR_BSSID_P1 
CR_BSSID_P2 
CR_RX_TIMEOUT
CR_RATE_9M
CR_RATE_18M
CR_RATE_36M
CR_RATE_48M
CR_RATE_54M
CR_RX_OFFSET
CR_PHY_DELAY
CR_BCN_FIFO
CR_DEVICE_STATE
CR_UNDERRUN_CNT
CR_BCN_FIFO_SEMAPHORE
CR_IFS_VALUE
CR_RX_TIME_OUT
CR_TOTAL_RX_FRM
CR_CRC32_CNT
CR_CRC16_CNT
CR_DECRYPTION_ERR_UNI
CR_RX_FIFO_OVERRUN
CR_DECRYPTION_ERR_MUL
CR_NAV_CNT
CR_NAV_CCA
CR_RETRY_CNT
CR_READ_TCB_ADDR
CR_READ_RFD_ADDR
CR_TOTAL_TX_FRM
CR_CAM_MODE
CR_CAM_ROLL_TB_LOW
CR_CAM_ROLL_TB_HIGH
CR_CAM_ADDRESS
CR_CAM_DATA
CR_ROMDIR
CR_DECRY_ERR_FLG_LOW
CR_DECRY_ERR_FLG_HIGH
CR_WEPKEY0
CR_WEPKEY1
CR_WEPKEY2
CR_WEPKEY3
CR_WEPKEY4
CR_WEPKEY5
CR_WEPKEY6
CR_WEPKEY7
CR_WEPKEY8
CR_WEPKEY9
CR_WEPKEY10
CR_WEPKEY11
CR_WEPKEY12
CR_WEPKEY13
CR_WEPKEY14
CR_WEPKEY15
CR_TKIP_MODE
CR_EEPROM_PROTECT0
CR_EEPROM_PROTECT1
CR_DBG_FIFO_RD
CR_DBG_SELECT
CR_FIFO_Length
CR_RSSI_MGC
CR_PON
CR_RX_ON
CR_TX_ON
CR_CHIP_EN
CR_LO_SW
CR_TXRX_SW
CR_S_MD
CR_USB_DEBUG_PORT
STA_RX_FILTER
E2P_PWR_CAL_VALUE2
E2P_PWR_CAL_VALUE3
E2P_PWR_CAL_VALUE4
E2P_PWR_INT_VALUE2
E2P_PWR_INT_VALUE3
E2P_PWR_INT_VALUE4
E2P_ALLOWED_CHANNEL
E2P_DEVICE_VER
E2P_36M_CAL_VALUE2
E2P_36M_CAL_VALUE3
E2P_36M_CAL_VALUE4
E2P_11A_INT_VALUE1
E2P_11A_INT_VALUE2
E2P_11A_INT_VALUE3
E2P_11A_INT_VALUE4
E2P_48M_CAL_VALUE2
E2P_48M_CAL_VALUE3
E2P_48M_CAL_VALUE4
E2P_48M_INT_VALUE1
E2P_48M_INT_VALUE2
E2P_48M_INT_VALUE3
E2P_48M_INT_VALUE4
E2P_54M_CAL_VALUE2
E2P_54M_CAL_VALUE3
E2P_54M_CAL_VALUE4
E2P_54M_INT_VALUE1
E2P_54M_INT_VALUE2
E2P_54M_INT_VALUE3
E2P_54M_INT_VALUE4
FW_SOFT_RESET
FW_FLASH_CHK

Regards,
Rami Rosen



On 6/4/06, Oliver Neukum [EMAIL PROTECTED] wrote:

Am Sonntag, 4. Juni 2006 18:29 schrieb John Que:
 I had noticed that the zd1211 driver does call request_irq() in zd1205_open(),
 file zd1205.c; grepping for request_irq() in the rewrite driver yields
 no results.
 (I looked at the rewrite version from a week ago but in this point it
 is probably the
 same).
 Why is this so ? I assume that the softmac layer does not call request_irq() 
on
 behalf of the driver because this is not supposed to be like it, as I 
understand
 its functionality. Can anybody briefly calrify this point ?

A USB driver never will request an irq. Interrupt handling is done in
the core usb layer. Individual drivers have no business there.

Regards
Oliver
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html