[Intel-wired-lan] [PATCH] ixgbevf: Set rx hash type for ingress packets

Alexander Duyck alexander.h.duyck at redhat.com
Wed Apr 15 15:20:09 UTC 2015



On 04/14/2015 08:42 PM, Tantilov, Emil S wrote:
>> -----Original Message-----
>> From: Du, Fan
>> Sent: Tuesday, April 14, 2015 8:12 PM
>> To: Kirsher, Jeffrey T
>> Subject: [PATCH] ixgbevf: Set rx hash type for ingress packets
>>
>> Set hash type for ingress packets according to NIC
>> advanced receive descriptors RSS type part.
>>
>> also use le16_to_cpu forcing type conversion to slient
>> endian check warnings.
>>
>> Signed-off-by: Fan Du <fan.du at intel.com>
>> ---
>> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |    2 +-
>> drivers/net/ethernet/intel/ixgbevf/defines.h      |   12 ++++++++
>> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   30 +++++++++++++++++++++
>> 3 files changed, 43 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index 8915992..1b3b5fb 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -1359,7 +1359,7 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
>> #endif /* CONFIG_IXGBE_DCA */
>> static inline enum pkt_hash_types ixgbe_get_hash_type(__le16 pkt_info)
>> {
>> -	switch (pkt_info & cpu_to_le16(IXGBE_RXDADV_RSSTYPE_MASK)) {
>> +	switch (le16_to_cpu(pkt_info) & IXGBE_RXDADV_RSSTYPE_MASK) {
> This appears to be a fix for your ixgbe patch and does not belong here. The proper way to handle it is to submit
> version 2. Also checkout my reply to your ixgbe patch - it has the logic we use in ixgbe and there are some differences
> that we need to address before we can accept this. Like the IPV4/6 extensions defines are not included and in the case of rss_type being 0 RSS is nor performed and so we probably should not call set_skb_hash() in that situation.
>
> Thanks,
> Emil
>

Also instead of byte swapping the value, why not byte swap the cases in 
the switch statement?  Then the byte swapping can all be done at compile 
time instead of having to do it at run-time on big endian systems.

- Alex


More information about the Intel-wired-lan mailing list