All of lore.kernel.org
 help / color / mirror / Atom feed
From: jhs@mojatatu.com (Jamal Hadi Salim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] net: Add Keystone NetCP ethernet driver
Date: Tue, 19 Aug 2014 07:38:55 -0400	[thread overview]
Message-ID: <53F3374F.1000808@mojatatu.com> (raw)
In-Reply-To: <1408115562-22487-3-git-send-email-santosh.shilimkar@ti.com>

On 08/15/14 11:12, Santosh Shilimkar wrote:


I am curious about these two calls below(netcp_process_one_rx_packet
and netcp_tx_submit_skb):
On tx you seem to be broadcasting to all "sub-modules" and on receive
you seem to be invoking from all as well.
I couldnt find the code for any of the sub-modules but i suspect
things like switching/bridging or ipsec etc could be sub-modules.
If yes, have you thought about integrating these features into
Linux proper instead?

cheers,
jamal

> +
> +static inline int netcp_process_one_rx_packet(struct netcp_intf *netcp)
> +{


> +
> +	/* Call each of the RX hooks */
> +	p_info.skb = skb;
> +	p_info.rxtstamp_complete = false;
> +	list_for_each_entry(rx_hook, &netcp->rxhook_list_head, list) {
> +		int ret;
> +
> +		ret = rx_hook->hook_rtn(rx_hook->order, rx_hook->hook_data,
> +					&p_info);
> +		if (unlikely(ret)) {
> +			dev_err(netcp->ndev_dev, "RX hook %d failed: %d\n",
> +				rx_hook->order, ret);
> +			netcp->ndev->stats.rx_errors++;
> +			dev_kfree_skb(skb);
> +			return 0;
> +		}
> +	}
..
....
> +	return 0;
> +}

[..]

> +static inline int netcp_tx_submit_skb(struct netcp_intf *netcp,
> +				      struct sk_buff *skb,
> +				      struct knav_dma_desc *desc)
> +{
> +	struct netcp_tx_pipe *tx_pipe = NULL;

> +
> +	p_info.netcp = netcp;
> +	p_info.skb = skb;
> +	p_info.tx_pipe = NULL;
> +	p_info.psdata_len = 0;
> +	p_info.ts_context = NULL;
> +	p_info.txtstamp_complete = NULL;
> +	p_info.epib = desc->epib;
> +	p_info.psdata = desc->psdata;
> +	memset(p_info.epib, 0, KNAV_DMA_NUM_EPIB_WORDS * sizeof(u32));
> +
> +	/* Find out where to inject the packet for transmission */
> +	list_for_each_entry(tx_hook, &netcp->txhook_list_head, list) {
> +		ret = tx_hook->hook_rtn(tx_hook->order, tx_hook->hook_data,
> +					&p_info);
> +		if (unlikely(ret != 0)) {
> +			dev_err(netcp->ndev_dev, "TX hook %d rejected the packet with reason(%d)\n",
> +				tx_hook->order, ret);
> +			ret = (ret < 0) ? ret : NETDEV_TX_OK;
> +			goto out;
> +		}
> +	}
> +

WARNING: multiple messages have this Message-ID (diff)
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	grant.likely@linaro.org, devicetree@vger.kernel.org,
	sandeep_n@ti.com
Subject: Re: [PATCH v2 2/3] net: Add Keystone NetCP ethernet driver
Date: Tue, 19 Aug 2014 07:38:55 -0400	[thread overview]
Message-ID: <53F3374F.1000808@mojatatu.com> (raw)
In-Reply-To: <1408115562-22487-3-git-send-email-santosh.shilimkar@ti.com>

On 08/15/14 11:12, Santosh Shilimkar wrote:


I am curious about these two calls below(netcp_process_one_rx_packet
and netcp_tx_submit_skb):
On tx you seem to be broadcasting to all "sub-modules" and on receive
you seem to be invoking from all as well.
I couldnt find the code for any of the sub-modules but i suspect
things like switching/bridging or ipsec etc could be sub-modules.
If yes, have you thought about integrating these features into
Linux proper instead?

cheers,
jamal

> +
> +static inline int netcp_process_one_rx_packet(struct netcp_intf *netcp)
> +{


> +
> +	/* Call each of the RX hooks */
> +	p_info.skb = skb;
> +	p_info.rxtstamp_complete = false;
> +	list_for_each_entry(rx_hook, &netcp->rxhook_list_head, list) {
> +		int ret;
> +
> +		ret = rx_hook->hook_rtn(rx_hook->order, rx_hook->hook_data,
> +					&p_info);
> +		if (unlikely(ret)) {
> +			dev_err(netcp->ndev_dev, "RX hook %d failed: %d\n",
> +				rx_hook->order, ret);
> +			netcp->ndev->stats.rx_errors++;
> +			dev_kfree_skb(skb);
> +			return 0;
> +		}
> +	}
..
....
> +	return 0;
> +}

[..]

> +static inline int netcp_tx_submit_skb(struct netcp_intf *netcp,
> +				      struct sk_buff *skb,
> +				      struct knav_dma_desc *desc)
> +{
> +	struct netcp_tx_pipe *tx_pipe = NULL;

> +
> +	p_info.netcp = netcp;
> +	p_info.skb = skb;
> +	p_info.tx_pipe = NULL;
> +	p_info.psdata_len = 0;
> +	p_info.ts_context = NULL;
> +	p_info.txtstamp_complete = NULL;
> +	p_info.epib = desc->epib;
> +	p_info.psdata = desc->psdata;
> +	memset(p_info.epib, 0, KNAV_DMA_NUM_EPIB_WORDS * sizeof(u32));
> +
> +	/* Find out where to inject the packet for transmission */
> +	list_for_each_entry(tx_hook, &netcp->txhook_list_head, list) {
> +		ret = tx_hook->hook_rtn(tx_hook->order, tx_hook->hook_data,
> +					&p_info);
> +		if (unlikely(ret != 0)) {
> +			dev_err(netcp->ndev_dev, "TX hook %d rejected the packet with reason(%d)\n",
> +				tx_hook->order, ret);
> +			ret = (ret < 0) ? ret : NETDEV_TX_OK;
> +			goto out;
> +		}
> +	}
> +

  reply	other threads:[~2014-08-19 11:38 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 15:12 [PATCH v2 0/3] net: Add Keystone NetCP ethernet driver support Santosh Shilimkar
2014-08-15 15:12 ` Santosh Shilimkar
2014-08-15 15:12 ` Santosh Shilimkar
2014-08-15 15:12 ` Santosh Shilimkar
2014-08-15 15:12 ` [PATCH v2 1/3] Documentation: dt: net: Add binding doc for Keystone NetCP ethernet driver Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-15 15:12 ` [PATCH v2 2/3] net: Add " Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-19 11:38   ` Jamal Hadi Salim [this message]
2014-08-19 11:38     ` Jamal Hadi Salim
2014-08-22  2:48   ` Stephen Hemminger
2014-08-22  2:48     ` Stephen Hemminger
2014-08-22  2:48     ` Stephen Hemminger
2014-08-22  2:48     ` Stephen Hemminger
2014-08-22 19:50     ` Santosh Shilimkar
2014-08-22 19:50       ` Santosh Shilimkar
2014-08-22 19:50       ` Santosh Shilimkar
2014-08-15 15:12 ` [PATCH v2 3/3] MAINTAINER: net: Add TI NETCP Ethernet driver entry Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-15 15:12   ` Santosh Shilimkar
2014-08-21 23:36 ` [PATCH v2 0/3] net: Add Keystone NetCP ethernet driver support David Miller
2014-08-21 23:36   ` David Miller
2014-08-22 19:45   ` Santosh Shilimkar
2014-08-22 19:45     ` Santosh Shilimkar
2014-08-22 19:45     ` Santosh Shilimkar
2014-08-22 19:45     ` Santosh Shilimkar
2014-09-08 14:41     ` Santosh Shilimkar
2014-09-08 14:41       ` Santosh Shilimkar
2014-09-08 14:41       ` Santosh Shilimkar
2014-09-08 14:41       ` Santosh Shilimkar
2014-09-09 11:44       ` Jamal Hadi Salim
2014-09-09 11:44         ` Jamal Hadi Salim
2014-09-09 11:44         ` Jamal Hadi Salim
2014-09-09 15:19         ` Santosh Shilimkar
2014-09-09 15:19           ` Santosh Shilimkar
2014-09-09 15:19           ` Santosh Shilimkar
2014-09-10 11:33           ` Jamal Hadi Salim
2014-09-10 11:33             ` Jamal Hadi Salim
2014-09-10 11:33             ` Jamal Hadi Salim
2014-09-11 15:30             ` Santosh Shilimkar
2014-09-11 15:30               ` Santosh Shilimkar
2014-09-11 15:30               ` Santosh Shilimkar
2014-09-11 15:30               ` Santosh Shilimkar
2014-09-11 15:56       ` Santosh Shilimkar
2014-09-11 15:56         ` Santosh Shilimkar
2014-09-11 15:56         ` Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F3374F.1000808@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.