All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Johannes Thumshirn <jthumshirn@suse.de>, Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Johannes Thumshirn <jth@kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 5/6] fcoe: implement FIP VLAN responder
Date: Mon, 4 Jul 2016 13:22:20 +0200	[thread overview]
Message-ID: <577A46EC.70306@suse.de> (raw)
In-Reply-To: <20160704100547.fy7ima6fwkcs4aha@c203.arch.suse.de>

On 07/04/2016 12:05 PM, Johannes Thumshirn wrote:
> On Mon, Jul 04, 2016 at 10:29:22AM +0200, Hannes Reinecke wrote:
>> When running in VN2VN mode there is no central instance which
>> would send out any FIP VLAN discovery notifications. So this
>> patch adds a new sysfs attribute 'fip_vlan_responder' which
>> will activate a FIP VLAN discovery responder.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
> 
> [...]
> 
>> +/**
>> + * fcoe_ctlr_vlan_send() - Send a FIP VLAN Notification
>> + * @fip: The FCoE controller
>> + * @sub: sub-opcode for vlan notification or vn2vn vlan notification
>> + * @dest: The destination Ethernet MAC address
>> + * @min_len: minimum size of the Ethernet payload to be sent
>> + */
>> +static void fcoe_ctlr_vlan_send(struct fcoe_ctlr *fip,
>> +			      enum fip_vlan_subcode sub,
>> +			      const u8 *dest)
>> +{
>> +	struct sk_buff *skb;
>> +	struct fip_frame {
>> +		struct ethhdr eth;
>> +		struct fip_header fip;
>> +		struct fip_mac_desc mac;
>> +		struct fip_vlan_desc vlan;
>> +	} __packed * frame;
> 
> Hmmm this is the 2nd time fip_frame is defined in  fcoe_ctlr.c. I'd prefere
> having the type definition somewhere else in this file and then use it in
> fcoe_ctlr_vlan_send() and fcoe_ctlr_vn_send().
> 
This appears to be the convention in the file; every function which is
sending a frame on the wire defines a local variable 'struct fip_frame'
which contains the actual frame definition.

Might be that the style can be improved, but that should be a separate
patch.

>> +	size_t len;
>> +	size_t dlen;
>> +
>> +	len = sizeof(*frame);
>> +	dlen = sizeof(frame->mac) + sizeof(frame->vlan);
>> +	len = max(len, sizeof(struct ethhdr));
>> +
>> +	skb = dev_alloc_skb(len);
>> +	if (!skb)
>> +		return;
> 
> dev_alloc_skb() uses GFP_ATOMIC so it's actually not unlikely to fail
> so please return -ENOMEM here, just so the caller knows what happened.
> 
Again, the calling convention of fcoe_ctlr_send_vlan() insists on using
a void return.
Yes, this should be improved, but again with another patch.

So do I need to send two additional patches for updating the infrastructure?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-07-04 11:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04  8:29 [PATCH 0/6] fcoe: VN2VN target mode fixes Hannes Reinecke
2016-07-04  8:29 ` [PATCH 1/6] fc_fip: Update to latest FC-BB-6 draft Hannes Reinecke
2016-07-04 10:12   ` Johannes Thumshirn
2016-07-04  8:29 ` [PATCH 2/6] fcoe: use enum for fip_mode Hannes Reinecke
2016-07-04 10:15   ` Johannes Thumshirn
2016-07-04  8:29 ` [PATCH 3/6] fcoe: fcoe->realdev is always set Hannes Reinecke
2016-07-04 10:16   ` Johannes Thumshirn
2016-07-04  8:29 ` [PATCH 4/6] fcoe: Update multicast addresses on FIP mode change Hannes Reinecke
2016-07-04 10:16   ` Johannes Thumshirn
2016-07-04  8:29 ` [PATCH 5/6] fcoe: implement FIP VLAN responder Hannes Reinecke
2016-07-04 10:05   ` Johannes Thumshirn
2016-07-04 11:22     ` Hannes Reinecke [this message]
2016-07-25  7:31   ` Johannes Thumshirn
2016-07-04  8:29 ` [PATCH 6/6] fcoe: Use default VLAN for FIP VLAN discovery Hannes Reinecke
2016-07-04 10:18   ` Johannes Thumshirn
2016-07-25  7:32   ` Johannes Thumshirn
2016-07-14  2:11 ` [PATCH 0/6] fcoe: VN2VN target mode fixes Martin K. Petersen
2016-07-25  7:34   ` Johannes Thumshirn
2016-07-27  4:26     ` Martin K. Petersen
2016-07-27  7:23       ` Johannes Thumshirn

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=577A46EC.70306@suse.de \
    --to=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jth@kernel.org \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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.