All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roopa Prabhu <roopa@cumulusnetworks.com>
To: jtoppins@redhat.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	stephen@networkplumber.org, nikolay@cumulusnetworks.com,
	tgraf@suug.ch, hannes@stressinduktion.org, jbenc@redhat.com,
	pshelar@ovn.org, dsa@cumulusnetworks.com, hadi@mojatatu.com
Subject: Re: [PATCH net-next 2/5] vxlan: support fdb and learning in COLLECT_METADATA mode
Date: Tue, 31 Jan 2017 19:38:28 -0800	[thread overview]
Message-ID: <58915834.9080802@cumulusnetworks.com> (raw)
In-Reply-To: <7e4844ec-df5e-6140-c2f7-281619616416@redhat.com>

On 1/31/17, 3:37 PM, Jonathan Toppins wrote:
> On 01/31/2017 12:57 AM, Roopa Prabhu wrote:
[snip]
>>
>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>> index 19b1653..b80c405 100644
>> --- a/drivers/net/vxlan.c
>> +++ b/drivers/net/vxlan.c
>> @@ -57,6 +57,8 @@
>>  
>>  static const u8 all_zeros_mac[ETH_ALEN + 2];
>>  
>> +static u32 fdb_salt __read_mostly;
>> +
>>  static int vxlan_sock_add(struct vxlan_dev *vxlan);
>>  
>>  /* per-network namespace private data for this module */
>> @@ -75,6 +77,7 @@ struct vxlan_fdb {
>>  	struct list_head  remotes;
>>  	u8		  eth_addr[ETH_ALEN];
>>  	u16		  state;	/* see ndm_state */
>> +	__be32		  vni;
>>  	u8		  flags;	/* see ndm_flags */
>>  };
>>  
>> @@ -302,6 +305,10 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
>>  	if (rdst->remote_vni != vxlan->default_dst.remote_vni &&
>>  	    nla_put_u32(skb, NDA_VNI, be32_to_cpu(rdst->remote_vni)))
>>  		goto nla_put_failure;
>> +	if ((vxlan->flags & VXLAN_F_COLLECT_METADATA) && fdb->vni &&
>> +	    nla_put_u32(skb, NDA_SRC_VNI,
>> +			be32_to_cpu(fdb->vni)))
>> +		goto nla_put_failure;
>>  	if (rdst->remote_ifindex &&
>>  	    nla_put_u32(skb, NDA_IFINDEX, rdst->remote_ifindex))
>>  		goto nla_put_failure;
>> @@ -400,34 +407,51 @@ static u32 eth_hash(const unsigned char *addr)
>>  	return hash_64(value, FDB_HASH_BITS);
>>  }
>>  
>> +static u32 eth_vni_hash(const unsigned char *addr, __be32 vni)
>> +{
>> +	/* use 1 byte of OUI and 3 bytes of NIC */
>> +	u32 key = get_unaligned((u32 *)(addr + 2));
>> +
>> +	return jhash_2words(key, vni, fdb_salt) & (FDB_HASH_SIZE - 1);
> Not seeing where fdb_salt gets set to anything, why not just use a
> constant zero here?
>
>
oversight. intended to use vxlan_salt which is already initialized but not used in the vxlan driver.
 fixed in next queued up version (just following bridge fdb code here which uses salt).

thanks.

  reply	other threads:[~2017-02-01  3:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31  5:57 [PATCH net-next 0/5] bridge: per vlan dst_metadata support Roopa Prabhu
2017-01-31  5:57 ` [PATCH net-next 1/5] ip_tunnels: new IP_TUNNEL_INFO_BRIDGE flag for ip_tunnel_info mode Roopa Prabhu
2017-01-31  5:57 ` [PATCH net-next 2/5] vxlan: support fdb and learning in COLLECT_METADATA mode Roopa Prabhu
2017-01-31 23:37   ` Jonathan Toppins
2017-02-01  3:38     ` Roopa Prabhu [this message]
2017-01-31  5:57 ` [PATCH net-next 3/5] bridge: uapi: add per vlan tunnel info Roopa Prabhu
2017-01-31  5:57 ` [PATCH net-next 4/5] bridge: per vlan dst_metadata netlink support Roopa Prabhu
2017-01-31  7:12   ` kbuild test robot
2017-01-31  9:34   ` kbuild test robot
2017-01-31  5:57 ` [PATCH net-next 5/5] bridge: vlan dst_metadata hooks in ingress and egress paths Roopa Prabhu
2017-01-31 12:52   ` kbuild test robot
2017-01-31 15:38     ` Roopa Prabhu
2017-01-31 16:41 ` [PATCH net-next 0/5] bridge: per vlan dst_metadata support Stephen Hemminger
2017-01-31 20:43   ` Roopa Prabhu
2017-02-01 16:35     ` Stephen Hemminger
2017-02-01 19:12       ` Roopa Prabhu

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=58915834.9080802@cumulusnetworks.com \
    --to=roopa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=hadi@mojatatu.com \
    --cc=hannes@stressinduktion.org \
    --cc=jbenc@redhat.com \
    --cc=jtoppins@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=pshelar@ovn.org \
    --cc=stephen@networkplumber.org \
    --cc=tgraf@suug.ch \
    /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.